From 959ba2069cfc4083ac965a873139b554403b48c8 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:01:40 +0000 Subject: [PATCH 1/8] Update Generator Version 3.0.0-alpha.20231018.4 --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 29 +++++++++++++++-------------- eng/emitter-package.json | 5 ++++- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index f0b286112d00..216c144e7908 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -176,7 +176,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 6bacad2787c0..633917c99d1d 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20231017.1" + "@azure-tools/typespec-csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest@local/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20231018.4.tgz" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -17,9 +17,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20231017.1", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20231017.1.tgz", - "integrity": "sha512-n1XBCtcPpvktlzaqw9xgDWQeP86V0C7cuTETqBnqdj6mOVQ695kyVXE0I3aNUn694+i8S5dqMeKMOwwk5kyTJQ==" + "version": "3.0.0-alpha.20231018.4", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest@local/npm/registry/@autorest/csharp/-/csharp-3.0.0-alpha.20231018.4.tgz", + "integrity": "sha512-rv7fCDch8yGgbVoQq1pzHojcOQ0/kJdhvbA39tqfuG9nZicTYg+QyMq8CJn5wPTNs20YGI08m7okT7F5BXzI+A==" }, "node_modules/@azure-tools/typespec-azure-core": { "version": "0.35.0", @@ -49,11 +49,12 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20231017.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20231017.1.tgz", - "integrity": "sha512-6rgJ9l4wS5QfP3X6up/z8fnzJp8JJxajt3pXFcdYo+TOeMHbyX4Y9mIa37CSKgXA6BOEPBvOBck2yddcEq09lQ==", + "version": "0.2.0-alpha.20231018.4", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest@local/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20231018.4.tgz", + "integrity": "sha512-APgs4oqRM7dz6qNMV8C4w/Pndhod3osud34af3E0Z7oPGgqnbOwaAM3KGKqLyd7YRjGwee/kfwvforO5vTwDpA==", + "license": "MIT", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20231017.1", + "@autorest/csharp": "3.0.0-alpha.20231018.4", "@azure-tools/typespec-azure-core": "0.35.0", "@azure-tools/typespec-client-generator-core": "0.35.0", "@typespec/compiler": "0.49.0", @@ -279,14 +280,14 @@ "integrity": "sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==" }, "node_modules/@types/json-schema": { - "version": "7.0.13", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", - "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==" + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", + "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==" }, "node_modules/@types/normalize-package-data": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.2.tgz", - "integrity": "sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==" + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.3.tgz", + "integrity": "sha512-ehPtgRgaULsFG8x0NeYJvmyH1hmlfsNLujHe9dQEia/7MAJYdzMSi19JtchUHjmBA6XC/75dK55mzZH+RyieSg==" }, "node_modules/@types/semver": { "version": "7.5.3", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 47eda588dae2..57737d334c59 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,9 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20231017.1" + "@azure-tools/typespec-csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest@local/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20231018.4.tgz" + }, + "overrides": { + "@autorest/csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest@local/npm/registry/@autorest/csharp/-/csharp-3.0.0-alpha.20231018.4.tgz" } } From cd76613986f0550fb9102bc45cf689c2cae72004 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:19:41 +0000 Subject: [PATCH 2/8] Update SDK codes he_ma_3 --- ...HealthcareApisArmClientMockingExtension.cs | 159 +++ .../Extensions/HealthcareApisExtensions.cs | 251 ++-- ...thcareApisResourceGroupMockingExtension.cs | 145 +++ ...thcareApisSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../HealthcareApisIotConnectorResource.cs | 6 +- .../HealthcareApisServiceResource.cs | 12 +- .../HealthcareApisWorkspaceResource.cs | 30 +- .../Extensions/ArmResourceExtensionClient.cs | 166 --- ...ntainerServiceArmClientMockingExtension.cs | 246 ++++ .../HybridContainerServiceExtensions.cs | 393 ++++--- ...nerServiceResourceGroupMockingExtension.cs | 198 ++++ ...nerServiceSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 55 - .../Generated/ProvisionedClusterResource.cs | 12 +- .../HybridComputeArmClientMockingExtension.cs | 111 ++ .../Extensions/HybridComputeExtensions.cs | 230 ++-- ...ridComputeResourceGroupMockingExtension.cs | 148 +++ ...ridComputeSubscriptionMockingExtension.cs} | 87 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../Generated/HybridComputeMachineResource.cs | 6 +- .../HybridComputePrivateLinkScopeResource.cs | 12 +- .../Extensions/ArmResourceExtensionClient.cs | 41 - ...idConnectivityArmClientMockingExtension.cs | 109 ++ .../HybridConnectivityExtensions.cs | 68 +- .../KubernetesArmClientMockingExtension.cs | 51 + .../Extensions/KubernetesExtensions.cs | 80 +- ...KubernetesResourceGroupMockingExtension.cs | 92 ++ ...KubernetesSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...irmwareDefenseArmClientMockingExtension.cs | 63 + .../IotFirmwareDefenseExtensions.cs | 93 +- ...areDefenseResourceGroupMockingExtension.cs | 92 ++ ...areDefenseSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/FirmwareWorkspaceResource.cs | 6 +- .../IotCentralArmClientMockingExtension.cs | 75 ++ .../Extensions/IotCentralExtensions.cs | 150 +-- ...IotCentralResourceGroupMockingExtension.cs | 92 ++ ...IotCentralSubscriptionMockingExtension.cs} | 41 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/IotCentralAppResource.cs | 12 +- .../IotHubArmClientMockingExtension.cs | 99 ++ .../Generated/Extensions/IotHubExtensions.cs | 160 +-- .../IotHubResourceGroupMockingExtension.cs | 92 ++ ... => IotHubSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/IotHubDescriptionResource.cs | 26 +- .../KeyVaultArmClientMockingExtension.cs | 123 ++ .../Extensions/KeyVaultExtensions.cs | 304 +++-- .../KeyVaultResourceGroupMockingExtension.cs | 145 +++ ...> KeyVaultSubscriptionMockingExtension.cs} | 149 ++- .../ResourceGroupResourceExtensionClient.cs | 48 - .../src/Generated/KeyVaultResource.cs | 12 +- .../src/Generated/ManagedHsmResource.cs | 6 +- ...sConfigurationArmClientMockingExtension.cs | 75 ++ .../KubernetesConfigurationExtensions.cs | 151 +-- ...figurationResourceGroupMockingExtension.cs | 231 ++++ .../ResourceGroupResourceExtensionClient.cs | 64 - .../KustoArmClientMockingExtension.cs | 159 +++ .../Generated/Extensions/KustoExtensions.cs | 237 ++-- .../KustoResourceGroupMockingExtension.cs | 92 ++ ...s => KustoSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/KustoClusterResource.cs | 36 +- .../src/Generated/KustoDatabaseResource.cs | 18 +- .../LabServicesArmClientMockingExtension.cs | 111 ++ .../Extensions/LabServicesExtensions.cs | 207 ++-- ...abServicesResourceGroupMockingExtension.cs | 145 +++ ...abServicesSubscriptionMockingExtension.cs} | 29 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../src/Generated/LabPlanResource.cs | 6 +- .../src/Generated/LabResource.cs | 18 +- .../LoadTestingArmClientMockingExtension.cs | 63 + .../Extensions/LoadTestingExtensions.cs | 119 +- ...oadTestingResourceGroupMockingExtension.cs | 92 ++ ...oadTestingSubscriptionMockingExtension.cs} | 67 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../LogicArmClientMockingExtension.cs | 303 +++++ .../Generated/Extensions/LogicExtensions.cs | 447 ++++--- .../LogicResourceGroupMockingExtension.cs | 281 +++++ ...s => LogicSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 132 --- .../Generated/IntegrationAccountResource.cs | 48 +- .../IntegrationServiceEnvironmentResource.cs | 6 +- .../src/Generated/LogicWorkflowResource.cs | 18 +- ...ogicWorkflowRunActionRepetitionResource.cs | 6 +- .../LogicWorkflowRunActionResource.cs | 18 +- .../src/Generated/LogicWorkflowRunResource.cs | 12 +- .../Generated/LogicWorkflowTriggerResource.cs | 6 +- ...earningComputeArmClientMockingExtension.cs | 51 + .../MachineLearningComputeExtensions.cs | 107 +- ...ingComputeResourceGroupMockingExtension.cs | 92 ++ ...ingComputeSubscriptionMockingExtension.cs} | 17 +- ...eLearningComputeTenantMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...achineLearningArmClientMockingExtension.cs | 507 ++++++++ .../Extensions/MachineLearningExtensions.cs | 664 +++++------ ...neLearningResourceGroupMockingExtension.cs | 145 +++ ...neLearningSubscriptionMockingExtension.cs} | 44 +- .../ResourceGroupResourceExtensionClient.cs | 48 - ...arninRegistryComponentContainerResource.cs | 6 +- .../MachineLearningBatchEndpointResource.cs | 6 +- .../MachineLearningCodeContainerResource.cs | 6 +- ...chineLearningComponentContainerResource.cs | 6 +- .../MachineLearningDataContainerResource.cs | 6 +- ...ineLearningEnvironmentContainerResource.cs | 6 +- ...hineLearningFeatureSetContainerResource.cs | 6 +- ...achineLearningFeatureSetVersionResource.cs | 6 +- ...ningFeatureStoreEntityContainerResource.cs | 6 +- .../MachineLearningModelContainerResource.cs | 6 +- .../MachineLearningOnlineEndpointResource.cs | 6 +- ...neLearningRegistryCodeContainerResource.cs | 6 +- ...neLearningRegistryDataContainerResource.cs | 6 +- ...ingRegistryEnvironmentContainerResource.cs | 6 +- ...eLearningRegistryModelContainerResource.cs | 6 +- .../MachineLearningRegistryResource.cs | 30 +- .../MachineLearningWorkspaceResource.cs | 102 +- .../MaintenanceArmClientMockingExtension.cs | 75 ++ .../Extensions/MaintenanceExtensions.cs | 594 +++++----- ...intenanceResourceGroupMockingExtension.cs} | 375 +++++- ...aintenanceSubscriptionMockingExtension.cs} | 125 +- .../Extensions/ArmResourceExtensionClient.cs | 41 - ...ManagedNetworkArmClientMockingExtension.cs | 147 +++ .../Extensions/ManagedNetworkExtensions.cs | 243 ++-- ...gedNetworkResourceGroupMockingExtension.cs | 92 ++ ...gedNetworkSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/ManagedNetworkResource.cs | 12 +- ...dNetworkFabricArmClientMockingExtension.cs | 315 +++++ .../ManagedNetworkFabricExtensions.cs | 1026 +++++++++++------ ...workFabricResourceGroupMockingExtension.cs | 940 +++++++++++++++ ...workFabricSubscriptionMockingExtension.cs} | 179 ++- .../ResourceGroupResourceExtensionClient.cs | 153 --- .../src/Generated/NetworkDeviceResource.cs | 6 +- .../NetworkFabricL3IsolationDomainResource.cs | 12 +- .../src/Generated/NetworkFabricResource.cs | 6 +- ...viceIdentitiesArmClientMockingExtension.cs | 83 ++ ...edServiceIdentitiesArmMockingExtension.cs} | 13 +- .../ManagedServiceIdentitiesExtensions.cs | 149 ++- ...IdentitiesResourceGroupMockingExtension.cs | 92 ++ ...IdentitiesSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/UserAssignedIdentityResource.cs | 6 +- .../Extensions/ArmResourceExtensionClient.cs | 55 - ...anagedServicesArmClientMockingExtension.cs | 249 ++++ .../Extensions/ManagedServicesExtensions.cs | 194 ++-- ...agementPartnerArmClientMockingExtension.cs | 51 + .../Extensions/ManagementPartnerExtensions.cs | 67 +- ...anagementPartnerTenantMockingExtension.cs} | 67 +- .../MapsArmClientMockingExtension.cs | 63 + .../Generated/Extensions/MapsExtensions.cs | 93 +- .../MapsResourceGroupMockingExtension.cs | 92 ++ ...cs => MapsSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/MapsAccountResource.cs | 6 +- .../MarketplaceArmClientMockingExtension.cs | 99 ++ .../Extensions/MarketplaceExtensions.cs | 103 +- .../MarketplaceTenantMockingExtension.cs | 88 ++ .../TenantResourceExtensionClient.cs | 41 - .../PrivateStoreCollectionInfoResource.cs | 6 +- .../src/Generated/PrivateStoreResource.cs | 14 +- ...tplaceOrderingArmClientMockingExtension.cs | 63 + .../MarketplaceOrderingExtensions.cs | 94 +- ...aceOrderingSubscriptionMockingExtension.cs | 156 +++ .../SubscriptionResourceExtensionClient.cs | 48 - 166 files changed, 11812 insertions(+), 4914 deletions(-) create mode 100644 sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisArmClientMockingExtension.cs create mode 100644 sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisResourceGroupMockingExtension.cs rename sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HealthcareApisSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceArmClientMockingExtension.cs create mode 100644 sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceResourceGroupMockingExtension.cs rename sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HybridContainerServiceSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeArmClientMockingExtension.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeResourceGroupMockingExtension.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HybridComputeSubscriptionMockingExtension.cs} (67%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityArmClientMockingExtension.cs create mode 100644 sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesArmClientMockingExtension.cs create mode 100644 sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesResourceGroupMockingExtension.cs rename sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => KubernetesSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseArmClientMockingExtension.cs create mode 100644 sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseResourceGroupMockingExtension.cs rename sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => IotFirmwareDefenseSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralArmClientMockingExtension.cs create mode 100644 sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralResourceGroupMockingExtension.cs rename sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => IotCentralSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubArmClientMockingExtension.cs create mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubResourceGroupMockingExtension.cs rename sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => IotHubSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultArmClientMockingExtension.cs create mode 100644 sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultResourceGroupMockingExtension.cs rename sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => KeyVaultSubscriptionMockingExtension.cs} (72%) delete mode 100644 sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationArmClientMockingExtension.cs create mode 100644 sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationResourceGroupMockingExtension.cs delete mode 100644 sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoArmClientMockingExtension.cs create mode 100644 sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoResourceGroupMockingExtension.cs rename sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => KustoSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesArmClientMockingExtension.cs create mode 100644 sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesResourceGroupMockingExtension.cs rename sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => LabServicesSubscriptionMockingExtension.cs} (90%) delete mode 100644 sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingArmClientMockingExtension.cs create mode 100644 sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingResourceGroupMockingExtension.cs rename sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => LoadTestingSubscriptionMockingExtension.cs} (58%) delete mode 100644 sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicArmClientMockingExtension.cs create mode 100644 sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicResourceGroupMockingExtension.cs rename sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => LogicSubscriptionMockingExtension.cs} (90%) delete mode 100644 sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeArmClientMockingExtension.cs create mode 100644 sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeResourceGroupMockingExtension.cs rename sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MachineLearningComputeSubscriptionMockingExtension.cs} (85%) rename sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/{TenantResourceExtensionClient.cs => MachineLearningComputeTenantMockingExtension.cs} (81%) delete mode 100644 sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningArmClientMockingExtension.cs create mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningResourceGroupMockingExtension.cs rename sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MachineLearningSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceArmClientMockingExtension.cs rename sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => MaintenanceResourceGroupMockingExtension.cs} (68%) rename sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MaintenanceSubscriptionMockingExtension.cs} (74%) delete mode 100644 sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkArmClientMockingExtension.cs create mode 100644 sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkResourceGroupMockingExtension.cs rename sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ManagedNetworkSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricArmClientMockingExtension.cs create mode 100644 sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricResourceGroupMockingExtension.cs rename sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ManagedNetworkFabricSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmClientMockingExtension.cs rename sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/{ArmResourceExtensionClient.cs => ManagedServiceIdentitiesArmMockingExtension.cs} (71%) create mode 100644 sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesResourceGroupMockingExtension.cs rename sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ManagedServiceIdentitiesSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesArmClientMockingExtension.cs create mode 100644 sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerArmClientMockingExtension.cs rename sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ManagementPartnerTenantMockingExtension.cs} (56%) create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsArmClientMockingExtension.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsResourceGroupMockingExtension.cs rename sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MapsSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceArmClientMockingExtension.cs create mode 100644 sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceTenantMockingExtension.cs delete mode 100644 sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingArmClientMockingExtension.cs create mode 100644 sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingSubscriptionMockingExtension.cs delete mode 100644 sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisArmClientMockingExtension.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisArmClientMockingExtension.cs new file mode 100644 index 000000000000..9cbf3637845a --- /dev/null +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HealthcareApis; + +namespace Azure.ResourceManager.HealthcareApis.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HealthcareApisArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HealthcareApisArmClientMockingExtension() + { + } + + /// 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 HealthcareApisArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HealthcareApisArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HealthcareApisServiceResource GetHealthcareApisServiceResource(ResourceIdentifier id) + { + HealthcareApisServiceResource.ValidateResourceId(id); + return new HealthcareApisServiceResource(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 HealthcareApisServicePrivateEndpointConnectionResource GetHealthcareApisServicePrivateEndpointConnectionResource(ResourceIdentifier id) + { + HealthcareApisServicePrivateEndpointConnectionResource.ValidateResourceId(id); + return new HealthcareApisServicePrivateEndpointConnectionResource(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 HealthcareApisWorkspacePrivateEndpointConnectionResource GetHealthcareApisWorkspacePrivateEndpointConnectionResource(ResourceIdentifier id) + { + HealthcareApisWorkspacePrivateEndpointConnectionResource.ValidateResourceId(id); + return new HealthcareApisWorkspacePrivateEndpointConnectionResource(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 HealthcareApisServicePrivateLinkResource GetHealthcareApisServicePrivateLinkResource(ResourceIdentifier id) + { + HealthcareApisServicePrivateLinkResource.ValidateResourceId(id); + return new HealthcareApisServicePrivateLinkResource(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 HealthcareApisWorkspacePrivateLinkResource GetHealthcareApisWorkspacePrivateLinkResource(ResourceIdentifier id) + { + HealthcareApisWorkspacePrivateLinkResource.ValidateResourceId(id); + return new HealthcareApisWorkspacePrivateLinkResource(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 HealthcareApisWorkspaceResource GetHealthcareApisWorkspaceResource(ResourceIdentifier id) + { + HealthcareApisWorkspaceResource.ValidateResourceId(id); + return new HealthcareApisWorkspaceResource(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 DicomServiceResource GetDicomServiceResource(ResourceIdentifier id) + { + DicomServiceResource.ValidateResourceId(id); + return new DicomServiceResource(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 HealthcareApisIotConnectorResource GetHealthcareApisIotConnectorResource(ResourceIdentifier id) + { + HealthcareApisIotConnectorResource.ValidateResourceId(id); + return new HealthcareApisIotConnectorResource(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 HealthcareApisIotFhirDestinationResource GetHealthcareApisIotFhirDestinationResource(ResourceIdentifier id) + { + HealthcareApisIotFhirDestinationResource.ValidateResourceId(id); + return new HealthcareApisIotFhirDestinationResource(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 FhirServiceResource GetFhirServiceResource(ResourceIdentifier id) + { + FhirServiceResource.ValidateResourceId(id); + return new FhirServiceResource(Client, id); + } + } +} diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisExtensions.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisExtensions.cs index 00bcadee78fb..7721fdfdb613 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisExtensions.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HealthcareApis.Mocking; using Azure.ResourceManager.HealthcareApis.Models; using Azure.ResourceManager.Resources; @@ -19,233 +20,193 @@ namespace Azure.ResourceManager.HealthcareApis /// A class to add extension methods to Azure.ResourceManager.HealthcareApis. public static partial class HealthcareApisExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HealthcareApisArmClientMockingExtension GetHealthcareApisArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HealthcareApisArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HealthcareApisResourceGroupMockingExtension GetHealthcareApisResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HealthcareApisResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HealthcareApisSubscriptionMockingExtension GetHealthcareApisSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HealthcareApisSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HealthcareApisServiceResource /// /// 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. /// Returns a object. public static HealthcareApisServiceResource GetHealthcareApisServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisServiceResource.ValidateResourceId(id); - return new HealthcareApisServiceResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisServiceResource(id); } - #endregion - #region HealthcareApisServicePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HealthcareApisServicePrivateEndpointConnectionResource GetHealthcareApisServicePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisServicePrivateEndpointConnectionResource.ValidateResourceId(id); - return new HealthcareApisServicePrivateEndpointConnectionResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisServicePrivateEndpointConnectionResource(id); } - #endregion - #region HealthcareApisWorkspacePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HealthcareApisWorkspacePrivateEndpointConnectionResource GetHealthcareApisWorkspacePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisWorkspacePrivateEndpointConnectionResource.ValidateResourceId(id); - return new HealthcareApisWorkspacePrivateEndpointConnectionResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisWorkspacePrivateEndpointConnectionResource(id); } - #endregion - #region HealthcareApisServicePrivateLinkResource /// /// 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. /// Returns a object. public static HealthcareApisServicePrivateLinkResource GetHealthcareApisServicePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisServicePrivateLinkResource.ValidateResourceId(id); - return new HealthcareApisServicePrivateLinkResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisServicePrivateLinkResource(id); } - #endregion - #region HealthcareApisWorkspacePrivateLinkResource /// /// 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. /// Returns a object. public static HealthcareApisWorkspacePrivateLinkResource GetHealthcareApisWorkspacePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisWorkspacePrivateLinkResource.ValidateResourceId(id); - return new HealthcareApisWorkspacePrivateLinkResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisWorkspacePrivateLinkResource(id); } - #endregion - #region HealthcareApisWorkspaceResource /// /// 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. /// Returns a object. public static HealthcareApisWorkspaceResource GetHealthcareApisWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisWorkspaceResource.ValidateResourceId(id); - return new HealthcareApisWorkspaceResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisWorkspaceResource(id); } - #endregion - #region DicomServiceResource /// /// 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. /// Returns a object. public static DicomServiceResource GetDicomServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DicomServiceResource.ValidateResourceId(id); - return new DicomServiceResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetDicomServiceResource(id); } - #endregion - #region HealthcareApisIotConnectorResource /// /// 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. /// Returns a object. public static HealthcareApisIotConnectorResource GetHealthcareApisIotConnectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisIotConnectorResource.ValidateResourceId(id); - return new HealthcareApisIotConnectorResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisIotConnectorResource(id); } - #endregion - #region HealthcareApisIotFhirDestinationResource /// /// 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. /// Returns a object. public static HealthcareApisIotFhirDestinationResource GetHealthcareApisIotFhirDestinationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthcareApisIotFhirDestinationResource.ValidateResourceId(id); - return new HealthcareApisIotFhirDestinationResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetHealthcareApisIotFhirDestinationResource(id); } - #endregion - #region FhirServiceResource /// /// 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. /// Returns a object. public static FhirServiceResource GetFhirServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FhirServiceResource.ValidateResourceId(id); - return new FhirServiceResource(client, id); - } - ); + return GetHealthcareApisArmClientMockingExtension(client).GetFhirServiceResource(id); } - #endregion - /// Gets a collection of HealthcareApisServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of HealthcareApisServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HealthcareApisServiceResources and their operations over a HealthcareApisServiceResource. public static HealthcareApisServiceCollection GetHealthcareApisServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHealthcareApisServices(); + return GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisServices(); } /// @@ -260,16 +221,20 @@ public static HealthcareApisServiceCollection GetHealthcareApisServices(this Res /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the service instance. /// The cancellation token to use. - /// 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 static async Task> GetHealthcareApisServiceAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHealthcareApisServices().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisServiceAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -284,24 +249,34 @@ public static async Task> GetHealthcareA /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the service instance. /// The cancellation token to use. - /// 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 static Response GetHealthcareApisService(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHealthcareApisServices().Get(resourceName, cancellationToken); + return GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisService(resourceName, cancellationToken); } - /// Gets a collection of HealthcareApisWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of HealthcareApisWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HealthcareApisWorkspaceResources and their operations over a HealthcareApisWorkspaceResource. public static HealthcareApisWorkspaceCollection GetHealthcareApisWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHealthcareApisWorkspaces(); + return GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisWorkspaces(); } /// @@ -316,16 +291,20 @@ public static HealthcareApisWorkspaceCollection GetHealthcareApisWorkspaces(this /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of workspace resource. /// The cancellation token to use. - /// 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 static async Task> GetHealthcareApisWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHealthcareApisWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -340,16 +319,20 @@ public static async Task> GetHealthcar /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of workspace resource. /// The cancellation token to use. - /// 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 static Response GetHealthcareApisWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHealthcareApisWorkspaces().Get(workspaceName, cancellationToken); + return GetHealthcareApisResourceGroupMockingExtension(resourceGroupResource).GetHealthcareApisWorkspace(workspaceName, cancellationToken); } /// @@ -364,13 +347,17 @@ public static Response GetHealthcareApisWorkspa /// Services_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHealthcareApisServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthcareApisServicesAsync(cancellationToken); + return GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).GetHealthcareApisServicesAsync(cancellationToken); } /// @@ -385,13 +372,17 @@ public static AsyncPageable GetHealthcareApisServ /// Services_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHealthcareApisServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthcareApisServices(cancellationToken); + return GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).GetHealthcareApisServices(cancellationToken); } /// @@ -406,6 +397,10 @@ public static Pageable GetHealthcareApisServices( /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. @@ -413,9 +408,7 @@ public static Pageable GetHealthcareApisServices( /// is null. public static async Task> CheckHealthcareApisNameAvailabilityAsync(this SubscriptionResource subscriptionResource, HealthcareApisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHealthcareApisNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).CheckHealthcareApisNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -430,6 +423,10 @@ public static async Task> CheckHe /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. @@ -437,9 +434,7 @@ public static async Task> CheckHe /// is null. public static Response CheckHealthcareApisNameAvailability(this SubscriptionResource subscriptionResource, HealthcareApisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHealthcareApisNameAvailability(content, cancellationToken); + return GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).CheckHealthcareApisNameAvailability(content, cancellationToken); } /// @@ -454,13 +449,17 @@ public static Response CheckHealthcareApis /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHealthcareApisWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthcareApisWorkspacesAsync(cancellationToken); + return GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).GetHealthcareApisWorkspacesAsync(cancellationToken); } /// @@ -475,13 +474,17 @@ public static AsyncPageable GetHealthcareApisWo /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHealthcareApisWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthcareApisWorkspaces(cancellationToken); + return GetHealthcareApisSubscriptionMockingExtension(subscriptionResource).GetHealthcareApisWorkspaces(cancellationToken); } } } diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisResourceGroupMockingExtension.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..bd006f211665 --- /dev/null +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HealthcareApis; + +namespace Azure.ResourceManager.HealthcareApis.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HealthcareApisResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HealthcareApisResourceGroupMockingExtension() + { + } + + /// 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 HealthcareApisResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HealthcareApisServiceResources in the ResourceGroupResource. + /// An object representing collection of HealthcareApisServiceResources and their operations over a HealthcareApisServiceResource. + public virtual HealthcareApisServiceCollection GetHealthcareApisServices() + { + return GetCachedClient(client => new HealthcareApisServiceCollection(client, Id)); + } + + /// + /// Get the metadata of a service instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the service instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHealthcareApisServiceAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetHealthcareApisServices().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the metadata of a service instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the service instance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHealthcareApisService(string resourceName, CancellationToken cancellationToken = default) + { + return GetHealthcareApisServices().Get(resourceName, cancellationToken); + } + + /// Gets a collection of HealthcareApisWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of HealthcareApisWorkspaceResources and their operations over a HealthcareApisWorkspaceResource. + public virtual HealthcareApisWorkspaceCollection GetHealthcareApisWorkspaces() + { + return GetCachedClient(client => new HealthcareApisWorkspaceCollection(client, Id)); + } + + /// + /// Gets the properties of the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of workspace resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHealthcareApisWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetHealthcareApisWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of workspace resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHealthcareApisWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetHealthcareApisWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisSubscriptionMockingExtension.cs similarity index 87% rename from sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisSubscriptionMockingExtension.cs index 4231692aa0ce..0dc7e9f6ec91 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/HealthcareApisSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HealthcareApis; using Azure.ResourceManager.HealthcareApis.Models; -namespace Azure.ResourceManager.HealthcareApis +namespace Azure.ResourceManager.HealthcareApis.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HealthcareApisSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _healthcareApisServiceServicesClientDiagnostics; private ServicesRestOperations _healthcareApisServiceServicesRestClient; private ClientDiagnostics _healthcareApisWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _healthcareApisWorkspaceWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HealthcareApisSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HealthcareApisSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetHealthcareApisSer { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthcareApisServiceServicesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthcareApisServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisServiceResource(Client, HealthcareApisServiceData.DeserializeHealthcareApisServiceData(e)), HealthcareApisServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthcareApisServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisServiceResource(Client, HealthcareApisServiceData.DeserializeHealthcareApisServiceData(e)), HealthcareApisServiceServicesClientDiagnostics, Pipeline, "HealthcareApisSubscriptionMockingExtension.GetHealthcareApisServices", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetHealthcareApisServices { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthcareApisServiceServicesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthcareApisServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisServiceResource(Client, HealthcareApisServiceData.DeserializeHealthcareApisServiceData(e)), HealthcareApisServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthcareApisServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisServiceResource(Client, HealthcareApisServiceData.DeserializeHealthcareApisServiceData(e)), HealthcareApisServiceServicesClientDiagnostics, Pipeline, "HealthcareApisSubscriptionMockingExtension.GetHealthcareApisServices", "value", "nextLink", cancellationToken); } /// @@ -107,9 +108,12 @@ public virtual Pageable GetHealthcareApisServices /// /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckHealthcareApisNameAvailabilityAsync(HealthcareApisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = HealthcareApisServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHealthcareApisNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = HealthcareApisServiceServicesClientDiagnostics.CreateScope("HealthcareApisSubscriptionMockingExtension.CheckHealthcareApisNameAvailability"); scope.Start(); try { @@ -138,9 +142,12 @@ public virtual async Task> CheckH /// /// Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the service instance to check. /// The cancellation token to use. + /// is null. public virtual Response CheckHealthcareApisNameAvailability(HealthcareApisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = HealthcareApisServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHealthcareApisNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = HealthcareApisServiceServicesClientDiagnostics.CreateScope("HealthcareApisSubscriptionMockingExtension.CheckHealthcareApisNameAvailability"); scope.Start(); try { @@ -173,7 +180,7 @@ public virtual AsyncPageable GetHealthcareApisW { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthcareApisWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthcareApisWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisWorkspaceResource(Client, HealthcareApisWorkspaceData.DeserializeHealthcareApisWorkspaceData(e)), HealthcareApisWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthcareApisWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisWorkspaceResource(Client, HealthcareApisWorkspaceData.DeserializeHealthcareApisWorkspaceData(e)), HealthcareApisWorkspaceWorkspacesClientDiagnostics, Pipeline, "HealthcareApisSubscriptionMockingExtension.GetHealthcareApisWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -195,7 +202,7 @@ public virtual Pageable GetHealthcareApisWorksp { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthcareApisWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthcareApisWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisWorkspaceResource(Client, HealthcareApisWorkspaceData.DeserializeHealthcareApisWorkspaceData(e)), HealthcareApisWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthcareApisWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthcareApisWorkspaceResource(Client, HealthcareApisWorkspaceData.DeserializeHealthcareApisWorkspaceData(e)), HealthcareApisWorkspaceWorkspacesClientDiagnostics, Pipeline, "HealthcareApisSubscriptionMockingExtension.GetHealthcareApisWorkspaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 1316bd6469aa..000000000000 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HealthcareApis -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HealthcareApisServiceResources in the ResourceGroupResource. - /// An object representing collection of HealthcareApisServiceResources and their operations over a HealthcareApisServiceResource. - public virtual HealthcareApisServiceCollection GetHealthcareApisServices() - { - return GetCachedClient(Client => new HealthcareApisServiceCollection(Client, Id)); - } - - /// Gets a collection of HealthcareApisWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of HealthcareApisWorkspaceResources and their operations over a HealthcareApisWorkspaceResource. - public virtual HealthcareApisWorkspaceCollection GetHealthcareApisWorkspaces() - { - return GetCachedClient(Client => new HealthcareApisWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisIotConnectorResource.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisIotConnectorResource.cs index 196ae7c0ed84..e782be90cfc6 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisIotConnectorResource.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisIotConnectorResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HealthcareApisIotFhirDestinationResources and their operations over a HealthcareApisIotFhirDestinationResource. public virtual HealthcareApisIotFhirDestinationCollection GetHealthcareApisIotFhirDestinations() { - return GetCachedClient(Client => new HealthcareApisIotFhirDestinationCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisIotFhirDestinationCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual HealthcareApisIotFhirDestinationCollection GetHealthcareApisIotFh /// /// The name of IoT Connector FHIR destination resource. /// The cancellation token to use. - /// 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> GetHealthcareApisIotFhirDestinationAsync(string fhirDestinationName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Ge /// /// The name of IoT Connector FHIR destination resource. /// The cancellation token to use. - /// 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 GetHealthcareApisIotFhirDestination(string fhirDestinationName, CancellationToken cancellationToken = default) { diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisServiceResource.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisServiceResource.cs index 2b222327a46d..c2bc4b7bb865 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisServiceResource.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisServiceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HealthcareApisServicePrivateEndpointConnectionResources and their operations over a HealthcareApisServicePrivateEndpointConnectionResource. public virtual HealthcareApisServicePrivateEndpointConnectionCollection GetHealthcareApisServicePrivateEndpointConnections() { - return GetCachedClient(Client => new HealthcareApisServicePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisServicePrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HealthcareApisServicePrivateEndpointConnectionCollection GetHealt /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetHealthcareApisServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetHealthcareApisServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response /// An object representing collection of HealthcareApisServicePrivateLinkResources and their operations over a HealthcareApisServicePrivateLinkResource. public virtual HealthcareApisServicePrivateLinkResourceCollection GetHealthcareApisServicePrivateLinkResources() { - return GetCachedClient(Client => new HealthcareApisServicePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisServicePrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual HealthcareApisServicePrivateLinkResourceCollection GetHealthcareA /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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> GetHealthcareApisServicePrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> Ge /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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 GetHealthcareApisServicePrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { diff --git a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisWorkspaceResource.cs b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisWorkspaceResource.cs index f50b3032369b..b9cf3cf75780 100644 --- a/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisWorkspaceResource.cs +++ b/sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/src/Generated/HealthcareApisWorkspaceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HealthcareApisWorkspacePrivateEndpointConnectionResources and their operations over a HealthcareApisWorkspacePrivateEndpointConnectionResource. public virtual HealthcareApisWorkspacePrivateEndpointConnectionCollection GetHealthcareApisWorkspacePrivateEndpointConnections() { - return GetCachedClient(Client => new HealthcareApisWorkspacePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisWorkspacePrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HealthcareApisWorkspacePrivateEndpointConnectionCollection GetHea /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetHealthcareApisWorkspacePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetHealthcareApisWorkspacePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response An object representing collection of HealthcareApisWorkspacePrivateLinkResources and their operations over a HealthcareApisWorkspacePrivateLinkResource. public virtual HealthcareApisWorkspacePrivateLinkResourceCollection GetHealthcareApisWorkspacePrivateLinkResources() { - return GetCachedClient(Client => new HealthcareApisWorkspacePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisWorkspacePrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual HealthcareApisWorkspacePrivateLinkResourceCollection GetHealthcar /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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> GetHealthcareApisWorkspacePrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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 GetHealthcareApisWorkspacePrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetHealthcar /// An object representing collection of DicomServiceResources and their operations over a DicomServiceResource. public virtual DicomServiceCollection GetDicomServices() { - return GetCachedClient(Client => new DicomServiceCollection(Client, Id)); + return GetCachedClient(client => new DicomServiceCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual DicomServiceCollection GetDicomServices() /// /// The name of DICOM Service resource. /// The cancellation token to use. - /// 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> GetDicomServiceAsync(string dicomServiceName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetDicomServiceAsync(s /// /// The name of DICOM Service resource. /// The cancellation token to use. - /// 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 GetDicomService(string dicomServiceName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetDicomService(string dicomServic /// An object representing collection of HealthcareApisIotConnectorResources and their operations over a HealthcareApisIotConnectorResource. public virtual HealthcareApisIotConnectorCollection GetHealthcareApisIotConnectors() { - return GetCachedClient(Client => new HealthcareApisIotConnectorCollection(Client, Id)); + return GetCachedClient(client => new HealthcareApisIotConnectorCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual HealthcareApisIotConnectorCollection GetHealthcareApisIotConnecto /// /// The name of IoT Connector resource. /// The cancellation token to use. - /// 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> GetHealthcareApisIotConnectorAsync(string iotConnectorName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetHealt /// /// The name of IoT Connector resource. /// The cancellation token to use. - /// 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 GetHealthcareApisIotConnector(string iotConnectorName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetHealthcareApisIot /// An object representing collection of FhirServiceResources and their operations over a FhirServiceResource. public virtual FhirServiceCollection GetFhirServices() { - return GetCachedClient(Client => new FhirServiceCollection(Client, Id)); + return GetCachedClient(client => new FhirServiceCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual FhirServiceCollection GetFhirServices() /// /// The name of FHIR Service resource. /// The cancellation token to use. - /// 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> GetFhirServiceAsync(string fhirServiceName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetFhirServiceAsync(str /// /// The name of FHIR Service resource. /// The cancellation token to use. - /// 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 GetFhirService(string fhirServiceName, CancellationToken cancellationToken = default) { diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index f2e3c0b130ca..000000000000 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.HybridContainerService.Models; - -namespace Azure.ResourceManager.HybridContainerService -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _hybridContainerServiceClientDiagnostics; - private HybridContainerServiceRestOperations _hybridContainerServiceRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics HybridContainerServiceClientDiagnostics => _hybridContainerServiceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private HybridContainerServiceRestOperations HybridContainerServiceRestClient => _hybridContainerServiceRestClient ??= new HybridContainerServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Lists the available orchestrators in a custom location for HybridAKS - /// - /// - /// Request Path - /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/orchestrators - /// - /// - /// Operation Id - /// HybridContainerService_ListOrchestrators - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetOrchestratorsHybridContainerServiceAsync(CancellationToken cancellationToken = default) - { - using var scope = HybridContainerServiceClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetOrchestratorsHybridContainerService"); - scope.Start(); - try - { - var response = await HybridContainerServiceRestClient.ListOrchestratorsAsync(Id, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the available orchestrators in a custom location for HybridAKS - /// - /// - /// Request Path - /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/orchestrators - /// - /// - /// Operation Id - /// HybridContainerService_ListOrchestrators - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetOrchestratorsHybridContainerService(CancellationToken cancellationToken = default) - { - using var scope = HybridContainerServiceClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetOrchestratorsHybridContainerService"); - scope.Start(); - try - { - var response = HybridContainerServiceRestClient.ListOrchestrators(Id, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the available VM SKUs in a custom location for HybridAKS - /// - /// - /// Request Path - /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/vmSkus - /// - /// - /// Operation Id - /// HybridContainerService_ListVMSkus - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetVmSkusHybridContainerServiceAsync(CancellationToken cancellationToken = default) - { - using var scope = HybridContainerServiceClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetVmSkusHybridContainerService"); - scope.Start(); - try - { - var response = await HybridContainerServiceRestClient.ListVmSkusAsync(Id, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the available VM SKUs in a custom location for HybridAKS - /// - /// - /// Request Path - /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/vmSkus - /// - /// - /// Operation Id - /// HybridContainerService_ListVMSkus - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetVmSkusHybridContainerService(CancellationToken cancellationToken = default) - { - using var scope = HybridContainerServiceClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetVmSkusHybridContainerService"); - scope.Start(); - try - { - var response = HybridContainerServiceRestClient.ListVmSkus(Id, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceArmClientMockingExtension.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceArmClientMockingExtension.cs new file mode 100644 index 000000000000..43871e687f59 --- /dev/null +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceArmClientMockingExtension.cs @@ -0,0 +1,246 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridContainerService; +using Azure.ResourceManager.HybridContainerService.Models; + +namespace Azure.ResourceManager.HybridContainerService.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HybridContainerServiceArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _hybridContainerServiceClientDiagnostics; + private HybridContainerServiceRestOperations _hybridContainerServiceRestClient; + + /// Initializes a new instance of the class for mocking. + protected HybridContainerServiceArmClientMockingExtension() + { + } + + /// 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 HybridContainerServiceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HybridContainerServiceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics HybridContainerServiceClientDiagnostics => _hybridContainerServiceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private HybridContainerServiceRestOperations HybridContainerServiceRestClient => _hybridContainerServiceRestClient ??= new HybridContainerServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Lists the available orchestrators in a custom location for HybridAKS + /// + /// + /// Request Path + /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/orchestrators + /// + /// + /// Operation Id + /// HybridContainerService_ListOrchestrators + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual async Task> GetOrchestratorsHybridContainerServiceAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = HybridContainerServiceClientDiagnostics.CreateScope("HybridContainerServiceArmClientMockingExtension.GetOrchestratorsHybridContainerService"); + scope0.Start(); + try + { + var response = await HybridContainerServiceRestClient.ListOrchestratorsAsync(scope, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Lists the available orchestrators in a custom location for HybridAKS + /// + /// + /// Request Path + /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/orchestrators + /// + /// + /// Operation Id + /// HybridContainerService_ListOrchestrators + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual Response GetOrchestratorsHybridContainerService(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = HybridContainerServiceClientDiagnostics.CreateScope("HybridContainerServiceArmClientMockingExtension.GetOrchestratorsHybridContainerService"); + scope0.Start(); + try + { + var response = HybridContainerServiceRestClient.ListOrchestrators(scope, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Lists the available VM SKUs in a custom location for HybridAKS + /// + /// + /// Request Path + /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/vmSkus + /// + /// + /// Operation Id + /// HybridContainerService_ListVMSkus + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual async Task> GetVmSkusHybridContainerServiceAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = HybridContainerServiceClientDiagnostics.CreateScope("HybridContainerServiceArmClientMockingExtension.GetVmSkusHybridContainerService"); + scope0.Start(); + try + { + var response = await HybridContainerServiceRestClient.ListVmSkusAsync(scope, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Lists the available VM SKUs in a custom location for HybridAKS + /// + /// + /// Request Path + /// /{customLocationResourceUri}/providers/Microsoft.HybridContainerService/vmSkus + /// + /// + /// Operation Id + /// HybridContainerService_ListVMSkus + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual Response GetVmSkusHybridContainerService(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = HybridContainerServiceClientDiagnostics.CreateScope("HybridContainerServiceArmClientMockingExtension.GetVmSkusHybridContainerService"); + scope0.Start(); + try + { + var response = HybridContainerServiceRestClient.ListVmSkus(scope, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + /// + /// 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 ProvisionedClusterResource GetProvisionedClusterResource(ResourceIdentifier id) + { + ProvisionedClusterResource.ValidateResourceId(id); + return new ProvisionedClusterResource(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 ProvisionedClusterUpgradeProfileResource GetProvisionedClusterUpgradeProfileResource(ResourceIdentifier id) + { + ProvisionedClusterUpgradeProfileResource.ValidateResourceId(id); + return new ProvisionedClusterUpgradeProfileResource(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 HybridIdentityMetadataResource GetHybridIdentityMetadataResource(ResourceIdentifier id) + { + HybridIdentityMetadataResource.ValidateResourceId(id); + return new HybridIdentityMetadataResource(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 HybridContainerServiceAgentPoolResource GetHybridContainerServiceAgentPoolResource(ResourceIdentifier id) + { + HybridContainerServiceAgentPoolResource.ValidateResourceId(id); + return new HybridContainerServiceAgentPoolResource(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 StorageSpaceResource GetStorageSpaceResource(ResourceIdentifier id) + { + StorageSpaceResource.ValidateResourceId(id); + return new StorageSpaceResource(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 HybridContainerServiceVirtualNetworkResource GetHybridContainerServiceVirtualNetworkResource(ResourceIdentifier id) + { + HybridContainerServiceVirtualNetworkResource.ValidateResourceId(id); + return new HybridContainerServiceVirtualNetworkResource(Client, id); + } + } +} diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceExtensions.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceExtensions.cs index 08aa47136184..de0de9f7b229 100644 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceExtensions.cs +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HybridContainerService.Mocking; using Azure.ResourceManager.HybridContainerService.Models; using Azure.ResourceManager.Resources; @@ -19,167 +20,21 @@ namespace Azure.ResourceManager.HybridContainerService /// A class to add extension methods to Azure.ResourceManager.HybridContainerService. public static partial class HybridContainerServiceExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static HybridContainerServiceArmClientMockingExtension GetHybridContainerServiceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HybridContainerServiceArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HybridContainerServiceResourceGroupMockingExtension GetHybridContainerServiceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HybridContainerServiceResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HybridContainerServiceSubscriptionMockingExtension GetHybridContainerServiceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HybridContainerServiceSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ProvisionedClusterResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ProvisionedClusterResource GetProvisionedClusterResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ProvisionedClusterResource.ValidateResourceId(id); - return new ProvisionedClusterResource(client, id); - } - ); - } - #endregion - - #region ProvisionedClusterUpgradeProfileResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ProvisionedClusterUpgradeProfileResource GetProvisionedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ProvisionedClusterUpgradeProfileResource.ValidateResourceId(id); - return new ProvisionedClusterUpgradeProfileResource(client, id); - } - ); - } - #endregion - - #region HybridIdentityMetadataResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridIdentityMetadataResource GetHybridIdentityMetadataResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridIdentityMetadataResource.ValidateResourceId(id); - return new HybridIdentityMetadataResource(client, id); - } - ); - } - #endregion - - #region HybridContainerServiceAgentPoolResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridContainerServiceAgentPoolResource GetHybridContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridContainerServiceAgentPoolResource.ValidateResourceId(id); - return new HybridContainerServiceAgentPoolResource(client, id); - } - ); - } - #endregion - - #region StorageSpaceResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static StorageSpaceResource GetStorageSpaceResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - StorageSpaceResource.ValidateResourceId(id); - return new StorageSpaceResource(client, id); - } - ); - } - #endregion - - #region HybridContainerServiceVirtualNetworkResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static HybridContainerServiceVirtualNetworkResource GetHybridContainerServiceVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - HybridContainerServiceVirtualNetworkResource.ValidateResourceId(id); - return new HybridContainerServiceVirtualNetworkResource(client, id); - } - ); - } - #endregion - /// /// Lists the available orchestrators in a custom location for HybridAKS /// @@ -192,13 +47,17 @@ public static HybridContainerServiceVirtualNetworkResource GetHybridContainerSer /// HybridContainerService_ListOrchestrators /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static async Task> GetOrchestratorsHybridContainerServiceAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).GetOrchestratorsHybridContainerServiceAsync(cancellationToken).ConfigureAwait(false); + return await GetHybridContainerServiceArmClientMockingExtension(client).GetOrchestratorsHybridContainerServiceAsync(scope, cancellationToken).ConfigureAwait(false); } /// @@ -213,13 +72,17 @@ public static async Task> GetOrch /// HybridContainerService_ListOrchestrators /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static Response GetOrchestratorsHybridContainerService(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetOrchestratorsHybridContainerService(cancellationToken); + return GetHybridContainerServiceArmClientMockingExtension(client).GetOrchestratorsHybridContainerService(scope, cancellationToken); } /// @@ -234,13 +97,17 @@ public static Response GetOrchestratorsHyb /// HybridContainerService_ListVMSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static async Task> GetVmSkusHybridContainerServiceAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).GetVmSkusHybridContainerServiceAsync(cancellationToken).ConfigureAwait(false); + return await GetHybridContainerServiceArmClientMockingExtension(client).GetVmSkusHybridContainerServiceAsync(scope, cancellationToken).ConfigureAwait(false); } /// @@ -255,21 +122,127 @@ public static async Task> GetVmSkusHybridContainerServ /// HybridContainerService_ListVMSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static Response GetVmSkusHybridContainerService(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetVmSkusHybridContainerService(cancellationToken); + return GetHybridContainerServiceArmClientMockingExtension(client).GetVmSkusHybridContainerService(scope, 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. + /// Returns a object. + public static ProvisionedClusterResource GetProvisionedClusterResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetProvisionedClusterResource(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. + /// Returns a object. + public static ProvisionedClusterUpgradeProfileResource GetProvisionedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetProvisionedClusterUpgradeProfileResource(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. + /// Returns a object. + public static HybridIdentityMetadataResource GetHybridIdentityMetadataResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetHybridIdentityMetadataResource(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. + /// Returns a object. + public static HybridContainerServiceAgentPoolResource GetHybridContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetHybridContainerServiceAgentPoolResource(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. + /// Returns a object. + public static StorageSpaceResource GetStorageSpaceResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetStorageSpaceResource(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. + /// Returns a object. + public static HybridContainerServiceVirtualNetworkResource GetHybridContainerServiceVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridContainerServiceArmClientMockingExtension(client).GetHybridContainerServiceVirtualNetworkResource(id); } - /// Gets a collection of ProvisionedClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of ProvisionedClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ProvisionedClusterResources and their operations over a ProvisionedClusterResource. public static ProvisionedClusterCollection GetProvisionedClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProvisionedClusters(); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetProvisionedClusters(); } /// @@ -284,16 +257,20 @@ public static ProvisionedClusterCollection GetProvisionedClusters(this ResourceG /// ProvisionedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the provisioned cluster. /// The cancellation token to use. - /// 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 static async Task> GetProvisionedClusterAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetProvisionedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetProvisionedClusterAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -308,24 +285,34 @@ public static async Task> GetProvisionedClu /// ProvisionedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the provisioned cluster. /// The cancellation token to use. - /// 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 static Response GetProvisionedCluster(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetProvisionedClusters().Get(resourceName, cancellationToken); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetProvisionedCluster(resourceName, cancellationToken); } - /// Gets a collection of StorageSpaceResources in the ResourceGroupResource. + /// + /// Gets a collection of StorageSpaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StorageSpaceResources and their operations over a StorageSpaceResource. public static StorageSpaceCollection GetStorageSpaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageSpaces(); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetStorageSpaces(); } /// @@ -340,16 +327,20 @@ public static StorageSpaceCollection GetStorageSpaces(this ResourceGroupResource /// storageSpaces_Retrieve /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the storage object. /// The cancellation token to use. - /// 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 static async Task> GetStorageSpaceAsync(this ResourceGroupResource resourceGroupResource, string storageSpacesName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStorageSpaces().GetAsync(storageSpacesName, cancellationToken).ConfigureAwait(false); + return await GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetStorageSpaceAsync(storageSpacesName, cancellationToken).ConfigureAwait(false); } /// @@ -364,24 +355,34 @@ public static async Task> GetStorageSpaceAsync(th /// storageSpaces_Retrieve /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the storage object. /// The cancellation token to use. - /// 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 static Response GetStorageSpace(this ResourceGroupResource resourceGroupResource, string storageSpacesName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStorageSpaces().Get(storageSpacesName, cancellationToken); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetStorageSpace(storageSpacesName, cancellationToken); } - /// Gets a collection of HybridContainerServiceVirtualNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of HybridContainerServiceVirtualNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HybridContainerServiceVirtualNetworkResources and their operations over a HybridContainerServiceVirtualNetworkResource. public static HybridContainerServiceVirtualNetworkCollection GetHybridContainerServiceVirtualNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHybridContainerServiceVirtualNetworks(); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetHybridContainerServiceVirtualNetworks(); } /// @@ -396,16 +397,20 @@ public static HybridContainerServiceVirtualNetworkCollection GetHybridContainerS /// virtualNetworks_Retrieve /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the virtual network. /// The cancellation token to use. - /// 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 static async Task> GetHybridContainerServiceVirtualNetworkAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworksName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHybridContainerServiceVirtualNetworks().GetAsync(virtualNetworksName, cancellationToken).ConfigureAwait(false); + return await GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetHybridContainerServiceVirtualNetworkAsync(virtualNetworksName, cancellationToken).ConfigureAwait(false); } /// @@ -420,16 +425,20 @@ public static async Task> /// virtualNetworks_Retrieve /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter for the name of the virtual network. /// The cancellation token to use. - /// 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 static Response GetHybridContainerServiceVirtualNetwork(this ResourceGroupResource resourceGroupResource, string virtualNetworksName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHybridContainerServiceVirtualNetworks().Get(virtualNetworksName, cancellationToken); + return GetHybridContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetHybridContainerServiceVirtualNetwork(virtualNetworksName, cancellationToken); } /// @@ -444,13 +453,17 @@ public static Response GetHybridCo /// ProvisionedClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProvisionedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProvisionedClustersAsync(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetProvisionedClustersAsync(cancellationToken); } /// @@ -465,13 +478,17 @@ public static AsyncPageable GetProvisionedClustersAs /// ProvisionedClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProvisionedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProvisionedClusters(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetProvisionedClusters(cancellationToken); } /// @@ -486,13 +503,17 @@ public static Pageable GetProvisionedClusters(this S /// storageSpaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageSpacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageSpacesAsync(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetStorageSpacesAsync(cancellationToken); } /// @@ -507,13 +528,17 @@ public static AsyncPageable GetStorageSpacesAsync(this Sub /// storageSpaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageSpaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageSpaces(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetStorageSpaces(cancellationToken); } /// @@ -528,13 +553,17 @@ public static Pageable GetStorageSpaces(this SubscriptionR /// virtualNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHybridContainerServiceVirtualNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridContainerServiceVirtualNetworksAsync(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetHybridContainerServiceVirtualNetworksAsync(cancellationToken); } /// @@ -549,13 +578,17 @@ public static AsyncPageable GetHyb /// virtualNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHybridContainerServiceVirtualNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridContainerServiceVirtualNetworks(cancellationToken); + return GetHybridContainerServiceSubscriptionMockingExtension(subscriptionResource).GetHybridContainerServiceVirtualNetworks(cancellationToken); } } } diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceResourceGroupMockingExtension.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..89e8b39e8bdc --- /dev/null +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceResourceGroupMockingExtension.cs @@ -0,0 +1,198 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridContainerService; + +namespace Azure.ResourceManager.HybridContainerService.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HybridContainerServiceResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HybridContainerServiceResourceGroupMockingExtension() + { + } + + /// 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 HybridContainerServiceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ProvisionedClusterResources in the ResourceGroupResource. + /// An object representing collection of ProvisionedClusterResources and their operations over a ProvisionedClusterResource. + public virtual ProvisionedClusterCollection GetProvisionedClusters() + { + return GetCachedClient(client => new ProvisionedClusterCollection(client, Id)); + } + + /// + /// Gets the Hybrid AKS provisioned cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName} + /// + /// + /// Operation Id + /// ProvisionedClusters_Get + /// + /// + /// + /// Parameter for the name of the provisioned cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProvisionedClusterAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetProvisionedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Hybrid AKS provisioned cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{resourceName} + /// + /// + /// Operation Id + /// ProvisionedClusters_Get + /// + /// + /// + /// Parameter for the name of the provisioned cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProvisionedCluster(string resourceName, CancellationToken cancellationToken = default) + { + return GetProvisionedClusters().Get(resourceName, cancellationToken); + } + + /// Gets a collection of StorageSpaceResources in the ResourceGroupResource. + /// An object representing collection of StorageSpaceResources and their operations over a StorageSpaceResource. + public virtual StorageSpaceCollection GetStorageSpaces() + { + return GetCachedClient(client => new StorageSpaceCollection(client, Id)); + } + + /// + /// Gets the Hybrid AKS storage space object + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName} + /// + /// + /// Operation Id + /// storageSpaces_Retrieve + /// + /// + /// + /// Parameter for the name of the storage object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageSpaceAsync(string storageSpacesName, CancellationToken cancellationToken = default) + { + return await GetStorageSpaces().GetAsync(storageSpacesName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Hybrid AKS storage space object + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName} + /// + /// + /// Operation Id + /// storageSpaces_Retrieve + /// + /// + /// + /// Parameter for the name of the storage object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageSpace(string storageSpacesName, CancellationToken cancellationToken = default) + { + return GetStorageSpaces().Get(storageSpacesName, cancellationToken); + } + + /// Gets a collection of HybridContainerServiceVirtualNetworkResources in the ResourceGroupResource. + /// An object representing collection of HybridContainerServiceVirtualNetworkResources and their operations over a HybridContainerServiceVirtualNetworkResource. + public virtual HybridContainerServiceVirtualNetworkCollection GetHybridContainerServiceVirtualNetworks() + { + return GetCachedClient(client => new HybridContainerServiceVirtualNetworkCollection(client, Id)); + } + + /// + /// Gets the Hybrid AKS virtual network + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName} + /// + /// + /// Operation Id + /// virtualNetworks_Retrieve + /// + /// + /// + /// Parameter for the name of the virtual network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHybridContainerServiceVirtualNetworkAsync(string virtualNetworksName, CancellationToken cancellationToken = default) + { + return await GetHybridContainerServiceVirtualNetworks().GetAsync(virtualNetworksName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Hybrid AKS virtual network + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName} + /// + /// + /// Operation Id + /// virtualNetworks_Retrieve + /// + /// + /// + /// Parameter for the name of the virtual network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHybridContainerServiceVirtualNetwork(string virtualNetworksName, CancellationToken cancellationToken = default) + { + return GetHybridContainerServiceVirtualNetworks().Get(virtualNetworksName, cancellationToken); + } + } +} diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceSubscriptionMockingExtension.cs similarity index 88% rename from sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceSubscriptionMockingExtension.cs index bfb4d12886ab..7c73b828ab86 100644 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/HybridContainerServiceSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HybridContainerService; -namespace Azure.ResourceManager.HybridContainerService +namespace Azure.ResourceManager.HybridContainerService.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HybridContainerServiceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _provisionedClusterClientDiagnostics; private ProvisionedClustersRestOperations _provisionedClusterRestClient; @@ -24,15 +25,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _hybridContainerServiceVirtualNetworkvirtualNetworksClientDiagnostics; private VirtualNetworksRestOperations _hybridContainerServiceVirtualNetworkvirtualNetworksRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HybridContainerServiceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HybridContainerServiceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,7 +69,7 @@ public virtual AsyncPageable GetProvisionedClustersA { HttpMessage FirstPageRequest(int? pageSizeHint) => ProvisionedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProvisionedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProvisionedClusterResource(Client, ProvisionedClusterData.DeserializeProvisionedClusterData(e)), ProvisionedClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProvisionedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProvisionedClusterResource(Client, ProvisionedClusterData.DeserializeProvisionedClusterData(e)), ProvisionedClusterClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetProvisionedClusters", "value", "nextLink", cancellationToken); } /// @@ -90,7 +91,7 @@ public virtual Pageable GetProvisionedClusters(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ProvisionedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProvisionedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProvisionedClusterResource(Client, ProvisionedClusterData.DeserializeProvisionedClusterData(e)), ProvisionedClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProvisionedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProvisionedClusterResource(Client, ProvisionedClusterData.DeserializeProvisionedClusterData(e)), ProvisionedClusterClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetProvisionedClusters", "value", "nextLink", cancellationToken); } /// @@ -112,7 +113,7 @@ public virtual AsyncPageable GetStorageSpacesAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageSpacestorageSpacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageSpacestorageSpacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageSpaceResource(Client, StorageSpaceData.DeserializeStorageSpaceData(e)), StorageSpacestorageSpacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageSpaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageSpaceResource(Client, StorageSpaceData.DeserializeStorageSpaceData(e)), StorageSpacestorageSpacesClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetStorageSpaces", "value", "nextLink", cancellationToken); } /// @@ -134,7 +135,7 @@ public virtual Pageable GetStorageSpaces(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageSpacestorageSpacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageSpacestorageSpacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageSpaceResource(Client, StorageSpaceData.DeserializeStorageSpaceData(e)), StorageSpacestorageSpacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageSpaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageSpaceResource(Client, StorageSpaceData.DeserializeStorageSpaceData(e)), StorageSpacestorageSpacesClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetStorageSpaces", "value", "nextLink", cancellationToken); } /// @@ -156,7 +157,7 @@ public virtual AsyncPageable GetHy { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridContainerServiceVirtualNetworkvirtualNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridContainerServiceVirtualNetworkvirtualNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridContainerServiceVirtualNetworkResource(Client, HybridContainerServiceVirtualNetworkData.DeserializeHybridContainerServiceVirtualNetworkData(e)), HybridContainerServiceVirtualNetworkvirtualNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridContainerServiceVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridContainerServiceVirtualNetworkResource(Client, HybridContainerServiceVirtualNetworkData.DeserializeHybridContainerServiceVirtualNetworkData(e)), HybridContainerServiceVirtualNetworkvirtualNetworksClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetHybridContainerServiceVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -178,7 +179,7 @@ public virtual Pageable GetHybridC { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridContainerServiceVirtualNetworkvirtualNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridContainerServiceVirtualNetworkvirtualNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridContainerServiceVirtualNetworkResource(Client, HybridContainerServiceVirtualNetworkData.DeserializeHybridContainerServiceVirtualNetworkData(e)), HybridContainerServiceVirtualNetworkvirtualNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridContainerServiceVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridContainerServiceVirtualNetworkResource(Client, HybridContainerServiceVirtualNetworkData.DeserializeHybridContainerServiceVirtualNetworkData(e)), HybridContainerServiceVirtualNetworkvirtualNetworksClientDiagnostics, Pipeline, "HybridContainerServiceSubscriptionMockingExtension.GetHybridContainerServiceVirtualNetworks", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d1bde90daf96..000000000000 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridContainerService -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ProvisionedClusterResources in the ResourceGroupResource. - /// An object representing collection of ProvisionedClusterResources and their operations over a ProvisionedClusterResource. - public virtual ProvisionedClusterCollection GetProvisionedClusters() - { - return GetCachedClient(Client => new ProvisionedClusterCollection(Client, Id)); - } - - /// Gets a collection of StorageSpaceResources in the ResourceGroupResource. - /// An object representing collection of StorageSpaceResources and their operations over a StorageSpaceResource. - public virtual StorageSpaceCollection GetStorageSpaces() - { - return GetCachedClient(Client => new StorageSpaceCollection(Client, Id)); - } - - /// Gets a collection of HybridContainerServiceVirtualNetworkResources in the ResourceGroupResource. - /// An object representing collection of HybridContainerServiceVirtualNetworkResources and their operations over a HybridContainerServiceVirtualNetworkResource. - public virtual HybridContainerServiceVirtualNetworkCollection GetHybridContainerServiceVirtualNetworks() - { - return GetCachedClient(Client => new HybridContainerServiceVirtualNetworkCollection(Client, Id)); - } - } -} diff --git a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/ProvisionedClusterResource.cs b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/ProvisionedClusterResource.cs index db1d0f2034d4..06b1544d926f 100644 --- a/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/ProvisionedClusterResource.cs +++ b/sdk/hybridaks/Azure.ResourceManager.HybridContainerService/src/Generated/ProvisionedClusterResource.cs @@ -100,7 +100,7 @@ public virtual ProvisionedClusterUpgradeProfileResource GetProvisionedClusterUpg /// An object representing collection of HybridIdentityMetadataResources and their operations over a HybridIdentityMetadataResource. public virtual HybridIdentityMetadataCollection GetAllHybridIdentityMetadata() { - return GetCachedClient(Client => new HybridIdentityMetadataCollection(Client, Id)); + return GetCachedClient(client => new HybridIdentityMetadataCollection(client, Id)); } /// @@ -118,8 +118,8 @@ public virtual HybridIdentityMetadataCollection GetAllHybridIdentityMetadata() /// /// Parameter for the name of the hybrid identity metadata resource. /// The cancellation token to use. - /// 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> GetHybridIdentityMetadataAsync(string hybridIdentityMetadataResourceName, CancellationToken cancellationToken = default) { @@ -141,8 +141,8 @@ public virtual async Task> GetHybridIde /// /// Parameter for the name of the hybrid identity metadata resource. /// The cancellation token to use. - /// 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 GetHybridIdentityMetadata(string hybridIdentityMetadataResourceName, CancellationToken cancellationToken = default) { @@ -153,7 +153,7 @@ public virtual Response GetHybridIdentityMetadat /// An object representing collection of HybridContainerServiceAgentPoolResources and their operations over a HybridContainerServiceAgentPoolResource. public virtual HybridContainerServiceAgentPoolCollection GetHybridContainerServiceAgentPools() { - return GetCachedClient(Client => new HybridContainerServiceAgentPoolCollection(Client, Id)); + return GetCachedClient(client => new HybridContainerServiceAgentPoolCollection(client, Id)); } /// @@ -171,8 +171,8 @@ public virtual HybridContainerServiceAgentPoolCollection GetHybridContainerServi /// /// Parameter for the name of the agent pool in the provisioned cluster. /// The cancellation token to use. - /// 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> GetHybridContainerServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) { @@ -194,8 +194,8 @@ public virtual async Task> Get /// /// Parameter for the name of the agent pool in the provisioned cluster. /// The cancellation token to use. - /// 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 GetHybridContainerServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default) { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeArmClientMockingExtension.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeArmClientMockingExtension.cs new file mode 100644 index 000000000000..d54f3f7fed7d --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HybridComputeArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HybridComputeArmClientMockingExtension() + { + } + + /// 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 HybridComputeArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HybridComputeArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HybridComputeMachineResource GetHybridComputeMachineResource(ResourceIdentifier id) + { + HybridComputeMachineResource.ValidateResourceId(id); + return new HybridComputeMachineResource(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 HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(ResourceIdentifier id) + { + HybridComputeMachineExtensionResource.ValidateResourceId(id); + return new HybridComputeMachineExtensionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExtensionValueResource GetExtensionValueResource(ResourceIdentifier id) + { + ExtensionValueResource.ValidateResourceId(id); + return new ExtensionValueResource(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 HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(ResourceIdentifier id) + { + HybridComputePrivateLinkScopeResource.ValidateResourceId(id); + return new HybridComputePrivateLinkScopeResource(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 HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(ResourceIdentifier id) + { + HybridComputePrivateLinkResource.ValidateResourceId(id); + return new HybridComputePrivateLinkResource(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 HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(ResourceIdentifier id) + { + HybridComputePrivateEndpointConnectionResource.ValidateResourceId(id); + return new HybridComputePrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs index 005ca6aae8cc..271bd15beb85 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute.Mocking; using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Resources; @@ -19,157 +20,129 @@ namespace Azure.ResourceManager.HybridCompute /// A class to add extension methods to Azure.ResourceManager.HybridCompute. public static partial class HybridComputeExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HybridComputeArmClientMockingExtension GetHybridComputeArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HybridComputeArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HybridComputeResourceGroupMockingExtension GetHybridComputeResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HybridComputeResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HybridComputeSubscriptionMockingExtension GetHybridComputeSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HybridComputeSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HybridComputeMachineResource /// /// 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. /// Returns a object. public static HybridComputeMachineResource GetHybridComputeMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridComputeMachineResource.ValidateResourceId(id); - return new HybridComputeMachineResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetHybridComputeMachineResource(id); } - #endregion - #region HybridComputeMachineExtensionResource /// /// 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. /// Returns a object. public static HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridComputeMachineExtensionResource.ValidateResourceId(id); - return new HybridComputeMachineExtensionResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetHybridComputeMachineExtensionResource(id); } - #endregion - #region ExtensionValueResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExtensionValueResource GetExtensionValueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExtensionValueResource.ValidateResourceId(id); - return new ExtensionValueResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetExtensionValueResource(id); } - #endregion - #region HybridComputePrivateLinkScopeResource /// /// 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. /// Returns a object. public static HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridComputePrivateLinkScopeResource.ValidateResourceId(id); - return new HybridComputePrivateLinkScopeResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetHybridComputePrivateLinkScopeResource(id); } - #endregion - #region HybridComputePrivateLinkResource /// /// 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. /// Returns a object. public static HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridComputePrivateLinkResource.ValidateResourceId(id); - return new HybridComputePrivateLinkResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetHybridComputePrivateLinkResource(id); } - #endregion - #region HybridComputePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridComputePrivateEndpointConnectionResource.ValidateResourceId(id); - return new HybridComputePrivateEndpointConnectionResource(client, id); - } - ); + return GetHybridComputeArmClientMockingExtension(client).GetHybridComputePrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of HybridComputeMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of HybridComputeMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HybridComputeMachineResources and their operations over a HybridComputeMachineResource. public static HybridComputeMachineCollection GetHybridComputeMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHybridComputeMachines(); + return GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputeMachines(); } /// @@ -184,17 +157,21 @@ public static HybridComputeMachineCollection GetHybridComputeMachines(this Resou /// Machines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the hybrid machine. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 static async Task> GetHybridComputeMachineAsync(this ResourceGroupResource resourceGroupResource, string machineName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHybridComputeMachines().GetAsync(machineName, expand, cancellationToken).ConfigureAwait(false); + return await GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputeMachineAsync(machineName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -209,25 +186,35 @@ public static async Task> GetHybridComput /// Machines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the hybrid machine. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 static Response GetHybridComputeMachine(this ResourceGroupResource resourceGroupResource, string machineName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHybridComputeMachines().Get(machineName, expand, cancellationToken); + return GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputeMachine(machineName, expand, cancellationToken); } - /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. + /// + /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HybridComputePrivateLinkScopeResources and their operations over a HybridComputePrivateLinkScopeResource. public static HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHybridComputePrivateLinkScopes(); + return GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputePrivateLinkScopes(); } /// @@ -242,16 +229,20 @@ public static HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLin /// PrivateLinkScopes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Arc PrivateLinkScope resource. /// The cancellation token to use. - /// 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 static async Task> GetHybridComputePrivateLinkScopeAsync(this ResourceGroupResource resourceGroupResource, string scopeName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHybridComputePrivateLinkScopes().GetAsync(scopeName, cancellationToken).ConfigureAwait(false); + return await GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputePrivateLinkScopeAsync(scopeName, cancellationToken).ConfigureAwait(false); } /// @@ -266,32 +257,39 @@ public static async Task> GetHyb /// PrivateLinkScopes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Arc PrivateLinkScope resource. /// The cancellation token to use. - /// 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 static Response GetHybridComputePrivateLinkScope(this ResourceGroupResource resourceGroupResource, string scopeName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHybridComputePrivateLinkScopes().Get(scopeName, cancellationToken); + return GetHybridComputeResourceGroupMockingExtension(resourceGroupResource).GetHybridComputePrivateLinkScope(scopeName, cancellationToken); } - /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// + /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location of the Extension being received. /// The publisher of the Extension being received. /// The extensionType of the Extension being received. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. public static ExtensionValueCollection GetExtensionValues(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType) { - Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); - Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExtensionValues(location, publisher, extensionType); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetExtensionValues(location, publisher, extensionType); } /// @@ -306,6 +304,10 @@ public static ExtensionValueCollection GetExtensionValues(this SubscriptionResou /// ExtensionMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the Extension being received. @@ -313,12 +315,12 @@ public static ExtensionValueCollection GetExtensionValues(this SubscriptionResou /// The extensionType of the Extension being received. /// The version of the Extension being received. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetExtensionValueAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetExtensionValues(location, publisher, extensionType).GetAsync(version, cancellationToken).ConfigureAwait(false); + return await GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetExtensionValueAsync(location, publisher, extensionType, version, cancellationToken).ConfigureAwait(false); } /// @@ -333,6 +335,10 @@ public static async Task> GetExtensionValueAsyn /// ExtensionMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the Extension being received. @@ -340,12 +346,12 @@ public static async Task> GetExtensionValueAsyn /// The extensionType of the Extension being received. /// The version of the Extension being received. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetExtensionValue(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) { - return subscriptionResource.GetExtensionValues(location, publisher, extensionType).Get(version, cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetExtensionValue(location, publisher, extensionType, version, cancellationToken); } /// @@ -360,13 +366,17 @@ public static Response GetExtensionValue(this Subscripti /// Machines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHybridComputeMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridComputeMachinesAsync(cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetHybridComputeMachinesAsync(cancellationToken); } /// @@ -381,13 +391,17 @@ public static AsyncPageable GetHybridComputeMachin /// Machines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHybridComputeMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridComputeMachines(cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetHybridComputeMachines(cancellationToken); } /// @@ -402,13 +416,17 @@ public static Pageable GetHybridComputeMachines(th /// PrivateLinkScopes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHybridComputePrivateLinkScopesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridComputePrivateLinkScopesAsync(cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetHybridComputePrivateLinkScopesAsync(cancellationToken); } /// @@ -423,13 +441,17 @@ public static AsyncPageable GetHybridComp /// PrivateLinkScopes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHybridComputePrivateLinkScopes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHybridComputePrivateLinkScopes(cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetHybridComputePrivateLinkScopes(cancellationToken); } /// @@ -444,6 +466,10 @@ public static Pageable GetHybridComputePr /// PrivateLinkScopes_GetValidationDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the target resource. @@ -453,9 +479,7 @@ public static Pageable GetHybridComputePr /// is null. public static async Task> GetValidationDetailsPrivateLinkScopeAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string privateLinkScopeId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(privateLinkScopeId, nameof(privateLinkScopeId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetValidationDetailsPrivateLinkScopeAsync(location, privateLinkScopeId, cancellationToken).ConfigureAwait(false); + return await GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetValidationDetailsPrivateLinkScopeAsync(location, privateLinkScopeId, cancellationToken).ConfigureAwait(false); } /// @@ -470,6 +494,10 @@ public static async Task> GetValidat /// PrivateLinkScopes_GetValidationDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the target resource. @@ -479,9 +507,7 @@ public static async Task> GetValidat /// is null. public static Response GetValidationDetailsPrivateLinkScope(this SubscriptionResource subscriptionResource, AzureLocation location, string privateLinkScopeId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(privateLinkScopeId, nameof(privateLinkScopeId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetValidationDetailsPrivateLinkScope(location, privateLinkScopeId, cancellationToken); + return GetHybridComputeSubscriptionMockingExtension(subscriptionResource).GetValidationDetailsPrivateLinkScope(location, privateLinkScopeId, cancellationToken); } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeResourceGroupMockingExtension.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..e0bec9ad1e92 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeResourceGroupMockingExtension.cs @@ -0,0 +1,148 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HybridComputeResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HybridComputeResourceGroupMockingExtension() + { + } + + /// 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 HybridComputeResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HybridComputeMachineResources in the ResourceGroupResource. + /// An object representing collection of HybridComputeMachineResources and their operations over a HybridComputeMachineResource. + public virtual HybridComputeMachineCollection GetHybridComputeMachines() + { + return GetCachedClient(client => new HybridComputeMachineCollection(client, Id)); + } + + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHybridComputeMachineAsync(string machineName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return await GetHybridComputeMachines().GetAsync(machineName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_Get + /// + /// + /// + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHybridComputeMachine(string machineName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return GetHybridComputeMachines().Get(machineName, expand, cancellationToken); + } + + /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. + /// An object representing collection of HybridComputePrivateLinkScopeResources and their operations over a HybridComputePrivateLinkScopeResource. + public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() + { + return GetCachedClient(client => new HybridComputePrivateLinkScopeCollection(client, Id)); + } + + /// + /// Returns a Azure Arc PrivateLinkScope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName} + /// + /// + /// Operation Id + /// PrivateLinkScopes_Get + /// + /// + /// + /// The name of the Azure Arc PrivateLinkScope resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHybridComputePrivateLinkScopeAsync(string scopeName, CancellationToken cancellationToken = default) + { + return await GetHybridComputePrivateLinkScopes().GetAsync(scopeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Azure Arc PrivateLinkScope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName} + /// + /// + /// Operation Id + /// PrivateLinkScopes_Get + /// + /// + /// + /// The name of the Azure Arc PrivateLinkScope resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHybridComputePrivateLinkScope(string scopeName, CancellationToken cancellationToken = default) + { + return GetHybridComputePrivateLinkScopes().Get(scopeName, cancellationToken); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeSubscriptionMockingExtension.cs similarity index 67% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeSubscriptionMockingExtension.cs index 12001559f25b..d1448c42bf4a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute; using Azure.ResourceManager.HybridCompute.Models; -namespace Azure.ResourceManager.HybridCompute +namespace Azure.ResourceManager.HybridCompute.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HybridComputeSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _hybridComputeMachineMachinesClientDiagnostics; private MachinesRestOperations _hybridComputeMachineMachinesRestClient; private ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HybridComputeSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HybridComputeSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -52,12 +53,66 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The location of the Extension being received. /// The publisher of the Extension being received. /// The extensionType of the Extension being received. + /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. public virtual ExtensionValueCollection GetExtensionValues(AzureLocation location, string publisher, string extensionType) { return new ExtensionValueCollection(Client, Id, location, publisher, extensionType); } + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExtensionValueAsync(AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return await GetExtensionValues(location, publisher, extensionType).GetAsync(version, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExtensionValue(AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return GetExtensionValues(location, publisher, extensionType).Get(version, cancellationToken); + } + /// /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// @@ -77,7 +132,7 @@ public virtual AsyncPageable GetHybridComputeMachi { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridComputeMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "HybridComputeSubscriptionMockingExtension.GetHybridComputeMachines", "value", "nextLink", cancellationToken); } /// @@ -99,7 +154,7 @@ public virtual Pageable GetHybridComputeMachines(C { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridComputeMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "HybridComputeSubscriptionMockingExtension.GetHybridComputeMachines", "value", "nextLink", cancellationToken); } /// @@ -121,7 +176,7 @@ public virtual AsyncPageable GetHybridCom { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputePrivateLinkScopePrivateLinkScopesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputePrivateLinkScopePrivateLinkScopesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputePrivateLinkScopeResource(Client, HybridComputePrivateLinkScopeData.DeserializeHybridComputePrivateLinkScopeData(e)), HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridComputePrivateLinkScopes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputePrivateLinkScopeResource(Client, HybridComputePrivateLinkScopeData.DeserializeHybridComputePrivateLinkScopeData(e)), HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "HybridComputeSubscriptionMockingExtension.GetHybridComputePrivateLinkScopes", "value", "nextLink", cancellationToken); } /// @@ -143,7 +198,7 @@ public virtual Pageable GetHybridComputeP { HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputePrivateLinkScopePrivateLinkScopesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputePrivateLinkScopePrivateLinkScopesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputePrivateLinkScopeResource(Client, HybridComputePrivateLinkScopeData.DeserializeHybridComputePrivateLinkScopeData(e)), HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHybridComputePrivateLinkScopes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputePrivateLinkScopeResource(Client, HybridComputePrivateLinkScopeData.DeserializeHybridComputePrivateLinkScopeData(e)), HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "HybridComputeSubscriptionMockingExtension.GetHybridComputePrivateLinkScopes", "value", "nextLink", cancellationToken); } /// @@ -162,9 +217,13 @@ public virtual Pageable GetHybridComputeP /// The location of the target resource. /// The id (Guid) of the Azure Arc PrivateLinkScope resource. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetValidationDetailsPrivateLinkScopeAsync(AzureLocation location, string privateLinkScopeId, CancellationToken cancellationToken = default) { - using var scope = HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetValidationDetailsPrivateLinkScope"); + Argument.AssertNotNullOrEmpty(privateLinkScopeId, nameof(privateLinkScopeId)); + + using var scope = HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics.CreateScope("HybridComputeSubscriptionMockingExtension.GetValidationDetailsPrivateLinkScope"); scope.Start(); try { @@ -194,9 +253,13 @@ public virtual async Task> GetValida /// The location of the target resource. /// The id (Guid) of the Azure Arc PrivateLinkScope resource. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetValidationDetailsPrivateLinkScope(AzureLocation location, string privateLinkScopeId, CancellationToken cancellationToken = default) { - using var scope = HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetValidationDetailsPrivateLinkScope"); + Argument.AssertNotNullOrEmpty(privateLinkScopeId, nameof(privateLinkScopeId)); + + using var scope = HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics.CreateScope("HybridComputeSubscriptionMockingExtension.GetValidationDetailsPrivateLinkScope"); scope.Start(); try { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index a4d98b11b08b..000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridCompute -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HybridComputeMachineResources in the ResourceGroupResource. - /// An object representing collection of HybridComputeMachineResources and their operations over a HybridComputeMachineResource. - public virtual HybridComputeMachineCollection GetHybridComputeMachines() - { - return GetCachedClient(Client => new HybridComputeMachineCollection(Client, Id)); - } - - /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. - /// An object representing collection of HybridComputePrivateLinkScopeResources and their operations over a HybridComputePrivateLinkScopeResource. - public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() - { - return GetCachedClient(Client => new HybridComputePrivateLinkScopeCollection(Client, Id)); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index 3c929770b020..5b11fbd78b5f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HybridComputeMachineExtensionResources and their operations over a HybridComputeMachineExtensionResource. public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { - return GetCachedClient(Client => new HybridComputeMachineExtensionCollection(Client, Id)); + return GetCachedClient(client => new HybridComputeMachineExtensionCollection(client, Id)); } /// @@ -124,8 +124,8 @@ public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineEx /// /// The name of the machine extension. /// The cancellation token to use. - /// 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> GetHybridComputeMachineExtensionAsync(string extensionName, CancellationToken cancellationToken = default) { @@ -147,8 +147,8 @@ public virtual async Task> GetHy /// /// The name of the machine extension. /// The cancellation token to use. - /// 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 GetHybridComputeMachineExtension(string extensionName, CancellationToken cancellationToken = default) { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs index d3d6494c98f7..51d0030f7b7b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HybridComputePrivateLinkResources and their operations over a HybridComputePrivateLinkResource. public virtual HybridComputePrivateLinkResourceCollection GetHybridComputePrivateLinkResources() { - return GetCachedClient(Client => new HybridComputePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new HybridComputePrivateLinkResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HybridComputePrivateLinkResourceCollection GetHybridComputePrivat /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetHybridComputePrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetHybridC /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetHybridComputePrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetHybridComputePrivat /// An object representing collection of HybridComputePrivateEndpointConnectionResources and their operations over a HybridComputePrivateEndpointConnectionResource. public virtual HybridComputePrivateEndpointConnectionCollection GetHybridComputePrivateEndpointConnections() { - return GetCachedClient(Client => new HybridComputePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HybridComputePrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual HybridComputePrivateEndpointConnectionCollection GetHybridCompute /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetHybridComputePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetHybridComputePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index ef9c5efe1023..000000000000 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HybridConnectivity -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EndpointResources in the ArmResource. - /// An object representing collection of EndpointResources and their operations over a EndpointResource. - public virtual EndpointResourceCollection GetEndpointResources() - { - return GetCachedClient(Client => new EndpointResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityArmClientMockingExtension.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityArmClientMockingExtension.cs new file mode 100644 index 000000000000..bdb65e444194 --- /dev/null +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityArmClientMockingExtension.cs @@ -0,0 +1,109 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridConnectivity; + +namespace Azure.ResourceManager.HybridConnectivity.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HybridConnectivityArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HybridConnectivityArmClientMockingExtension() + { + } + + /// 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 HybridConnectivityArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HybridConnectivityArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EndpointResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of EndpointResources and their operations over a EndpointResource. + public virtual EndpointResourceCollection GetEndpointResources(ResourceIdentifier scope) + { + return new EndpointResourceCollection(Client, scope); + } + + /// + /// Gets the endpoint to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoints_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The endpoint name. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetEndpointResourceAsync(ResourceIdentifier scope, string endpointName, CancellationToken cancellationToken = default) + { + return await GetEndpointResources(scope).GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the endpoint to the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoints_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The endpoint name. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetEndpointResource(ResourceIdentifier scope, string endpointName, CancellationToken cancellationToken = default) + { + return GetEndpointResources(scope).Get(endpointName, cancellationToken); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EndpointResource GetEndpointResource(ResourceIdentifier id) + { + EndpointResource.ValidateResourceId(id); + return new EndpointResource(Client, id); + } + } +} diff --git a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs index 130dd6baa23e..98b4c717cae2 100644 --- a/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs +++ b/sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/src/Generated/Extensions/HybridConnectivityExtensions.cs @@ -11,53 +11,31 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HybridConnectivity.Mocking; namespace Azure.ResourceManager.HybridConnectivity { /// A class to add extension methods to Azure.ResourceManager.HybridConnectivity. public static partial class HybridConnectivityExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static HybridConnectivityArmClientMockingExtension GetHybridConnectivityArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HybridConnectivityArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); - } - #region EndpointResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets a collection of EndpointResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static EndpointResource GetEndpointResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - EndpointResource.ValidateResourceId(id); - return new EndpointResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of EndpointResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of EndpointResources and their operations over a EndpointResource. public static EndpointResourceCollection GetEndpointResources(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetEndpointResources(); + return GetHybridConnectivityArmClientMockingExtension(client).GetEndpointResources(scope); } /// @@ -72,6 +50,10 @@ public static EndpointResourceCollection GetEndpointResources(this ArmClient cli /// Endpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -81,7 +63,7 @@ public static EndpointResourceCollection GetEndpointResources(this ArmClient cli [ForwardsClientCalls] public static async Task> GetEndpointResourceAsync(this ArmClient client, ResourceIdentifier scope, string endpointName, CancellationToken cancellationToken = default) { - return await client.GetEndpointResources(scope).GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + return await GetHybridConnectivityArmClientMockingExtension(client).GetEndpointResourceAsync(scope, endpointName, cancellationToken).ConfigureAwait(false); } /// @@ -96,6 +78,10 @@ public static async Task> GetEndpointResourceAsync(th /// Endpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -105,7 +91,23 @@ public static async Task> GetEndpointResourceAsync(th [ForwardsClientCalls] public static Response GetEndpointResource(this ArmClient client, ResourceIdentifier scope, string endpointName, CancellationToken cancellationToken = default) { - return client.GetEndpointResources(scope).Get(endpointName, cancellationToken); + return GetHybridConnectivityArmClientMockingExtension(client).GetEndpointResource(scope, endpointName, cancellationToken); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static EndpointResource GetEndpointResource(this ArmClient client, ResourceIdentifier id) + { + return GetHybridConnectivityArmClientMockingExtension(client).GetEndpointResource(id); } } } diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesArmClientMockingExtension.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesArmClientMockingExtension.cs new file mode 100644 index 000000000000..af63a247c197 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Kubernetes; + +namespace Azure.ResourceManager.Kubernetes.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class KubernetesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KubernetesArmClientMockingExtension() + { + } + + /// 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 KubernetesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal KubernetesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ConnectedClusterResource GetConnectedClusterResource(ResourceIdentifier id) + { + ConnectedClusterResource.ValidateResourceId(id); + return new ConnectedClusterResource(Client, id); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesExtensions.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesExtensions.cs index 619b29908f2b..97e12c610b37 100644 --- a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesExtensions.cs +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Kubernetes.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Kubernetes @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.Kubernetes /// A class to add extension methods to Azure.ResourceManager.Kubernetes. public static partial class KubernetesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static KubernetesArmClientMockingExtension GetKubernetesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new KubernetesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static KubernetesResourceGroupMockingExtension GetKubernetesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new KubernetesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static KubernetesSubscriptionMockingExtension GetKubernetesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new KubernetesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ConnectedClusterResource /// /// 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. /// Returns a object. public static ConnectedClusterResource GetConnectedClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectedClusterResource.ValidateResourceId(id); - return new ConnectedClusterResource(client, id); - } - ); + return GetKubernetesArmClientMockingExtension(client).GetConnectedClusterResource(id); } - #endregion - /// Gets a collection of ConnectedClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of ConnectedClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ConnectedClusterResources and their operations over a ConnectedClusterResource. public static ConnectedClusterCollection GetConnectedClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConnectedClusters(); + return GetKubernetesResourceGroupMockingExtension(resourceGroupResource).GetConnectedClusters(); } /// @@ -88,16 +76,20 @@ public static ConnectedClusterCollection GetConnectedClusters(this ResourceGroup /// ConnectedCluster_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kubernetes cluster on which get is called. /// The cancellation token to use. - /// 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 static async Task> GetConnectedClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetConnectedClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetKubernetesResourceGroupMockingExtension(resourceGroupResource).GetConnectedClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetConnectedCluster /// ConnectedCluster_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kubernetes cluster on which get is called. /// The cancellation token to use. - /// 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 static Response GetConnectedCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetConnectedClusters().Get(clusterName, cancellationToken); + return GetKubernetesResourceGroupMockingExtension(resourceGroupResource).GetConnectedCluster(clusterName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetConnectedCluster(this Resour /// ConnectedCluster_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConnectedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConnectedClustersAsync(cancellationToken); + return GetKubernetesSubscriptionMockingExtension(subscriptionResource).GetConnectedClustersAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetConnectedClustersAsync( /// ConnectedCluster_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConnectedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConnectedClusters(cancellationToken); + return GetKubernetesSubscriptionMockingExtension(subscriptionResource).GetConnectedClusters(cancellationToken); } } } diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesResourceGroupMockingExtension.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..160e037afb99 --- /dev/null +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Kubernetes; + +namespace Azure.ResourceManager.Kubernetes.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class KubernetesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KubernetesResourceGroupMockingExtension() + { + } + + /// 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 KubernetesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ConnectedClusterResources in the ResourceGroupResource. + /// An object representing collection of ConnectedClusterResources and their operations over a ConnectedClusterResource. + public virtual ConnectedClusterCollection GetConnectedClusters() + { + return GetCachedClient(client => new ConnectedClusterCollection(client, Id)); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConnectedClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetConnectedClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName} + /// + /// + /// Operation Id + /// ConnectedCluster_Get + /// + /// + /// + /// The name of the Kubernetes cluster on which get is called. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConnectedCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetConnectedClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesSubscriptionMockingExtension.cs similarity index 84% rename from sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesSubscriptionMockingExtension.cs index 0924967d823a..935d819576fa 100644 --- a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/KubernetesSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Kubernetes; -namespace Azure.ResourceManager.Kubernetes +namespace Azure.ResourceManager.Kubernetes.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class KubernetesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _connectedClusterClientDiagnostics; private ConnectedClusterRestOperations _connectedClusterRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected KubernetesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal KubernetesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetConnectedClustersAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => ConnectedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConnectedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConnectedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "KubernetesSubscriptionMockingExtension.GetConnectedClusters", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetConnectedClusters(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ConnectedClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConnectedClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConnectedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedClusterResource(Client, ConnectedClusterData.DeserializeConnectedClusterData(e)), ConnectedClusterClientDiagnostics, Pipeline, "KubernetesSubscriptionMockingExtension.GetConnectedClusters", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 40b7f3983e15..000000000000 --- a/sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Kubernetes -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ConnectedClusterResources in the ResourceGroupResource. - /// An object representing collection of ConnectedClusterResources and their operations over a ConnectedClusterResource. - public virtual ConnectedClusterCollection GetConnectedClusters() - { - return GetCachedClient(Client => new ConnectedClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseArmClientMockingExtension.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseArmClientMockingExtension.cs new file mode 100644 index 000000000000..9abaccdf65da --- /dev/null +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotFirmwareDefense; + +namespace Azure.ResourceManager.IotFirmwareDefense.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class IotFirmwareDefenseArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotFirmwareDefenseArmClientMockingExtension() + { + } + + /// 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 IotFirmwareDefenseArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal IotFirmwareDefenseArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FirmwareResource GetFirmwareResource(ResourceIdentifier id) + { + FirmwareResource.ValidateResourceId(id); + return new FirmwareResource(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 FirmwareWorkspaceResource GetFirmwareWorkspaceResource(ResourceIdentifier id) + { + FirmwareWorkspaceResource.ValidateResourceId(id); + return new FirmwareWorkspaceResource(Client, id); + } + } +} diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseExtensions.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseExtensions.cs index cda528d5d45d..ec0090f68d45 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseExtensions.cs +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.IotFirmwareDefense.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.IotFirmwareDefense @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.IotFirmwareDefense /// A class to add extension methods to Azure.ResourceManager.IotFirmwareDefense. public static partial class IotFirmwareDefenseExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static IotFirmwareDefenseArmClientMockingExtension GetIotFirmwareDefenseArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new IotFirmwareDefenseArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static IotFirmwareDefenseResourceGroupMockingExtension GetIotFirmwareDefenseResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new IotFirmwareDefenseResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static IotFirmwareDefenseSubscriptionMockingExtension GetIotFirmwareDefenseSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new IotFirmwareDefenseSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region FirmwareResource /// /// 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. /// Returns a object. public static FirmwareResource GetFirmwareResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FirmwareResource.ValidateResourceId(id); - return new FirmwareResource(client, id); - } - ); + return GetIotFirmwareDefenseArmClientMockingExtension(client).GetFirmwareResource(id); } - #endregion - #region FirmwareWorkspaceResource /// /// 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. /// Returns a object. public static FirmwareWorkspaceResource GetFirmwareWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FirmwareWorkspaceResource.ValidateResourceId(id); - return new FirmwareWorkspaceResource(client, id); - } - ); + return GetIotFirmwareDefenseArmClientMockingExtension(client).GetFirmwareWorkspaceResource(id); } - #endregion - /// Gets a collection of FirmwareWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of FirmwareWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FirmwareWorkspaceResources and their operations over a FirmwareWorkspaceResource. public static FirmwareWorkspaceCollection GetFirmwareWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFirmwareWorkspaces(); + return GetIotFirmwareDefenseResourceGroupMockingExtension(resourceGroupResource).GetFirmwareWorkspaces(); } /// @@ -107,16 +92,20 @@ public static FirmwareWorkspaceCollection GetFirmwareWorkspaces(this ResourceGro /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the firmware analysis workspace. /// The cancellation token to use. - /// 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 static async Task> GetFirmwareWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFirmwareWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetIotFirmwareDefenseResourceGroupMockingExtension(resourceGroupResource).GetFirmwareWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetFirmwareWorkspa /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the firmware analysis workspace. /// The cancellation token to use. - /// 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 static Response GetFirmwareWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFirmwareWorkspaces().Get(workspaceName, cancellationToken); + return GetIotFirmwareDefenseResourceGroupMockingExtension(resourceGroupResource).GetFirmwareWorkspace(workspaceName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetFirmwareWorkspace(this Reso /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFirmwareWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFirmwareWorkspacesAsync(cancellationToken); + return GetIotFirmwareDefenseSubscriptionMockingExtension(subscriptionResource).GetFirmwareWorkspacesAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetFirmwareWorkspacesAsyn /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFirmwareWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFirmwareWorkspaces(cancellationToken); + return GetIotFirmwareDefenseSubscriptionMockingExtension(subscriptionResource).GetFirmwareWorkspaces(cancellationToken); } } } diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseResourceGroupMockingExtension.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..98c6bf11157c --- /dev/null +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotFirmwareDefense; + +namespace Azure.ResourceManager.IotFirmwareDefense.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class IotFirmwareDefenseResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotFirmwareDefenseResourceGroupMockingExtension() + { + } + + /// 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 IotFirmwareDefenseResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FirmwareWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of FirmwareWorkspaceResources and their operations over a FirmwareWorkspaceResource. + public virtual FirmwareWorkspaceCollection GetFirmwareWorkspaces() + { + return GetCachedClient(client => new FirmwareWorkspaceCollection(client, Id)); + } + + /// + /// Get firmware analysis workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the firmware analysis workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFirmwareWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetFirmwareWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get firmware analysis workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the firmware analysis workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFirmwareWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetFirmwareWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseSubscriptionMockingExtension.cs similarity index 84% rename from sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseSubscriptionMockingExtension.cs index 150b933658c3..d32d435f22fa 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/IotFirmwareDefenseSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.IotFirmwareDefense; -namespace Azure.ResourceManager.IotFirmwareDefense +namespace Azure.ResourceManager.IotFirmwareDefense.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class IotFirmwareDefenseSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _firmwareWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _firmwareWorkspaceWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected IotFirmwareDefenseSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal IotFirmwareDefenseSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetFirmwareWorkspacesAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => FirmwareWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FirmwareWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirmwareWorkspaceResource(Client, FirmwareWorkspaceData.DeserializeFirmwareWorkspaceData(e)), FirmwareWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFirmwareWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirmwareWorkspaceResource(Client, FirmwareWorkspaceData.DeserializeFirmwareWorkspaceData(e)), FirmwareWorkspaceWorkspacesClientDiagnostics, Pipeline, "IotFirmwareDefenseSubscriptionMockingExtension.GetFirmwareWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetFirmwareWorkspaces(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => FirmwareWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FirmwareWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirmwareWorkspaceResource(Client, FirmwareWorkspaceData.DeserializeFirmwareWorkspaceData(e)), FirmwareWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFirmwareWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirmwareWorkspaceResource(Client, FirmwareWorkspaceData.DeserializeFirmwareWorkspaceData(e)), FirmwareWorkspaceWorkspacesClientDiagnostics, Pipeline, "IotFirmwareDefenseSubscriptionMockingExtension.GetFirmwareWorkspaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index cde6733cec16..000000000000 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.IotFirmwareDefense -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of FirmwareWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of FirmwareWorkspaceResources and their operations over a FirmwareWorkspaceResource. - public virtual FirmwareWorkspaceCollection GetFirmwareWorkspaces() - { - return GetCachedClient(Client => new FirmwareWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/FirmwareWorkspaceResource.cs b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/FirmwareWorkspaceResource.cs index b705a2b38d48..7a9b199bb98f 100644 --- a/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/FirmwareWorkspaceResource.cs +++ b/sdk/iot/Azure.ResourceManager.IotFirmwareDefense/src/Generated/FirmwareWorkspaceResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FirmwareResources and their operations over a FirmwareResource. public virtual FirmwareCollection GetFirmwares() { - return GetCachedClient(Client => new FirmwareCollection(Client, Id)); + return GetCachedClient(client => new FirmwareCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual FirmwareCollection GetFirmwares() /// /// The id of the firmware. /// The cancellation token to use. - /// 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> GetFirmwareAsync(string firmwareName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetFirmwareAsync(string fi /// /// The id of the firmware. /// The cancellation token to use. - /// 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 GetFirmware(string firmwareName, CancellationToken cancellationToken = default) { diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralArmClientMockingExtension.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralArmClientMockingExtension.cs new file mode 100644 index 000000000000..d49ae01a0150 --- /dev/null +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotCentral; + +namespace Azure.ResourceManager.IotCentral.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class IotCentralArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotCentralArmClientMockingExtension() + { + } + + /// 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 IotCentralArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal IotCentralArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotCentralAppResource GetIotCentralAppResource(ResourceIdentifier id) + { + IotCentralAppResource.ValidateResourceId(id); + return new IotCentralAppResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotCentralPrivateEndpointConnectionResource GetIotCentralPrivateEndpointConnectionResource(ResourceIdentifier id) + { + IotCentralPrivateEndpointConnectionResource.ValidateResourceId(id); + return new IotCentralPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotCentralPrivateLinkResource GetIotCentralPrivateLinkResource(ResourceIdentifier id) + { + IotCentralPrivateLinkResource.ValidateResourceId(id); + return new IotCentralPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralExtensions.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralExtensions.cs index d6b9f0d66b86..8d4b701c7ac6 100644 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralExtensions.cs +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.IotCentral.Mocking; using Azure.ResourceManager.IotCentral.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.IotCentral /// A class to add extension methods to Azure.ResourceManager.IotCentral. public static partial class IotCentralExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static IotCentralArmClientMockingExtension GetIotCentralArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new IotCentralArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static IotCentralResourceGroupMockingExtension GetIotCentralResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new IotCentralResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static IotCentralSubscriptionMockingExtension GetIotCentralSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new IotCentralSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region IotCentralAppResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotCentralAppResource GetIotCentralAppResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotCentralAppResource.ValidateResourceId(id); - return new IotCentralAppResource(client, id); - } - ); + return GetIotCentralArmClientMockingExtension(client).GetIotCentralAppResource(id); } - #endregion - #region IotCentralPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotCentralPrivateEndpointConnectionResource GetIotCentralPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotCentralPrivateEndpointConnectionResource.ValidateResourceId(id); - return new IotCentralPrivateEndpointConnectionResource(client, id); - } - ); + return GetIotCentralArmClientMockingExtension(client).GetIotCentralPrivateEndpointConnectionResource(id); } - #endregion - #region IotCentralPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotCentralPrivateLinkResource GetIotCentralPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotCentralPrivateLinkResource.ValidateResourceId(id); - return new IotCentralPrivateLinkResource(client, id); - } - ); + return GetIotCentralArmClientMockingExtension(client).GetIotCentralPrivateLinkResource(id); } - #endregion - /// Gets a collection of IotCentralAppResources in the ResourceGroupResource. + /// + /// Gets a collection of IotCentralAppResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IotCentralAppResources and their operations over a IotCentralAppResource. public static IotCentralAppCollection GetIotCentralApps(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIotCentralApps(); + return GetIotCentralResourceGroupMockingExtension(resourceGroupResource).GetIotCentralApps(); } /// @@ -127,16 +109,20 @@ public static IotCentralAppCollection GetIotCentralApps(this ResourceGroupResour /// Apps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ARM resource name of the IoT Central application. /// The cancellation token to use. - /// 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 static async Task> GetIotCentralAppAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIotCentralApps().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetIotCentralResourceGroupMockingExtension(resourceGroupResource).GetIotCentralAppAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -151,16 +137,20 @@ public static async Task> GetIotCentralAppAsync( /// Apps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ARM resource name of the IoT Central application. /// The cancellation token to use. - /// 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 static Response GetIotCentralApp(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIotCentralApps().Get(resourceName, cancellationToken); + return GetIotCentralResourceGroupMockingExtension(resourceGroupResource).GetIotCentralApp(resourceName, cancellationToken); } /// @@ -175,13 +165,17 @@ public static Response GetIotCentralApp(this ResourceGrou /// Apps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIotCentralAppsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotCentralAppsAsync(cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).GetIotCentralAppsAsync(cancellationToken); } /// @@ -196,13 +190,17 @@ public static AsyncPageable GetIotCentralAppsAsync(this S /// Apps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIotCentralApps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotCentralApps(cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).GetIotCentralApps(cancellationToken); } /// @@ -217,6 +215,10 @@ public static Pageable GetIotCentralApps(this Subscriptio /// Apps_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. @@ -224,9 +226,7 @@ public static Pageable GetIotCentralApps(this Subscriptio /// is null. public static async Task> CheckIotCentralAppNameAvailabilityAsync(this SubscriptionResource subscriptionResource, IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotCentralAppNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetIotCentralSubscriptionMockingExtension(subscriptionResource).CheckIotCentralAppNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -241,6 +241,10 @@ public static async Task> CheckI /// Apps_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. @@ -248,9 +252,7 @@ public static async Task> CheckI /// is null. public static Response CheckIotCentralAppNameAvailability(this SubscriptionResource subscriptionResource, IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotCentralAppNameAvailability(content, cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).CheckIotCentralAppNameAvailability(content, cancellationToken); } /// @@ -265,6 +267,10 @@ public static Response CheckIotCentralApp /// Apps_CheckSubdomainAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. @@ -272,9 +278,7 @@ public static Response CheckIotCentralApp /// is null. public static async Task> CheckIotCentralAppSubdomainAvailabilityAsync(this SubscriptionResource subscriptionResource, IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotCentralAppSubdomainAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetIotCentralSubscriptionMockingExtension(subscriptionResource).CheckIotCentralAppSubdomainAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -289,6 +293,10 @@ public static async Task> CheckI /// Apps_CheckSubdomainAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. @@ -296,9 +304,7 @@ public static async Task> CheckI /// is null. public static Response CheckIotCentralAppSubdomainAvailability(this SubscriptionResource subscriptionResource, IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotCentralAppSubdomainAvailability(content, cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).CheckIotCentralAppSubdomainAvailability(content, cancellationToken); } /// @@ -313,13 +319,17 @@ public static Response CheckIotCentralApp /// Apps_ListTemplates /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTemplatesAppsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTemplatesAppsAsync(cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).GetTemplatesAppsAsync(cancellationToken); } /// @@ -334,13 +344,17 @@ public static AsyncPageable GetTemplatesAppsAsync(this Su /// Apps_ListTemplates /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTemplatesApps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTemplatesApps(cancellationToken); + return GetIotCentralSubscriptionMockingExtension(subscriptionResource).GetTemplatesApps(cancellationToken); } } } diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralResourceGroupMockingExtension.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..ffd84cd462c3 --- /dev/null +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotCentral; + +namespace Azure.ResourceManager.IotCentral.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class IotCentralResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotCentralResourceGroupMockingExtension() + { + } + + /// 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 IotCentralResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of IotCentralAppResources in the ResourceGroupResource. + /// An object representing collection of IotCentralAppResources and their operations over a IotCentralAppResource. + public virtual IotCentralAppCollection GetIotCentralApps() + { + return GetCachedClient(client => new IotCentralAppCollection(client, Id)); + } + + /// + /// Get the metadata of an IoT Central application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName} + /// + /// + /// Operation Id + /// Apps_Get + /// + /// + /// + /// The ARM resource name of the IoT Central application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotCentralAppAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetIotCentralApps().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the metadata of an IoT Central application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName} + /// + /// + /// Operation Id + /// Apps_Get + /// + /// + /// + /// The ARM resource name of the IoT Central application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotCentralApp(string resourceName, CancellationToken cancellationToken = default) + { + return GetIotCentralApps().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralSubscriptionMockingExtension.cs similarity index 86% rename from sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralSubscriptionMockingExtension.cs index b70af80d9fcc..a8745df706bf 100644 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/IotCentralSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.IotCentral; using Azure.ResourceManager.IotCentral.Models; -namespace Azure.ResourceManager.IotCentral +namespace Azure.ResourceManager.IotCentral.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class IotCentralSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _iotCentralAppAppsClientDiagnostics; private AppsRestOperations _iotCentralAppAppsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected IotCentralSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal IotCentralSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetIotCentralAppsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => IotCentralAppAppsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotCentralAppAppsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotCentralAppResource(Client, IotCentralAppData.DeserializeIotCentralAppData(e)), IotCentralAppAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotCentralApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotCentralAppResource(Client, IotCentralAppData.DeserializeIotCentralAppData(e)), IotCentralAppAppsClientDiagnostics, Pipeline, "IotCentralSubscriptionMockingExtension.GetIotCentralApps", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetIotCentralApps(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => IotCentralAppAppsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotCentralAppAppsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotCentralAppResource(Client, IotCentralAppData.DeserializeIotCentralAppData(e)), IotCentralAppAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotCentralApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotCentralAppResource(Client, IotCentralAppData.DeserializeIotCentralAppData(e)), IotCentralAppAppsClientDiagnostics, Pipeline, "IotCentralSubscriptionMockingExtension.GetIotCentralApps", "value", "nextLink", cancellationToken); } /// @@ -103,9 +104,12 @@ public virtual Pageable GetIotCentralApps(CancellationTok /// /// Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckIotCentralAppNameAvailabilityAsync(IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotCentralAppNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("IotCentralSubscriptionMockingExtension.CheckIotCentralAppNameAvailability"); scope.Start(); try { @@ -134,9 +138,12 @@ public virtual async Task> Check /// /// Set the name parameter in the OperationInputs structure to the name of the IoT Central application to check. /// The cancellation token to use. + /// is null. public virtual Response CheckIotCentralAppNameAvailability(IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotCentralAppNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("IotCentralSubscriptionMockingExtension.CheckIotCentralAppNameAvailability"); scope.Start(); try { @@ -165,9 +172,12 @@ public virtual Response CheckIotCentralAp /// /// Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckIotCentralAppSubdomainAvailabilityAsync(IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotCentralAppSubdomainAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("IotCentralSubscriptionMockingExtension.CheckIotCentralAppSubdomainAvailability"); scope.Start(); try { @@ -196,9 +206,12 @@ public virtual async Task> Check /// /// Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application to check. /// The cancellation token to use. + /// is null. public virtual Response CheckIotCentralAppSubdomainAvailability(IotCentralAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotCentralAppSubdomainAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotCentralAppAppsClientDiagnostics.CreateScope("IotCentralSubscriptionMockingExtension.CheckIotCentralAppSubdomainAvailability"); scope.Start(); try { @@ -231,7 +244,7 @@ public virtual AsyncPageable GetTemplatesAppsAsync(Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => IotCentralAppAppsRestClient.CreateListTemplatesRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotCentralAppAppsRestClient.CreateListTemplatesNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, IotCentralAppTemplate.DeserializeIotCentralAppTemplate, IotCentralAppAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTemplatesApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, IotCentralAppTemplate.DeserializeIotCentralAppTemplate, IotCentralAppAppsClientDiagnostics, Pipeline, "IotCentralSubscriptionMockingExtension.GetTemplatesApps", "value", "nextLink", cancellationToken); } /// @@ -253,7 +266,7 @@ public virtual Pageable GetTemplatesApps(CancellationToke { HttpMessage FirstPageRequest(int? pageSizeHint) => IotCentralAppAppsRestClient.CreateListTemplatesRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotCentralAppAppsRestClient.CreateListTemplatesNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, IotCentralAppTemplate.DeserializeIotCentralAppTemplate, IotCentralAppAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTemplatesApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, IotCentralAppTemplate.DeserializeIotCentralAppTemplate, IotCentralAppAppsClientDiagnostics, Pipeline, "IotCentralSubscriptionMockingExtension.GetTemplatesApps", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 645774d459bc..000000000000 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.IotCentral -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of IotCentralAppResources in the ResourceGroupResource. - /// An object representing collection of IotCentralAppResources and their operations over a IotCentralAppResource. - public virtual IotCentralAppCollection GetIotCentralApps() - { - return GetCachedClient(Client => new IotCentralAppCollection(Client, Id)); - } - } -} diff --git a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/IotCentralAppResource.cs b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/IotCentralAppResource.cs index 9270510f06ac..1e0ae84d0475 100644 --- a/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/IotCentralAppResource.cs +++ b/sdk/iotcentral/Azure.ResourceManager.IotCentral/src/Generated/IotCentralAppResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of IotCentralPrivateEndpointConnectionResources and their operations over a IotCentralPrivateEndpointConnectionResource. public virtual IotCentralPrivateEndpointConnectionCollection GetIotCentralPrivateEndpointConnections() { - return GetCachedClient(Client => new IotCentralPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new IotCentralPrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual IotCentralPrivateEndpointConnectionCollection GetIotCentralPrivat /// /// The private endpoint connection name. /// The cancellation token to use. - /// 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> GetIotCentralPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> /// /// The private endpoint connection name. /// The cancellation token to use. - /// 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 GetIotCentralPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetIotCentr /// An object representing collection of IotCentralPrivateLinkResources and their operations over a IotCentralPrivateLinkResource. public virtual IotCentralPrivateLinkResourceCollection GetIotCentralPrivateLinkResources() { - return GetCachedClient(Client => new IotCentralPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new IotCentralPrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual IotCentralPrivateLinkResourceCollection GetIotCentralPrivateLinkR /// /// The private link resource name. /// The cancellation token to use. - /// 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> GetIotCentralPrivateLinkResourceAsync(string groupId, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetIotCentral /// /// The private link resource name. /// The cancellation token to use. - /// 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 GetIotCentralPrivateLinkResource(string groupId, CancellationToken cancellationToken = default) { diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubArmClientMockingExtension.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubArmClientMockingExtension.cs new file mode 100644 index 000000000000..22b2f65cb349 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotHub; + +namespace Azure.ResourceManager.IotHub.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class IotHubArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotHubArmClientMockingExtension() + { + } + + /// 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 IotHubArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal IotHubArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotHubDescriptionResource GetIotHubDescriptionResource(ResourceIdentifier id) + { + IotHubDescriptionResource.ValidateResourceId(id); + return new IotHubDescriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubConsumerGroupInfoResource GetEventHubConsumerGroupInfoResource(ResourceIdentifier id) + { + EventHubConsumerGroupInfoResource.ValidateResourceId(id); + return new EventHubConsumerGroupInfoResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotHubCertificateDescriptionResource GetIotHubCertificateDescriptionResource(ResourceIdentifier id) + { + IotHubCertificateDescriptionResource.ValidateResourceId(id); + return new IotHubCertificateDescriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotHubPrivateEndpointGroupInformationResource GetIotHubPrivateEndpointGroupInformationResource(ResourceIdentifier id) + { + IotHubPrivateEndpointGroupInformationResource.ValidateResourceId(id); + return new IotHubPrivateEndpointGroupInformationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotHubPrivateEndpointConnectionResource GetIotHubPrivateEndpointConnectionResource(ResourceIdentifier id) + { + IotHubPrivateEndpointConnectionResource.ValidateResourceId(id); + return new IotHubPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubExtensions.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubExtensions.cs index 9b461d1752e8..9767b00a9071 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubExtensions.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.IotHub.Mocking; using Azure.ResourceManager.IotHub.Models; using Azure.ResourceManager.Resources; @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.IotHub /// A class to add extension methods to Azure.ResourceManager.IotHub. public static partial class IotHubExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static IotHubArmClientMockingExtension GetIotHubArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new IotHubArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static IotHubResourceGroupMockingExtension GetIotHubResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new IotHubResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static IotHubSubscriptionMockingExtension GetIotHubSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new IotHubSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region IotHubDescriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotHubDescriptionResource GetIotHubDescriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotHubDescriptionResource.ValidateResourceId(id); - return new IotHubDescriptionResource(client, id); - } - ); + return GetIotHubArmClientMockingExtension(client).GetIotHubDescriptionResource(id); } - #endregion - #region EventHubConsumerGroupInfoResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubConsumerGroupInfoResource GetEventHubConsumerGroupInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubConsumerGroupInfoResource.ValidateResourceId(id); - return new EventHubConsumerGroupInfoResource(client, id); - } - ); + return GetIotHubArmClientMockingExtension(client).GetEventHubConsumerGroupInfoResource(id); } - #endregion - #region IotHubCertificateDescriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotHubCertificateDescriptionResource GetIotHubCertificateDescriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotHubCertificateDescriptionResource.ValidateResourceId(id); - return new IotHubCertificateDescriptionResource(client, id); - } - ); + return GetIotHubArmClientMockingExtension(client).GetIotHubCertificateDescriptionResource(id); } - #endregion - #region IotHubPrivateEndpointGroupInformationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotHubPrivateEndpointGroupInformationResource GetIotHubPrivateEndpointGroupInformationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotHubPrivateEndpointGroupInformationResource.ValidateResourceId(id); - return new IotHubPrivateEndpointGroupInformationResource(client, id); - } - ); + return GetIotHubArmClientMockingExtension(client).GetIotHubPrivateEndpointGroupInformationResource(id); } - #endregion - #region IotHubPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IotHubPrivateEndpointConnectionResource GetIotHubPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IotHubPrivateEndpointConnectionResource.ValidateResourceId(id); - return new IotHubPrivateEndpointConnectionResource(client, id); - } - ); + return GetIotHubArmClientMockingExtension(client).GetIotHubPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of IotHubDescriptionResources in the ResourceGroupResource. + /// + /// Gets a collection of IotHubDescriptionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IotHubDescriptionResources and their operations over a IotHubDescriptionResource. public static IotHubDescriptionCollection GetIotHubDescriptions(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIotHubDescriptions(); + return GetIotHubResourceGroupMockingExtension(resourceGroupResource).GetIotHubDescriptions(); } /// @@ -165,16 +141,20 @@ public static IotHubDescriptionCollection GetIotHubDescriptions(this ResourceGro /// IotHubResource_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IoT hub. /// The cancellation token to use. - /// 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 static async Task> GetIotHubDescriptionAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIotHubDescriptions().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetIotHubResourceGroupMockingExtension(resourceGroupResource).GetIotHubDescriptionAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetIotHubDescripti /// IotHubResource_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IoT hub. /// The cancellation token to use. - /// 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 static Response GetIotHubDescription(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIotHubDescriptions().Get(resourceName, cancellationToken); + return GetIotHubResourceGroupMockingExtension(resourceGroupResource).GetIotHubDescription(resourceName, cancellationToken); } /// @@ -213,13 +197,17 @@ public static Response GetIotHubDescription(this Reso /// IotHubResource_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIotHubDescriptionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotHubDescriptionsAsync(cancellationToken); + return GetIotHubSubscriptionMockingExtension(subscriptionResource).GetIotHubDescriptionsAsync(cancellationToken); } /// @@ -234,13 +222,17 @@ public static AsyncPageable GetIotHubDescriptionsAsyn /// IotHubResource_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIotHubDescriptions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotHubDescriptions(cancellationToken); + return GetIotHubSubscriptionMockingExtension(subscriptionResource).GetIotHubDescriptions(cancellationToken); } /// @@ -255,6 +247,10 @@ public static Pageable GetIotHubDescriptions(this Sub /// IotHubResource_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. @@ -262,9 +258,7 @@ public static Pageable GetIotHubDescriptions(this Sub /// is null. public static async Task> CheckIotHubNameAvailabilityAsync(this SubscriptionResource subscriptionResource, IotHubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotHubNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetIotHubSubscriptionMockingExtension(subscriptionResource).CheckIotHubNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -279,6 +273,10 @@ public static async Task> CheckIotHubNa /// IotHubResource_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. @@ -286,9 +284,7 @@ public static async Task> CheckIotHubNa /// is null. public static Response CheckIotHubNameAvailability(this SubscriptionResource subscriptionResource, IotHubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckIotHubNameAvailability(content, cancellationToken); + return GetIotHubSubscriptionMockingExtension(subscriptionResource).CheckIotHubNameAvailability(content, cancellationToken); } /// @@ -303,13 +299,17 @@ public static Response CheckIotHubNameAvailabili /// ResourceProviderCommon_GetSubscriptionQuota /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIotHubUserSubscriptionQuotaAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotHubUserSubscriptionQuotaAsync(cancellationToken); + return GetIotHubSubscriptionMockingExtension(subscriptionResource).GetIotHubUserSubscriptionQuotaAsync(cancellationToken); } /// @@ -324,13 +324,17 @@ public static AsyncPageable GetIotHubUserSubscripti /// ResourceProviderCommon_GetSubscriptionQuota /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIotHubUserSubscriptionQuota(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotHubUserSubscriptionQuota(cancellationToken); + return GetIotHubSubscriptionMockingExtension(subscriptionResource).GetIotHubUserSubscriptionQuota(cancellationToken); } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubResourceGroupMockingExtension.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8ace74554835 --- /dev/null +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.IotHub; + +namespace Azure.ResourceManager.IotHub.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class IotHubResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected IotHubResourceGroupMockingExtension() + { + } + + /// 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 IotHubResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of IotHubDescriptionResources in the ResourceGroupResource. + /// An object representing collection of IotHubDescriptionResources and their operations over a IotHubDescriptionResource. + public virtual IotHubDescriptionCollection GetIotHubDescriptions() + { + return GetCachedClient(client => new IotHubDescriptionCollection(client, Id)); + } + + /// + /// Get the non-security related metadata of an IoT hub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName} + /// + /// + /// Operation Id + /// IotHubResource_Get + /// + /// + /// + /// The name of the IoT hub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotHubDescriptionAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetIotHubDescriptions().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the non-security related metadata of an IoT hub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName} + /// + /// + /// Operation Id + /// IotHubResource_Get + /// + /// + /// + /// The name of the IoT hub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotHubDescription(string resourceName, CancellationToken cancellationToken = default) + { + return GetIotHubDescriptions().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubSubscriptionMockingExtension.cs similarity index 88% rename from sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubSubscriptionMockingExtension.cs index 5f556690caab..2b20567b75b5 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/IotHubSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.IotHub; using Azure.ResourceManager.IotHub.Models; -namespace Azure.ResourceManager.IotHub +namespace Azure.ResourceManager.IotHub.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class IotHubSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _iotHubDescriptionIotHubResourceClientDiagnostics; private IotHubResourceRestOperations _iotHubDescriptionIotHubResourceRestClient; private ClientDiagnostics _resourceProviderCommonClientDiagnostics; private ResourceProviderCommonRestOperations _resourceProviderCommonRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected IotHubSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal IotHubSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetIotHubDescriptionsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => IotHubDescriptionIotHubResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotHubDescriptionIotHubResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotHubDescriptionResource(Client, IotHubDescriptionData.DeserializeIotHubDescriptionData(e)), IotHubDescriptionIotHubResourceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotHubDescriptions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotHubDescriptionResource(Client, IotHubDescriptionData.DeserializeIotHubDescriptionData(e)), IotHubDescriptionIotHubResourceClientDiagnostics, Pipeline, "IotHubSubscriptionMockingExtension.GetIotHubDescriptions", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetIotHubDescriptions(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => IotHubDescriptionIotHubResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotHubDescriptionIotHubResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotHubDescriptionResource(Client, IotHubDescriptionData.DeserializeIotHubDescriptionData(e)), IotHubDescriptionIotHubResourceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotHubDescriptions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotHubDescriptionResource(Client, IotHubDescriptionData.DeserializeIotHubDescriptionData(e)), IotHubDescriptionIotHubResourceClientDiagnostics, Pipeline, "IotHubSubscriptionMockingExtension.GetIotHubDescriptions", "value", "nextLink", cancellationToken); } /// @@ -107,9 +108,12 @@ public virtual Pageable GetIotHubDescriptions(Cancell /// /// Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckIotHubNameAvailabilityAsync(IotHubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotHubDescriptionIotHubResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotHubNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotHubDescriptionIotHubResourceClientDiagnostics.CreateScope("IotHubSubscriptionMockingExtension.CheckIotHubNameAvailability"); scope.Start(); try { @@ -138,9 +142,12 @@ public virtual async Task> CheckIotHubN /// /// Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. /// The cancellation token to use. + /// is null. public virtual Response CheckIotHubNameAvailability(IotHubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = IotHubDescriptionIotHubResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckIotHubNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = IotHubDescriptionIotHubResourceClientDiagnostics.CreateScope("IotHubSubscriptionMockingExtension.CheckIotHubNameAvailability"); scope.Start(); try { @@ -172,7 +179,7 @@ public virtual Response CheckIotHubNameAvailabil public virtual AsyncPageable GetIotHubUserSubscriptionQuotaAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceProviderCommonRestClient.CreateGetSubscriptionQuotaRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, IotHubUserSubscriptionQuota.DeserializeIotHubUserSubscriptionQuota, ResourceProviderCommonClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotHubUserSubscriptionQuota", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, IotHubUserSubscriptionQuota.DeserializeIotHubUserSubscriptionQuota, ResourceProviderCommonClientDiagnostics, Pipeline, "IotHubSubscriptionMockingExtension.GetIotHubUserSubscriptionQuota", "value", null, cancellationToken); } /// @@ -193,7 +200,7 @@ public virtual AsyncPageable GetIotHubUserSubscript public virtual Pageable GetIotHubUserSubscriptionQuota(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceProviderCommonRestClient.CreateGetSubscriptionQuotaRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, IotHubUserSubscriptionQuota.DeserializeIotHubUserSubscriptionQuota, ResourceProviderCommonClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotHubUserSubscriptionQuota", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, IotHubUserSubscriptionQuota.DeserializeIotHubUserSubscriptionQuota, ResourceProviderCommonClientDiagnostics, Pipeline, "IotHubSubscriptionMockingExtension.GetIotHubUserSubscriptionQuota", "value", null, cancellationToken); } } } diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 8b1914375b6d..000000000000 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.IotHub -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of IotHubDescriptionResources in the ResourceGroupResource. - /// An object representing collection of IotHubDescriptionResources and their operations over a IotHubDescriptionResource. - public virtual IotHubDescriptionCollection GetIotHubDescriptions() - { - return GetCachedClient(Client => new IotHubDescriptionCollection(Client, Id)); - } - } -} diff --git a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionResource.cs b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionResource.cs index 68056aaafc29..d88df290795b 100644 --- a/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionResource.cs +++ b/sdk/iothub/Azure.ResourceManager.IotHub/src/Generated/IotHubDescriptionResource.cs @@ -96,13 +96,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// Gets a collection of EventHubConsumerGroupInfoResources in the IotHubDescription. /// The name of the Event Hub-compatible endpoint. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of EventHubConsumerGroupInfoResources and their operations over a EventHubConsumerGroupInfoResource. public virtual EventHubConsumerGroupInfoCollection GetEventHubConsumerGroupInfos(string eventHubEndpointName) { - Argument.AssertNotNullOrEmpty(eventHubEndpointName, nameof(eventHubEndpointName)); - return new EventHubConsumerGroupInfoCollection(Client, Id, eventHubEndpointName); } @@ -122,8 +120,8 @@ public virtual EventHubConsumerGroupInfoCollection GetEventHubConsumerGroupInfos /// The name of the Event Hub-compatible endpoint. /// The name of the consumer group to retrieve. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetEventHubConsumerGroupInfoAsync(string eventHubEndpointName, string name, CancellationToken cancellationToken = default) { @@ -146,8 +144,8 @@ public virtual async Task> GetEventH /// The name of the Event Hub-compatible endpoint. /// The name of the consumer group to retrieve. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetEventHubConsumerGroupInfo(string eventHubEndpointName, string name, CancellationToken cancellationToken = default) { @@ -158,7 +156,7 @@ public virtual Response GetEventHubConsumerGr /// An object representing collection of IotHubCertificateDescriptionResources and their operations over a IotHubCertificateDescriptionResource. public virtual IotHubCertificateDescriptionCollection GetIotHubCertificateDescriptions() { - return GetCachedClient(Client => new IotHubCertificateDescriptionCollection(Client, Id)); + return GetCachedClient(client => new IotHubCertificateDescriptionCollection(client, Id)); } /// @@ -176,8 +174,8 @@ public virtual IotHubCertificateDescriptionCollection GetIotHubCertificateDescri /// /// The name of the certificate. /// The cancellation token to use. - /// 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> GetIotHubCertificateDescriptionAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -199,8 +197,8 @@ public virtual async Task> GetIot /// /// The name of the certificate. /// The cancellation token to use. - /// 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 GetIotHubCertificateDescription(string certificateName, CancellationToken cancellationToken = default) { @@ -211,7 +209,7 @@ public virtual Response GetIotHubCertifica /// An object representing collection of IotHubPrivateEndpointGroupInformationResources and their operations over a IotHubPrivateEndpointGroupInformationResource. public virtual IotHubPrivateEndpointGroupInformationCollection GetAllIotHubPrivateEndpointGroupInformation() { - return GetCachedClient(Client => new IotHubPrivateEndpointGroupInformationCollection(Client, Id)); + return GetCachedClient(client => new IotHubPrivateEndpointGroupInformationCollection(client, Id)); } /// @@ -229,8 +227,8 @@ public virtual IotHubPrivateEndpointGroupInformationCollection GetAllIotHubPriva /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetIotHubPrivateEndpointGroupInformationAsync(string groupId, CancellationToken cancellationToken = default) { @@ -252,8 +250,8 @@ public virtual async Task /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetIotHubPrivateEndpointGroupInformation(string groupId, CancellationToken cancellationToken = default) { @@ -264,7 +262,7 @@ public virtual Response GetIotHub /// An object representing collection of IotHubPrivateEndpointConnectionResources and their operations over a IotHubPrivateEndpointConnectionResource. public virtual IotHubPrivateEndpointConnectionCollection GetIotHubPrivateEndpointConnections() { - return GetCachedClient(Client => new IotHubPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new IotHubPrivateEndpointConnectionCollection(client, Id)); } /// @@ -282,8 +280,8 @@ public virtual IotHubPrivateEndpointConnectionCollection GetIotHubPrivateEndpoin /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetIotHubPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -305,8 +303,8 @@ public virtual async Task> Get /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetIotHubPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultArmClientMockingExtension.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultArmClientMockingExtension.cs new file mode 100644 index 000000000000..d2cfc71233d1 --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.KeyVault; + +namespace Azure.ResourceManager.KeyVault.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class KeyVaultArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KeyVaultArmClientMockingExtension() + { + } + + /// 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 KeyVaultArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal KeyVaultArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual KeyVaultResource GetKeyVaultResource(ResourceIdentifier id) + { + KeyVaultResource.ValidateResourceId(id); + return new KeyVaultResource(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 DeletedKeyVaultResource GetDeletedKeyVaultResource(ResourceIdentifier id) + { + DeletedKeyVaultResource.ValidateResourceId(id); + return new DeletedKeyVaultResource(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 KeyVaultPrivateEndpointConnectionResource GetKeyVaultPrivateEndpointConnectionResource(ResourceIdentifier id) + { + KeyVaultPrivateEndpointConnectionResource.ValidateResourceId(id); + return new KeyVaultPrivateEndpointConnectionResource(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 ManagedHsmResource GetManagedHsmResource(ResourceIdentifier id) + { + ManagedHsmResource.ValidateResourceId(id); + return new ManagedHsmResource(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 DeletedManagedHsmResource GetDeletedManagedHsmResource(ResourceIdentifier id) + { + DeletedManagedHsmResource.ValidateResourceId(id); + return new DeletedManagedHsmResource(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 ManagedHsmPrivateEndpointConnectionResource GetManagedHsmPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ManagedHsmPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ManagedHsmPrivateEndpointConnectionResource(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 KeyVaultSecretResource GetKeyVaultSecretResource(ResourceIdentifier id) + { + KeyVaultSecretResource.ValidateResourceId(id); + return new KeyVaultSecretResource(Client, id); + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs index 0fb461164070..5abcf8deb055 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.KeyVault.Mocking; using Azure.ResourceManager.KeyVault.Models; using Azure.ResourceManager.Resources; @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.KeyVault /// A class to add extension methods to Azure.ResourceManager.KeyVault. public static partial class KeyVaultExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static KeyVaultArmClientMockingExtension GetKeyVaultArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new KeyVaultArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static KeyVaultResourceGroupMockingExtension GetKeyVaultResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new KeyVaultResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static KeyVaultSubscriptionMockingExtension GetKeyVaultSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new KeyVaultSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region KeyVaultResource /// /// 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. /// Returns a object. public static KeyVaultResource GetKeyVaultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KeyVaultResource.ValidateResourceId(id); - return new KeyVaultResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetKeyVaultResource(id); } - #endregion - #region DeletedKeyVaultResource /// /// 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. /// Returns a object. public static DeletedKeyVaultResource GetDeletedKeyVaultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedKeyVaultResource.ValidateResourceId(id); - return new DeletedKeyVaultResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetDeletedKeyVaultResource(id); } - #endregion - #region KeyVaultPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static KeyVaultPrivateEndpointConnectionResource GetKeyVaultPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KeyVaultPrivateEndpointConnectionResource.ValidateResourceId(id); - return new KeyVaultPrivateEndpointConnectionResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetKeyVaultPrivateEndpointConnectionResource(id); } - #endregion - #region ManagedHsmResource /// /// 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. /// Returns a object. public static ManagedHsmResource GetManagedHsmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedHsmResource.ValidateResourceId(id); - return new ManagedHsmResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetManagedHsmResource(id); } - #endregion - #region DeletedManagedHsmResource /// /// 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. /// Returns a object. public static DeletedManagedHsmResource GetDeletedManagedHsmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedManagedHsmResource.ValidateResourceId(id); - return new DeletedManagedHsmResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetDeletedManagedHsmResource(id); } - #endregion - #region ManagedHsmPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ManagedHsmPrivateEndpointConnectionResource GetManagedHsmPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedHsmPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ManagedHsmPrivateEndpointConnectionResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetManagedHsmPrivateEndpointConnectionResource(id); } - #endregion - #region KeyVaultSecretResource /// /// 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. /// Returns a object. public static KeyVaultSecretResource GetKeyVaultSecretResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KeyVaultSecretResource.ValidateResourceId(id); - return new KeyVaultSecretResource(client, id); - } - ); + return GetKeyVaultArmClientMockingExtension(client).GetKeyVaultSecretResource(id); } - #endregion - /// Gets a collection of KeyVaultResources in the ResourceGroupResource. + /// + /// Gets a collection of KeyVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of KeyVaultResources and their operations over a KeyVaultResource. public static KeyVaultCollection GetKeyVaults(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKeyVaults(); + return GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetKeyVaults(); } /// @@ -203,16 +173,20 @@ public static KeyVaultCollection GetKeyVaults(this ResourceGroupResource resourc /// Vaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the vault. /// The cancellation token to use. - /// 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 static async Task> GetKeyVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKeyVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetKeyVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -227,24 +201,34 @@ public static async Task> GetKeyVaultAsync(this Resou /// Vaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the vault. /// The cancellation token to use. - /// 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 static Response GetKeyVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKeyVaults().Get(vaultName, cancellationToken); + return GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetKeyVault(vaultName, cancellationToken); } - /// Gets a collection of ManagedHsmResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedHsmResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedHsmResources and their operations over a ManagedHsmResource. public static ManagedHsmCollection GetManagedHsms(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedHsms(); + return GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetManagedHsms(); } /// @@ -259,16 +243,20 @@ public static ManagedHsmCollection GetManagedHsms(this ResourceGroupResource res /// ManagedHsms_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed HSM Pool. /// The cancellation token to use. - /// 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 static async Task> GetManagedHsmAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedHsms().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetManagedHsmAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -283,24 +271,34 @@ public static async Task> GetManagedHsmAsync(this R /// ManagedHsms_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed HSM Pool. /// The cancellation token to use. - /// 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 static Response GetManagedHsm(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedHsms().Get(name, cancellationToken); + return GetKeyVaultResourceGroupMockingExtension(resourceGroupResource).GetManagedHsm(name, cancellationToken); } - /// Gets a collection of DeletedKeyVaultResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedKeyVaultResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeletedKeyVaultResources and their operations over a DeletedKeyVaultResource. public static DeletedKeyVaultCollection GetDeletedKeyVaults(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedKeyVaults(); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedKeyVaults(); } /// @@ -315,17 +313,21 @@ public static DeletedKeyVaultCollection GetDeletedKeyVaults(this SubscriptionRes /// Vaults_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted vault. /// The name of the vault. /// The cancellation token to use. - /// 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 static async Task> GetDeletedKeyVaultAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedKeyVaults().GetAsync(location, vaultName, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedKeyVaultAsync(location, vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -340,25 +342,35 @@ public static async Task> GetDeletedKeyVaultAs /// Vaults_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted vault. /// The name of the vault. /// The cancellation token to use. - /// 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 static Response GetDeletedKeyVault(this SubscriptionResource subscriptionResource, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedKeyVaults().Get(location, vaultName, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedKeyVault(location, vaultName, cancellationToken); } - /// Gets a collection of DeletedManagedHsmResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedManagedHsmResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeletedManagedHsmResources and their operations over a DeletedManagedHsmResource. public static DeletedManagedHsmCollection GetDeletedManagedHsms(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedManagedHsms(); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedManagedHsms(); } /// @@ -373,17 +385,21 @@ public static DeletedManagedHsmCollection GetDeletedManagedHsms(this Subscriptio /// ManagedHsms_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted managed HSM. /// The name of the deleted managed HSM. /// The cancellation token to use. - /// 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 static async Task> GetDeletedManagedHsmAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string name, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedManagedHsms().GetAsync(location, name, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedManagedHsmAsync(location, name, cancellationToken).ConfigureAwait(false); } /// @@ -398,17 +414,21 @@ public static async Task> GetDeletedManagedH /// ManagedHsms_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted managed HSM. /// The name of the deleted managed HSM. /// The cancellation token to use. - /// 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 static Response GetDeletedManagedHsm(this SubscriptionResource subscriptionResource, AzureLocation location, string name, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedManagedHsms().Get(location, name, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedManagedHsm(location, name, cancellationToken); } /// @@ -423,6 +443,10 @@ public static Response GetDeletedManagedHsm(this Subs /// Vaults_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -430,7 +454,7 @@ public static Response GetDeletedManagedHsm(this Subs /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetKeyVaultsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKeyVaultsAsync(top, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetKeyVaultsAsync(top, cancellationToken); } /// @@ -445,6 +469,10 @@ public static AsyncPageable GetKeyVaultsAsync(this Subscriptio /// Vaults_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -452,7 +480,7 @@ public static AsyncPageable GetKeyVaultsAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetKeyVaults(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKeyVaults(top, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetKeyVaults(top, cancellationToken); } /// @@ -467,13 +495,17 @@ public static Pageable GetKeyVaults(this SubscriptionResource /// Vaults_ListDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedKeyVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedKeyVaultsAsync(cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedKeyVaultsAsync(cancellationToken); } /// @@ -488,13 +520,17 @@ public static AsyncPageable GetDeletedKeyVaultsAsync(th /// Vaults_ListDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedKeyVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedKeyVaults(cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedKeyVaults(cancellationToken); } /// @@ -509,6 +545,10 @@ public static Pageable GetDeletedKeyVaults(this Subscri /// Vaults_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the vault. @@ -516,9 +556,7 @@ public static Pageable GetDeletedKeyVaults(this Subscri /// is null. public static async Task> CheckKeyVaultNameAvailabilityAsync(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKeyVaultNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultSubscriptionMockingExtension(subscriptionResource).CheckKeyVaultNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -533,6 +571,10 @@ public static async Task> CheckKeyVault /// Vaults_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the vault. @@ -540,9 +582,7 @@ public static async Task> CheckKeyVault /// is null. public static Response CheckKeyVaultNameAvailability(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKeyVaultNameAvailability(content, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).CheckKeyVaultNameAvailability(content, cancellationToken); } /// @@ -557,6 +597,10 @@ public static Response CheckKeyVaultNameAvailabi /// ManagedHsms_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -564,7 +608,7 @@ public static Response CheckKeyVaultNameAvailabi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedHsmsAsync(top, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetManagedHsmsAsync(top, cancellationToken); } /// @@ -579,6 +623,10 @@ public static AsyncPageable GetManagedHsmsAsync(this Subscri /// ManagedHsms_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -586,7 +634,7 @@ public static AsyncPageable GetManagedHsmsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedHsms(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedHsms(top, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetManagedHsms(top, cancellationToken); } /// @@ -601,13 +649,17 @@ public static Pageable GetManagedHsms(this SubscriptionResou /// ManagedHsms_ListDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedManagedHsmsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedManagedHsmsAsync(cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedManagedHsmsAsync(cancellationToken); } /// @@ -622,13 +674,17 @@ public static AsyncPageable GetDeletedManagedHsmsAsyn /// ManagedHsms_ListDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedManagedHsms(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedManagedHsms(cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).GetDeletedManagedHsms(cancellationToken); } /// @@ -643,6 +699,10 @@ public static Pageable GetDeletedManagedHsms(this Sub /// ManagedHsms_CheckMhsmNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed hsm. @@ -650,9 +710,7 @@ public static Pageable GetDeletedManagedHsms(this Sub /// is null. public static async Task> CheckManagedHsmNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckManagedHsmNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetKeyVaultSubscriptionMockingExtension(subscriptionResource).CheckManagedHsmNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -667,6 +725,10 @@ public static async Task> CheckManage /// ManagedHsms_CheckMhsmNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed hsm. @@ -674,9 +736,7 @@ public static async Task> CheckManage /// is null. public static Response CheckManagedHsmNameAvailability(this SubscriptionResource subscriptionResource, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckManagedHsmNameAvailability(content, cancellationToken); + return GetKeyVaultSubscriptionMockingExtension(subscriptionResource).CheckManagedHsmNameAvailability(content, cancellationToken); } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultResourceGroupMockingExtension.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..7bf24ac3ff18 --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.KeyVault; + +namespace Azure.ResourceManager.KeyVault.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class KeyVaultResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KeyVaultResourceGroupMockingExtension() + { + } + + /// 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 KeyVaultResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of KeyVaultResources in the ResourceGroupResource. + /// An object representing collection of KeyVaultResources and their operations over a KeyVaultResource. + public virtual KeyVaultCollection GetKeyVaults() + { + return GetCachedClient(client => new KeyVaultCollection(client, Id)); + } + + /// + /// Gets the specified Azure key vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_Get + /// + /// + /// + /// The name of the vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKeyVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetKeyVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Azure key vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_Get + /// + /// + /// + /// The name of the vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKeyVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetKeyVaults().Get(vaultName, cancellationToken); + } + + /// Gets a collection of ManagedHsmResources in the ResourceGroupResource. + /// An object representing collection of ManagedHsmResources and their operations over a ManagedHsmResource. + public virtual ManagedHsmCollection GetManagedHsms() + { + return GetCachedClient(client => new ManagedHsmCollection(client, Id)); + } + + /// + /// Gets the specified managed HSM Pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name} + /// + /// + /// Operation Id + /// ManagedHsms_Get + /// + /// + /// + /// The name of the managed HSM Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedHsmAsync(string name, CancellationToken cancellationToken = default) + { + return await GetManagedHsms().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified managed HSM Pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name} + /// + /// + /// Operation Id + /// ManagedHsms_Get + /// + /// + /// + /// The name of the managed HSM Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedHsm(string name, CancellationToken cancellationToken = default) + { + return GetManagedHsms().Get(name, cancellationToken); + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultSubscriptionMockingExtension.cs similarity index 72% rename from sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultSubscriptionMockingExtension.cs index d95aa8c4e3a4..3d469a3eef70 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.KeyVault; using Azure.ResourceManager.KeyVault.Models; -namespace Azure.ResourceManager.KeyVault +namespace Azure.ResourceManager.KeyVault.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class KeyVaultSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _keyVaultVaultsClientDiagnostics; private VaultsRestOperations _keyVaultVaultsRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _managedHsmsClientDiagnostics; private ManagedHsmsRestOperations _managedHsmsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected KeyVaultSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal KeyVaultSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,14 +61,110 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of DeletedKeyVaultResources and their operations over a DeletedKeyVaultResource. public virtual DeletedKeyVaultCollection GetDeletedKeyVaults() { - return GetCachedClient(Client => new DeletedKeyVaultCollection(Client, Id)); + return GetCachedClient(client => new DeletedKeyVaultCollection(client, Id)); + } + + /// + /// Gets the deleted Azure key vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_GetDeleted + /// + /// + /// + /// The location of the deleted vault. + /// The name of the vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedKeyVaultAsync(AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + return await GetDeletedKeyVaults().GetAsync(location, vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the deleted Azure key vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_GetDeleted + /// + /// + /// + /// The location of the deleted vault. + /// The name of the vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedKeyVault(AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + return GetDeletedKeyVaults().Get(location, vaultName, cancellationToken); } /// Gets a collection of DeletedManagedHsmResources in the SubscriptionResource. /// An object representing collection of DeletedManagedHsmResources and their operations over a DeletedManagedHsmResource. public virtual DeletedManagedHsmCollection GetDeletedManagedHsms() { - return GetCachedClient(Client => new DeletedManagedHsmCollection(Client, Id)); + return GetCachedClient(client => new DeletedManagedHsmCollection(client, Id)); + } + + /// + /// Gets the specified deleted managed HSM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name} + /// + /// + /// Operation Id + /// ManagedHsms_GetDeleted + /// + /// + /// + /// The location of the deleted managed HSM. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedManagedHsmAsync(AzureLocation location, string name, CancellationToken cancellationToken = default) + { + return await GetDeletedManagedHsms().GetAsync(location, name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified deleted managed HSM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name} + /// + /// + /// Operation Id + /// ManagedHsms_GetDeleted + /// + /// + /// + /// The location of the deleted managed HSM. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedManagedHsm(AzureLocation location, string name, CancellationToken cancellationToken = default) + { + return GetDeletedManagedHsms().Get(location, name, cancellationToken); } /// @@ -90,7 +187,7 @@ public virtual AsyncPageable GetKeyVaultsAsync(int? top = null { HttpMessage FirstPageRequest(int? pageSizeHint) => KeyVaultVaultsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => KeyVaultVaultsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new KeyVaultResource(Client, KeyVaultData.DeserializeKeyVaultData(e)), KeyVaultVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKeyVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new KeyVaultResource(Client, KeyVaultData.DeserializeKeyVaultData(e)), KeyVaultVaultsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -113,7 +210,7 @@ public virtual Pageable GetKeyVaults(int? top = null, Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => KeyVaultVaultsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => KeyVaultVaultsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new KeyVaultResource(Client, KeyVaultData.DeserializeKeyVaultData(e)), KeyVaultVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKeyVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new KeyVaultResource(Client, KeyVaultData.DeserializeKeyVaultData(e)), KeyVaultVaultsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -135,7 +232,7 @@ public virtual AsyncPageable GetDeletedKeyVaultsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsRestClient.CreateListDeletedRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -157,7 +254,7 @@ public virtual Pageable GetDeletedKeyVaults(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsRestClient.CreateListDeletedRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -175,9 +272,12 @@ public virtual Pageable GetDeletedKeyVaults(Cancellatio /// /// The name of the vault. /// The cancellation token to use. + /// is null. public virtual async Task> CheckKeyVaultNameAvailabilityAsync(KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKeyVaultNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("KeyVaultSubscriptionMockingExtension.CheckKeyVaultNameAvailability"); scope.Start(); try { @@ -206,9 +306,12 @@ public virtual async Task> CheckKeyVaul /// /// The name of the vault. /// The cancellation token to use. + /// is null. public virtual Response CheckKeyVaultNameAvailability(KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKeyVaultNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("KeyVaultSubscriptionMockingExtension.CheckKeyVaultNameAvailability"); scope.Start(); try { @@ -242,7 +345,7 @@ public virtual AsyncPageable GetManagedHsmsAsync(int? top = { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -265,7 +368,7 @@ public virtual Pageable GetManagedHsms(int? top = null, Canc { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -287,7 +390,7 @@ public virtual AsyncPageable GetDeletedManagedHsmsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsRestClient.CreateListDeletedRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -309,7 +412,7 @@ public virtual Pageable GetDeletedManagedHsms(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsRestClient.CreateListDeletedRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "KeyVaultSubscriptionMockingExtension.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -327,9 +430,12 @@ public virtual Pageable GetDeletedManagedHsms(Cancell /// /// The name of the managed hsm. /// The cancellation token to use. + /// is null. public virtual async Task> CheckManagedHsmNameAvailabilityAsync(ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ManagedHsmClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckManagedHsmNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ManagedHsmClientDiagnostics.CreateScope("KeyVaultSubscriptionMockingExtension.CheckManagedHsmNameAvailability"); scope.Start(); try { @@ -358,9 +464,12 @@ public virtual async Task> CheckManag /// /// The name of the managed hsm. /// The cancellation token to use. + /// is null. public virtual Response CheckManagedHsmNameAvailability(ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ManagedHsmClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckManagedHsmNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ManagedHsmClientDiagnostics.CreateScope("KeyVaultSubscriptionMockingExtension.CheckManagedHsmNameAvailability"); scope.Start(); try { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index bd48bddaf800..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.KeyVault -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of KeyVaultResources in the ResourceGroupResource. - /// An object representing collection of KeyVaultResources and their operations over a KeyVaultResource. - public virtual KeyVaultCollection GetKeyVaults() - { - return GetCachedClient(Client => new KeyVaultCollection(Client, Id)); - } - - /// Gets a collection of ManagedHsmResources in the ResourceGroupResource. - /// An object representing collection of ManagedHsmResources and their operations over a ManagedHsmResource. - public virtual ManagedHsmCollection GetManagedHsms() - { - return GetCachedClient(Client => new ManagedHsmCollection(Client, Id)); - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs index 749b60a96b74..74b0625d416d 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of KeyVaultPrivateEndpointConnectionResources and their operations over a KeyVaultPrivateEndpointConnectionResource. public virtual KeyVaultPrivateEndpointConnectionCollection GetKeyVaultPrivateEndpointConnections() { - return GetCachedClient(Client => new KeyVaultPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new KeyVaultPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual KeyVaultPrivateEndpointConnectionCollection GetKeyVaultPrivateEnd /// /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. - /// 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> GetKeyVaultPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> G /// /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. - /// 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 GetKeyVaultPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetKeyVaultPr /// An object representing collection of KeyVaultSecretResources and their operations over a KeyVaultSecretResource. public virtual KeyVaultSecretCollection GetKeyVaultSecrets() { - return GetCachedClient(Client => new KeyVaultSecretCollection(Client, Id)); + return GetCachedClient(client => new KeyVaultSecretCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual KeyVaultSecretCollection GetKeyVaultSecrets() /// /// The name of the secret. /// The cancellation token to use. - /// 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> GetKeyVaultSecretAsync(string secretName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetKeyVaultSecretAsy /// /// The name of the secret. /// The cancellation token to use. - /// 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 GetKeyVaultSecret(string secretName, CancellationToken cancellationToken = default) { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs index 2b6c39485b51..1bbfaab28529 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedHsmPrivateEndpointConnectionResources and their operations over a ManagedHsmPrivateEndpointConnectionResource. public virtual ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivateEndpointConnections() { - return GetCachedClient(Client => new ManagedHsmPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ManagedHsmPrivateEndpointConnectionCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivat /// /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. - /// 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> GetManagedHsmPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> /// /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. - /// 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 GetManagedHsmPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationArmClientMockingExtension.cs b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationArmClientMockingExtension.cs new file mode 100644 index 000000000000..9e44adcd30d2 --- /dev/null +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.KubernetesConfiguration; + +namespace Azure.ResourceManager.KubernetesConfiguration.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class KubernetesConfigurationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KubernetesConfigurationArmClientMockingExtension() + { + } + + /// 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 KubernetesConfigurationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal KubernetesConfigurationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual KubernetesClusterExtensionResource GetKubernetesClusterExtensionResource(ResourceIdentifier id) + { + KubernetesClusterExtensionResource.ValidateResourceId(id); + return new KubernetesClusterExtensionResource(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 KubernetesFluxConfigurationResource GetKubernetesFluxConfigurationResource(ResourceIdentifier id) + { + KubernetesFluxConfigurationResource.ValidateResourceId(id); + return new KubernetesFluxConfigurationResource(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 KubernetesSourceControlConfigurationResource GetKubernetesSourceControlConfigurationResource(ResourceIdentifier id) + { + KubernetesSourceControlConfigurationResource.ValidateResourceId(id); + return new KubernetesSourceControlConfigurationResource(Client, id); + } + } +} diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationExtensions.cs b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationExtensions.cs index 2cc80c601a89..628695d7a457 100644 --- a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationExtensions.cs +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.KubernetesConfiguration.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.KubernetesConfiguration @@ -18,93 +19,81 @@ namespace Azure.ResourceManager.KubernetesConfiguration /// A class to add extension methods to Azure.ResourceManager.KubernetesConfiguration. public static partial class KubernetesConfigurationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static KubernetesConfigurationArmClientMockingExtension GetKubernetesConfigurationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new KubernetesConfigurationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static KubernetesConfigurationResourceGroupMockingExtension GetKubernetesConfigurationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new KubernetesConfigurationResourceGroupMockingExtension(client, resource.Id)); } - #region KubernetesClusterExtensionResource + /// /// 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. /// Returns a object. public static KubernetesClusterExtensionResource GetKubernetesClusterExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KubernetesClusterExtensionResource.ValidateResourceId(id); - return new KubernetesClusterExtensionResource(client, id); - } - ); + return GetKubernetesConfigurationArmClientMockingExtension(client).GetKubernetesClusterExtensionResource(id); } - #endregion - #region KubernetesFluxConfigurationResource /// /// 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. /// Returns a object. public static KubernetesFluxConfigurationResource GetKubernetesFluxConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KubernetesFluxConfigurationResource.ValidateResourceId(id); - return new KubernetesFluxConfigurationResource(client, id); - } - ); + return GetKubernetesConfigurationArmClientMockingExtension(client).GetKubernetesFluxConfigurationResource(id); } - #endregion - #region KubernetesSourceControlConfigurationResource /// /// 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. /// Returns a object. public static KubernetesSourceControlConfigurationResource GetKubernetesSourceControlConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KubernetesSourceControlConfigurationResource.ValidateResourceId(id); - return new KubernetesSourceControlConfigurationResource(client, id); - } - ); + return GetKubernetesConfigurationArmClientMockingExtension(client).GetKubernetesSourceControlConfigurationResource(id); } - #endregion - /// Gets a collection of KubernetesClusterExtensionResources in the ResourceGroupResource. + /// + /// Gets a collection of KubernetesClusterExtensionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. /// The name of the kubernetes cluster. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of KubernetesClusterExtensionResources and their operations over a KubernetesClusterExtensionResource. public static KubernetesClusterExtensionCollection GetKubernetesClusterExtensions(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName) { - Argument.AssertNotNullOrEmpty(clusterRp, nameof(clusterRp)); - Argument.AssertNotNullOrEmpty(clusterResourceName, nameof(clusterResourceName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName); } /// @@ -119,6 +108,10 @@ public static KubernetesClusterExtensionCollection GetKubernetesClusterExtension /// Extensions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -126,12 +119,12 @@ public static KubernetesClusterExtensionCollection GetKubernetesClusterExtension /// The name of the kubernetes cluster. /// Name of the Extension. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetKubernetesClusterExtensionAsync(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string extensionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName).GetAsync(extensionName, cancellationToken).ConfigureAwait(false); + return await GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesClusterExtensionAsync(clusterRp, clusterResourceName, clusterName, extensionName, cancellationToken).ConfigureAwait(false); } /// @@ -146,6 +139,10 @@ public static async Task> GetKubern /// Extensions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -153,29 +150,31 @@ public static async Task> GetKubern /// The name of the kubernetes cluster. /// Name of the Extension. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetKubernetesClusterExtension(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string extensionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName).Get(extensionName, cancellationToken); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesClusterExtension(clusterRp, clusterResourceName, clusterName, extensionName, cancellationToken); } - /// Gets a collection of KubernetesFluxConfigurationResources in the ResourceGroupResource. + /// + /// Gets a collection of KubernetesFluxConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. /// The name of the kubernetes cluster. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of KubernetesFluxConfigurationResources and their operations over a KubernetesFluxConfigurationResource. public static KubernetesFluxConfigurationCollection GetKubernetesFluxConfigurations(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName) { - Argument.AssertNotNullOrEmpty(clusterRp, nameof(clusterRp)); - Argument.AssertNotNullOrEmpty(clusterResourceName, nameof(clusterResourceName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName); } /// @@ -190,6 +189,10 @@ public static KubernetesFluxConfigurationCollection GetKubernetesFluxConfigurati /// FluxConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -197,12 +200,12 @@ public static KubernetesFluxConfigurationCollection GetKubernetesFluxConfigurati /// The name of the kubernetes cluster. /// Name of the Flux Configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetKubernetesFluxConfigurationAsync(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string fluxConfigurationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName).GetAsync(fluxConfigurationName, cancellationToken).ConfigureAwait(false); + return await GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesFluxConfigurationAsync(clusterRp, clusterResourceName, clusterName, fluxConfigurationName, cancellationToken).ConfigureAwait(false); } /// @@ -217,6 +220,10 @@ public static async Task> GetKuber /// FluxConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -224,29 +231,31 @@ public static async Task> GetKuber /// The name of the kubernetes cluster. /// Name of the Flux Configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetKubernetesFluxConfiguration(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string fluxConfigurationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName).Get(fluxConfigurationName, cancellationToken); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesFluxConfiguration(clusterRp, clusterResourceName, clusterName, fluxConfigurationName, cancellationToken); } - /// Gets a collection of KubernetesSourceControlConfigurationResources in the ResourceGroupResource. + /// + /// Gets a collection of KubernetesSourceControlConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. /// The name of the kubernetes cluster. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of KubernetesSourceControlConfigurationResources and their operations over a KubernetesSourceControlConfigurationResource. public static KubernetesSourceControlConfigurationCollection GetKubernetesSourceControlConfigurations(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName) { - Argument.AssertNotNullOrEmpty(clusterRp, nameof(clusterRp)); - Argument.AssertNotNullOrEmpty(clusterResourceName, nameof(clusterResourceName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName); } /// @@ -261,6 +270,10 @@ public static KubernetesSourceControlConfigurationCollection GetKubernetesSource /// SourceControlConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -268,12 +281,12 @@ public static KubernetesSourceControlConfigurationCollection GetKubernetesSource /// The name of the kubernetes cluster. /// Name of the Source Control Configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetKubernetesSourceControlConfigurationAsync(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string sourceControlConfigurationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName).GetAsync(sourceControlConfigurationName, cancellationToken).ConfigureAwait(false); + return await GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesSourceControlConfigurationAsync(clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, cancellationToken).ConfigureAwait(false); } /// @@ -288,6 +301,10 @@ public static async Task> /// SourceControlConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. @@ -295,12 +312,12 @@ public static async Task> /// The name of the kubernetes cluster. /// Name of the Source Control Configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetKubernetesSourceControlConfiguration(this ResourceGroupResource resourceGroupResource, string clusterRp, string clusterResourceName, string clusterName, string sourceControlConfigurationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName).Get(sourceControlConfigurationName, cancellationToken); + return GetKubernetesConfigurationResourceGroupMockingExtension(resourceGroupResource).GetKubernetesSourceControlConfiguration(clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, cancellationToken); } } } diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationResourceGroupMockingExtension.cs b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..29ad8c395450 --- /dev/null +++ b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/KubernetesConfigurationResourceGroupMockingExtension.cs @@ -0,0 +1,231 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.KubernetesConfiguration; + +namespace Azure.ResourceManager.KubernetesConfiguration.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class KubernetesConfigurationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KubernetesConfigurationResourceGroupMockingExtension() + { + } + + /// 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 KubernetesConfigurationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of KubernetesClusterExtensionResources in the ResourceGroupResource. + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of KubernetesClusterExtensionResources and their operations over a KubernetesClusterExtensionResource. + public virtual KubernetesClusterExtensionCollection GetKubernetesClusterExtensions(string clusterRp, string clusterResourceName, string clusterName) + { + return new KubernetesClusterExtensionCollection(Client, Id, clusterRp, clusterResourceName, clusterName); + } + + /// + /// Gets Kubernetes Cluster Extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName} + /// + /// + /// Operation Id + /// Extensions_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Extension. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKubernetesClusterExtensionAsync(string clusterRp, string clusterResourceName, string clusterName, string extensionName, CancellationToken cancellationToken = default) + { + return await GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName).GetAsync(extensionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets Kubernetes Cluster Extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName} + /// + /// + /// Operation Id + /// Extensions_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Extension. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKubernetesClusterExtension(string clusterRp, string clusterResourceName, string clusterName, string extensionName, CancellationToken cancellationToken = default) + { + return GetKubernetesClusterExtensions(clusterRp, clusterResourceName, clusterName).Get(extensionName, cancellationToken); + } + + /// Gets a collection of KubernetesFluxConfigurationResources in the ResourceGroupResource. + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of KubernetesFluxConfigurationResources and their operations over a KubernetesFluxConfigurationResource. + public virtual KubernetesFluxConfigurationCollection GetKubernetesFluxConfigurations(string clusterRp, string clusterResourceName, string clusterName) + { + return new KubernetesFluxConfigurationCollection(Client, Id, clusterRp, clusterResourceName, clusterName); + } + + /// + /// Gets details of the Flux Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName} + /// + /// + /// Operation Id + /// FluxConfigurations_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Flux Configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKubernetesFluxConfigurationAsync(string clusterRp, string clusterResourceName, string clusterName, string fluxConfigurationName, CancellationToken cancellationToken = default) + { + return await GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName).GetAsync(fluxConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details of the Flux Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName} + /// + /// + /// Operation Id + /// FluxConfigurations_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Flux Configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKubernetesFluxConfiguration(string clusterRp, string clusterResourceName, string clusterName, string fluxConfigurationName, CancellationToken cancellationToken = default) + { + return GetKubernetesFluxConfigurations(clusterRp, clusterResourceName, clusterName).Get(fluxConfigurationName, cancellationToken); + } + + /// Gets a collection of KubernetesSourceControlConfigurationResources in the ResourceGroupResource. + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of KubernetesSourceControlConfigurationResources and their operations over a KubernetesSourceControlConfigurationResource. + public virtual KubernetesSourceControlConfigurationCollection GetKubernetesSourceControlConfigurations(string clusterRp, string clusterResourceName, string clusterName) + { + return new KubernetesSourceControlConfigurationCollection(Client, Id, clusterRp, clusterResourceName, clusterName); + } + + /// + /// Gets details of the Source Control Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName} + /// + /// + /// Operation Id + /// SourceControlConfigurations_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Source Control Configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKubernetesSourceControlConfigurationAsync(string clusterRp, string clusterResourceName, string clusterName, string sourceControlConfigurationName, CancellationToken cancellationToken = default) + { + return await GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName).GetAsync(sourceControlConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details of the Source Control Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName} + /// + /// + /// Operation Id + /// SourceControlConfigurations_Get + /// + /// + /// + /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. + /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. + /// The name of the kubernetes cluster. + /// Name of the Source Control Configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKubernetesSourceControlConfiguration(string clusterRp, string clusterResourceName, string clusterName, string sourceControlConfigurationName, CancellationToken cancellationToken = default) + { + return GetKubernetesSourceControlConfigurations(clusterRp, clusterResourceName, clusterName).Get(sourceControlConfigurationName, cancellationToken); + } + } +} diff --git a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ec62f4eb6b57..000000000000 --- a/sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.KubernetesConfiguration -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of KubernetesClusterExtensionResources in the ResourceGroupResource. - /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. - /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. - /// The name of the kubernetes cluster. - /// An object representing collection of KubernetesClusterExtensionResources and their operations over a KubernetesClusterExtensionResource. - public virtual KubernetesClusterExtensionCollection GetKubernetesClusterExtensions(string clusterRp, string clusterResourceName, string clusterName) - { - return new KubernetesClusterExtensionCollection(Client, Id, clusterRp, clusterResourceName, clusterName); - } - - /// Gets a collection of KubernetesFluxConfigurationResources in the ResourceGroupResource. - /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. - /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. - /// The name of the kubernetes cluster. - /// An object representing collection of KubernetesFluxConfigurationResources and their operations over a KubernetesFluxConfigurationResource. - public virtual KubernetesFluxConfigurationCollection GetKubernetesFluxConfigurations(string clusterRp, string clusterResourceName, string clusterName) - { - return new KubernetesFluxConfigurationCollection(Client, Id, clusterRp, clusterResourceName, clusterName); - } - - /// Gets a collection of KubernetesSourceControlConfigurationResources in the ResourceGroupResource. - /// The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, Microsoft.HybridContainerService. - /// The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, provisionedClusters. - /// The name of the kubernetes cluster. - /// An object representing collection of KubernetesSourceControlConfigurationResources and their operations over a KubernetesSourceControlConfigurationResource. - public virtual KubernetesSourceControlConfigurationCollection GetKubernetesSourceControlConfigurations(string clusterRp, string clusterResourceName, string clusterName) - { - return new KubernetesSourceControlConfigurationCollection(Client, Id, clusterRp, clusterResourceName, clusterName); - } - } -} diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoArmClientMockingExtension.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoArmClientMockingExtension.cs new file mode 100644 index 000000000000..454a3bc1565f --- /dev/null +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Kusto; + +namespace Azure.ResourceManager.Kusto.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class KustoArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KustoArmClientMockingExtension() + { + } + + /// 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 KustoArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal KustoArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual KustoClusterResource GetKustoClusterResource(ResourceIdentifier id) + { + KustoClusterResource.ValidateResourceId(id); + return new KustoClusterResource(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 KustoClusterPrincipalAssignmentResource GetKustoClusterPrincipalAssignmentResource(ResourceIdentifier id) + { + KustoClusterPrincipalAssignmentResource.ValidateResourceId(id); + return new KustoClusterPrincipalAssignmentResource(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 KustoDatabaseResource GetKustoDatabaseResource(ResourceIdentifier id) + { + KustoDatabaseResource.ValidateResourceId(id); + return new KustoDatabaseResource(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 KustoAttachedDatabaseConfigurationResource GetKustoAttachedDatabaseConfigurationResource(ResourceIdentifier id) + { + KustoAttachedDatabaseConfigurationResource.ValidateResourceId(id); + return new KustoAttachedDatabaseConfigurationResource(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 KustoManagedPrivateEndpointResource GetKustoManagedPrivateEndpointResource(ResourceIdentifier id) + { + KustoManagedPrivateEndpointResource.ValidateResourceId(id); + return new KustoManagedPrivateEndpointResource(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 KustoDatabasePrincipalAssignmentResource GetKustoDatabasePrincipalAssignmentResource(ResourceIdentifier id) + { + KustoDatabasePrincipalAssignmentResource.ValidateResourceId(id); + return new KustoDatabasePrincipalAssignmentResource(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 KustoScriptResource GetKustoScriptResource(ResourceIdentifier id) + { + KustoScriptResource.ValidateResourceId(id); + return new KustoScriptResource(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 KustoPrivateEndpointConnectionResource GetKustoPrivateEndpointConnectionResource(ResourceIdentifier id) + { + KustoPrivateEndpointConnectionResource.ValidateResourceId(id); + return new KustoPrivateEndpointConnectionResource(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 KustoPrivateLinkResource GetKustoPrivateLinkResource(ResourceIdentifier id) + { + KustoPrivateLinkResource.ValidateResourceId(id); + return new KustoPrivateLinkResource(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 KustoDataConnectionResource GetKustoDataConnectionResource(ResourceIdentifier id) + { + KustoDataConnectionResource.ValidateResourceId(id); + return new KustoDataConnectionResource(Client, id); + } + } +} diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoExtensions.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoExtensions.cs index 5759f2e551b0..b4af9a8448e4 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoExtensions.cs +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Kusto.Mocking; using Azure.ResourceManager.Kusto.Models; using Azure.ResourceManager.Resources; @@ -19,233 +20,193 @@ namespace Azure.ResourceManager.Kusto /// A class to add extension methods to Azure.ResourceManager.Kusto. public static partial class KustoExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static KustoArmClientMockingExtension GetKustoArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new KustoArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static KustoResourceGroupMockingExtension GetKustoResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new KustoResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static KustoSubscriptionMockingExtension GetKustoSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new KustoSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region KustoClusterResource /// /// 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. /// Returns a object. public static KustoClusterResource GetKustoClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoClusterResource.ValidateResourceId(id); - return new KustoClusterResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoClusterResource(id); } - #endregion - #region KustoClusterPrincipalAssignmentResource /// /// 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. /// Returns a object. public static KustoClusterPrincipalAssignmentResource GetKustoClusterPrincipalAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoClusterPrincipalAssignmentResource.ValidateResourceId(id); - return new KustoClusterPrincipalAssignmentResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoClusterPrincipalAssignmentResource(id); } - #endregion - #region KustoDatabaseResource /// /// 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. /// Returns a object. public static KustoDatabaseResource GetKustoDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoDatabaseResource.ValidateResourceId(id); - return new KustoDatabaseResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoDatabaseResource(id); } - #endregion - #region KustoAttachedDatabaseConfigurationResource /// /// 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. /// Returns a object. public static KustoAttachedDatabaseConfigurationResource GetKustoAttachedDatabaseConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoAttachedDatabaseConfigurationResource.ValidateResourceId(id); - return new KustoAttachedDatabaseConfigurationResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoAttachedDatabaseConfigurationResource(id); } - #endregion - #region KustoManagedPrivateEndpointResource /// /// 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. /// Returns a object. public static KustoManagedPrivateEndpointResource GetKustoManagedPrivateEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoManagedPrivateEndpointResource.ValidateResourceId(id); - return new KustoManagedPrivateEndpointResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoManagedPrivateEndpointResource(id); } - #endregion - #region KustoDatabasePrincipalAssignmentResource /// /// 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. /// Returns a object. public static KustoDatabasePrincipalAssignmentResource GetKustoDatabasePrincipalAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoDatabasePrincipalAssignmentResource.ValidateResourceId(id); - return new KustoDatabasePrincipalAssignmentResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoDatabasePrincipalAssignmentResource(id); } - #endregion - #region KustoScriptResource /// /// 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. /// Returns a object. public static KustoScriptResource GetKustoScriptResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoScriptResource.ValidateResourceId(id); - return new KustoScriptResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoScriptResource(id); } - #endregion - #region KustoPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static KustoPrivateEndpointConnectionResource GetKustoPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoPrivateEndpointConnectionResource.ValidateResourceId(id); - return new KustoPrivateEndpointConnectionResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoPrivateEndpointConnectionResource(id); } - #endregion - #region KustoPrivateLinkResource /// /// 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. /// Returns a object. public static KustoPrivateLinkResource GetKustoPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoPrivateLinkResource.ValidateResourceId(id); - return new KustoPrivateLinkResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoPrivateLinkResource(id); } - #endregion - #region KustoDataConnectionResource /// /// 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. /// Returns a object. public static KustoDataConnectionResource GetKustoDataConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KustoDataConnectionResource.ValidateResourceId(id); - return new KustoDataConnectionResource(client, id); - } - ); + return GetKustoArmClientMockingExtension(client).GetKustoDataConnectionResource(id); } - #endregion - /// Gets a collection of KustoClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of KustoClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of KustoClusterResources and their operations over a KustoClusterResource. public static KustoClusterCollection GetKustoClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKustoClusters(); + return GetKustoResourceGroupMockingExtension(resourceGroupResource).GetKustoClusters(); } /// @@ -260,16 +221,20 @@ public static KustoClusterCollection GetKustoClusters(this ResourceGroupResource /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kusto cluster. /// The cancellation token to use. - /// 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 static async Task> GetKustoClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKustoClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetKustoResourceGroupMockingExtension(resourceGroupResource).GetKustoClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -284,16 +249,20 @@ public static async Task> GetKustoClusterAsync(th /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kusto cluster. /// The cancellation token to use. - /// 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 static Response GetKustoCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKustoClusters().Get(clusterName, cancellationToken); + return GetKustoResourceGroupMockingExtension(resourceGroupResource).GetKustoCluster(clusterName, cancellationToken); } /// @@ -308,13 +277,17 @@ public static Response GetKustoCluster(this ResourceGroupR /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetKustoClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKustoClustersAsync(cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetKustoClustersAsync(cancellationToken); } /// @@ -329,13 +302,17 @@ public static AsyncPageable GetKustoClustersAsync(this Sub /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetKustoClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKustoClusters(cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetKustoClusters(cancellationToken); } /// @@ -350,13 +327,17 @@ public static Pageable GetKustoClusters(this SubscriptionR /// Clusters_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetKustoEligibleSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKustoEligibleSkusAsync(cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetKustoEligibleSkusAsync(cancellationToken); } /// @@ -371,13 +352,17 @@ public static AsyncPageable GetKustoEligibleSkusAsync(this /// Clusters_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetKustoEligibleSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKustoEligibleSkus(cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetKustoEligibleSkus(cancellationToken); } /// @@ -392,6 +377,10 @@ public static Pageable GetKustoEligibleSkus(this Subscripti /// Clusters_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -400,9 +389,7 @@ public static Pageable GetKustoEligibleSkus(this Subscripti /// is null. public static async Task> CheckKustoClusterNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, KustoClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKustoClusterNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetKustoSubscriptionMockingExtension(subscriptionResource).CheckKustoClusterNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -417,6 +404,10 @@ public static async Task> CheckKustoCluste /// Clusters_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -425,9 +416,7 @@ public static async Task> CheckKustoCluste /// is null. public static Response CheckKustoClusterNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, KustoClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKustoClusterNameAvailability(location, content, cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).CheckKustoClusterNameAvailability(location, content, cancellationToken); } /// @@ -442,6 +431,10 @@ public static Response CheckKustoClusterNameAvailab /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -449,7 +442,7 @@ public static Response CheckKustoClusterNameAvailab /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(location, cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(location, cancellationToken); } /// @@ -464,6 +457,10 @@ public static AsyncPageable GetSkusAsync(this SubscriptionR /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -471,7 +468,7 @@ public static AsyncPageable GetSkusAsync(this SubscriptionR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkus(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(location, cancellationToken); + return GetKustoSubscriptionMockingExtension(subscriptionResource).GetSkus(location, cancellationToken); } } } diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoResourceGroupMockingExtension.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8fd63e394dd6 --- /dev/null +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Kusto; + +namespace Azure.ResourceManager.Kusto.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class KustoResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected KustoResourceGroupMockingExtension() + { + } + + /// 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 KustoResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of KustoClusterResources in the ResourceGroupResource. + /// An object representing collection of KustoClusterResources and their operations over a KustoClusterResource. + public virtual KustoClusterCollection GetKustoClusters() + { + return GetCachedClient(client => new KustoClusterCollection(client, Id)); + } + + /// + /// Gets a Kusto cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the Kusto cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKustoClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetKustoClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Kusto cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the Kusto cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKustoCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetKustoClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoSubscriptionMockingExtension.cs similarity index 87% rename from sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoSubscriptionMockingExtension.cs index 5fd6452371b1..e4a15e52ea07 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/KustoSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Kusto; using Azure.ResourceManager.Kusto.Models; -namespace Azure.ResourceManager.Kusto +namespace Azure.ResourceManager.Kusto.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class KustoSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _kustoClusterClustersClientDiagnostics; private ClustersRestOperations _kustoClusterClustersRestClient; private ClientDiagnostics _skusClientDiagnostics; private SkusRestOperations _skusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected KustoSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal KustoSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetKustoClustersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => KustoClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new KustoClusterResource(Client, KustoClusterData.DeserializeKustoClusterData(e)), KustoClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKustoClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new KustoClusterResource(Client, KustoClusterData.DeserializeKustoClusterData(e)), KustoClusterClustersClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetKustoClusters", "value", null, cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual AsyncPageable GetKustoClustersAsync(Cancell public virtual Pageable GetKustoClusters(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => KustoClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new KustoClusterResource(Client, KustoClusterData.DeserializeKustoClusterData(e)), KustoClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKustoClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new KustoClusterResource(Client, KustoClusterData.DeserializeKustoClusterData(e)), KustoClusterClustersClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetKustoClusters", "value", null, cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual Pageable GetKustoClusters(CancellationToken public virtual AsyncPageable GetKustoEligibleSkusAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => KustoClusterClustersRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, KustoClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKustoEligibleSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, KustoClusterClustersClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetKustoEligibleSkus", "value", null, cancellationToken); } /// @@ -129,7 +130,7 @@ public virtual AsyncPageable GetKustoEligibleSkusAsync(Canc public virtual Pageable GetKustoEligibleSkus(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => KustoClusterClustersRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, KustoClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKustoEligibleSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, KustoClusterClustersClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetKustoEligibleSkus", "value", null, cancellationToken); } /// @@ -148,9 +149,12 @@ public virtual Pageable GetKustoEligibleSkus(CancellationTo /// The name of Azure region. /// The name of the cluster. /// The cancellation token to use. + /// is null. public virtual async Task> CheckKustoClusterNameAvailabilityAsync(AzureLocation location, KustoClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = KustoClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKustoClusterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = KustoClusterClustersClientDiagnostics.CreateScope("KustoSubscriptionMockingExtension.CheckKustoClusterNameAvailability"); scope.Start(); try { @@ -180,9 +184,12 @@ public virtual async Task> CheckKustoClust /// The name of Azure region. /// The name of the cluster. /// The cancellation token to use. + /// is null. public virtual Response CheckKustoClusterNameAvailability(AzureLocation location, KustoClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = KustoClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKustoClusterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = KustoClusterClustersClientDiagnostics.CreateScope("KustoSubscriptionMockingExtension.CheckKustoClusterNameAvailability"); scope.Start(); try { @@ -215,7 +222,7 @@ public virtual Response CheckKustoClusterNameAvaila public virtual AsyncPageable GetSkusAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, SkusClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } /// @@ -237,7 +244,7 @@ public virtual AsyncPageable GetSkusAsync(AzureLocation loc public virtual Pageable GetSkus(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoSkuDescription.DeserializeKustoSkuDescription, SkusClientDiagnostics, Pipeline, "KustoSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } } } diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f49013758ecb..000000000000 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Kusto -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of KustoClusterResources in the ResourceGroupResource. - /// An object representing collection of KustoClusterResources and their operations over a KustoClusterResource. - public virtual KustoClusterCollection GetKustoClusters() - { - return GetCachedClient(Client => new KustoClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoClusterResource.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoClusterResource.cs index 7c18671db6ed..39a3bc132586 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoClusterResource.cs +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoClusterResource.cs @@ -114,7 +114,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of KustoClusterPrincipalAssignmentResources and their operations over a KustoClusterPrincipalAssignmentResource. public virtual KustoClusterPrincipalAssignmentCollection GetKustoClusterPrincipalAssignments() { - return GetCachedClient(Client => new KustoClusterPrincipalAssignmentCollection(Client, Id)); + return GetCachedClient(client => new KustoClusterPrincipalAssignmentCollection(client, Id)); } /// @@ -132,8 +132,8 @@ public virtual KustoClusterPrincipalAssignmentCollection GetKustoClusterPrincipa /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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> GetKustoClusterPrincipalAssignmentAsync(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -155,8 +155,8 @@ public virtual async Task> Get /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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 GetKustoClusterPrincipalAssignment(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -167,7 +167,7 @@ public virtual Response GetKustoCluster /// An object representing collection of KustoDatabaseResources and their operations over a KustoDatabaseResource. public virtual KustoDatabaseCollection GetKustoDatabases() { - return GetCachedClient(Client => new KustoDatabaseCollection(Client, Id)); + return GetCachedClient(client => new KustoDatabaseCollection(client, Id)); } /// @@ -185,8 +185,8 @@ public virtual KustoDatabaseCollection GetKustoDatabases() /// /// The name of the database in the Kusto cluster. /// The cancellation token to use. - /// 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> GetKustoDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -208,8 +208,8 @@ public virtual async Task> GetKustoDatabaseAsync /// /// The name of the database in the Kusto cluster. /// The cancellation token to use. - /// 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 GetKustoDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -220,7 +220,7 @@ public virtual Response GetKustoDatabase(string databaseN /// An object representing collection of KustoAttachedDatabaseConfigurationResources and their operations over a KustoAttachedDatabaseConfigurationResource. public virtual KustoAttachedDatabaseConfigurationCollection GetKustoAttachedDatabaseConfigurations() { - return GetCachedClient(Client => new KustoAttachedDatabaseConfigurationCollection(Client, Id)); + return GetCachedClient(client => new KustoAttachedDatabaseConfigurationCollection(client, Id)); } /// @@ -238,8 +238,8 @@ public virtual KustoAttachedDatabaseConfigurationCollection GetKustoAttachedData /// /// The name of the attached database configuration. /// The cancellation token to use. - /// 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> GetKustoAttachedDatabaseConfigurationAsync(string attachedDatabaseConfigurationName, CancellationToken cancellationToken = default) { @@ -261,8 +261,8 @@ public virtual async Task> /// /// The name of the attached database configuration. /// The cancellation token to use. - /// 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 GetKustoAttachedDatabaseConfiguration(string attachedDatabaseConfigurationName, CancellationToken cancellationToken = default) { @@ -273,7 +273,7 @@ public virtual Response GetKustoAtta /// An object representing collection of KustoManagedPrivateEndpointResources and their operations over a KustoManagedPrivateEndpointResource. public virtual KustoManagedPrivateEndpointCollection GetKustoManagedPrivateEndpoints() { - return GetCachedClient(Client => new KustoManagedPrivateEndpointCollection(Client, Id)); + return GetCachedClient(client => new KustoManagedPrivateEndpointCollection(client, Id)); } /// @@ -291,8 +291,8 @@ public virtual KustoManagedPrivateEndpointCollection GetKustoManagedPrivateEndpo /// /// The name of the managed private endpoint. /// The cancellation token to use. - /// 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> GetKustoManagedPrivateEndpointAsync(string managedPrivateEndpointName, CancellationToken cancellationToken = default) { @@ -314,8 +314,8 @@ public virtual async Task> GetKust /// /// The name of the managed private endpoint. /// The cancellation token to use. - /// 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 GetKustoManagedPrivateEndpoint(string managedPrivateEndpointName, CancellationToken cancellationToken = default) { @@ -326,7 +326,7 @@ public virtual Response GetKustoManagedPriv /// An object representing collection of KustoPrivateEndpointConnectionResources and their operations over a KustoPrivateEndpointConnectionResource. public virtual KustoPrivateEndpointConnectionCollection GetKustoPrivateEndpointConnections() { - return GetCachedClient(Client => new KustoPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new KustoPrivateEndpointConnectionCollection(client, Id)); } /// @@ -344,8 +344,8 @@ public virtual KustoPrivateEndpointConnectionCollection GetKustoPrivateEndpointC /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetKustoPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -367,8 +367,8 @@ public virtual async Task> GetK /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetKustoPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -379,7 +379,7 @@ public virtual Response GetKustoPrivateE /// An object representing collection of KustoPrivateLinkResources and their operations over a KustoPrivateLinkResource. public virtual KustoPrivateLinkResourceCollection GetKustoPrivateLinkResources() { - return GetCachedClient(Client => new KustoPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new KustoPrivateLinkResourceCollection(client, Id)); } /// @@ -397,8 +397,8 @@ public virtual KustoPrivateLinkResourceCollection GetKustoPrivateLinkResources() /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetKustoPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -420,8 +420,8 @@ public virtual async Task> GetKustoPrivateLin /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetKustoPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoDatabaseResource.cs b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoDatabaseResource.cs index fd7e64f20f49..ac5c28d0df12 100644 --- a/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoDatabaseResource.cs +++ b/sdk/kusto/Azure.ResourceManager.Kusto/src/Generated/KustoDatabaseResource.cs @@ -111,7 +111,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of KustoDatabasePrincipalAssignmentResources and their operations over a KustoDatabasePrincipalAssignmentResource. public virtual KustoDatabasePrincipalAssignmentCollection GetKustoDatabasePrincipalAssignments() { - return GetCachedClient(Client => new KustoDatabasePrincipalAssignmentCollection(Client, Id)); + return GetCachedClient(client => new KustoDatabasePrincipalAssignmentCollection(client, Id)); } /// @@ -129,8 +129,8 @@ public virtual KustoDatabasePrincipalAssignmentCollection GetKustoDatabasePrinci /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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> GetKustoDatabasePrincipalAssignmentAsync(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -152,8 +152,8 @@ public virtual async Task> Ge /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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 GetKustoDatabasePrincipalAssignment(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -164,7 +164,7 @@ public virtual Response GetKustoDataba /// An object representing collection of KustoScriptResources and their operations over a KustoScriptResource. public virtual KustoScriptCollection GetKustoScripts() { - return GetCachedClient(Client => new KustoScriptCollection(Client, Id)); + return GetCachedClient(client => new KustoScriptCollection(client, Id)); } /// @@ -182,8 +182,8 @@ public virtual KustoScriptCollection GetKustoScripts() /// /// The name of the Kusto database script. /// The cancellation token to use. - /// 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> GetKustoScriptAsync(string scriptName, CancellationToken cancellationToken = default) { @@ -205,8 +205,8 @@ public virtual async Task> GetKustoScriptAsync(str /// /// The name of the Kusto database script. /// The cancellation token to use. - /// 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 GetKustoScript(string scriptName, CancellationToken cancellationToken = default) { @@ -217,7 +217,7 @@ public virtual Response GetKustoScript(string scriptName, C /// An object representing collection of KustoDataConnectionResources and their operations over a KustoDataConnectionResource. public virtual KustoDataConnectionCollection GetKustoDataConnections() { - return GetCachedClient(Client => new KustoDataConnectionCollection(Client, Id)); + return GetCachedClient(client => new KustoDataConnectionCollection(client, Id)); } /// @@ -235,8 +235,8 @@ public virtual KustoDataConnectionCollection GetKustoDataConnections() /// /// The name of the data connection. /// The cancellation token to use. - /// 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> GetKustoDataConnectionAsync(string dataConnectionName, CancellationToken cancellationToken = default) { @@ -258,8 +258,8 @@ public virtual async Task> GetKustoDataCon /// /// The name of the data connection. /// The cancellation token to use. - /// 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 GetKustoDataConnection(string dataConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesArmClientMockingExtension.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..1219511cbd7f --- /dev/null +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.LabServices; + +namespace Azure.ResourceManager.LabServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class LabServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected LabServicesArmClientMockingExtension() + { + } + + /// 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 LabServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal LabServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual LabVirtualMachineImageResource GetLabVirtualMachineImageResource(ResourceIdentifier id) + { + LabVirtualMachineImageResource.ValidateResourceId(id); + return new LabVirtualMachineImageResource(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 LabPlanResource GetLabPlanResource(ResourceIdentifier id) + { + LabPlanResource.ValidateResourceId(id); + return new LabPlanResource(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 LabResource GetLabResource(ResourceIdentifier id) + { + LabResource.ValidateResourceId(id); + return new LabResource(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 LabServicesScheduleResource GetLabServicesScheduleResource(ResourceIdentifier id) + { + LabServicesScheduleResource.ValidateResourceId(id); + return new LabServicesScheduleResource(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 LabUserResource GetLabUserResource(ResourceIdentifier id) + { + LabUserResource.ValidateResourceId(id); + return new LabUserResource(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 LabVirtualMachineResource GetLabVirtualMachineResource(ResourceIdentifier id) + { + LabVirtualMachineResource.ValidateResourceId(id); + return new LabVirtualMachineResource(Client, id); + } + } +} diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesExtensions.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesExtensions.cs index 1d692e525940..3bbd507b29b6 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesExtensions.cs +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.LabServices.Mocking; using Azure.ResourceManager.LabServices.Models; using Azure.ResourceManager.Resources; @@ -19,157 +20,129 @@ namespace Azure.ResourceManager.LabServices /// A class to add extension methods to Azure.ResourceManager.LabServices. public static partial class LabServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static LabServicesArmClientMockingExtension GetLabServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new LabServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static LabServicesResourceGroupMockingExtension GetLabServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new LabServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static LabServicesSubscriptionMockingExtension GetLabServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new LabServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region LabVirtualMachineImageResource /// /// 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. /// Returns a object. public static LabVirtualMachineImageResource GetLabVirtualMachineImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabVirtualMachineImageResource.ValidateResourceId(id); - return new LabVirtualMachineImageResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabVirtualMachineImageResource(id); } - #endregion - #region LabPlanResource /// /// 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. /// Returns a object. public static LabPlanResource GetLabPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabPlanResource.ValidateResourceId(id); - return new LabPlanResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabPlanResource(id); } - #endregion - #region LabResource /// /// 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. /// Returns a object. public static LabResource GetLabResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabResource.ValidateResourceId(id); - return new LabResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabResource(id); } - #endregion - #region LabServicesScheduleResource /// /// 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. /// Returns a object. public static LabServicesScheduleResource GetLabServicesScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabServicesScheduleResource.ValidateResourceId(id); - return new LabServicesScheduleResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabServicesScheduleResource(id); } - #endregion - #region LabUserResource /// /// 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. /// Returns a object. public static LabUserResource GetLabUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabUserResource.ValidateResourceId(id); - return new LabUserResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabUserResource(id); } - #endregion - #region LabVirtualMachineResource /// /// 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. /// Returns a object. public static LabVirtualMachineResource GetLabVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LabVirtualMachineResource.ValidateResourceId(id); - return new LabVirtualMachineResource(client, id); - } - ); + return GetLabServicesArmClientMockingExtension(client).GetLabVirtualMachineResource(id); } - #endregion - /// Gets a collection of LabPlanResources in the ResourceGroupResource. + /// + /// Gets a collection of LabPlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LabPlanResources and their operations over a LabPlanResource. public static LabPlanCollection GetLabPlans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLabPlans(); + return GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLabPlans(); } /// @@ -184,16 +157,20 @@ public static LabPlanCollection GetLabPlans(this ResourceGroupResource resourceG /// LabPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab plan that uniquely identifies it within containing resource group. Used in resource URIs and in UI. /// The cancellation token to use. - /// 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 static async Task> GetLabPlanAsync(this ResourceGroupResource resourceGroupResource, string labPlanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLabPlans().GetAsync(labPlanName, cancellationToken).ConfigureAwait(false); + return await GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLabPlanAsync(labPlanName, cancellationToken).ConfigureAwait(false); } /// @@ -208,24 +185,34 @@ public static async Task> GetLabPlanAsync(this Resourc /// LabPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab plan that uniquely identifies it within containing resource group. Used in resource URIs and in UI. /// The cancellation token to use. - /// 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 static Response GetLabPlan(this ResourceGroupResource resourceGroupResource, string labPlanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLabPlans().Get(labPlanName, cancellationToken); + return GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLabPlan(labPlanName, cancellationToken); } - /// Gets a collection of LabResources in the ResourceGroupResource. + /// + /// Gets a collection of LabResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LabResources and their operations over a LabResource. public static LabCollection GetLabs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLabs(); + return GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLabs(); } /// @@ -240,16 +227,20 @@ public static LabCollection GetLabs(this ResourceGroupResource resourceGroupReso /// Labs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. /// The cancellation token to use. - /// 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 static async Task> GetLabAsync(this ResourceGroupResource resourceGroupResource, string labName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLabs().GetAsync(labName, cancellationToken).ConfigureAwait(false); + return await GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLabAsync(labName, cancellationToken).ConfigureAwait(false); } /// @@ -264,16 +255,20 @@ public static async Task> GetLabAsync(this ResourceGroupRe /// Labs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. /// The cancellation token to use. - /// 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 static Response GetLab(this ResourceGroupResource resourceGroupResource, string labName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLabs().Get(labName, cancellationToken); + return GetLabServicesResourceGroupMockingExtension(resourceGroupResource).GetLab(labName, cancellationToken); } /// @@ -288,6 +283,10 @@ public static Response GetLab(this ResourceGroupResource resourceGr /// LabPlans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -295,7 +294,7 @@ public static Response GetLab(this ResourceGroupResource resourceGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLabPlansAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLabPlansAsync(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetLabPlansAsync(filter, cancellationToken); } /// @@ -310,6 +309,10 @@ public static AsyncPageable GetLabPlansAsync(this SubscriptionR /// LabPlans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -317,7 +320,7 @@ public static AsyncPageable GetLabPlansAsync(this SubscriptionR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLabPlans(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLabPlans(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetLabPlans(filter, cancellationToken); } /// @@ -332,6 +335,10 @@ public static Pageable GetLabPlans(this SubscriptionResource su /// Labs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -339,7 +346,7 @@ public static Pageable GetLabPlans(this SubscriptionResource su /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLabsAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLabsAsync(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetLabsAsync(filter, cancellationToken); } /// @@ -354,6 +361,10 @@ public static AsyncPageable GetLabsAsync(this SubscriptionResource /// Labs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -361,7 +372,7 @@ public static AsyncPageable GetLabsAsync(this SubscriptionResource /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLabs(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLabs(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetLabs(filter, cancellationToken); } /// @@ -376,6 +387,10 @@ public static Pageable GetLabs(this SubscriptionResource subscripti /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -383,7 +398,7 @@ public static Pageable GetLabs(this SubscriptionResource subscripti /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(filter, cancellationToken); } /// @@ -398,6 +413,10 @@ public static AsyncPageable GetSkusAsync(this Subscript /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply to the operation. @@ -405,7 +424,7 @@ public static AsyncPageable GetSkusAsync(this Subscript /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkus(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetSkus(filter, cancellationToken); } /// @@ -420,6 +439,10 @@ public static Pageable GetSkus(this SubscriptionResourc /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location name. @@ -428,7 +451,7 @@ public static Pageable GetSkus(this SubscriptionResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, filter, cancellationToken); } /// @@ -443,6 +466,10 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionRe /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location name. @@ -451,7 +478,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionRe /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, filter, cancellationToken); + return GetLabServicesSubscriptionMockingExtension(subscriptionResource).GetUsages(location, filter, cancellationToken); } } } diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesResourceGroupMockingExtension.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..061d21da06d0 --- /dev/null +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.LabServices; + +namespace Azure.ResourceManager.LabServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class LabServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected LabServicesResourceGroupMockingExtension() + { + } + + /// 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 LabServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of LabPlanResources in the ResourceGroupResource. + /// An object representing collection of LabPlanResources and their operations over a LabPlanResource. + public virtual LabPlanCollection GetLabPlans() + { + return GetCachedClient(client => new LabPlanCollection(client, Id)); + } + + /// + /// Retrieves the properties of a Lab Plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName} + /// + /// + /// Operation Id + /// LabPlans_Get + /// + /// + /// + /// The name of the lab plan that uniquely identifies it within containing resource group. Used in resource URIs and in UI. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLabPlanAsync(string labPlanName, CancellationToken cancellationToken = default) + { + return await GetLabPlans().GetAsync(labPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of a Lab Plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName} + /// + /// + /// Operation Id + /// LabPlans_Get + /// + /// + /// + /// The name of the lab plan that uniquely identifies it within containing resource group. Used in resource URIs and in UI. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLabPlan(string labPlanName, CancellationToken cancellationToken = default) + { + return GetLabPlans().Get(labPlanName, cancellationToken); + } + + /// Gets a collection of LabResources in the ResourceGroupResource. + /// An object representing collection of LabResources and their operations over a LabResource. + public virtual LabCollection GetLabs() + { + return GetCachedClient(client => new LabCollection(client, Id)); + } + + /// + /// Returns the properties of a lab resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName} + /// + /// + /// Operation Id + /// Labs_Get + /// + /// + /// + /// The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLabAsync(string labName, CancellationToken cancellationToken = default) + { + return await GetLabs().GetAsync(labName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the properties of a lab resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName} + /// + /// + /// Operation Id + /// Labs_Get + /// + /// + /// + /// The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLab(string labName, CancellationToken cancellationToken = default) + { + return GetLabs().Get(labName, cancellationToken); + } + } +} diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesSubscriptionMockingExtension.cs similarity index 90% rename from sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesSubscriptionMockingExtension.cs index f1425715fe14..a8f7801fae0b 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/LabServicesSubscriptionMockingExtension.cs @@ -11,12 +11,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.LabServices; using Azure.ResourceManager.LabServices.Models; -namespace Azure.ResourceManager.LabServices +namespace Azure.ResourceManager.LabServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class LabServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _labPlanClientDiagnostics; private LabPlansRestOperations _labPlanRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected LabServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal LabServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -74,7 +75,7 @@ public virtual AsyncPageable GetLabPlansAsync(string filter = n { HttpMessage FirstPageRequest(int? pageSizeHint) => LabPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LabPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LabPlanResource(Client, LabPlanData.DeserializeLabPlanData(e)), LabPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLabPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LabPlanResource(Client, LabPlanData.DeserializeLabPlanData(e)), LabPlanClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetLabPlans", "value", "nextLink", cancellationToken); } /// @@ -97,7 +98,7 @@ public virtual Pageable GetLabPlans(string filter = null, Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => LabPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LabPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LabPlanResource(Client, LabPlanData.DeserializeLabPlanData(e)), LabPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLabPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LabPlanResource(Client, LabPlanData.DeserializeLabPlanData(e)), LabPlanClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetLabPlans", "value", "nextLink", cancellationToken); } /// @@ -120,7 +121,7 @@ public virtual AsyncPageable GetLabsAsync(string filter = null, Can { HttpMessage FirstPageRequest(int? pageSizeHint) => LabRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LabRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LabResource(Client, LabData.DeserializeLabData(e)), LabClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLabs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LabResource(Client, LabData.DeserializeLabData(e)), LabClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetLabs", "value", "nextLink", cancellationToken); } /// @@ -143,7 +144,7 @@ public virtual Pageable GetLabs(string filter = null, CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => LabRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LabRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LabResource(Client, LabData.DeserializeLabData(e)), LabClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLabs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LabResource(Client, LabData.DeserializeLabData(e)), LabClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetLabs", "value", "nextLink", cancellationToken); } /// @@ -166,7 +167,7 @@ public virtual AsyncPageable GetSkusAsync(string filter { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableLabServicesSku.DeserializeAvailableLabServicesSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableLabServicesSku.DeserializeAvailableLabServicesSku, SkusClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetSkus", "value", "nextLink", cancellationToken); } /// @@ -189,7 +190,7 @@ public virtual Pageable GetSkus(string filter = null, C { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableLabServicesSku.DeserializeAvailableLabServicesSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableLabServicesSku.DeserializeAvailableLabServicesSku, SkusClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetSkus", "value", "nextLink", cancellationToken); } /// @@ -213,7 +214,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation loca { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LabServicesUsage.DeserializeLabServicesUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LabServicesUsage.DeserializeLabServicesUsage, UsagesClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -237,7 +238,7 @@ public virtual Pageable GetUsages(AzureLocation location, stri { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LabServicesUsage.DeserializeLabServicesUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LabServicesUsage.DeserializeLabServicesUsage, UsagesClientDiagnostics, Pipeline, "LabServicesSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 647728d9c8f8..000000000000 --- a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.LabServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LabPlanResources in the ResourceGroupResource. - /// An object representing collection of LabPlanResources and their operations over a LabPlanResource. - public virtual LabPlanCollection GetLabPlans() - { - return GetCachedClient(Client => new LabPlanCollection(Client, Id)); - } - - /// Gets a collection of LabResources in the ResourceGroupResource. - /// An object representing collection of LabResources and their operations over a LabResource. - public virtual LabCollection GetLabs() - { - return GetCachedClient(Client => new LabCollection(Client, Id)); - } - } -} diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabPlanResource.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabPlanResource.cs index f2faa0f4718e..41120954e24f 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabPlanResource.cs +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabPlanResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LabVirtualMachineImageResources and their operations over a LabVirtualMachineImageResource. public virtual LabVirtualMachineImageCollection GetLabVirtualMachineImages() { - return GetCachedClient(Client => new LabVirtualMachineImageCollection(Client, Id)); + return GetCachedClient(client => new LabVirtualMachineImageCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual LabVirtualMachineImageCollection GetLabVirtualMachineImages() /// /// The image name. /// The cancellation token to use. - /// 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> GetLabVirtualMachineImageAsync(string imageName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetLabVirtua /// /// The image name. /// The cancellation token to use. - /// 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 GetLabVirtualMachineImage(string imageName, CancellationToken cancellationToken = default) { diff --git a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabResource.cs b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabResource.cs index 01a3e07ba083..45c722e4cb4f 100644 --- a/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabResource.cs +++ b/sdk/labservices/Azure.ResourceManager.LabServices/src/Generated/LabResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LabServicesScheduleResources and their operations over a LabServicesScheduleResource. public virtual LabServicesScheduleCollection GetLabServicesSchedules() { - return GetCachedClient(Client => new LabServicesScheduleCollection(Client, Id)); + return GetCachedClient(client => new LabServicesScheduleCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual LabServicesScheduleCollection GetLabServicesSchedules() /// /// The name of the schedule that uniquely identifies it within containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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> GetLabServicesScheduleAsync(string scheduleName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetLabServicesS /// /// The name of the schedule that uniquely identifies it within containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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 GetLabServicesSchedule(string scheduleName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetLabServicesSchedule(stri /// An object representing collection of LabUserResources and their operations over a LabUserResource. public virtual LabUserCollection GetLabUsers() { - return GetCachedClient(Client => new LabUserCollection(Client, Id)); + return GetCachedClient(client => new LabUserCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual LabUserCollection GetLabUsers() /// /// The name of the user that uniquely identifies it within containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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> GetLabUserAsync(string userName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> GetLabUserAsync(string user /// /// The name of the user that uniquely identifies it within containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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 GetLabUser(string userName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetLabUser(string userName, Cancellatio /// An object representing collection of LabVirtualMachineResources and their operations over a LabVirtualMachineResource. public virtual LabVirtualMachineCollection GetLabVirtualMachines() { - return GetCachedClient(Client => new LabVirtualMachineCollection(Client, Id)); + return GetCachedClient(client => new LabVirtualMachineCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual LabVirtualMachineCollection GetLabVirtualMachines() /// /// The ID of the virtual machine that uniquely identifies it within the containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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> GetLabVirtualMachineAsync(string virtualMachineName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> GetLabVirtualMach /// /// The ID of the virtual machine that uniquely identifies it within the containing lab. Used in resource URIs. /// The cancellation token to use. - /// 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 GetLabVirtualMachine(string virtualMachineName, CancellationToken cancellationToken = default) { diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingArmClientMockingExtension.cs b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingArmClientMockingExtension.cs new file mode 100644 index 000000000000..45be4086a756 --- /dev/null +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.LoadTesting; + +namespace Azure.ResourceManager.LoadTesting.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class LoadTestingArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected LoadTestingArmClientMockingExtension() + { + } + + /// 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 LoadTestingArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal LoadTestingArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual LoadTestingQuotaResource GetLoadTestingQuotaResource(ResourceIdentifier id) + { + LoadTestingQuotaResource.ValidateResourceId(id); + return new LoadTestingQuotaResource(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 LoadTestingResource GetLoadTestingResource(ResourceIdentifier id) + { + LoadTestingResource.ValidateResourceId(id); + return new LoadTestingResource(Client, id); + } + } +} diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingExtensions.cs b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingExtensions.cs index d12ca546e780..ede3bbcc0458 100644 --- a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingExtensions.cs +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.LoadTesting.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.LoadTesting @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.LoadTesting /// A class to add extension methods to Azure.ResourceManager.LoadTesting. public static partial class LoadTestingExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static LoadTestingArmClientMockingExtension GetLoadTestingArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new LoadTestingArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static LoadTestingResourceGroupMockingExtension GetLoadTestingResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new LoadTestingResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static LoadTestingSubscriptionMockingExtension GetLoadTestingSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new LoadTestingSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region LoadTestingQuotaResource /// /// 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. /// Returns a object. public static LoadTestingQuotaResource GetLoadTestingQuotaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LoadTestingQuotaResource.ValidateResourceId(id); - return new LoadTestingQuotaResource(client, id); - } - ); + return GetLoadTestingArmClientMockingExtension(client).GetLoadTestingQuotaResource(id); } - #endregion - #region LoadTestingResource /// /// 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. /// Returns a object. public static LoadTestingResource GetLoadTestingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LoadTestingResource.ValidateResourceId(id); - return new LoadTestingResource(client, id); - } - ); + return GetLoadTestingArmClientMockingExtension(client).GetLoadTestingResource(id); } - #endregion - /// Gets a collection of LoadTestingResources in the ResourceGroupResource. + /// + /// Gets a collection of LoadTestingResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LoadTestingResources and their operations over a LoadTestingResource. public static LoadTestingResourceCollection GetLoadTestingResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLoadTestingResources(); + return GetLoadTestingResourceGroupMockingExtension(resourceGroupResource).GetLoadTestingResources(); } /// @@ -107,16 +92,20 @@ public static LoadTestingResourceCollection GetLoadTestingResources(this Resourc /// LoadTests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Load Test name. /// The cancellation token to use. - /// 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 static async Task> GetLoadTestingResourceAsync(this ResourceGroupResource resourceGroupResource, string loadTestName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLoadTestingResources().GetAsync(loadTestName, cancellationToken).ConfigureAwait(false); + return await GetLoadTestingResourceGroupMockingExtension(resourceGroupResource).GetLoadTestingResourceAsync(loadTestName, cancellationToken).ConfigureAwait(false); } /// @@ -131,25 +120,35 @@ public static async Task> GetLoadTestingResourceAs /// LoadTests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Load Test name. /// The cancellation token to use. - /// 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 static Response GetLoadTestingResource(this ResourceGroupResource resourceGroupResource, string loadTestName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLoadTestingResources().Get(loadTestName, cancellationToken); + return GetLoadTestingResourceGroupMockingExtension(resourceGroupResource).GetLoadTestingResource(loadTestName, cancellationToken); } - /// Gets a collection of LoadTestingQuotaResources in the SubscriptionResource. + /// + /// Gets a collection of LoadTestingQuotaResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of Azure region. /// An object representing collection of LoadTestingQuotaResources and their operations over a LoadTestingQuotaResource. public static LoadTestingQuotaCollection GetAllLoadTestingQuota(this SubscriptionResource subscriptionResource, AzureLocation location) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllLoadTestingQuota(location); + return GetLoadTestingSubscriptionMockingExtension(subscriptionResource).GetAllLoadTestingQuota(location); } /// @@ -164,17 +163,21 @@ public static LoadTestingQuotaCollection GetAllLoadTestingQuota(this Subscriptio /// Quotas_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// Quota Bucket name. /// The cancellation token to use. - /// 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 static async Task> GetLoadTestingQuotaAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string quotaBucketName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAllLoadTestingQuota(location).GetAsync(quotaBucketName, cancellationToken).ConfigureAwait(false); + return await GetLoadTestingSubscriptionMockingExtension(subscriptionResource).GetLoadTestingQuotaAsync(location, quotaBucketName, cancellationToken).ConfigureAwait(false); } /// @@ -189,17 +192,21 @@ public static async Task> GetLoadTestingQuota /// Quotas_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// Quota Bucket name. /// The cancellation token to use. - /// 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 static Response GetLoadTestingQuota(this SubscriptionResource subscriptionResource, AzureLocation location, string quotaBucketName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAllLoadTestingQuota(location).Get(quotaBucketName, cancellationToken); + return GetLoadTestingSubscriptionMockingExtension(subscriptionResource).GetLoadTestingQuota(location, quotaBucketName, cancellationToken); } /// @@ -214,13 +221,17 @@ public static Response GetLoadTestingQuota(this Subscr /// LoadTests_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLoadTestingResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLoadTestingResourcesAsync(cancellationToken); + return GetLoadTestingSubscriptionMockingExtension(subscriptionResource).GetLoadTestingResourcesAsync(cancellationToken); } /// @@ -235,13 +246,17 @@ public static AsyncPageable GetLoadTestingResourcesAsync(th /// LoadTests_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLoadTestingResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLoadTestingResources(cancellationToken); + return GetLoadTestingSubscriptionMockingExtension(subscriptionResource).GetLoadTestingResources(cancellationToken); } } } diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingResourceGroupMockingExtension.cs b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..76e8bce8015d --- /dev/null +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.LoadTesting; + +namespace Azure.ResourceManager.LoadTesting.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class LoadTestingResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected LoadTestingResourceGroupMockingExtension() + { + } + + /// 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 LoadTestingResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of LoadTestingResources in the ResourceGroupResource. + /// An object representing collection of LoadTestingResources and their operations over a LoadTestingResource. + public virtual LoadTestingResourceCollection GetLoadTestingResources() + { + return GetCachedClient(client => new LoadTestingResourceCollection(client, Id)); + } + + /// + /// Get a LoadTest resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName} + /// + /// + /// Operation Id + /// LoadTests_Get + /// + /// + /// + /// Load Test name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLoadTestingResourceAsync(string loadTestName, CancellationToken cancellationToken = default) + { + return await GetLoadTestingResources().GetAsync(loadTestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a LoadTest resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LoadTestService/loadTests/{loadTestName} + /// + /// + /// Operation Id + /// LoadTests_Get + /// + /// + /// + /// Load Test name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLoadTestingResource(string loadTestName, CancellationToken cancellationToken = default) + { + return GetLoadTestingResources().Get(loadTestName, cancellationToken); + } + } +} diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingSubscriptionMockingExtension.cs similarity index 58% rename from sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingSubscriptionMockingExtension.cs index dafdba0f7c1b..b121e5ff65bc 100644 --- a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/LoadTestingSubscriptionMockingExtension.cs @@ -5,30 +5,33 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.LoadTesting; -namespace Azure.ResourceManager.LoadTesting +namespace Azure.ResourceManager.LoadTesting.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class LoadTestingSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _loadTestingResourceLoadTestsClientDiagnostics; private LoadTestsRestOperations _loadTestingResourceLoadTestsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected LoadTestingSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal LoadTestingSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -49,6 +52,54 @@ public virtual LoadTestingQuotaCollection GetAllLoadTestingQuota(AzureLocation l return new LoadTestingQuotaCollection(Client, Id, location); } + /// + /// Get the available quota for a quota bucket per region per subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName} + /// + /// + /// Operation Id + /// Quotas_Get + /// + /// + /// + /// The name of Azure region. + /// Quota Bucket name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLoadTestingQuotaAsync(AzureLocation location, string quotaBucketName, CancellationToken cancellationToken = default) + { + return await GetAllLoadTestingQuota(location).GetAsync(quotaBucketName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the available quota for a quota bucket per region per subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.LoadTestService/locations/{location}/quotas/{quotaBucketName} + /// + /// + /// Operation Id + /// Quotas_Get + /// + /// + /// + /// The name of Azure region. + /// Quota Bucket name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLoadTestingQuota(AzureLocation location, string quotaBucketName, CancellationToken cancellationToken = default) + { + return GetAllLoadTestingQuota(location).Get(quotaBucketName, cancellationToken); + } + /// /// Lists loadtests resources in a subscription. /// @@ -68,7 +119,7 @@ public virtual AsyncPageable GetLoadTestingResourcesAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => LoadTestingResourceLoadTestsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LoadTestingResourceLoadTestsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadTestingResource(Client, LoadTestingResourceData.DeserializeLoadTestingResourceData(e)), LoadTestingResourceLoadTestsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLoadTestingResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadTestingResource(Client, LoadTestingResourceData.DeserializeLoadTestingResourceData(e)), LoadTestingResourceLoadTestsClientDiagnostics, Pipeline, "LoadTestingSubscriptionMockingExtension.GetLoadTestingResources", "value", "nextLink", cancellationToken); } /// @@ -90,7 +141,7 @@ public virtual Pageable GetLoadTestingResources(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => LoadTestingResourceLoadTestsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LoadTestingResourceLoadTestsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadTestingResource(Client, LoadTestingResourceData.DeserializeLoadTestingResourceData(e)), LoadTestingResourceLoadTestsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLoadTestingResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadTestingResource(Client, LoadTestingResourceData.DeserializeLoadTestingResourceData(e)), LoadTestingResourceLoadTestsClientDiagnostics, Pipeline, "LoadTestingSubscriptionMockingExtension.GetLoadTestingResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3b6684064c29..000000000000 --- a/sdk/loadtestservice/Azure.ResourceManager.LoadTesting/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.LoadTesting -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LoadTestingResources in the ResourceGroupResource. - /// An object representing collection of LoadTestingResources and their operations over a LoadTestingResource. - public virtual LoadTestingResourceCollection GetLoadTestingResources() - { - return GetCachedClient(Client => new LoadTestingResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicArmClientMockingExtension.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicArmClientMockingExtension.cs new file mode 100644 index 000000000000..2d301d59765d --- /dev/null +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicArmClientMockingExtension.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Logic; + +namespace Azure.ResourceManager.Logic.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class LogicArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected LogicArmClientMockingExtension() + { + } + + /// 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 LogicArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal LogicArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual LogicWorkflowResource GetLogicWorkflowResource(ResourceIdentifier id) + { + LogicWorkflowResource.ValidateResourceId(id); + return new LogicWorkflowResource(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 LogicWorkflowVersionResource GetLogicWorkflowVersionResource(ResourceIdentifier id) + { + LogicWorkflowVersionResource.ValidateResourceId(id); + return new LogicWorkflowVersionResource(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 LogicWorkflowTriggerResource GetLogicWorkflowTriggerResource(ResourceIdentifier id) + { + LogicWorkflowTriggerResource.ValidateResourceId(id); + return new LogicWorkflowTriggerResource(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 LogicWorkflowTriggerHistoryResource GetLogicWorkflowTriggerHistoryResource(ResourceIdentifier id) + { + LogicWorkflowTriggerHistoryResource.ValidateResourceId(id); + return new LogicWorkflowTriggerHistoryResource(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 LogicWorkflowRunResource GetLogicWorkflowRunResource(ResourceIdentifier id) + { + LogicWorkflowRunResource.ValidateResourceId(id); + return new LogicWorkflowRunResource(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 LogicWorkflowRunOperationResource GetLogicWorkflowRunOperationResource(ResourceIdentifier id) + { + LogicWorkflowRunOperationResource.ValidateResourceId(id); + return new LogicWorkflowRunOperationResource(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 LogicWorkflowRunActionResource GetLogicWorkflowRunActionResource(ResourceIdentifier id) + { + LogicWorkflowRunActionResource.ValidateResourceId(id); + return new LogicWorkflowRunActionResource(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 LogicWorkflowRunActionRepetitionResource GetLogicWorkflowRunActionRepetitionResource(ResourceIdentifier id) + { + LogicWorkflowRunActionRepetitionResource.ValidateResourceId(id); + return new LogicWorkflowRunActionRepetitionResource(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 LogicWorkflowRunActionScopeRepetitionResource GetLogicWorkflowRunActionScopeRepetitionResource(ResourceIdentifier id) + { + LogicWorkflowRunActionScopeRepetitionResource.ValidateResourceId(id); + return new LogicWorkflowRunActionScopeRepetitionResource(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 LogicWorkflowRunActionRepetitionRequestHistoryResource GetLogicWorkflowRunActionRepetitionRequestHistoryResource(ResourceIdentifier id) + { + LogicWorkflowRunActionRepetitionRequestHistoryResource.ValidateResourceId(id); + return new LogicWorkflowRunActionRepetitionRequestHistoryResource(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 LogicWorkflowRunActionRequestHistoryResource GetLogicWorkflowRunActionRequestHistoryResource(ResourceIdentifier id) + { + LogicWorkflowRunActionRequestHistoryResource.ValidateResourceId(id); + return new LogicWorkflowRunActionRequestHistoryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountResource GetIntegrationAccountResource(ResourceIdentifier id) + { + IntegrationAccountResource.ValidateResourceId(id); + return new IntegrationAccountResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountAssemblyDefinitionResource GetIntegrationAccountAssemblyDefinitionResource(ResourceIdentifier id) + { + IntegrationAccountAssemblyDefinitionResource.ValidateResourceId(id); + return new IntegrationAccountAssemblyDefinitionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountBatchConfigurationResource GetIntegrationAccountBatchConfigurationResource(ResourceIdentifier id) + { + IntegrationAccountBatchConfigurationResource.ValidateResourceId(id); + return new IntegrationAccountBatchConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountSchemaResource GetIntegrationAccountSchemaResource(ResourceIdentifier id) + { + IntegrationAccountSchemaResource.ValidateResourceId(id); + return new IntegrationAccountSchemaResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountMapResource GetIntegrationAccountMapResource(ResourceIdentifier id) + { + IntegrationAccountMapResource.ValidateResourceId(id); + return new IntegrationAccountMapResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountPartnerResource GetIntegrationAccountPartnerResource(ResourceIdentifier id) + { + IntegrationAccountPartnerResource.ValidateResourceId(id); + return new IntegrationAccountPartnerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountAgreementResource GetIntegrationAccountAgreementResource(ResourceIdentifier id) + { + IntegrationAccountAgreementResource.ValidateResourceId(id); + return new IntegrationAccountAgreementResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountCertificateResource GetIntegrationAccountCertificateResource(ResourceIdentifier id) + { + IntegrationAccountCertificateResource.ValidateResourceId(id); + return new IntegrationAccountCertificateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationAccountSessionResource GetIntegrationAccountSessionResource(ResourceIdentifier id) + { + IntegrationAccountSessionResource.ValidateResourceId(id); + return new IntegrationAccountSessionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationServiceEnvironmentResource GetIntegrationServiceEnvironmentResource(ResourceIdentifier id) + { + IntegrationServiceEnvironmentResource.ValidateResourceId(id); + return new IntegrationServiceEnvironmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IntegrationServiceEnvironmentManagedApiResource GetIntegrationServiceEnvironmentManagedApiResource(ResourceIdentifier id) + { + IntegrationServiceEnvironmentManagedApiResource.ValidateResourceId(id); + return new IntegrationServiceEnvironmentManagedApiResource(Client, id); + } + } +} diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicExtensions.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicExtensions.cs index 0cba29b50914..10df25e5db9c 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicExtensions.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Logic.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Logic @@ -18,461 +19,385 @@ namespace Azure.ResourceManager.Logic /// A class to add extension methods to Azure.ResourceManager.Logic. public static partial class LogicExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static LogicArmClientMockingExtension GetLogicArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new LogicArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static LogicResourceGroupMockingExtension GetLogicResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new LogicResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static LogicSubscriptionMockingExtension GetLogicSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new LogicSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region LogicWorkflowResource /// /// 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. /// Returns a object. public static LogicWorkflowResource GetLogicWorkflowResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowResource.ValidateResourceId(id); - return new LogicWorkflowResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowResource(id); } - #endregion - #region LogicWorkflowVersionResource /// /// 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. /// Returns a object. public static LogicWorkflowVersionResource GetLogicWorkflowVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowVersionResource.ValidateResourceId(id); - return new LogicWorkflowVersionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowVersionResource(id); } - #endregion - #region LogicWorkflowTriggerResource /// /// 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. /// Returns a object. public static LogicWorkflowTriggerResource GetLogicWorkflowTriggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowTriggerResource.ValidateResourceId(id); - return new LogicWorkflowTriggerResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowTriggerResource(id); } - #endregion - #region LogicWorkflowTriggerHistoryResource /// /// 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. /// Returns a object. public static LogicWorkflowTriggerHistoryResource GetLogicWorkflowTriggerHistoryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowTriggerHistoryResource.ValidateResourceId(id); - return new LogicWorkflowTriggerHistoryResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowTriggerHistoryResource(id); } - #endregion - #region LogicWorkflowRunResource /// /// 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. /// Returns a object. public static LogicWorkflowRunResource GetLogicWorkflowRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunResource.ValidateResourceId(id); - return new LogicWorkflowRunResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunResource(id); } - #endregion - #region LogicWorkflowRunOperationResource /// /// 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. /// Returns a object. public static LogicWorkflowRunOperationResource GetLogicWorkflowRunOperationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunOperationResource.ValidateResourceId(id); - return new LogicWorkflowRunOperationResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunOperationResource(id); } - #endregion - #region LogicWorkflowRunActionResource /// /// 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. /// Returns a object. public static LogicWorkflowRunActionResource GetLogicWorkflowRunActionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunActionResource.ValidateResourceId(id); - return new LogicWorkflowRunActionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunActionResource(id); } - #endregion - #region LogicWorkflowRunActionRepetitionResource /// /// 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. /// Returns a object. public static LogicWorkflowRunActionRepetitionResource GetLogicWorkflowRunActionRepetitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunActionRepetitionResource.ValidateResourceId(id); - return new LogicWorkflowRunActionRepetitionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunActionRepetitionResource(id); } - #endregion - #region LogicWorkflowRunActionScopeRepetitionResource /// /// 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. /// Returns a object. public static LogicWorkflowRunActionScopeRepetitionResource GetLogicWorkflowRunActionScopeRepetitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunActionScopeRepetitionResource.ValidateResourceId(id); - return new LogicWorkflowRunActionScopeRepetitionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunActionScopeRepetitionResource(id); } - #endregion - #region LogicWorkflowRunActionRepetitionRequestHistoryResource /// /// 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. /// Returns a object. public static LogicWorkflowRunActionRepetitionRequestHistoryResource GetLogicWorkflowRunActionRepetitionRequestHistoryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunActionRepetitionRequestHistoryResource.ValidateResourceId(id); - return new LogicWorkflowRunActionRepetitionRequestHistoryResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunActionRepetitionRequestHistoryResource(id); } - #endregion - #region LogicWorkflowRunActionRequestHistoryResource /// /// 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. /// Returns a object. public static LogicWorkflowRunActionRequestHistoryResource GetLogicWorkflowRunActionRequestHistoryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicWorkflowRunActionRequestHistoryResource.ValidateResourceId(id); - return new LogicWorkflowRunActionRequestHistoryResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetLogicWorkflowRunActionRequestHistoryResource(id); } - #endregion - #region IntegrationAccountResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountResource GetIntegrationAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountResource.ValidateResourceId(id); - return new IntegrationAccountResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountResource(id); } - #endregion - #region IntegrationAccountAssemblyDefinitionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountAssemblyDefinitionResource GetIntegrationAccountAssemblyDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountAssemblyDefinitionResource.ValidateResourceId(id); - return new IntegrationAccountAssemblyDefinitionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountAssemblyDefinitionResource(id); } - #endregion - #region IntegrationAccountBatchConfigurationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountBatchConfigurationResource GetIntegrationAccountBatchConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountBatchConfigurationResource.ValidateResourceId(id); - return new IntegrationAccountBatchConfigurationResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountBatchConfigurationResource(id); } - #endregion - #region IntegrationAccountSchemaResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountSchemaResource GetIntegrationAccountSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountSchemaResource.ValidateResourceId(id); - return new IntegrationAccountSchemaResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountSchemaResource(id); } - #endregion - #region IntegrationAccountMapResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountMapResource GetIntegrationAccountMapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountMapResource.ValidateResourceId(id); - return new IntegrationAccountMapResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountMapResource(id); } - #endregion - #region IntegrationAccountPartnerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountPartnerResource GetIntegrationAccountPartnerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountPartnerResource.ValidateResourceId(id); - return new IntegrationAccountPartnerResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountPartnerResource(id); } - #endregion - #region IntegrationAccountAgreementResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountAgreementResource GetIntegrationAccountAgreementResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountAgreementResource.ValidateResourceId(id); - return new IntegrationAccountAgreementResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountAgreementResource(id); } - #endregion - #region IntegrationAccountCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountCertificateResource GetIntegrationAccountCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountCertificateResource.ValidateResourceId(id); - return new IntegrationAccountCertificateResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountCertificateResource(id); } - #endregion - #region IntegrationAccountSessionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationAccountSessionResource GetIntegrationAccountSessionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationAccountSessionResource.ValidateResourceId(id); - return new IntegrationAccountSessionResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationAccountSessionResource(id); } - #endregion - #region IntegrationServiceEnvironmentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationServiceEnvironmentResource GetIntegrationServiceEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationServiceEnvironmentResource.ValidateResourceId(id); - return new IntegrationServiceEnvironmentResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationServiceEnvironmentResource(id); } - #endregion - #region IntegrationServiceEnvironmentManagedApiResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IntegrationServiceEnvironmentManagedApiResource GetIntegrationServiceEnvironmentManagedApiResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IntegrationServiceEnvironmentManagedApiResource.ValidateResourceId(id); - return new IntegrationServiceEnvironmentManagedApiResource(client, id); - } - ); + return GetLogicArmClientMockingExtension(client).GetIntegrationServiceEnvironmentManagedApiResource(id); } - #endregion - /// Gets a collection of LogicWorkflowResources in the ResourceGroupResource. + /// + /// Gets a collection of LogicWorkflowResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LogicWorkflowResources and their operations over a LogicWorkflowResource. public static LogicWorkflowCollection GetLogicWorkflows(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLogicWorkflows(); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetLogicWorkflows(); } /// @@ -487,16 +412,20 @@ public static LogicWorkflowCollection GetLogicWorkflows(this ResourceGroupResour /// Workflows_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workflow name. /// The cancellation token to use. - /// 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 static async Task> GetLogicWorkflowAsync(this ResourceGroupResource resourceGroupResource, string workflowName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLogicWorkflows().GetAsync(workflowName, cancellationToken).ConfigureAwait(false); + return await GetLogicResourceGroupMockingExtension(resourceGroupResource).GetLogicWorkflowAsync(workflowName, cancellationToken).ConfigureAwait(false); } /// @@ -511,24 +440,34 @@ public static async Task> GetLogicWorkflowAsync( /// Workflows_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workflow name. /// The cancellation token to use. - /// 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 static Response GetLogicWorkflow(this ResourceGroupResource resourceGroupResource, string workflowName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLogicWorkflows().Get(workflowName, cancellationToken); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetLogicWorkflow(workflowName, cancellationToken); } - /// Gets a collection of IntegrationAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of IntegrationAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IntegrationAccountResources and their operations over a IntegrationAccountResource. public static IntegrationAccountCollection GetIntegrationAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIntegrationAccounts(); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationAccounts(); } /// @@ -543,16 +482,20 @@ public static IntegrationAccountCollection GetIntegrationAccounts(this ResourceG /// IntegrationAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The integration account name. /// The cancellation token to use. - /// 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 static async Task> GetIntegrationAccountAsync(this ResourceGroupResource resourceGroupResource, string integrationAccountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIntegrationAccounts().GetAsync(integrationAccountName, cancellationToken).ConfigureAwait(false); + return await GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationAccountAsync(integrationAccountName, cancellationToken).ConfigureAwait(false); } /// @@ -567,24 +510,34 @@ public static async Task> GetIntegrationAcc /// IntegrationAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The integration account name. /// The cancellation token to use. - /// 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 static Response GetIntegrationAccount(this ResourceGroupResource resourceGroupResource, string integrationAccountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIntegrationAccounts().Get(integrationAccountName, cancellationToken); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationAccount(integrationAccountName, cancellationToken); } - /// Gets a collection of IntegrationServiceEnvironmentResources in the ResourceGroupResource. + /// + /// Gets a collection of IntegrationServiceEnvironmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IntegrationServiceEnvironmentResources and their operations over a IntegrationServiceEnvironmentResource. public static IntegrationServiceEnvironmentCollection GetIntegrationServiceEnvironments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIntegrationServiceEnvironments(); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationServiceEnvironments(); } /// @@ -599,16 +552,20 @@ public static IntegrationServiceEnvironmentCollection GetIntegrationServiceEnvir /// IntegrationServiceEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The integration service environment name. /// The cancellation token to use. - /// 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 static async Task> GetIntegrationServiceEnvironmentAsync(this ResourceGroupResource resourceGroupResource, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIntegrationServiceEnvironments().GetAsync(integrationServiceEnvironmentName, cancellationToken).ConfigureAwait(false); + return await GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationServiceEnvironmentAsync(integrationServiceEnvironmentName, cancellationToken).ConfigureAwait(false); } /// @@ -623,16 +580,20 @@ public static async Task> GetInt /// IntegrationServiceEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The integration service environment name. /// The cancellation token to use. - /// 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 static Response GetIntegrationServiceEnvironment(this ResourceGroupResource resourceGroupResource, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIntegrationServiceEnvironments().Get(integrationServiceEnvironmentName, cancellationToken); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).GetIntegrationServiceEnvironment(integrationServiceEnvironmentName, cancellationToken); } /// @@ -647,6 +608,10 @@ public static Response GetIntegrationServ /// Workflows_ValidateByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workflow location. @@ -657,10 +622,7 @@ public static Response GetIntegrationServ /// or is null. public static async Task ValidateByLocationWorkflowAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateByLocationWorkflowAsync(location, workflowName, data, cancellationToken).ConfigureAwait(false); + return await GetLogicResourceGroupMockingExtension(resourceGroupResource).ValidateByLocationWorkflowAsync(location, workflowName, data, cancellationToken).ConfigureAwait(false); } /// @@ -675,6 +637,10 @@ public static async Task ValidateByLocationWorkflowAsync(this Resource /// Workflows_ValidateByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workflow location. @@ -685,10 +651,7 @@ public static async Task ValidateByLocationWorkflowAsync(this Resource /// or is null. public static Response ValidateByLocationWorkflow(this ResourceGroupResource resourceGroupResource, AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateByLocationWorkflow(location, workflowName, data, cancellationToken); + return GetLogicResourceGroupMockingExtension(resourceGroupResource).ValidateByLocationWorkflow(location, workflowName, data, cancellationToken); } /// @@ -703,6 +666,10 @@ public static Response ValidateByLocationWorkflow(this ResourceGroupResource res /// Workflows_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -711,7 +678,7 @@ public static Response ValidateByLocationWorkflow(this ResourceGroupResource res /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLogicWorkflowsAsync(this SubscriptionResource subscriptionResource, int? top = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLogicWorkflowsAsync(top, filter, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetLogicWorkflowsAsync(top, filter, cancellationToken); } /// @@ -726,6 +693,10 @@ public static AsyncPageable GetLogicWorkflowsAsync(this S /// Workflows_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -734,7 +705,7 @@ public static AsyncPageable GetLogicWorkflowsAsync(this S /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLogicWorkflows(this SubscriptionResource subscriptionResource, int? top = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLogicWorkflows(top, filter, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetLogicWorkflows(top, filter, cancellationToken); } /// @@ -749,6 +720,10 @@ public static Pageable GetLogicWorkflows(this Subscriptio /// IntegrationAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -756,7 +731,7 @@ public static Pageable GetLogicWorkflows(this Subscriptio /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIntegrationAccountsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIntegrationAccountsAsync(top, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetIntegrationAccountsAsync(top, cancellationToken); } /// @@ -771,6 +746,10 @@ public static AsyncPageable GetIntegrationAccountsAs /// IntegrationAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -778,7 +757,7 @@ public static AsyncPageable GetIntegrationAccountsAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIntegrationAccounts(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIntegrationAccounts(top, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetIntegrationAccounts(top, cancellationToken); } /// @@ -793,6 +772,10 @@ public static Pageable GetIntegrationAccounts(this S /// IntegrationServiceEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -800,7 +783,7 @@ public static Pageable GetIntegrationAccounts(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIntegrationServiceEnvironmentsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIntegrationServiceEnvironmentsAsync(top, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetIntegrationServiceEnvironmentsAsync(top, cancellationToken); } /// @@ -815,6 +798,10 @@ public static AsyncPageable GetIntegratio /// IntegrationServiceEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of items to be included in the result. @@ -822,7 +809,7 @@ public static AsyncPageable GetIntegratio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIntegrationServiceEnvironments(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIntegrationServiceEnvironments(top, cancellationToken); + return GetLogicSubscriptionMockingExtension(subscriptionResource).GetIntegrationServiceEnvironments(top, cancellationToken); } } } diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicResourceGroupMockingExtension.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..dc5e8bb4025f --- /dev/null +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicResourceGroupMockingExtension.cs @@ -0,0 +1,281 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Logic; + +namespace Azure.ResourceManager.Logic.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class LogicResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _logicWorkflowWorkflowsClientDiagnostics; + private WorkflowsRestOperations _logicWorkflowWorkflowsRestClient; + + /// Initializes a new instance of the class for mocking. + protected LogicResourceGroupMockingExtension() + { + } + + /// 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 LogicResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics LogicWorkflowWorkflowsClientDiagnostics => _logicWorkflowWorkflowsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Logic", LogicWorkflowResource.ResourceType.Namespace, Diagnostics); + private WorkflowsRestOperations LogicWorkflowWorkflowsRestClient => _logicWorkflowWorkflowsRestClient ??= new WorkflowsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(LogicWorkflowResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of LogicWorkflowResources in the ResourceGroupResource. + /// An object representing collection of LogicWorkflowResources and their operations over a LogicWorkflowResource. + public virtual LogicWorkflowCollection GetLogicWorkflows() + { + return GetCachedClient(client => new LogicWorkflowCollection(client, Id)); + } + + /// + /// Gets a workflow. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName} + /// + /// + /// Operation Id + /// Workflows_Get + /// + /// + /// + /// The workflow name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLogicWorkflowAsync(string workflowName, CancellationToken cancellationToken = default) + { + return await GetLogicWorkflows().GetAsync(workflowName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a workflow. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName} + /// + /// + /// Operation Id + /// Workflows_Get + /// + /// + /// + /// The workflow name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLogicWorkflow(string workflowName, CancellationToken cancellationToken = default) + { + return GetLogicWorkflows().Get(workflowName, cancellationToken); + } + + /// Gets a collection of IntegrationAccountResources in the ResourceGroupResource. + /// An object representing collection of IntegrationAccountResources and their operations over a IntegrationAccountResource. + public virtual IntegrationAccountCollection GetIntegrationAccounts() + { + return GetCachedClient(client => new IntegrationAccountCollection(client, Id)); + } + + /// + /// Gets an integration account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName} + /// + /// + /// Operation Id + /// IntegrationAccounts_Get + /// + /// + /// + /// The integration account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIntegrationAccountAsync(string integrationAccountName, CancellationToken cancellationToken = default) + { + return await GetIntegrationAccounts().GetAsync(integrationAccountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an integration account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName} + /// + /// + /// Operation Id + /// IntegrationAccounts_Get + /// + /// + /// + /// The integration account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIntegrationAccount(string integrationAccountName, CancellationToken cancellationToken = default) + { + return GetIntegrationAccounts().Get(integrationAccountName, cancellationToken); + } + + /// Gets a collection of IntegrationServiceEnvironmentResources in the ResourceGroupResource. + /// An object representing collection of IntegrationServiceEnvironmentResources and their operations over a IntegrationServiceEnvironmentResource. + public virtual IntegrationServiceEnvironmentCollection GetIntegrationServiceEnvironments() + { + return GetCachedClient(client => new IntegrationServiceEnvironmentCollection(client, Id)); + } + + /// + /// Gets an integration service environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName} + /// + /// + /// Operation Id + /// IntegrationServiceEnvironments_Get + /// + /// + /// + /// The integration service environment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIntegrationServiceEnvironmentAsync(string integrationServiceEnvironmentName, CancellationToken cancellationToken = default) + { + return await GetIntegrationServiceEnvironments().GetAsync(integrationServiceEnvironmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an integration service environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName} + /// + /// + /// Operation Id + /// IntegrationServiceEnvironments_Get + /// + /// + /// + /// The integration service environment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIntegrationServiceEnvironment(string integrationServiceEnvironmentName, CancellationToken cancellationToken = default) + { + return GetIntegrationServiceEnvironments().Get(integrationServiceEnvironmentName, cancellationToken); + } + + /// + /// Validates the workflow definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate + /// + /// + /// Operation Id + /// Workflows_ValidateByLocation + /// + /// + /// + /// The workflow location. + /// The workflow name. + /// The workflow. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task ValidateByLocationWorkflowAsync(AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = LogicWorkflowWorkflowsClientDiagnostics.CreateScope("LogicResourceGroupMockingExtension.ValidateByLocationWorkflow"); + scope.Start(); + try + { + var response = await LogicWorkflowWorkflowsRestClient.ValidateByLocationAsync(Id.SubscriptionId, Id.ResourceGroupName, location, workflowName, data, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Validates the workflow definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate + /// + /// + /// Operation Id + /// Workflows_ValidateByLocation + /// + /// + /// + /// The workflow location. + /// The workflow name. + /// The workflow. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response ValidateByLocationWorkflow(AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = LogicWorkflowWorkflowsClientDiagnostics.CreateScope("LogicResourceGroupMockingExtension.ValidateByLocationWorkflow"); + scope.Start(); + try + { + var response = LogicWorkflowWorkflowsRestClient.ValidateByLocation(Id.SubscriptionId, Id.ResourceGroupName, location, workflowName, data, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicSubscriptionMockingExtension.cs similarity index 90% rename from sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicSubscriptionMockingExtension.cs index 3ede1c07a0e3..80ab519a666c 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/LogicSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Logic; -namespace Azure.ResourceManager.Logic +namespace Azure.ResourceManager.Logic.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class LogicSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _logicWorkflowWorkflowsClientDiagnostics; private WorkflowsRestOperations _logicWorkflowWorkflowsRestClient; @@ -24,15 +25,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _integrationServiceEnvironmentClientDiagnostics; private IntegrationServiceEnvironmentsRestOperations _integrationServiceEnvironmentRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected LogicSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal LogicSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,7 +71,7 @@ public virtual AsyncPageable GetLogicWorkflowsAsync(int? { HttpMessage FirstPageRequest(int? pageSizeHint) => LogicWorkflowWorkflowsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LogicWorkflowWorkflowsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LogicWorkflowResource(Client, LogicWorkflowData.DeserializeLogicWorkflowData(e)), LogicWorkflowWorkflowsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLogicWorkflows", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LogicWorkflowResource(Client, LogicWorkflowData.DeserializeLogicWorkflowData(e)), LogicWorkflowWorkflowsClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetLogicWorkflows", "value", "nextLink", cancellationToken); } /// @@ -94,7 +95,7 @@ public virtual Pageable GetLogicWorkflows(int? top = null { HttpMessage FirstPageRequest(int? pageSizeHint) => LogicWorkflowWorkflowsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LogicWorkflowWorkflowsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LogicWorkflowResource(Client, LogicWorkflowData.DeserializeLogicWorkflowData(e)), LogicWorkflowWorkflowsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLogicWorkflows", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LogicWorkflowResource(Client, LogicWorkflowData.DeserializeLogicWorkflowData(e)), LogicWorkflowWorkflowsClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetLogicWorkflows", "value", "nextLink", cancellationToken); } /// @@ -117,7 +118,7 @@ public virtual AsyncPageable GetIntegrationAccountsA { HttpMessage FirstPageRequest(int? pageSizeHint) => IntegrationAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IntegrationAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IntegrationAccountResource(Client, IntegrationAccountData.DeserializeIntegrationAccountData(e)), IntegrationAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIntegrationAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IntegrationAccountResource(Client, IntegrationAccountData.DeserializeIntegrationAccountData(e)), IntegrationAccountClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetIntegrationAccounts", "value", "nextLink", cancellationToken); } /// @@ -140,7 +141,7 @@ public virtual Pageable GetIntegrationAccounts(int? { HttpMessage FirstPageRequest(int? pageSizeHint) => IntegrationAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IntegrationAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IntegrationAccountResource(Client, IntegrationAccountData.DeserializeIntegrationAccountData(e)), IntegrationAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIntegrationAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IntegrationAccountResource(Client, IntegrationAccountData.DeserializeIntegrationAccountData(e)), IntegrationAccountClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetIntegrationAccounts", "value", "nextLink", cancellationToken); } /// @@ -163,7 +164,7 @@ public virtual AsyncPageable GetIntegrati { HttpMessage FirstPageRequest(int? pageSizeHint) => IntegrationServiceEnvironmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IntegrationServiceEnvironmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IntegrationServiceEnvironmentResource(Client, IntegrationServiceEnvironmentData.DeserializeIntegrationServiceEnvironmentData(e)), IntegrationServiceEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIntegrationServiceEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IntegrationServiceEnvironmentResource(Client, IntegrationServiceEnvironmentData.DeserializeIntegrationServiceEnvironmentData(e)), IntegrationServiceEnvironmentClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetIntegrationServiceEnvironments", "value", "nextLink", cancellationToken); } /// @@ -186,7 +187,7 @@ public virtual Pageable GetIntegrationSer { HttpMessage FirstPageRequest(int? pageSizeHint) => IntegrationServiceEnvironmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IntegrationServiceEnvironmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IntegrationServiceEnvironmentResource(Client, IntegrationServiceEnvironmentData.DeserializeIntegrationServiceEnvironmentData(e)), IntegrationServiceEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIntegrationServiceEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IntegrationServiceEnvironmentResource(Client, IntegrationServiceEnvironmentData.DeserializeIntegrationServiceEnvironmentData(e)), IntegrationServiceEnvironmentClientDiagnostics, Pipeline, "LogicSubscriptionMockingExtension.GetIntegrationServiceEnvironments", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index fb807d1271c5..000000000000 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,132 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Logic -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _logicWorkflowWorkflowsClientDiagnostics; - private WorkflowsRestOperations _logicWorkflowWorkflowsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics LogicWorkflowWorkflowsClientDiagnostics => _logicWorkflowWorkflowsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Logic", LogicWorkflowResource.ResourceType.Namespace, Diagnostics); - private WorkflowsRestOperations LogicWorkflowWorkflowsRestClient => _logicWorkflowWorkflowsRestClient ??= new WorkflowsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(LogicWorkflowResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LogicWorkflowResources in the ResourceGroupResource. - /// An object representing collection of LogicWorkflowResources and their operations over a LogicWorkflowResource. - public virtual LogicWorkflowCollection GetLogicWorkflows() - { - return GetCachedClient(Client => new LogicWorkflowCollection(Client, Id)); - } - - /// Gets a collection of IntegrationAccountResources in the ResourceGroupResource. - /// An object representing collection of IntegrationAccountResources and their operations over a IntegrationAccountResource. - public virtual IntegrationAccountCollection GetIntegrationAccounts() - { - return GetCachedClient(Client => new IntegrationAccountCollection(Client, Id)); - } - - /// Gets a collection of IntegrationServiceEnvironmentResources in the ResourceGroupResource. - /// An object representing collection of IntegrationServiceEnvironmentResources and their operations over a IntegrationServiceEnvironmentResource. - public virtual IntegrationServiceEnvironmentCollection GetIntegrationServiceEnvironments() - { - return GetCachedClient(Client => new IntegrationServiceEnvironmentCollection(Client, Id)); - } - - /// - /// Validates the workflow definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate - /// - /// - /// Operation Id - /// Workflows_ValidateByLocation - /// - /// - /// - /// The workflow location. - /// The workflow name. - /// The workflow. - /// The cancellation token to use. - public virtual async Task ValidateByLocationWorkflowAsync(AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) - { - using var scope = LogicWorkflowWorkflowsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateByLocationWorkflow"); - scope.Start(); - try - { - var response = await LogicWorkflowWorkflowsRestClient.ValidateByLocationAsync(Id.SubscriptionId, Id.ResourceGroupName, location, workflowName, data, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Validates the workflow definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate - /// - /// - /// Operation Id - /// Workflows_ValidateByLocation - /// - /// - /// - /// The workflow location. - /// The workflow name. - /// The workflow. - /// The cancellation token to use. - public virtual Response ValidateByLocationWorkflow(AzureLocation location, string workflowName, LogicWorkflowData data, CancellationToken cancellationToken = default) - { - using var scope = LogicWorkflowWorkflowsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateByLocationWorkflow"); - scope.Start(); - try - { - var response = LogicWorkflowWorkflowsRestClient.ValidateByLocation(Id.SubscriptionId, Id.ResourceGroupName, location, workflowName, data, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationAccountResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationAccountResource.cs index b0caf6fb20b9..e74b9c5c53ef 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationAccountResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationAccountResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of IntegrationAccountAssemblyDefinitionResources and their operations over a IntegrationAccountAssemblyDefinitionResource. public virtual IntegrationAccountAssemblyDefinitionCollection GetIntegrationAccountAssemblyDefinitions() { - return GetCachedClient(Client => new IntegrationAccountAssemblyDefinitionCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountAssemblyDefinitionCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual IntegrationAccountAssemblyDefinitionCollection GetIntegrationAcco /// /// The assembly artifact name. /// The cancellation token to use. - /// 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> GetIntegrationAccountAssemblyDefinitionAsync(string assemblyArtifactName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task /// /// The assembly artifact name. /// The cancellation token to use. - /// 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 GetIntegrationAccountAssemblyDefinition(string assemblyArtifactName, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetIntegra /// An object representing collection of IntegrationAccountBatchConfigurationResources and their operations over a IntegrationAccountBatchConfigurationResource. public virtual IntegrationAccountBatchConfigurationCollection GetIntegrationAccountBatchConfigurations() { - return GetCachedClient(Client => new IntegrationAccountBatchConfigurationCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountBatchConfigurationCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual IntegrationAccountBatchConfigurationCollection GetIntegrationAcco /// /// The batch configuration name. /// The cancellation token to use. - /// 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> GetIntegrationAccountBatchConfigurationAsync(string batchConfigurationName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task /// /// The batch configuration name. /// The cancellation token to use. - /// 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 GetIntegrationAccountBatchConfiguration(string batchConfigurationName, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetIntegra /// An object representing collection of IntegrationAccountSchemaResources and their operations over a IntegrationAccountSchemaResource. public virtual IntegrationAccountSchemaCollection GetIntegrationAccountSchemas() { - return GetCachedClient(Client => new IntegrationAccountSchemaCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountSchemaCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual IntegrationAccountSchemaCollection GetIntegrationAccountSchemas() /// /// The integration account schema name. /// The cancellation token to use. - /// 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> GetIntegrationAccountSchemaAsync(string schemaName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetIntegra /// /// The integration account schema name. /// The cancellation token to use. - /// 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 GetIntegrationAccountSchema(string schemaName, CancellationToken cancellationToken = default) { @@ -253,7 +253,7 @@ public virtual Response GetIntegrationAccountS /// An object representing collection of IntegrationAccountMapResources and their operations over a IntegrationAccountMapResource. public virtual IntegrationAccountMapCollection GetIntegrationAccountMaps() { - return GetCachedClient(Client => new IntegrationAccountMapCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountMapCollection(client, Id)); } /// @@ -271,8 +271,8 @@ public virtual IntegrationAccountMapCollection GetIntegrationAccountMaps() /// /// The integration account map name. /// The cancellation token to use. - /// 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> GetIntegrationAccountMapAsync(string mapName, CancellationToken cancellationToken = default) { @@ -294,8 +294,8 @@ public virtual async Task> GetIntegratio /// /// The integration account map name. /// The cancellation token to use. - /// 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 GetIntegrationAccountMap(string mapName, CancellationToken cancellationToken = default) { @@ -306,7 +306,7 @@ public virtual Response GetIntegrationAccountMap( /// An object representing collection of IntegrationAccountPartnerResources and their operations over a IntegrationAccountPartnerResource. public virtual IntegrationAccountPartnerCollection GetIntegrationAccountPartners() { - return GetCachedClient(Client => new IntegrationAccountPartnerCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountPartnerCollection(client, Id)); } /// @@ -324,8 +324,8 @@ public virtual IntegrationAccountPartnerCollection GetIntegrationAccountPartners /// /// The integration account partner name. /// The cancellation token to use. - /// 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> GetIntegrationAccountPartnerAsync(string partnerName, CancellationToken cancellationToken = default) { @@ -347,8 +347,8 @@ public virtual async Task> GetIntegr /// /// The integration account partner name. /// The cancellation token to use. - /// 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 GetIntegrationAccountPartner(string partnerName, CancellationToken cancellationToken = default) { @@ -359,7 +359,7 @@ public virtual Response GetIntegrationAccount /// An object representing collection of IntegrationAccountAgreementResources and their operations over a IntegrationAccountAgreementResource. public virtual IntegrationAccountAgreementCollection GetIntegrationAccountAgreements() { - return GetCachedClient(Client => new IntegrationAccountAgreementCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountAgreementCollection(client, Id)); } /// @@ -377,8 +377,8 @@ public virtual IntegrationAccountAgreementCollection GetIntegrationAccountAgreem /// /// The integration account agreement name. /// The cancellation token to use. - /// 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> GetIntegrationAccountAgreementAsync(string agreementName, CancellationToken cancellationToken = default) { @@ -400,8 +400,8 @@ public virtual async Task> GetInte /// /// The integration account agreement name. /// The cancellation token to use. - /// 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 GetIntegrationAccountAgreement(string agreementName, CancellationToken cancellationToken = default) { @@ -412,7 +412,7 @@ public virtual Response GetIntegrationAccou /// An object representing collection of IntegrationAccountCertificateResources and their operations over a IntegrationAccountCertificateResource. public virtual IntegrationAccountCertificateCollection GetIntegrationAccountCertificates() { - return GetCachedClient(Client => new IntegrationAccountCertificateCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountCertificateCollection(client, Id)); } /// @@ -430,8 +430,8 @@ public virtual IntegrationAccountCertificateCollection GetIntegrationAccountCert /// /// The integration account certificate name. /// The cancellation token to use. - /// 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> GetIntegrationAccountCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -453,8 +453,8 @@ public virtual async Task> GetIn /// /// The integration account certificate name. /// The cancellation token to use. - /// 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 GetIntegrationAccountCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -465,7 +465,7 @@ public virtual Response GetIntegrationAcc /// An object representing collection of IntegrationAccountSessionResources and their operations over a IntegrationAccountSessionResource. public virtual IntegrationAccountSessionCollection GetIntegrationAccountSessions() { - return GetCachedClient(Client => new IntegrationAccountSessionCollection(Client, Id)); + return GetCachedClient(client => new IntegrationAccountSessionCollection(client, Id)); } /// @@ -483,8 +483,8 @@ public virtual IntegrationAccountSessionCollection GetIntegrationAccountSessions /// /// The integration account session name. /// The cancellation token to use. - /// 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> GetIntegrationAccountSessionAsync(string sessionName, CancellationToken cancellationToken = default) { @@ -506,8 +506,8 @@ public virtual async Task> GetIntegr /// /// The integration account session name. /// The cancellation token to use. - /// 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 GetIntegrationAccountSession(string sessionName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationServiceEnvironmentResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationServiceEnvironmentResource.cs index 6fe72b8faab5..75dc650d5504 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationServiceEnvironmentResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/IntegrationServiceEnvironmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of IntegrationServiceEnvironmentManagedApiResources and their operations over a IntegrationServiceEnvironmentManagedApiResource. public virtual IntegrationServiceEnvironmentManagedApiCollection GetIntegrationServiceEnvironmentManagedApis() { - return GetCachedClient(Client => new IntegrationServiceEnvironmentManagedApiCollection(Client, Id)); + return GetCachedClient(client => new IntegrationServiceEnvironmentManagedApiCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual IntegrationServiceEnvironmentManagedApiCollection GetIntegrationS /// /// The api name. /// The cancellation token to use. - /// 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> GetIntegrationServiceEnvironmentManagedApiAsync(string apiName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task /// The api name. /// The cancellation token to use. - /// 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 GetIntegrationServiceEnvironmentManagedApi(string apiName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowResource.cs index 41171e189ddd..4c73ca634ddd 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogicWorkflowVersionResources and their operations over a LogicWorkflowVersionResource. public virtual LogicWorkflowVersionCollection GetLogicWorkflowVersions() { - return GetCachedClient(Client => new LogicWorkflowVersionCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowVersionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual LogicWorkflowVersionCollection GetLogicWorkflowVersions() /// /// The workflow versionId. /// The cancellation token to use. - /// 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> GetLogicWorkflowVersionAsync(string versionId, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetLogicWorkfl /// /// The workflow versionId. /// The cancellation token to use. - /// 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 GetLogicWorkflowVersion(string versionId, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetLogicWorkflowVersion(st /// An object representing collection of LogicWorkflowTriggerResources and their operations over a LogicWorkflowTriggerResource. public virtual LogicWorkflowTriggerCollection GetLogicWorkflowTriggers() { - return GetCachedClient(Client => new LogicWorkflowTriggerCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowTriggerCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual LogicWorkflowTriggerCollection GetLogicWorkflowTriggers() /// /// The workflow trigger name. /// The cancellation token to use. - /// 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> GetLogicWorkflowTriggerAsync(string triggerName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetLogicWorkfl /// /// The workflow trigger name. /// The cancellation token to use. - /// 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 GetLogicWorkflowTrigger(string triggerName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetLogicWorkflowTrigger(st /// An object representing collection of LogicWorkflowRunResources and their operations over a LogicWorkflowRunResource. public virtual LogicWorkflowRunCollection GetLogicWorkflowRuns() { - return GetCachedClient(Client => new LogicWorkflowRunCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual LogicWorkflowRunCollection GetLogicWorkflowRuns() /// /// The workflow run name. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunAsync(string runName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetLogicWorkflowRu /// /// The workflow run name. /// The cancellation token to use. - /// 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 GetLogicWorkflowRun(string runName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionRepetitionResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionRepetitionResource.cs index b7426a5a5e7f..606f49fe9bfb 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionRepetitionResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionRepetitionResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogicWorkflowRunActionRepetitionRequestHistoryResources and their operations over a LogicWorkflowRunActionRepetitionRequestHistoryResource. public virtual LogicWorkflowRunActionRepetitionRequestHistoryCollection GetLogicWorkflowRunActionRepetitionRequestHistories() { - return GetCachedClient(Client => new LogicWorkflowRunActionRepetitionRequestHistoryCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunActionRepetitionRequestHistoryCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual LogicWorkflowRunActionRepetitionRequestHistoryCollection GetLogic /// /// The request history name. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunActionRepetitionRequestHistoryAsync(string requestHistoryName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task /// The request history name. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunActionRepetitionRequestHistory(string requestHistoryName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionResource.cs index 936858a192c9..130833952e70 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunActionResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogicWorkflowRunActionRepetitionResources and their operations over a LogicWorkflowRunActionRepetitionResource. public virtual LogicWorkflowRunActionRepetitionCollection GetLogicWorkflowRunActionRepetitions() { - return GetCachedClient(Client => new LogicWorkflowRunActionRepetitionCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunActionRepetitionCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual LogicWorkflowRunActionRepetitionCollection GetLogicWorkflowRunAct /// /// The workflow repetition. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunActionRepetitionAsync(string repetitionName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Ge /// /// The workflow repetition. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunActionRepetition(string repetitionName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetLogicWorkfl /// An object representing collection of LogicWorkflowRunActionScopeRepetitionResources and their operations over a LogicWorkflowRunActionScopeRepetitionResource. public virtual LogicWorkflowRunActionScopeRepetitionCollection GetLogicWorkflowRunActionScopeRepetitions() { - return GetCachedClient(Client => new LogicWorkflowRunActionScopeRepetitionCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunActionScopeRepetitionCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual LogicWorkflowRunActionScopeRepetitionCollection GetLogicWorkflowR /// /// The workflow repetition. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunActionScopeRepetitionAsync(string repetitionName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task /// The workflow repetition. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunActionScopeRepetition(string repetitionName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetLogicW /// An object representing collection of LogicWorkflowRunActionRequestHistoryResources and their operations over a LogicWorkflowRunActionRequestHistoryResource. public virtual LogicWorkflowRunActionRequestHistoryCollection GetLogicWorkflowRunActionRequestHistories() { - return GetCachedClient(Client => new LogicWorkflowRunActionRequestHistoryCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunActionRequestHistoryCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual LogicWorkflowRunActionRequestHistoryCollection GetLogicWorkflowRu /// /// The request history name. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunActionRequestHistoryAsync(string requestHistoryName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task /// /// The request history name. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunActionRequestHistory(string requestHistoryName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunResource.cs index d23ea5681b49..cd442ec46f07 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowRunResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogicWorkflowRunOperationResources and their operations over a LogicWorkflowRunOperationResource. public virtual LogicWorkflowRunOperationCollection GetLogicWorkflowRunOperations() { - return GetCachedClient(Client => new LogicWorkflowRunOperationCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunOperationCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual LogicWorkflowRunOperationCollection GetLogicWorkflowRunOperations /// /// The workflow operation id. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunOperationAsync(string operationId, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetLogicW /// /// The workflow operation id. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunOperation(string operationId, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetLogicWorkflowRunOp /// An object representing collection of LogicWorkflowRunActionResources and their operations over a LogicWorkflowRunActionResource. public virtual LogicWorkflowRunActionCollection GetLogicWorkflowRunActions() { - return GetCachedClient(Client => new LogicWorkflowRunActionCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowRunActionCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual LogicWorkflowRunActionCollection GetLogicWorkflowRunActions() /// /// The workflow action name. /// The cancellation token to use. - /// 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> GetLogicWorkflowRunActionAsync(string actionName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> GetLogicWork /// /// The workflow action name. /// The cancellation token to use. - /// 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 GetLogicWorkflowRunAction(string actionName, CancellationToken cancellationToken = default) { diff --git a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowTriggerResource.cs b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowTriggerResource.cs index 60c4cb384743..fc7095a3a46e 100644 --- a/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowTriggerResource.cs +++ b/sdk/logic/Azure.ResourceManager.Logic/src/Generated/LogicWorkflowTriggerResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogicWorkflowTriggerHistoryResources and their operations over a LogicWorkflowTriggerHistoryResource. public virtual LogicWorkflowTriggerHistoryCollection GetLogicWorkflowTriggerHistories() { - return GetCachedClient(Client => new LogicWorkflowTriggerHistoryCollection(Client, Id)); + return GetCachedClient(client => new LogicWorkflowTriggerHistoryCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual LogicWorkflowTriggerHistoryCollection GetLogicWorkflowTriggerHist /// /// The workflow trigger history name. Corresponds to the run name for triggers that resulted in a run. /// The cancellation token to use. - /// 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> GetLogicWorkflowTriggerHistoryAsync(string historyName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetLogi /// /// The workflow trigger history name. Corresponds to the run name for triggers that resulted in a run. /// The cancellation token to use. - /// 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 GetLogicWorkflowTriggerHistory(string historyName, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeArmClientMockingExtension.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeArmClientMockingExtension.cs new file mode 100644 index 000000000000..215250ad1586 --- /dev/null +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearningCompute; + +namespace Azure.ResourceManager.MachineLearningCompute.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MachineLearningComputeArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MachineLearningComputeArmClientMockingExtension() + { + } + + /// 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 MachineLearningComputeArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MachineLearningComputeArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalizationClusterResource GetOperationalizationClusterResource(ResourceIdentifier id) + { + OperationalizationClusterResource.ValidateResourceId(id); + return new OperationalizationClusterResource(Client, id); + } + } +} diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeExtensions.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeExtensions.cs index ed8e98da8a4c..1945d762d260 100644 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeExtensions.cs +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearningCompute.Mocking; using Azure.ResourceManager.MachineLearningCompute.Models; using Azure.ResourceManager.Resources; @@ -19,78 +20,54 @@ namespace Azure.ResourceManager.MachineLearningCompute /// A class to add extension methods to Azure.ResourceManager.MachineLearningCompute. public static partial class MachineLearningComputeExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MachineLearningComputeArmClientMockingExtension GetMachineLearningComputeArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MachineLearningComputeArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MachineLearningComputeResourceGroupMockingExtension GetMachineLearningComputeResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MachineLearningComputeResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MachineLearningComputeSubscriptionMockingExtension GetMachineLearningComputeSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MachineLearningComputeSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MachineLearningComputeTenantMockingExtension GetMachineLearningComputeTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MachineLearningComputeTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region OperationalizationClusterResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalizationClusterResource GetOperationalizationClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalizationClusterResource.ValidateResourceId(id); - return new OperationalizationClusterResource(client, id); - } - ); + return GetMachineLearningComputeArmClientMockingExtension(client).GetOperationalizationClusterResource(id); } - #endregion - /// Gets a collection of OperationalizationClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of OperationalizationClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of OperationalizationClusterResources and their operations over a OperationalizationClusterResource. public static OperationalizationClusterCollection GetOperationalizationClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetOperationalizationClusters(); + return GetMachineLearningComputeResourceGroupMockingExtension(resourceGroupResource).GetOperationalizationClusters(); } /// @@ -105,16 +82,20 @@ public static OperationalizationClusterCollection GetOperationalizationClusters( /// OperationalizationClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetOperationalizationClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetOperationalizationClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningComputeResourceGroupMockingExtension(resourceGroupResource).GetOperationalizationClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -129,16 +110,20 @@ public static async Task> GetOperati /// OperationalizationClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetOperationalizationCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetOperationalizationClusters().Get(clusterName, cancellationToken); + return GetMachineLearningComputeResourceGroupMockingExtension(resourceGroupResource).GetOperationalizationCluster(clusterName, cancellationToken); } /// @@ -153,6 +138,10 @@ public static Response GetOperationalizationC /// OperationalizationClusters_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token for pagination. @@ -160,7 +149,7 @@ public static Response GetOperationalizationC /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationalizationClustersAsync(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalizationClustersAsync(skiptoken, cancellationToken); + return GetMachineLearningComputeSubscriptionMockingExtension(subscriptionResource).GetOperationalizationClustersAsync(skiptoken, cancellationToken); } /// @@ -175,6 +164,10 @@ public static AsyncPageable GetOperationaliza /// OperationalizationClusters_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token for pagination. @@ -182,7 +175,7 @@ public static AsyncPageable GetOperationaliza /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationalizationClusters(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalizationClusters(skiptoken, cancellationToken); + return GetMachineLearningComputeSubscriptionMockingExtension(subscriptionResource).GetOperationalizationClusters(skiptoken, cancellationToken); } /// @@ -197,13 +190,17 @@ public static Pageable GetOperationalizationC /// MachineLearningCompute_ListAvailableOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableOperationsMachineLearningComputesAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetAvailableOperationsMachineLearningComputesAsync(cancellationToken); + return GetMachineLearningComputeTenantMockingExtension(tenantResource).GetAvailableOperationsMachineLearningComputesAsync(cancellationToken); } /// @@ -218,13 +215,17 @@ public static AsyncPageable GetAvailableOperationsMachineLear /// MachineLearningCompute_ListAvailableOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableOperationsMachineLearningComputes(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetAvailableOperationsMachineLearningComputes(cancellationToken); + return GetMachineLearningComputeTenantMockingExtension(tenantResource).GetAvailableOperationsMachineLearningComputes(cancellationToken); } } } diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeResourceGroupMockingExtension.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..4a6a8dce16a0 --- /dev/null +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearningCompute; + +namespace Azure.ResourceManager.MachineLearningCompute.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MachineLearningComputeResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MachineLearningComputeResourceGroupMockingExtension() + { + } + + /// 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 MachineLearningComputeResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of OperationalizationClusterResources in the ResourceGroupResource. + /// An object representing collection of OperationalizationClusterResources and their operations over a OperationalizationClusterResource. + public virtual OperationalizationClusterCollection GetOperationalizationClusters() + { + return GetCachedClient(client => new OperationalizationClusterCollection(client, Id)); + } + + /// + /// Gets the operationalization cluster resource view. Note that the credentials are not returned by this call. Call ListKeys to get them. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName} + /// + /// + /// Operation Id + /// OperationalizationClusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOperationalizationClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetOperationalizationClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the operationalization cluster resource view. Note that the credentials are not returned by this call. Call ListKeys to get them. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningCompute/operationalizationClusters/{clusterName} + /// + /// + /// Operation Id + /// OperationalizationClusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOperationalizationCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetOperationalizationClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeSubscriptionMockingExtension.cs similarity index 85% rename from sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeSubscriptionMockingExtension.cs index 614fb6155eb2..5229978fe4b9 100644 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearningCompute; -namespace Azure.ResourceManager.MachineLearningCompute +namespace Azure.ResourceManager.MachineLearningCompute.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MachineLearningComputeSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _operationalizationClusterClientDiagnostics; private OperationalizationClustersRestOperations _operationalizationClusterRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MachineLearningComputeSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MachineLearningComputeSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ public virtual AsyncPageable GetOperationaliz { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalizationClusterRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationalizationClusterRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperationalizationClusterResource(Client, OperationalizationClusterData.DeserializeOperationalizationClusterData(e)), OperationalizationClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalizationClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperationalizationClusterResource(Client, OperationalizationClusterData.DeserializeOperationalizationClusterData(e)), OperationalizationClusterClientDiagnostics, Pipeline, "MachineLearningComputeSubscriptionMockingExtension.GetOperationalizationClusters", "value", "nextLink", cancellationToken); } /// @@ -84,7 +85,7 @@ public virtual Pageable GetOperationalization { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalizationClusterRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationalizationClusterRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperationalizationClusterResource(Client, OperationalizationClusterData.DeserializeOperationalizationClusterData(e)), OperationalizationClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalizationClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperationalizationClusterResource(Client, OperationalizationClusterData.DeserializeOperationalizationClusterData(e)), OperationalizationClusterClientDiagnostics, Pipeline, "MachineLearningComputeSubscriptionMockingExtension.GetOperationalizationClusters", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeTenantMockingExtension.cs similarity index 81% rename from sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeTenantMockingExtension.cs index 922eb80cace3..5316b4745146 100644 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/MachineLearningComputeTenantMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearningCompute; using Azure.ResourceManager.MachineLearningCompute.Models; -namespace Azure.ResourceManager.MachineLearningCompute +namespace Azure.ResourceManager.MachineLearningCompute.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class MachineLearningComputeTenantMockingExtension : ArmResource { private ClientDiagnostics _machineLearningComputeClientDiagnostics; private MachineLearningComputeRestOperations _machineLearningComputeRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MachineLearningComputeTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MachineLearningComputeTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetAvailableOperationsMachineLearningComputesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningComputeRestClient.CreateListAvailableOperationsRequest(); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ResourceOperation.DeserializeResourceOperation, MachineLearningComputeClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetAvailableOperationsMachineLearningComputes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ResourceOperation.DeserializeResourceOperation, MachineLearningComputeClientDiagnostics, Pipeline, "MachineLearningComputeTenantMockingExtension.GetAvailableOperationsMachineLearningComputes", "value", null, cancellationToken); } /// @@ -81,7 +82,7 @@ public virtual AsyncPageable GetAvailableOperationsMachineLea public virtual Pageable GetAvailableOperationsMachineLearningComputes(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningComputeRestClient.CreateListAvailableOperationsRequest(); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ResourceOperation.DeserializeResourceOperation, MachineLearningComputeClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetAvailableOperationsMachineLearningComputes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ResourceOperation.DeserializeResourceOperation, MachineLearningComputeClientDiagnostics, Pipeline, "MachineLearningComputeTenantMockingExtension.GetAvailableOperationsMachineLearningComputes", "value", null, cancellationToken); } } } diff --git a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6682e7421c8c..000000000000 --- a/sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MachineLearningCompute -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of OperationalizationClusterResources in the ResourceGroupResource. - /// An object representing collection of OperationalizationClusterResources and their operations over a OperationalizationClusterResource. - public virtual OperationalizationClusterCollection GetOperationalizationClusters() - { - return GetCachedClient(Client => new OperationalizationClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningArmClientMockingExtension.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningArmClientMockingExtension.cs new file mode 100644 index 000000000000..e015d97539d2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningArmClientMockingExtension.cs @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearning; + +namespace Azure.ResourceManager.MachineLearning.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MachineLearningArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MachineLearningArmClientMockingExtension() + { + } + + /// 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 MachineLearningArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MachineLearningArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineLearningComputeResource GetMachineLearningComputeResource(ResourceIdentifier id) + { + MachineLearningComputeResource.ValidateResourceId(id); + return new MachineLearningComputeResource(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 MachineLearningRegistryCodeContainerResource GetMachineLearningRegistryCodeContainerResource(ResourceIdentifier id) + { + MachineLearningRegistryCodeContainerResource.ValidateResourceId(id); + return new MachineLearningRegistryCodeContainerResource(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 MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(ResourceIdentifier id) + { + MachineLearningCodeContainerResource.ValidateResourceId(id); + return new MachineLearningCodeContainerResource(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 MachineLearningRegistryCodeVersionResource GetMachineLearningRegistryCodeVersionResource(ResourceIdentifier id) + { + MachineLearningRegistryCodeVersionResource.ValidateResourceId(id); + return new MachineLearningRegistryCodeVersionResource(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 MachineLearningCodeVersionResource GetMachineLearningCodeVersionResource(ResourceIdentifier id) + { + MachineLearningCodeVersionResource.ValidateResourceId(id); + return new MachineLearningCodeVersionResource(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 MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(ResourceIdentifier id) + { + MachineLearninRegistryComponentContainerResource.ValidateResourceId(id); + return new MachineLearninRegistryComponentContainerResource(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 MachineLearningComponentContainerResource GetMachineLearningComponentContainerResource(ResourceIdentifier id) + { + MachineLearningComponentContainerResource.ValidateResourceId(id); + return new MachineLearningComponentContainerResource(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 MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(ResourceIdentifier id) + { + MachineLearninRegistryComponentVersionResource.ValidateResourceId(id); + return new MachineLearninRegistryComponentVersionResource(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 MachineLearningComponentVersionResource GetMachineLearningComponentVersionResource(ResourceIdentifier id) + { + MachineLearningComponentVersionResource.ValidateResourceId(id); + return new MachineLearningComponentVersionResource(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 MachineLearningRegistryDataContainerResource GetMachineLearningRegistryDataContainerResource(ResourceIdentifier id) + { + MachineLearningRegistryDataContainerResource.ValidateResourceId(id); + return new MachineLearningRegistryDataContainerResource(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 MachineLearningDataContainerResource GetMachineLearningDataContainerResource(ResourceIdentifier id) + { + MachineLearningDataContainerResource.ValidateResourceId(id); + return new MachineLearningDataContainerResource(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 MachineLearningRegistryDataVersionResource GetMachineLearningRegistryDataVersionResource(ResourceIdentifier id) + { + MachineLearningRegistryDataVersionResource.ValidateResourceId(id); + return new MachineLearningRegistryDataVersionResource(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 MachineLearningDataVersionResource GetMachineLearningDataVersionResource(ResourceIdentifier id) + { + MachineLearningDataVersionResource.ValidateResourceId(id); + return new MachineLearningDataVersionResource(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 MachineLearningRegistryEnvironmentContainerResource GetMachineLearningRegistryEnvironmentContainerResource(ResourceIdentifier id) + { + MachineLearningRegistryEnvironmentContainerResource.ValidateResourceId(id); + return new MachineLearningRegistryEnvironmentContainerResource(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 MachineLearningEnvironmentContainerResource GetMachineLearningEnvironmentContainerResource(ResourceIdentifier id) + { + MachineLearningEnvironmentContainerResource.ValidateResourceId(id); + return new MachineLearningEnvironmentContainerResource(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 MachineLearningRegistryEnvironmentVersionResource GetMachineLearningRegistryEnvironmentVersionResource(ResourceIdentifier id) + { + MachineLearningRegistryEnvironmentVersionResource.ValidateResourceId(id); + return new MachineLearningRegistryEnvironmentVersionResource(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 MachineLearningEnvironmentVersionResource GetMachineLearningEnvironmentVersionResource(ResourceIdentifier id) + { + MachineLearningEnvironmentVersionResource.ValidateResourceId(id); + return new MachineLearningEnvironmentVersionResource(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 MachineLearningRegistryModelContainerResource GetMachineLearningRegistryModelContainerResource(ResourceIdentifier id) + { + MachineLearningRegistryModelContainerResource.ValidateResourceId(id); + return new MachineLearningRegistryModelContainerResource(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 MachineLearningModelContainerResource GetMachineLearningModelContainerResource(ResourceIdentifier id) + { + MachineLearningModelContainerResource.ValidateResourceId(id); + return new MachineLearningModelContainerResource(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 MachineLearningRegistryModelVersionResource GetMachineLearningRegistryModelVersionResource(ResourceIdentifier id) + { + MachineLearningRegistryModelVersionResource.ValidateResourceId(id); + return new MachineLearningRegistryModelVersionResource(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 MachineLearningModelVersionResource GetMachineLearningModelVersionResource(ResourceIdentifier id) + { + MachineLearningModelVersionResource.ValidateResourceId(id); + return new MachineLearningModelVersionResource(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 MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(ResourceIdentifier id) + { + MachineLearningBatchEndpointResource.ValidateResourceId(id); + return new MachineLearningBatchEndpointResource(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 MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(ResourceIdentifier id) + { + MachineLearningBatchDeploymentResource.ValidateResourceId(id); + return new MachineLearningBatchDeploymentResource(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 MachineLearningDatastoreResource GetMachineLearningDatastoreResource(ResourceIdentifier id) + { + MachineLearningDatastoreResource.ValidateResourceId(id); + return new MachineLearningDatastoreResource(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 MachineLearningFeatureSetContainerResource GetMachineLearningFeatureSetContainerResource(ResourceIdentifier id) + { + MachineLearningFeatureSetContainerResource.ValidateResourceId(id); + return new MachineLearningFeatureSetContainerResource(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 MachineLearningFeatureResource GetMachineLearningFeatureResource(ResourceIdentifier id) + { + MachineLearningFeatureResource.ValidateResourceId(id); + return new MachineLearningFeatureResource(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 MachineLearningFeatureSetVersionResource GetMachineLearningFeatureSetVersionResource(ResourceIdentifier id) + { + MachineLearningFeatureSetVersionResource.ValidateResourceId(id); + return new MachineLearningFeatureSetVersionResource(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 MachineLearningFeatureStoreEntityContainerResource GetMachineLearningFeatureStoreEntityContainerResource(ResourceIdentifier id) + { + MachineLearningFeatureStoreEntityContainerResource.ValidateResourceId(id); + return new MachineLearningFeatureStoreEntityContainerResource(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 MachineLearningFeaturestoreEntityVersionResource GetMachineLearningFeaturestoreEntityVersionResource(ResourceIdentifier id) + { + MachineLearningFeaturestoreEntityVersionResource.ValidateResourceId(id); + return new MachineLearningFeaturestoreEntityVersionResource(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 MachineLearningJobResource GetMachineLearningJobResource(ResourceIdentifier id) + { + MachineLearningJobResource.ValidateResourceId(id); + return new MachineLearningJobResource(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 MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(ResourceIdentifier id) + { + MachineLearningLabelingJobResource.ValidateResourceId(id); + return new MachineLearningLabelingJobResource(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 MachineLearningOnlineEndpointResource GetMachineLearningOnlineEndpointResource(ResourceIdentifier id) + { + MachineLearningOnlineEndpointResource.ValidateResourceId(id); + return new MachineLearningOnlineEndpointResource(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 MachineLearningOnlineDeploymentResource GetMachineLearningOnlineDeploymentResource(ResourceIdentifier id) + { + MachineLearningOnlineDeploymentResource.ValidateResourceId(id); + return new MachineLearningOnlineDeploymentResource(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 MachineLearningScheduleResource GetMachineLearningScheduleResource(ResourceIdentifier id) + { + MachineLearningScheduleResource.ValidateResourceId(id); + return new MachineLearningScheduleResource(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 MachineLearningRegistryResource GetMachineLearningRegistryResource(ResourceIdentifier id) + { + MachineLearningRegistryResource.ValidateResourceId(id); + return new MachineLearningRegistryResource(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 MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(ResourceIdentifier id) + { + MachineLearningWorkspaceResource.ValidateResourceId(id); + return new MachineLearningWorkspaceResource(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 MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(ResourceIdentifier id) + { + MachineLearningWorkspaceConnectionResource.ValidateResourceId(id); + return new MachineLearningWorkspaceConnectionResource(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 MachineLearningOutboundRuleBasicResource GetMachineLearningOutboundRuleBasicResource(ResourceIdentifier id) + { + MachineLearningOutboundRuleBasicResource.ValidateResourceId(id); + return new MachineLearningOutboundRuleBasicResource(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 MachineLearningPrivateEndpointConnectionResource GetMachineLearningPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MachineLearningPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MachineLearningPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs index 2f27418ea6ce..3c8eba3f14c7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearning.Mocking; using Azure.ResourceManager.MachineLearning.Models; using Azure.ResourceManager.Resources; @@ -19,784 +20,657 @@ namespace Azure.ResourceManager.MachineLearning /// A class to add extension methods to Azure.ResourceManager.MachineLearning. public static partial class MachineLearningExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MachineLearningArmClientMockingExtension GetMachineLearningArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MachineLearningArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MachineLearningResourceGroupMockingExtension GetMachineLearningResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MachineLearningResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MachineLearningSubscriptionMockingExtension GetMachineLearningSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MachineLearningSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region MachineLearningComputeResource /// /// 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. /// Returns a object. public static MachineLearningComputeResource GetMachineLearningComputeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningComputeResource.ValidateResourceId(id); - return new MachineLearningComputeResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningComputeResource(id); } - #endregion - #region MachineLearningRegistryCodeContainerResource /// /// 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. /// Returns a object. public static MachineLearningRegistryCodeContainerResource GetMachineLearningRegistryCodeContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryCodeContainerResource.ValidateResourceId(id); - return new MachineLearningRegistryCodeContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryCodeContainerResource(id); } - #endregion - #region MachineLearningCodeContainerResource /// /// 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. /// Returns a object. public static MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningCodeContainerResource.ValidateResourceId(id); - return new MachineLearningCodeContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningCodeContainerResource(id); } - #endregion - #region MachineLearningRegistryCodeVersionResource /// /// 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. /// Returns a object. public static MachineLearningRegistryCodeVersionResource GetMachineLearningRegistryCodeVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryCodeVersionResource.ValidateResourceId(id); - return new MachineLearningRegistryCodeVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryCodeVersionResource(id); } - #endregion - #region MachineLearningCodeVersionResource /// /// 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. /// Returns a object. public static MachineLearningCodeVersionResource GetMachineLearningCodeVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningCodeVersionResource.ValidateResourceId(id); - return new MachineLearningCodeVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningCodeVersionResource(id); } - #endregion - #region MachineLearninRegistryComponentContainerResource /// /// 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. /// Returns a object. public static MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearninRegistryComponentContainerResource.ValidateResourceId(id); - return new MachineLearninRegistryComponentContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearninRegistryComponentContainerResource(id); } - #endregion - #region MachineLearningComponentContainerResource /// /// 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. /// Returns a object. public static MachineLearningComponentContainerResource GetMachineLearningComponentContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningComponentContainerResource.ValidateResourceId(id); - return new MachineLearningComponentContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningComponentContainerResource(id); } - #endregion - #region MachineLearninRegistryComponentVersionResource /// /// 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. /// Returns a object. public static MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearninRegistryComponentVersionResource.ValidateResourceId(id); - return new MachineLearninRegistryComponentVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearninRegistryComponentVersionResource(id); } - #endregion - #region MachineLearningComponentVersionResource /// /// 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. /// Returns a object. public static MachineLearningComponentVersionResource GetMachineLearningComponentVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningComponentVersionResource.ValidateResourceId(id); - return new MachineLearningComponentVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningComponentVersionResource(id); } - #endregion - #region MachineLearningRegistryDataContainerResource /// /// 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. /// Returns a object. public static MachineLearningRegistryDataContainerResource GetMachineLearningRegistryDataContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryDataContainerResource.ValidateResourceId(id); - return new MachineLearningRegistryDataContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryDataContainerResource(id); } - #endregion - #region MachineLearningDataContainerResource /// /// 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. /// Returns a object. public static MachineLearningDataContainerResource GetMachineLearningDataContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningDataContainerResource.ValidateResourceId(id); - return new MachineLearningDataContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningDataContainerResource(id); } - #endregion - #region MachineLearningRegistryDataVersionResource /// /// 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. /// Returns a object. public static MachineLearningRegistryDataVersionResource GetMachineLearningRegistryDataVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryDataVersionResource.ValidateResourceId(id); - return new MachineLearningRegistryDataVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryDataVersionResource(id); } - #endregion - #region MachineLearningDataVersionResource /// /// 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. /// Returns a object. public static MachineLearningDataVersionResource GetMachineLearningDataVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningDataVersionResource.ValidateResourceId(id); - return new MachineLearningDataVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningDataVersionResource(id); } - #endregion - #region MachineLearningRegistryEnvironmentContainerResource /// /// 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. /// Returns a object. public static MachineLearningRegistryEnvironmentContainerResource GetMachineLearningRegistryEnvironmentContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryEnvironmentContainerResource.ValidateResourceId(id); - return new MachineLearningRegistryEnvironmentContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryEnvironmentContainerResource(id); } - #endregion - #region MachineLearningEnvironmentContainerResource /// /// 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. /// Returns a object. public static MachineLearningEnvironmentContainerResource GetMachineLearningEnvironmentContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningEnvironmentContainerResource.ValidateResourceId(id); - return new MachineLearningEnvironmentContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningEnvironmentContainerResource(id); } - #endregion - #region MachineLearningRegistryEnvironmentVersionResource /// /// 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. /// Returns a object. public static MachineLearningRegistryEnvironmentVersionResource GetMachineLearningRegistryEnvironmentVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryEnvironmentVersionResource.ValidateResourceId(id); - return new MachineLearningRegistryEnvironmentVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryEnvironmentVersionResource(id); } - #endregion - #region MachineLearningEnvironmentVersionResource /// /// 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. /// Returns a object. public static MachineLearningEnvironmentVersionResource GetMachineLearningEnvironmentVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningEnvironmentVersionResource.ValidateResourceId(id); - return new MachineLearningEnvironmentVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningEnvironmentVersionResource(id); } - #endregion - #region MachineLearningRegistryModelContainerResource /// /// 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. /// Returns a object. public static MachineLearningRegistryModelContainerResource GetMachineLearningRegistryModelContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryModelContainerResource.ValidateResourceId(id); - return new MachineLearningRegistryModelContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryModelContainerResource(id); } - #endregion - #region MachineLearningModelContainerResource /// /// 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. /// Returns a object. public static MachineLearningModelContainerResource GetMachineLearningModelContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningModelContainerResource.ValidateResourceId(id); - return new MachineLearningModelContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningModelContainerResource(id); } - #endregion - #region MachineLearningRegistryModelVersionResource /// /// 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. /// Returns a object. public static MachineLearningRegistryModelVersionResource GetMachineLearningRegistryModelVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryModelVersionResource.ValidateResourceId(id); - return new MachineLearningRegistryModelVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryModelVersionResource(id); } - #endregion - #region MachineLearningModelVersionResource /// /// 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. /// Returns a object. public static MachineLearningModelVersionResource GetMachineLearningModelVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningModelVersionResource.ValidateResourceId(id); - return new MachineLearningModelVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningModelVersionResource(id); } - #endregion - #region MachineLearningBatchEndpointResource /// /// 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. /// Returns a object. public static MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningBatchEndpointResource.ValidateResourceId(id); - return new MachineLearningBatchEndpointResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningBatchEndpointResource(id); } - #endregion - #region MachineLearningBatchDeploymentResource /// /// 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. /// Returns a object. public static MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningBatchDeploymentResource.ValidateResourceId(id); - return new MachineLearningBatchDeploymentResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningBatchDeploymentResource(id); } - #endregion - #region MachineLearningDatastoreResource /// /// 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. /// Returns a object. public static MachineLearningDatastoreResource GetMachineLearningDatastoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningDatastoreResource.ValidateResourceId(id); - return new MachineLearningDatastoreResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningDatastoreResource(id); } - #endregion - #region MachineLearningFeatureSetContainerResource /// /// 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. /// Returns a object. public static MachineLearningFeatureSetContainerResource GetMachineLearningFeatureSetContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningFeatureSetContainerResource.ValidateResourceId(id); - return new MachineLearningFeatureSetContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningFeatureSetContainerResource(id); } - #endregion - #region MachineLearningFeatureResource /// /// 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. /// Returns a object. public static MachineLearningFeatureResource GetMachineLearningFeatureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningFeatureResource.ValidateResourceId(id); - return new MachineLearningFeatureResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningFeatureResource(id); } - #endregion - #region MachineLearningFeatureSetVersionResource /// /// 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. /// Returns a object. public static MachineLearningFeatureSetVersionResource GetMachineLearningFeatureSetVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningFeatureSetVersionResource.ValidateResourceId(id); - return new MachineLearningFeatureSetVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningFeatureSetVersionResource(id); } - #endregion - #region MachineLearningFeatureStoreEntityContainerResource /// /// 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. /// Returns a object. public static MachineLearningFeatureStoreEntityContainerResource GetMachineLearningFeatureStoreEntityContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningFeatureStoreEntityContainerResource.ValidateResourceId(id); - return new MachineLearningFeatureStoreEntityContainerResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningFeatureStoreEntityContainerResource(id); } - #endregion - #region MachineLearningFeaturestoreEntityVersionResource /// /// 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. /// Returns a object. public static MachineLearningFeaturestoreEntityVersionResource GetMachineLearningFeaturestoreEntityVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningFeaturestoreEntityVersionResource.ValidateResourceId(id); - return new MachineLearningFeaturestoreEntityVersionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningFeaturestoreEntityVersionResource(id); } - #endregion - #region MachineLearningJobResource /// /// 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. /// Returns a object. public static MachineLearningJobResource GetMachineLearningJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningJobResource.ValidateResourceId(id); - return new MachineLearningJobResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningJobResource(id); } - #endregion - #region MachineLearningLabelingJobResource /// /// 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. /// Returns a object. public static MachineLearningLabelingJobResource GetMachineLearningLabelingJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningLabelingJobResource.ValidateResourceId(id); - return new MachineLearningLabelingJobResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningLabelingJobResource(id); } - #endregion - #region MachineLearningOnlineEndpointResource /// /// 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. /// Returns a object. public static MachineLearningOnlineEndpointResource GetMachineLearningOnlineEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningOnlineEndpointResource.ValidateResourceId(id); - return new MachineLearningOnlineEndpointResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningOnlineEndpointResource(id); } - #endregion - #region MachineLearningOnlineDeploymentResource /// /// 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. /// Returns a object. public static MachineLearningOnlineDeploymentResource GetMachineLearningOnlineDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningOnlineDeploymentResource.ValidateResourceId(id); - return new MachineLearningOnlineDeploymentResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningOnlineDeploymentResource(id); } - #endregion - #region MachineLearningScheduleResource /// /// 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. /// Returns a object. public static MachineLearningScheduleResource GetMachineLearningScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningScheduleResource.ValidateResourceId(id); - return new MachineLearningScheduleResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningScheduleResource(id); } - #endregion - #region MachineLearningRegistryResource /// /// 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. /// Returns a object. public static MachineLearningRegistryResource GetMachineLearningRegistryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningRegistryResource.ValidateResourceId(id); - return new MachineLearningRegistryResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningRegistryResource(id); } - #endregion - #region MachineLearningWorkspaceResource /// /// 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. /// Returns a object. public static MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningWorkspaceResource.ValidateResourceId(id); - return new MachineLearningWorkspaceResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningWorkspaceResource(id); } - #endregion - #region MachineLearningWorkspaceConnectionResource /// /// 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. /// Returns a object. public static MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningWorkspaceConnectionResource.ValidateResourceId(id); - return new MachineLearningWorkspaceConnectionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningWorkspaceConnectionResource(id); } - #endregion - #region MachineLearningOutboundRuleBasicResource /// /// 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. /// Returns a object. public static MachineLearningOutboundRuleBasicResource GetMachineLearningOutboundRuleBasicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningOutboundRuleBasicResource.ValidateResourceId(id); - return new MachineLearningOutboundRuleBasicResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningOutboundRuleBasicResource(id); } - #endregion - #region MachineLearningPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static MachineLearningPrivateEndpointConnectionResource GetMachineLearningPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineLearningPrivateEndpointConnectionResource.ValidateResourceId(id); - return new MachineLearningPrivateEndpointConnectionResource(client, id); - } - ); + return GetMachineLearningArmClientMockingExtension(client).GetMachineLearningPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. + /// + /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MachineLearningRegistryResources and their operations over a MachineLearningRegistryResource. public static MachineLearningRegistryCollection GetMachineLearningRegistries(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMachineLearningRegistries(); + return GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningRegistries(); } /// @@ -811,16 +685,20 @@ public static MachineLearningRegistryCollection GetMachineLearningRegistries(thi /// Registries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Azure Machine Learning registry. This is case-insensitive. /// The cancellation token to use. - /// 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 static async Task> GetMachineLearningRegistryAsync(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMachineLearningRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningRegistryAsync(registryName, cancellationToken).ConfigureAwait(false); } /// @@ -835,24 +713,34 @@ public static async Task> GetMachineLe /// Registries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Azure Machine Learning registry. This is case-insensitive. /// The cancellation token to use. - /// 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 static Response GetMachineLearningRegistry(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMachineLearningRegistries().Get(registryName, cancellationToken); + return GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningRegistry(registryName, cancellationToken); } - /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MachineLearningWorkspaceResources and their operations over a MachineLearningWorkspaceResource. public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMachineLearningWorkspaces(); + return GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningWorkspaces(); } /// @@ -867,16 +755,20 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Azure Machine Learning workspace. /// The cancellation token to use. - /// 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 static async Task> GetMachineLearningWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMachineLearningWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -891,16 +783,20 @@ public static async Task> GetMachineL /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Azure Machine Learning workspace. /// The cancellation token to use. - /// 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 static Response GetMachineLearningWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMachineLearningWorkspaces().Get(workspaceName, cancellationToken); + return GetMachineLearningResourceGroupMockingExtension(resourceGroupResource).GetMachineLearningWorkspace(workspaceName, cancellationToken); } /// @@ -915,6 +811,10 @@ public static Response GetMachineLearningWorks /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -922,7 +822,7 @@ public static Response GetMachineLearningWorks /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMachineLearningUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningUsagesAsync(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningUsagesAsync(location, cancellationToken); } /// @@ -937,6 +837,10 @@ public static AsyncPageable GetMachineLearningUsagesAsync( /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -944,7 +848,7 @@ public static AsyncPageable GetMachineLearningUsagesAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMachineLearningUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningUsages(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningUsages(location, cancellationToken); } /// @@ -959,6 +863,10 @@ public static Pageable GetMachineLearningUsages(this Subsc /// VirtualMachineSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which virtual-machine-sizes is queried. @@ -966,7 +874,7 @@ public static Pageable GetMachineLearningUsages(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMachineLearningVmSizesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningVmSizesAsync(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningVmSizesAsync(location, cancellationToken); } /// @@ -981,6 +889,10 @@ public static AsyncPageable GetMachineLearningVmSizesAsyn /// VirtualMachineSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which virtual-machine-sizes is queried. @@ -988,7 +900,7 @@ public static AsyncPageable GetMachineLearningVmSizesAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMachineLearningVmSizes(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningVmSizes(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningVmSizes(location, cancellationToken); } /// @@ -1003,6 +915,10 @@ public static Pageable GetMachineLearningVmSizes(this Sub /// Quotas_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for update quota is queried. @@ -1012,9 +928,7 @@ public static Pageable GetMachineLearningVmSizes(this Sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable UpdateMachineLearningQuotasAsync(this SubscriptionResource subscriptionResource, AzureLocation location, MachineLearningQuotaUpdateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateMachineLearningQuotasAsync(location, content, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).UpdateMachineLearningQuotasAsync(location, content, cancellationToken); } /// @@ -1029,6 +943,10 @@ public static AsyncPageable UpdateMachineLe /// Quotas_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for update quota is queried. @@ -1038,9 +956,7 @@ public static AsyncPageable UpdateMachineLe /// A collection of that may take multiple service requests to iterate over. public static Pageable UpdateMachineLearningQuotas(this SubscriptionResource subscriptionResource, AzureLocation location, MachineLearningQuotaUpdateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateMachineLearningQuotas(location, content, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).UpdateMachineLearningQuotas(location, content, cancellationToken); } /// @@ -1055,6 +971,10 @@ public static Pageable UpdateMachineLearnin /// Quotas_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -1062,7 +982,7 @@ public static Pageable UpdateMachineLearnin /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMachineLearningQuotasAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningQuotasAsync(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningQuotasAsync(location, cancellationToken); } /// @@ -1077,6 +997,10 @@ public static AsyncPageable GetMachineLearningQuot /// Quotas_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -1084,7 +1008,7 @@ public static AsyncPageable GetMachineLearningQuot /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMachineLearningQuotas(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningQuotas(location, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningQuotas(location, cancellationToken); } /// @@ -1099,13 +1023,17 @@ public static Pageable GetMachineLearningQuotas(th /// Registries_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMachineLearningRegistriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningRegistriesAsync(cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningRegistriesAsync(cancellationToken); } /// @@ -1120,13 +1048,17 @@ public static AsyncPageable GetMachineLearningR /// Registries_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMachineLearningRegistries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningRegistries(cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningRegistries(cancellationToken); } /// @@ -1141,6 +1073,10 @@ public static Pageable GetMachineLearningRegist /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token for pagination. @@ -1149,7 +1085,7 @@ public static Pageable GetMachineLearningRegist /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningWorkspacesAsync(skip, kind, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningWorkspacesAsync(skip, kind, cancellationToken); } /// @@ -1164,6 +1100,10 @@ public static AsyncPageable GetMachineLearning /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token for pagination. @@ -1172,7 +1112,7 @@ public static AsyncPageable GetMachineLearning /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string skip = null, string kind = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMachineLearningWorkspaces(skip, kind, cancellationToken); + return GetMachineLearningSubscriptionMockingExtension(subscriptionResource).GetMachineLearningWorkspaces(skip, kind, cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningResourceGroupMockingExtension.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..9063b2f6aa09 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearning; + +namespace Azure.ResourceManager.MachineLearning.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MachineLearningResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MachineLearningResourceGroupMockingExtension() + { + } + + /// 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 MachineLearningResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. + /// An object representing collection of MachineLearningRegistryResources and their operations over a MachineLearningRegistryResource. + public virtual MachineLearningRegistryCollection GetMachineLearningRegistries() + { + return GetCachedClient(client => new MachineLearningRegistryCollection(client, Id)); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningRegistryAsync(string registryName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningRegistry(string registryName, CancellationToken cancellationToken = default) + { + return GetMachineLearningRegistries().Get(registryName, cancellationToken); + } + + /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of MachineLearningWorkspaceResources and their operations over a MachineLearningWorkspaceResource. + public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() + { + return GetCachedClient(client => new MachineLearningWorkspaceCollection(client, Id)); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// Name of Azure Machine Learning workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// Name of Azure Machine Learning workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetMachineLearningWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningSubscriptionMockingExtension.cs similarity index 89% rename from sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningSubscriptionMockingExtension.cs index e01328541757..ec32384f59be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningSubscriptionMockingExtension.cs @@ -5,18 +5,20 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MachineLearning; using Azure.ResourceManager.MachineLearning.Models; -namespace Azure.ResourceManager.MachineLearning +namespace Azure.ResourceManager.MachineLearning.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MachineLearningSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; @@ -29,15 +31,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _machineLearningWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _machineLearningWorkspaceWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MachineLearningSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MachineLearningSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -78,7 +80,7 @@ public virtual AsyncPageable GetMachineLearningUsagesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MachineLearningUsage.DeserializeMachineLearningUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MachineLearningUsage.DeserializeMachineLearningUsage, UsagesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningUsages", "value", "nextLink", cancellationToken); } /// @@ -101,7 +103,7 @@ public virtual Pageable GetMachineLearningUsages(AzureLoca { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MachineLearningUsage.DeserializeMachineLearningUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MachineLearningUsage.DeserializeMachineLearningUsage, UsagesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningUsages", "value", "nextLink", cancellationToken); } /// @@ -123,7 +125,7 @@ public virtual Pageable GetMachineLearningUsages(AzureLoca public virtual AsyncPageable GetMachineLearningVmSizesAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MachineLearningVmSize.DeserializeMachineLearningVmSize, VirtualMachineSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningVmSizes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MachineLearningVmSize.DeserializeMachineLearningVmSize, VirtualMachineSizesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningVmSizes", "value", null, cancellationToken); } /// @@ -145,7 +147,7 @@ public virtual AsyncPageable GetMachineLearningVmSizesAsy public virtual Pageable GetMachineLearningVmSizes(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MachineLearningVmSize.DeserializeMachineLearningVmSize, VirtualMachineSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningVmSizes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MachineLearningVmSize.DeserializeMachineLearningVmSize, VirtualMachineSizesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningVmSizes", "value", null, cancellationToken); } /// @@ -164,11 +166,14 @@ public virtual Pageable GetMachineLearningVmSizes(AzureLo /// The location for update quota is queried. /// Quota update parameters. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable UpdateMachineLearningQuotasAsync(AzureLocation location, MachineLearningQuotaUpdateContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => QuotasRestClient.CreateUpdateRequest(Id.SubscriptionId, location, content); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MachineLearningWorkspaceQuotaUpdate.DeserializeMachineLearningWorkspaceQuotaUpdate, QuotasClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.UpdateMachineLearningQuotas", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MachineLearningWorkspaceQuotaUpdate.DeserializeMachineLearningWorkspaceQuotaUpdate, QuotasClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.UpdateMachineLearningQuotas", "value", null, cancellationToken); } /// @@ -187,11 +192,14 @@ public virtual AsyncPageable UpdateMachineL /// The location for update quota is queried. /// Quota update parameters. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable UpdateMachineLearningQuotas(AzureLocation location, MachineLearningQuotaUpdateContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => QuotasRestClient.CreateUpdateRequest(Id.SubscriptionId, location, content); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MachineLearningWorkspaceQuotaUpdate.DeserializeMachineLearningWorkspaceQuotaUpdate, QuotasClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.UpdateMachineLearningQuotas", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MachineLearningWorkspaceQuotaUpdate.DeserializeMachineLearningWorkspaceQuotaUpdate, QuotasClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.UpdateMachineLearningQuotas", "value", null, cancellationToken); } /// @@ -214,7 +222,7 @@ public virtual AsyncPageable GetMachineLearningQuo { HttpMessage FirstPageRequest(int? pageSizeHint) => QuotasRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuotasRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MachineLearningResourceQuota.DeserializeMachineLearningResourceQuota, QuotasClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningQuotas", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MachineLearningResourceQuota.DeserializeMachineLearningResourceQuota, QuotasClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningQuotas", "value", "nextLink", cancellationToken); } /// @@ -237,7 +245,7 @@ public virtual Pageable GetMachineLearningQuotas(A { HttpMessage FirstPageRequest(int? pageSizeHint) => QuotasRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuotasRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MachineLearningResourceQuota.DeserializeMachineLearningResourceQuota, QuotasClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningQuotas", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MachineLearningResourceQuota.DeserializeMachineLearningResourceQuota, QuotasClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningQuotas", "value", "nextLink", cancellationToken); } /// @@ -259,7 +267,7 @@ public virtual AsyncPageable GetMachineLearning { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningRegistryRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningRegistryRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryResource(Client, MachineLearningRegistryData.DeserializeMachineLearningRegistryData(e)), MachineLearningRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningRegistries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryResource(Client, MachineLearningRegistryData.DeserializeMachineLearningRegistryData(e)), MachineLearningRegistryRegistriesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningRegistries", "value", "nextLink", cancellationToken); } /// @@ -281,7 +289,7 @@ public virtual Pageable GetMachineLearningRegis { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningRegistryRegistriesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningRegistryRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryResource(Client, MachineLearningRegistryData.DeserializeMachineLearningRegistryData(e)), MachineLearningRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningRegistries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryResource(Client, MachineLearningRegistryData.DeserializeMachineLearningRegistryData(e)), MachineLearningRegistryRegistriesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningRegistries", "value", "nextLink", cancellationToken); } /// @@ -305,7 +313,7 @@ public virtual AsyncPageable GetMachineLearnin { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -329,7 +337,7 @@ public virtual Pageable GetMachineLearningWork { HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skip, kind); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skip, kind); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningSubscriptionMockingExtension.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ecfc3a6b3627..000000000000 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MachineLearning -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. - /// An object representing collection of MachineLearningRegistryResources and their operations over a MachineLearningRegistryResource. - public virtual MachineLearningRegistryCollection GetMachineLearningRegistries() - { - return GetCachedClient(Client => new MachineLearningRegistryCollection(Client, Id)); - } - - /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of MachineLearningWorkspaceResources and their operations over a MachineLearningWorkspaceResource. - public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() - { - return GetCachedClient(Client => new MachineLearningWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs index 02bdeb110e1a..0e8b680f5de3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearninRegistryComponentVersionResources and their operations over a MachineLearninRegistryComponentVersionResource. public virtual MachineLearninRegistryComponentVersionCollection GetMachineLearninRegistryComponentVersions() { - return GetCachedClient(Client => new MachineLearninRegistryComponentVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearninRegistryComponentVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearninRegistryComponentVersionCollection GetMachineLearni /// /// Version identifier. /// The cancellation token to use. - /// 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> GetMachineLearninRegistryComponentVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// Version identifier. /// The cancellation token to use. - /// 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 GetMachineLearninRegistryComponentVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs index 8f172f63be13..2df6258c128d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningBatchDeploymentResources and their operations over a MachineLearningBatchDeploymentResource. public virtual MachineLearningBatchDeploymentCollection GetMachineLearningBatchDeployments() { - return GetCachedClient(Client => new MachineLearningBatchDeploymentCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningBatchDeploymentCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MachineLearningBatchDeploymentCollection GetMachineLearningBatchD /// /// The identifier for the Batch deployments. /// The cancellation token to use. - /// 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> GetMachineLearningBatchDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetM /// /// The identifier for the Batch deployments. /// The cancellation token to use. - /// 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 GetMachineLearningBatchDeployment(string deploymentName, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs index e6bb135fbd4a..d64bf584df03 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningCodeVersionResources and their operations over a MachineLearningCodeVersionResource. public virtual MachineLearningCodeVersionCollection GetMachineLearningCodeVersions() { - return GetCachedClient(Client => new MachineLearningCodeVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningCodeVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningCodeVersionCollection GetMachineLearningCodeVersio /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningCodeVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetMachi /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningCodeVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs index bc4a355d9221..b3c59b976959 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningComponentVersionResources and their operations over a MachineLearningComponentVersionResource. public virtual MachineLearningComponentVersionCollection GetMachineLearningComponentVersions() { - return GetCachedClient(Client => new MachineLearningComponentVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningComponentVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningComponentVersionCollection GetMachineLearningCompo /// /// Version identifier. /// The cancellation token to use. - /// 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> GetMachineLearningComponentVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> Get /// /// Version identifier. /// The cancellation token to use. - /// 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 GetMachineLearningComponentVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs index ad3cbeb4ead5..2ae640154f7e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningDataVersionResources and their operations over a MachineLearningDataVersionResource. public virtual MachineLearningDataVersionCollection GetMachineLearningDataVersions() { - return GetCachedClient(Client => new MachineLearningDataVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningDataVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningDataVersionCollection GetMachineLearningDataVersio /// /// Version identifier. /// The cancellation token to use. - /// 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> GetMachineLearningDataVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetMachi /// /// Version identifier. /// The cancellation token to use. - /// 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 GetMachineLearningDataVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs index 21abbbb167a2..aec6b03eaf73 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningEnvironmentVersionResources and their operations over a MachineLearningEnvironmentVersionResource. public virtual MachineLearningEnvironmentVersionCollection GetMachineLearningEnvironmentVersions() { - return GetCachedClient(Client => new MachineLearningEnvironmentVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningEnvironmentVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningEnvironmentVersionCollection GetMachineLearningEnv /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningEnvironmentVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> G /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningEnvironmentVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs index 9139d5d81af2..2327120364e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningFeatureSetVersionResources and their operations over a MachineLearningFeatureSetVersionResource. public virtual MachineLearningFeatureSetVersionCollection GetMachineLearningFeatureSetVersions() { - return GetCachedClient(Client => new MachineLearningFeatureSetVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningFeatureSetVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningFeatureSetVersionCollection GetMachineLearningFeat /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningFeatureSetVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> Ge /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningFeatureSetVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs index cb1865ffa9e0..d90dc2850020 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningFeatureResources and their operations over a MachineLearningFeatureResource. public virtual MachineLearningFeatureCollection GetMachineLearningFeatures() { - return GetCachedClient(Client => new MachineLearningFeatureCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningFeatureCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MachineLearningFeatureCollection GetMachineLearningFeatures() /// /// Feature Name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningFeatureAsync(string featureName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetMachineLe /// /// Feature Name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningFeature(string featureName, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs index 2154c19f6b43..54496cd9e6d7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningFeaturestoreEntityVersionResources and their operations over a MachineLearningFeaturestoreEntityVersionResource. public virtual MachineLearningFeaturestoreEntityVersionCollection GetMachineLearningFeaturestoreEntityVersions() { - return GetCachedClient(Client => new MachineLearningFeaturestoreEntityVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningFeaturestoreEntityVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningFeaturestoreEntityVersionCollection GetMachineLear /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningFeaturestoreEntityVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningFeaturestoreEntityVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs index a9a9c60468bf..5712864e706c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningModelVersionResources and their operations over a MachineLearningModelVersionResource. public virtual MachineLearningModelVersionCollection GetMachineLearningModelVersions() { - return GetCachedClient(Client => new MachineLearningModelVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningModelVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningModelVersionCollection GetMachineLearningModelVers /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningModelVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetMach /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningModelVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs index 175fc1d9e835..23b29a12d310 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningOnlineDeploymentResources and their operations over a MachineLearningOnlineDeploymentResource. public virtual MachineLearningOnlineDeploymentCollection GetMachineLearningOnlineDeployments() { - return GetCachedClient(Client => new MachineLearningOnlineDeploymentCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningOnlineDeploymentCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MachineLearningOnlineDeploymentCollection GetMachineLearningOnlin /// /// Inference Endpoint Deployment name. /// The cancellation token to use. - /// 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> GetMachineLearningOnlineDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Get /// /// Inference Endpoint Deployment name. /// The cancellation token to use. - /// 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 GetMachineLearningOnlineDeployment(string deploymentName, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs index df389f08a833..8c259f4ca012 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningRegistryCodeVersionResources and their operations over a MachineLearningRegistryCodeVersionResource. public virtual MachineLearningRegistryCodeVersionCollection GetMachineLearningRegistryCodeVersions() { - return GetCachedClient(Client => new MachineLearningRegistryCodeVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryCodeVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningRegistryCodeVersionCollection GetMachineLearningRe /// /// Version identifier. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryCodeVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> /// /// Version identifier. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryCodeVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs index 1c0de50b118e..3fd1dc4d1e1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningRegistryDataVersionResources and their operations over a MachineLearningRegistryDataVersionResource. public virtual MachineLearningRegistryDataVersionCollection GetMachineLearningRegistryDataVersions() { - return GetCachedClient(Client => new MachineLearningRegistryDataVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryDataVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningRegistryDataVersionCollection GetMachineLearningRe /// /// Version identifier. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryDataVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> /// /// Version identifier. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryDataVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs index d8d26cf9f491..14314e06f21e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningRegistryEnvironmentVersionResources and their operations over a MachineLearningRegistryEnvironmentVersionResource. public virtual MachineLearningRegistryEnvironmentVersionCollection GetMachineLearningRegistryEnvironmentVersions() { - return GetCachedClient(Client => new MachineLearningRegistryEnvironmentVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryEnvironmentVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningRegistryEnvironmentVersionCollection GetMachineLea /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryEnvironmentVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryEnvironmentVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs index abf169fd56a6..6d203a9bee62 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningRegistryModelVersionResources and their operations over a MachineLearningRegistryModelVersionResource. public virtual MachineLearningRegistryModelVersionCollection GetMachineLearningRegistryModelVersions() { - return GetCachedClient(Client => new MachineLearningRegistryModelVersionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryModelVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MachineLearningRegistryModelVersionCollection GetMachineLearningR /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryModelVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> /// /// Version identifier. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryModelVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs index be4f72d7662e..787114ff6397 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningRegistryCodeContainerResources and their operations over a MachineLearningRegistryCodeContainerResource. public virtual MachineLearningRegistryCodeContainerCollection GetMachineLearningRegistryCodeContainers() { - return GetCachedClient(Client => new MachineLearningRegistryCodeContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryCodeContainerCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MachineLearningRegistryCodeContainerCollection GetMachineLearning /// /// Container name. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryCodeContainerAsync(string codeName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task /// /// Container name. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryCodeContainer(string codeName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetMachine /// An object representing collection of MachineLearninRegistryComponentContainerResources and their operations over a MachineLearninRegistryComponentContainerResource. public virtual MachineLearninRegistryComponentContainerCollection GetMachineLearninRegistryComponentContainers() { - return GetCachedClient(Client => new MachineLearninRegistryComponentContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearninRegistryComponentContainerCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MachineLearninRegistryComponentContainerCollection GetMachineLear /// /// Container name. /// The cancellation token to use. - /// 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> GetMachineLearninRegistryComponentContainerAsync(string componentName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// Container name. /// The cancellation token to use. - /// 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 GetMachineLearninRegistryComponentContainer(string componentName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMac /// An object representing collection of MachineLearningRegistryDataContainerResources and their operations over a MachineLearningRegistryDataContainerResource. public virtual MachineLearningRegistryDataContainerCollection GetMachineLearningRegistryDataContainers() { - return GetCachedClient(Client => new MachineLearningRegistryDataContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryDataContainerCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual MachineLearningRegistryDataContainerCollection GetMachineLearning /// /// Container name. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryDataContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// /// Container name. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryDataContainer(string name, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetMachine /// An object representing collection of MachineLearningRegistryEnvironmentContainerResources and their operations over a MachineLearningRegistryEnvironmentContainerResource. public virtual MachineLearningRegistryEnvironmentContainerCollection GetMachineLearningRegistryEnvironmentContainers() { - return GetCachedClient(Client => new MachineLearningRegistryEnvironmentContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryEnvironmentContainerCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual MachineLearningRegistryEnvironmentContainerCollection GetMachineL /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryEnvironmentContainerAsync(string environmentName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryEnvironmentContainer(string environmentName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response Get /// An object representing collection of MachineLearningRegistryModelContainerResources and their operations over a MachineLearningRegistryModelContainerResource. public virtual MachineLearningRegistryModelContainerCollection GetMachineLearningRegistryModelContainers() { - return GetCachedClient(Client => new MachineLearningRegistryModelContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningRegistryModelContainerCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual MachineLearningRegistryModelContainerCollection GetMachineLearnin /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningRegistryModelContainerAsync(string modelName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningRegistryModelContainer(string modelName, CancellationToken cancellationToken = default) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs index e67a157de249..aa5785872f12 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MachineLearningComputeResources and their operations over a MachineLearningComputeResource. public virtual MachineLearningComputeCollection GetMachineLearningComputes() { - return GetCachedClient(Client => new MachineLearningComputeCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningComputeCollection(client, Id)); } /// @@ -124,8 +124,8 @@ public virtual MachineLearningComputeCollection GetMachineLearningComputes() /// /// Name of the Azure Machine Learning compute. /// The cancellation token to use. - /// 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> GetMachineLearningComputeAsync(string computeName, CancellationToken cancellationToken = default) { @@ -147,8 +147,8 @@ public virtual async Task> GetMachineLe /// /// Name of the Azure Machine Learning compute. /// The cancellation token to use. - /// 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 GetMachineLearningCompute(string computeName, CancellationToken cancellationToken = default) { @@ -159,7 +159,7 @@ public virtual Response GetMachineLearningComput /// An object representing collection of MachineLearningCodeContainerResources and their operations over a MachineLearningCodeContainerResource. public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeContainers() { - return GetCachedClient(Client => new MachineLearningCodeContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningCodeContainerCollection(client, Id)); } /// @@ -177,8 +177,8 @@ public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeCont /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningCodeContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -200,8 +200,8 @@ public virtual async Task> GetMac /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningCodeContainer(string name, CancellationToken cancellationToken = default) { @@ -212,7 +212,7 @@ public virtual Response GetMachineLearning /// An object representing collection of MachineLearningComponentContainerResources and their operations over a MachineLearningComponentContainerResource. public virtual MachineLearningComponentContainerCollection GetMachineLearningComponentContainers() { - return GetCachedClient(Client => new MachineLearningComponentContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningComponentContainerCollection(client, Id)); } /// @@ -230,8 +230,8 @@ public virtual MachineLearningComponentContainerCollection GetMachineLearningCom /// /// Container name. /// The cancellation token to use. - /// 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> GetMachineLearningComponentContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -253,8 +253,8 @@ public virtual async Task> G /// /// Container name. /// The cancellation token to use. - /// 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 GetMachineLearningComponentContainer(string name, CancellationToken cancellationToken = default) { @@ -265,7 +265,7 @@ public virtual Response GetMachineLea /// An object representing collection of MachineLearningDataContainerResources and their operations over a MachineLearningDataContainerResource. public virtual MachineLearningDataContainerCollection GetMachineLearningDataContainers() { - return GetCachedClient(Client => new MachineLearningDataContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningDataContainerCollection(client, Id)); } /// @@ -283,8 +283,8 @@ public virtual MachineLearningDataContainerCollection GetMachineLearningDataCont /// /// Container name. /// The cancellation token to use. - /// 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> GetMachineLearningDataContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -306,8 +306,8 @@ public virtual async Task> GetMac /// /// Container name. /// The cancellation token to use. - /// 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 GetMachineLearningDataContainer(string name, CancellationToken cancellationToken = default) { @@ -318,7 +318,7 @@ public virtual Response GetMachineLearning /// An object representing collection of MachineLearningEnvironmentContainerResources and their operations over a MachineLearningEnvironmentContainerResource. public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningEnvironmentContainers() { - return GetCachedClient(Client => new MachineLearningEnvironmentContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningEnvironmentContainerCollection(client, Id)); } /// @@ -336,8 +336,8 @@ public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningE /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningEnvironmentContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -359,8 +359,8 @@ public virtual async Task> /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningEnvironmentContainer(string name, CancellationToken cancellationToken = default) { @@ -371,7 +371,7 @@ public virtual Response GetMachineL /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() { - return GetCachedClient(Client => new MachineLearningModelContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningModelContainerCollection(client, Id)); } /// @@ -389,8 +389,8 @@ public virtual MachineLearningModelContainerCollection GetMachineLearningModelCo /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningModelContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -412,8 +412,8 @@ public virtual async Task> GetMa /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningModelContainer(string name, CancellationToken cancellationToken = default) { @@ -424,7 +424,7 @@ public virtual Response GetMachineLearnin /// An object representing collection of MachineLearningBatchEndpointResources and their operations over a MachineLearningBatchEndpointResource. public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEndpoints() { - return GetCachedClient(Client => new MachineLearningBatchEndpointCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningBatchEndpointCollection(client, Id)); } /// @@ -442,8 +442,8 @@ public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEnd /// /// Name for the Batch Endpoint. /// The cancellation token to use. - /// 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> GetMachineLearningBatchEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -465,8 +465,8 @@ public virtual async Task> GetMac /// /// Name for the Batch Endpoint. /// The cancellation token to use. - /// 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 GetMachineLearningBatchEndpoint(string endpointName, CancellationToken cancellationToken = default) { @@ -477,7 +477,7 @@ public virtual Response GetMachineLearning /// An object representing collection of MachineLearningDatastoreResources and their operations over a MachineLearningDatastoreResource. public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() { - return GetCachedClient(Client => new MachineLearningDatastoreCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningDatastoreCollection(client, Id)); } /// @@ -495,8 +495,8 @@ public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() /// /// Datastore name. /// The cancellation token to use. - /// 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> GetMachineLearningDatastoreAsync(string name, CancellationToken cancellationToken = default) { @@ -518,8 +518,8 @@ public virtual async Task> GetMachine /// /// Datastore name. /// The cancellation token to use. - /// 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 GetMachineLearningDatastore(string name, CancellationToken cancellationToken = default) { @@ -530,7 +530,7 @@ public virtual Response GetMachineLearningData /// An object representing collection of MachineLearningFeatureSetContainerResources and their operations over a MachineLearningFeatureSetContainerResource. public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFeatureSetContainers() { - return GetCachedClient(Client => new MachineLearningFeatureSetContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningFeatureSetContainerCollection(client, Id)); } /// @@ -548,8 +548,8 @@ public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFe /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningFeatureSetContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -571,8 +571,8 @@ public virtual async Task> /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningFeatureSetContainer(string name, CancellationToken cancellationToken = default) { @@ -583,7 +583,7 @@ public virtual Response GetMachineLe /// An object representing collection of MachineLearningFeatureStoreEntityContainerResources and their operations over a MachineLearningFeatureStoreEntityContainerResource. public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLearningFeatureStoreEntityContainers() { - return GetCachedClient(Client => new MachineLearningFeatureStoreEntityContainerCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningFeatureStoreEntityContainerCollection(client, Id)); } /// @@ -601,8 +601,8 @@ public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLe /// /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningFeatureStoreEntityContainerAsync(string name, CancellationToken cancellationToken = default) { @@ -624,8 +624,8 @@ public virtual async Task /// Container name. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningFeatureStoreEntityContainer(string name, CancellationToken cancellationToken = default) { @@ -636,7 +636,7 @@ public virtual Response GetM /// An object representing collection of MachineLearningJobResources and their operations over a MachineLearningJobResource. public virtual MachineLearningJobCollection GetMachineLearningJobs() { - return GetCachedClient(Client => new MachineLearningJobCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningJobCollection(client, Id)); } /// @@ -654,8 +654,8 @@ public virtual MachineLearningJobCollection GetMachineLearningJobs() /// /// The name and identifier for the Job. This is case-sensitive. /// The cancellation token to use. - /// 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> GetMachineLearningJobAsync(string id, CancellationToken cancellationToken = default) { @@ -677,8 +677,8 @@ public virtual async Task> GetMachineLearni /// /// The name and identifier for the Job. This is case-sensitive. /// The cancellation token to use. - /// 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 GetMachineLearningJob(string id, CancellationToken cancellationToken = default) { @@ -689,7 +689,7 @@ public virtual Response GetMachineLearningJob(string /// An object representing collection of MachineLearningLabelingJobResources and their operations over a MachineLearningLabelingJobResource. public virtual MachineLearningLabelingJobCollection GetMachineLearningLabelingJobs() { - return GetCachedClient(Client => new MachineLearningLabelingJobCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningLabelingJobCollection(client, Id)); } /// @@ -709,8 +709,8 @@ public virtual MachineLearningLabelingJobCollection GetMachineLearningLabelingJo /// Boolean value to indicate whether to include JobInstructions in response. /// Boolean value to indicate Whether to include LabelCategories in response. /// The cancellation token to use. - /// 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> GetMachineLearningLabelingJobAsync(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) { @@ -734,8 +734,8 @@ public virtual async Task> GetMachi /// Boolean value to indicate whether to include JobInstructions in response. /// Boolean value to indicate Whether to include LabelCategories in response. /// The cancellation token to use. - /// 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 GetMachineLearningLabelingJob(string id, bool? includeJobInstructions = null, bool? includeLabelCategories = null, CancellationToken cancellationToken = default) { @@ -746,7 +746,7 @@ public virtual Response GetMachineLearningLa /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() { - return GetCachedClient(Client => new MachineLearningOnlineEndpointCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); } /// @@ -764,8 +764,8 @@ public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineE /// /// Online Endpoint name. /// The cancellation token to use. - /// 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> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -787,8 +787,8 @@ public virtual async Task> GetMa /// /// Online Endpoint name. /// The cancellation token to use. - /// 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 GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) { @@ -799,7 +799,7 @@ public virtual Response GetMachineLearnin /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() { - return GetCachedClient(Client => new MachineLearningScheduleCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); } /// @@ -817,8 +817,8 @@ public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() /// /// Schedule name. /// The cancellation token to use. - /// 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> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) { @@ -840,8 +840,8 @@ public virtual async Task> GetMachineL /// /// Schedule name. /// The cancellation token to use. - /// 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 GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) { @@ -852,7 +852,7 @@ public virtual Response GetMachineLearningSched /// An object representing collection of MachineLearningWorkspaceConnectionResources and their operations over a MachineLearningWorkspaceConnectionResource. public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWorkspaceConnections() { - return GetCachedClient(Client => new MachineLearningWorkspaceConnectionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningWorkspaceConnectionCollection(client, Id)); } /// @@ -870,8 +870,8 @@ public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWo /// /// Friendly name of the workspace connection. /// The cancellation token to use. - /// 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> GetMachineLearningWorkspaceConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -893,8 +893,8 @@ public virtual async Task> /// /// Friendly name of the workspace connection. /// The cancellation token to use. - /// 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 GetMachineLearningWorkspaceConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -905,7 +905,7 @@ public virtual Response GetMachineLe /// An object representing collection of MachineLearningOutboundRuleBasicResources and their operations over a MachineLearningOutboundRuleBasicResource. public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutboundRuleBasics() { - return GetCachedClient(Client => new MachineLearningOutboundRuleBasicCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningOutboundRuleBasicCollection(client, Id)); } /// @@ -923,8 +923,8 @@ public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutb /// /// Name of the workspace managed network outbound rule. /// The cancellation token to use. - /// 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> GetMachineLearningOutboundRuleBasicAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -946,8 +946,8 @@ public virtual async Task> Ge /// /// Name of the workspace managed network outbound rule. /// The cancellation token to use. - /// 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 GetMachineLearningOutboundRuleBasic(string ruleName, CancellationToken cancellationToken = default) { @@ -958,7 +958,7 @@ public virtual Response GetMachineLear /// An object representing collection of MachineLearningPrivateEndpointConnectionResources and their operations over a MachineLearningPrivateEndpointConnectionResource. public virtual MachineLearningPrivateEndpointConnectionCollection GetMachineLearningPrivateEndpointConnections() { - return GetCachedClient(Client => new MachineLearningPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new MachineLearningPrivateEndpointConnectionCollection(client, Id)); } /// @@ -976,8 +976,8 @@ public virtual MachineLearningPrivateEndpointConnectionCollection GetMachineLear /// /// NRP Private Endpoint Connection Name. /// The cancellation token to use. - /// 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> GetMachineLearningPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -999,8 +999,8 @@ public virtual async Task /// NRP Private Endpoint Connection Name. /// The cancellation token to use. - /// 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 GetMachineLearningPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceArmClientMockingExtension.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceArmClientMockingExtension.cs new file mode 100644 index 000000000000..967fcb178e37 --- /dev/null +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance; + +namespace Azure.ResourceManager.Maintenance.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MaintenanceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MaintenanceArmClientMockingExtension() + { + } + + /// 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 MaintenanceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MaintenanceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MaintenancePublicConfigurationResource GetMaintenancePublicConfigurationResource(ResourceIdentifier id) + { + MaintenancePublicConfigurationResource.ValidateResourceId(id); + return new MaintenancePublicConfigurationResource(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 MaintenanceConfigurationResource GetMaintenanceConfigurationResource(ResourceIdentifier id) + { + MaintenanceConfigurationResource.ValidateResourceId(id); + return new MaintenanceConfigurationResource(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 MaintenanceApplyUpdateResource GetMaintenanceApplyUpdateResource(ResourceIdentifier id) + { + MaintenanceApplyUpdateResource.ValidateResourceId(id); + return new MaintenanceApplyUpdateResource(Client, id); + } + } +} diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs index 12644938a10a..bd95bcc2271d 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance.Mocking; using Azure.ResourceManager.Maintenance.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.Maintenance /// A class to add extension methods to Azure.ResourceManager.Maintenance. public static partial class MaintenanceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MaintenanceArmClientMockingExtension GetMaintenanceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MaintenanceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MaintenanceResourceGroupMockingExtension GetMaintenanceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MaintenanceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MaintenanceSubscriptionMockingExtension GetMaintenanceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MaintenanceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region MaintenancePublicConfigurationResource /// /// 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. /// Returns a object. public static MaintenancePublicConfigurationResource GetMaintenancePublicConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MaintenancePublicConfigurationResource.ValidateResourceId(id); - return new MaintenancePublicConfigurationResource(client, id); - } - ); + return GetMaintenanceArmClientMockingExtension(client).GetMaintenancePublicConfigurationResource(id); } - #endregion - #region MaintenanceConfigurationResource /// /// 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. /// Returns a object. public static MaintenanceConfigurationResource GetMaintenanceConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MaintenanceConfigurationResource.ValidateResourceId(id); - return new MaintenanceConfigurationResource(client, id); - } - ); + return GetMaintenanceArmClientMockingExtension(client).GetMaintenanceConfigurationResource(id); } - #endregion - #region MaintenanceApplyUpdateResource /// /// 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. /// Returns a object. public static MaintenanceApplyUpdateResource GetMaintenanceApplyUpdateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MaintenanceApplyUpdateResource.ValidateResourceId(id); - return new MaintenanceApplyUpdateResource(client, id); - } - ); + return GetMaintenanceArmClientMockingExtension(client).GetMaintenanceApplyUpdateResource(id); } - #endregion - /// Gets a collection of MaintenanceConfigurationResources in the ResourceGroupResource. + /// + /// Gets a collection of MaintenanceConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MaintenanceConfigurationResources and their operations over a MaintenanceConfigurationResource. public static MaintenanceConfigurationCollection GetMaintenanceConfigurations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMaintenanceConfigurations(); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceConfigurations(); } /// @@ -127,16 +109,20 @@ public static MaintenanceConfigurationCollection GetMaintenanceConfigurations(th /// MaintenanceConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maintenance Configuration Name. /// The cancellation token to use. - /// 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 static async Task> GetMaintenanceConfigurationAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMaintenanceConfigurations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceConfigurationAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -151,24 +137,34 @@ public static async Task> GetMaintena /// MaintenanceConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maintenance Configuration Name. /// The cancellation token to use. - /// 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 static Response GetMaintenanceConfiguration(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMaintenanceConfigurations().Get(resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceConfiguration(resourceName, cancellationToken); } - /// Gets a collection of MaintenanceApplyUpdateResources in the ResourceGroupResource. + /// + /// Gets a collection of MaintenanceApplyUpdateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MaintenanceApplyUpdateResources and their operations over a MaintenanceApplyUpdateResource. public static MaintenanceApplyUpdateCollection GetMaintenanceApplyUpdates(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMaintenanceApplyUpdates(); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceApplyUpdates(); } /// @@ -183,6 +179,10 @@ public static MaintenanceApplyUpdateCollection GetMaintenanceApplyUpdates(this R /// ApplyUpdates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -190,12 +190,12 @@ public static MaintenanceApplyUpdateCollection GetMaintenanceApplyUpdates(this R /// Resource identifier. /// applyUpdate Id. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetMaintenanceApplyUpdateAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string applyUpdateName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMaintenanceApplyUpdates().GetAsync(providerName, resourceType, resourceName, applyUpdateName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceApplyUpdateAsync(providerName, resourceType, resourceName, applyUpdateName, cancellationToken).ConfigureAwait(false); } /// @@ -210,6 +210,10 @@ public static async Task> GetMaintenanc /// ApplyUpdates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -217,12 +221,12 @@ public static async Task> GetMaintenanc /// Resource identifier. /// applyUpdate Id. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetMaintenanceApplyUpdate(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string applyUpdateName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMaintenanceApplyUpdates().Get(providerName, resourceType, resourceName, applyUpdateName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceApplyUpdate(providerName, resourceType, resourceName, applyUpdateName, cancellationToken); } /// @@ -237,6 +241,10 @@ public static Response GetMaintenanceApplyUpdate /// ApplyUpdates_GetParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -244,9 +252,7 @@ public static Response GetMaintenanceApplyUpdate /// is null. public static async Task> GetApplyUpdatesByParentAsync(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetApplyUpdatesByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApplyUpdatesByParentAsync(options, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetApplyUpdatesByParentAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -261,6 +267,10 @@ public static async Task> GetApplyUpdat /// ApplyUpdates_GetParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -268,9 +278,7 @@ public static async Task> GetApplyUpdat /// is null. public static Response GetApplyUpdatesByParent(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetApplyUpdatesByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApplyUpdatesByParent(options, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetApplyUpdatesByParent(options, cancellationToken); } /// @@ -285,6 +293,10 @@ public static Response GetApplyUpdatesByParent(t /// ApplyUpdates_CreateOrUpdateParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -297,13 +309,7 @@ public static Response GetApplyUpdatesByParent(t /// , , , or is null. public static async Task> CreateOrUpdateApplyUpdateByParentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateApplyUpdateByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateApplyUpdateByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -318,6 +324,10 @@ public static async Task> CreateOrUpdat /// ApplyUpdates_CreateOrUpdateParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -330,13 +340,7 @@ public static async Task> CreateOrUpdat /// , , , or is null. public static Response CreateOrUpdateApplyUpdateByParent(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateApplyUpdateByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateApplyUpdateByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); } /// @@ -351,6 +355,10 @@ public static Response CreateOrUpdateApplyUpdate /// ApplyUpdates_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -361,11 +369,7 @@ public static Response CreateOrUpdateApplyUpdate /// , or is null. public static async Task> CreateOrUpdateApplyUpdateAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateApplyUpdateAsync(providerName, resourceType, resourceName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateApplyUpdateAsync(providerName, resourceType, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -380,6 +384,10 @@ public static async Task> CreateOrUpdat /// ApplyUpdates_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -390,11 +398,7 @@ public static async Task> CreateOrUpdat /// , or is null. public static Response CreateOrUpdateApplyUpdate(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateApplyUpdate(providerName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateApplyUpdate(providerName, resourceType, resourceName, cancellationToken); } /// @@ -409,6 +413,10 @@ public static Response CreateOrUpdateApplyUpdate /// ConfigurationAssignments_GetParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -416,9 +424,7 @@ public static Response CreateOrUpdateApplyUpdate /// is null. public static async Task> GetConfigurationAssignmentByParentAsync(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -433,6 +439,10 @@ public static async Task> GetCo /// ConfigurationAssignments_GetParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -440,9 +450,7 @@ public static async Task> GetCo /// is null. public static Response GetConfigurationAssignmentByParent(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByParent(options, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentByParent(options, cancellationToken); } /// @@ -457,6 +465,10 @@ public static Response GetConfigurationA /// ConfigurationAssignments_CreateOrUpdateParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -464,9 +476,7 @@ public static Response GetConfigurationA /// is null. public static async Task> CreateOrUpdateConfigurationAssignmentByParentAsync(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -481,6 +491,10 @@ public static async Task> Creat /// ConfigurationAssignments_CreateOrUpdateParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -488,9 +502,7 @@ public static async Task> Creat /// is null. public static Response CreateOrUpdateConfigurationAssignmentByParent(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByParent(options, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByParent(options, cancellationToken); } /// @@ -505,6 +517,10 @@ public static Response CreateOrUpdateCon /// ConfigurationAssignments_DeleteParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -512,9 +528,7 @@ public static Response CreateOrUpdateCon /// is null. public static async Task> DeleteConfigurationAssignmentByParentAsync(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignmentByParentAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -529,6 +543,10 @@ public static async Task> Delet /// ConfigurationAssignments_DeleteParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -536,9 +554,7 @@ public static async Task> Delet /// is null. public static Response DeleteConfigurationAssignmentByParent(this ResourceGroupResource resourceGroupResource, ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByParent(options, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignmentByParent(options, cancellationToken); } /// @@ -553,6 +569,10 @@ public static Response DeleteConfigurati /// ConfigurationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -564,12 +584,7 @@ public static Response DeleteConfigurati /// , , or is null. public static async Task> GetConfigurationAssignmentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -584,6 +599,10 @@ public static async Task> GetCo /// ConfigurationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -595,12 +614,7 @@ public static async Task> GetCo /// , , or is null. public static Response GetConfigurationAssignment(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); } /// @@ -615,6 +629,10 @@ public static Response GetConfigurationA /// ConfigurationAssignments_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -627,13 +645,7 @@ public static Response GetConfigurationA /// , , , or is null. public static async Task> CreateOrUpdateConfigurationAssignmentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); } /// @@ -648,6 +660,10 @@ public static async Task> Creat /// ConfigurationAssignments_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -660,13 +676,7 @@ public static async Task> Creat /// , , , or is null. public static Response CreateOrUpdateConfigurationAssignment(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, data, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, data, cancellationToken); } /// @@ -681,6 +691,10 @@ public static Response CreateOrUpdateCon /// ConfigurationAssignments_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -692,12 +706,7 @@ public static Response CreateOrUpdateCon /// , , or is null. public static async Task> DeleteConfigurationAssignmentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignmentAsync(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -712,6 +721,10 @@ public static async Task> Delet /// ConfigurationAssignments_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -723,12 +736,7 @@ public static async Task> Delet /// , , or is null. public static Response DeleteConfigurationAssignment(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignment(providerName, resourceType, resourceName, configurationAssignmentName, cancellationToken); } /// @@ -743,6 +751,10 @@ public static Response DeleteConfigurati /// ConfigurationAssignments_ListParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -756,13 +768,7 @@ public static Response DeleteConfigurati /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationAssignmentsByParentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentsByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentsByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); } /// @@ -777,6 +783,10 @@ public static AsyncPageable GetConfigura /// ConfigurationAssignments_ListParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -790,13 +800,7 @@ public static AsyncPageable GetConfigura /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurationAssignmentsByParent(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentsByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentsByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); } /// @@ -811,6 +815,10 @@ public static Pageable GetConfigurationA /// ConfigurationAssignments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -822,11 +830,7 @@ public static Pageable GetConfigurationA /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationAssignmentsAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentsAsync(providerName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentsAsync(providerName, resourceType, resourceName, cancellationToken); } /// @@ -841,6 +845,10 @@ public static AsyncPageable GetConfigura /// ConfigurationAssignments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -852,11 +860,7 @@ public static AsyncPageable GetConfigura /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurationAssignments(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignments(providerName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignments(providerName, resourceType, resourceName, cancellationToken); } /// @@ -871,13 +875,17 @@ public static Pageable GetConfigurationA /// ApplyUpdateForResourceGroup_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMaintenanceApplyUpdatesAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMaintenanceApplyUpdatesAsync(cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceApplyUpdatesAsync(cancellationToken); } /// @@ -892,13 +900,17 @@ public static AsyncPageable GetMaintenanceApplyU /// ApplyUpdateForResourceGroup_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMaintenanceApplyUpdates(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMaintenanceApplyUpdates(cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetMaintenanceApplyUpdates(cancellationToken); } /// @@ -913,6 +925,10 @@ public static Pageable GetMaintenanceApplyUpdate /// ConfigurationAssignmentsForResourceGroup_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -921,9 +937,7 @@ public static Pageable GetMaintenanceApplyUpdate /// is null. public static async Task> GetConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -938,6 +952,10 @@ public static async Task> GetCo /// ConfigurationAssignmentsForResourceGroup_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -946,9 +964,7 @@ public static async Task> GetCo /// is null. public static Response GetConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); } /// @@ -963,6 +979,10 @@ public static Response GetConfigurationA /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -972,10 +992,7 @@ public static Response GetConfigurationA /// or is null. public static async Task> CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); } /// @@ -990,6 +1007,10 @@ public static async Task> Creat /// ConfigurationAssignmentsForResourceGroup_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -999,10 +1020,7 @@ public static async Task> Creat /// or is null. public static Response CreateOrUpdateConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); } /// @@ -1017,6 +1035,10 @@ public static Response CreateOrUpdateCon /// ConfigurationAssignmentsForResourceGroup_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1026,10 +1048,7 @@ public static Response CreateOrUpdateCon /// or is null. public static async Task> UpdateConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); } /// @@ -1044,6 +1063,10 @@ public static async Task> Updat /// ConfigurationAssignmentsForResourceGroup_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1053,10 +1076,7 @@ public static async Task> Updat /// or is null. public static Response UpdateConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).UpdateConfigurationAssignmentByResourceGroup(configurationAssignmentName, data, cancellationToken); } /// @@ -1071,6 +1091,10 @@ public static Response UpdateConfigurati /// ConfigurationAssignmentsForResourceGroup_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique configuration assignment name. @@ -1079,9 +1103,7 @@ public static Response UpdateConfigurati /// is null. public static async Task> DeleteConfigurationAssignmentByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroupAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -1096,6 +1118,10 @@ public static async Task> Delet /// ConfigurationAssignmentsForResourceGroup_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique configuration assignment name. @@ -1104,9 +1130,7 @@ public static async Task> Delet /// is null. public static Response DeleteConfigurationAssignmentByResourceGroup(this ResourceGroupResource resourceGroupResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).DeleteConfigurationAssignmentByResourceGroup(configurationAssignmentName, cancellationToken); } /// @@ -1121,6 +1145,10 @@ public static Response DeleteConfigurati /// Updates_ListParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -1134,13 +1162,7 @@ public static Response DeleteConfigurati /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUpdatesByParentAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetUpdatesByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetUpdatesByParentAsync(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); } /// @@ -1155,6 +1177,10 @@ public static AsyncPageable GetUpdatesByParentAsync(this Reso /// Updates_ListParent /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -1168,13 +1194,7 @@ public static AsyncPageable GetUpdatesByParentAsync(this Reso /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUpdatesByParent(this ResourceGroupResource resourceGroupResource, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); - Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetUpdatesByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetUpdatesByParent(providerName, resourceParentType, resourceParentName, resourceType, resourceName, cancellationToken); } /// @@ -1189,6 +1209,10 @@ public static Pageable GetUpdatesByParent(this ResourceGroupR /// Updates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -1200,11 +1224,7 @@ public static Pageable GetUpdatesByParent(this ResourceGroupR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUpdatesAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetUpdatesAsync(providerName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetUpdatesAsync(providerName, resourceType, resourceName, cancellationToken); } /// @@ -1219,6 +1239,10 @@ public static AsyncPageable GetUpdatesAsync(this ResourceGrou /// Updates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource provider name. @@ -1230,19 +1254,21 @@ public static AsyncPageable GetUpdatesAsync(this ResourceGrou /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUpdates(this ResourceGroupResource resourceGroupResource, string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetUpdates(providerName, resourceType, resourceName, cancellationToken); + return GetMaintenanceResourceGroupMockingExtension(resourceGroupResource).GetUpdates(providerName, resourceType, resourceName, cancellationToken); } - /// Gets a collection of MaintenancePublicConfigurationResources in the SubscriptionResource. + /// + /// Gets a collection of MaintenancePublicConfigurationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MaintenancePublicConfigurationResources and their operations over a MaintenancePublicConfigurationResource. public static MaintenancePublicConfigurationCollection GetMaintenancePublicConfigurations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenancePublicConfigurations(); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenancePublicConfigurations(); } /// @@ -1257,16 +1283,20 @@ public static MaintenancePublicConfigurationCollection GetMaintenancePublicConfi /// PublicMaintenanceConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maintenance Configuration Name. /// The cancellation token to use. - /// 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 static async Task> GetMaintenancePublicConfigurationAsync(this SubscriptionResource subscriptionResource, string resourceName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetMaintenancePublicConfigurations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenancePublicConfigurationAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1281,16 +1311,20 @@ public static async Task> GetMa /// PublicMaintenanceConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maintenance Configuration Name. /// The cancellation token to use. - /// 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 static Response GetMaintenancePublicConfiguration(this SubscriptionResource subscriptionResource, string resourceName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetMaintenancePublicConfigurations().Get(resourceName, cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenancePublicConfiguration(resourceName, cancellationToken); } /// @@ -1305,13 +1339,17 @@ public static Response GetMaintenancePub /// ApplyUpdates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMaintenanceApplyUpdatesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenanceApplyUpdatesAsync(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenanceApplyUpdatesAsync(cancellationToken); } /// @@ -1326,13 +1364,17 @@ public static AsyncPageable GetMaintenanceApplyU /// ApplyUpdates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMaintenanceApplyUpdates(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenanceApplyUpdates(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenanceApplyUpdates(cancellationToken); } /// @@ -1347,13 +1389,17 @@ public static Pageable GetMaintenanceApplyUpdate /// MaintenanceConfigurations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMaintenanceConfigurationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenanceConfigurationsAsync(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenanceConfigurationsAsync(cancellationToken); } /// @@ -1368,13 +1414,17 @@ public static AsyncPageable GetMaintenanceConf /// MaintenanceConfigurations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMaintenanceConfigurations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMaintenanceConfigurations(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetMaintenanceConfigurations(cancellationToken); } /// @@ -1389,13 +1439,17 @@ public static Pageable GetMaintenanceConfigura /// ConfigurationAssignmentsWithinSubscription_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationAssignmentsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentsBySubscriptionAsync(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetConfigurationAssignmentsBySubscriptionAsync(cancellationToken); } /// @@ -1410,13 +1464,17 @@ public static AsyncPageable GetConfigura /// ConfigurationAssignmentsWithinSubscription_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurationAssignmentsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentsBySubscription(cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetConfigurationAssignmentsBySubscription(cancellationToken); } /// @@ -1431,6 +1489,10 @@ public static Pageable GetConfigurationA /// ConfigurationAssignmentsForSubscriptions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1439,9 +1501,7 @@ public static Pageable GetConfigurationA /// is null. public static async Task> GetConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -1456,6 +1516,10 @@ public static async Task> GetCo /// ConfigurationAssignmentsForSubscriptions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1464,9 +1528,7 @@ public static async Task> GetCo /// is null. public static Response GetConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).GetConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); } /// @@ -1481,6 +1543,10 @@ public static Response GetConfigurationA /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1490,10 +1556,7 @@ public static Response GetConfigurationA /// or is null. public static async Task> CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceSubscriptionMockingExtension(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); } /// @@ -1508,6 +1571,10 @@ public static async Task> Creat /// ConfigurationAssignmentsForSubscriptions_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1517,10 +1584,7 @@ public static async Task> Creat /// or is null. public static Response CreateOrUpdateConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).CreateOrUpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); } /// @@ -1535,6 +1599,10 @@ public static Response CreateOrUpdateCon /// ConfigurationAssignmentsForSubscriptions_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1544,10 +1612,7 @@ public static Response CreateOrUpdateCon /// or is null. public static async Task> UpdateConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceSubscriptionMockingExtension(subscriptionResource).UpdateConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, data, cancellationToken).ConfigureAwait(false); } /// @@ -1562,6 +1627,10 @@ public static async Task> Updat /// ConfigurationAssignmentsForSubscriptions_Update /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Configuration assignment name. @@ -1571,10 +1640,7 @@ public static async Task> Updat /// or is null. public static Response UpdateConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).UpdateConfigurationAssignmentBySubscription(configurationAssignmentName, data, cancellationToken); } /// @@ -1589,6 +1655,10 @@ public static Response UpdateConfigurati /// ConfigurationAssignmentsForSubscriptions_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique configuration assignment name. @@ -1597,9 +1667,7 @@ public static Response UpdateConfigurati /// is null. public static async Task> DeleteConfigurationAssignmentBySubscriptionAsync(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).DeleteConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetMaintenanceSubscriptionMockingExtension(subscriptionResource).DeleteConfigurationAssignmentBySubscriptionAsync(configurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -1614,6 +1682,10 @@ public static async Task> Delet /// ConfigurationAssignmentsForSubscriptions_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique configuration assignment name. @@ -1622,9 +1694,7 @@ public static async Task> Delet /// is null. public static Response DeleteConfigurationAssignmentBySubscription(this SubscriptionResource subscriptionResource, string configurationAssignmentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).DeleteConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); + return GetMaintenanceSubscriptionMockingExtension(subscriptionResource).DeleteConfigurationAssignmentBySubscription(configurationAssignmentName, cancellationToken); } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceResourceGroupMockingExtension.cs similarity index 68% rename from sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceResourceGroupMockingExtension.cs index 154a784272ec..dbd4cf0fadd7 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceResourceGroupMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance; using Azure.ResourceManager.Maintenance.Models; -namespace Azure.ResourceManager.Maintenance +namespace Azure.ResourceManager.Maintenance.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class MaintenanceResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _maintenanceApplyUpdateApplyUpdatesClientDiagnostics; private ApplyUpdatesRestOperations _maintenanceApplyUpdateApplyUpdatesRestClient; @@ -31,15 +32,15 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource private ClientDiagnostics _updatesClientDiagnostics; private UpdatesRestOperations _updatesRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MaintenanceResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MaintenanceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,14 +65,112 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of MaintenanceConfigurationResources and their operations over a MaintenanceConfigurationResource. public virtual MaintenanceConfigurationCollection GetMaintenanceConfigurations() { - return GetCachedClient(Client => new MaintenanceConfigurationCollection(Client, Id)); + return GetCachedClient(client => new MaintenanceConfigurationCollection(client, Id)); + } + + /// + /// Get Configuration record + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// + /// Maintenance Configuration Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMaintenanceConfigurationAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetMaintenanceConfigurations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Configuration record + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// + /// Maintenance Configuration Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMaintenanceConfiguration(string resourceName, CancellationToken cancellationToken = default) + { + return GetMaintenanceConfigurations().Get(resourceName, cancellationToken); } /// Gets a collection of MaintenanceApplyUpdateResources in the ResourceGroupResource. /// An object representing collection of MaintenanceApplyUpdateResources and their operations over a MaintenanceApplyUpdateResource. public virtual MaintenanceApplyUpdateCollection GetMaintenanceApplyUpdates() { - return GetCachedClient(Client => new MaintenanceApplyUpdateCollection(Client, Id)); + return GetCachedClient(client => new MaintenanceApplyUpdateCollection(client, Id)); + } + + /// + /// Track maintenance updates to resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName} + /// + /// + /// Operation Id + /// ApplyUpdates_Get + /// + /// + /// + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// applyUpdate Id. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMaintenanceApplyUpdateAsync(string providerName, string resourceType, string resourceName, string applyUpdateName, CancellationToken cancellationToken = default) + { + return await GetMaintenanceApplyUpdates().GetAsync(providerName, resourceType, resourceName, applyUpdateName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Track maintenance updates to resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName} + /// + /// + /// Operation Id + /// ApplyUpdates_Get + /// + /// + /// + /// Resource provider name. + /// Resource type. + /// Resource identifier. + /// applyUpdate Id. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMaintenanceApplyUpdate(string providerName, string resourceType, string resourceName, string applyUpdateName, CancellationToken cancellationToken = default) + { + return GetMaintenanceApplyUpdates().Get(providerName, resourceType, resourceName, applyUpdateName, cancellationToken); } /// @@ -89,9 +188,12 @@ public virtual MaintenanceApplyUpdateCollection GetMaintenanceApplyUpdates() /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> GetApplyUpdatesByParentAsync(ResourceGroupResourceGetApplyUpdatesByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetApplyUpdatesByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetApplyUpdatesByParent"); scope.Start(); try { @@ -120,9 +222,12 @@ public virtual async Task> GetApplyUpda /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response GetApplyUpdatesByParent(ResourceGroupResourceGetApplyUpdatesByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetApplyUpdatesByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetApplyUpdatesByParent"); scope.Start(); try { @@ -155,9 +260,17 @@ public virtual Response GetApplyUpdatesByParent( /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. public virtual async Task> CreateOrUpdateApplyUpdateByParentAsync(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateApplyUpdateByParent"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateApplyUpdateByParent"); scope.Start(); try { @@ -190,9 +303,17 @@ public virtual async Task> CreateOrUpda /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. public virtual Response CreateOrUpdateApplyUpdateByParent(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateApplyUpdateByParent"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateApplyUpdateByParent"); scope.Start(); try { @@ -223,9 +344,15 @@ public virtual Response CreateOrUpdateApplyUpdat /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> CreateOrUpdateApplyUpdateAsync(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateApplyUpdate"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateApplyUpdate"); scope.Start(); try { @@ -256,9 +383,15 @@ public virtual async Task> CreateOrUpda /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual Response CreateOrUpdateApplyUpdate(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateApplyUpdate"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = MaintenanceApplyUpdateApplyUpdatesClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateApplyUpdate"); scope.Start(); try { @@ -287,9 +420,12 @@ public virtual Response CreateOrUpdateApplyUpdat /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> GetConfigurationAssignmentByParentAsync(ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentByParent"); scope.Start(); try { @@ -318,9 +454,12 @@ public virtual async Task> GetC /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response GetConfigurationAssignmentByParent(ResourceGroupResourceGetConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentByParent"); scope.Start(); try { @@ -349,9 +488,12 @@ public virtual Response GetConfiguration /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> CreateOrUpdateConfigurationAssignmentByParentAsync(ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignmentByParent"); scope.Start(); try { @@ -380,9 +522,12 @@ public virtual async Task> Crea /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response CreateOrUpdateConfigurationAssignmentByParent(ResourceGroupResourceCreateOrUpdateConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignmentByParent"); scope.Start(); try { @@ -411,9 +556,12 @@ public virtual Response CreateOrUpdateCo /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> DeleteConfigurationAssignmentByParentAsync(ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignmentByParent"); scope.Start(); try { @@ -442,9 +590,12 @@ public virtual async Task> Dele /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response DeleteConfigurationAssignmentByParent(ResourceGroupResourceDeleteConfigurationAssignmentByParentOptions options, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByParent"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignmentByParent"); scope.Start(); try { @@ -476,9 +627,16 @@ public virtual Response DeleteConfigurat /// Resource identifier. /// Configuration assignment name. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual async Task> GetConfigurationAssignmentAsync(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignment"); scope.Start(); try { @@ -510,9 +668,16 @@ public virtual async Task> GetC /// Resource identifier. /// Configuration assignment name. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual Response GetConfigurationAssignment(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignment"); scope.Start(); try { @@ -545,9 +710,17 @@ public virtual Response GetConfiguration /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. public virtual async Task> CreateOrUpdateConfigurationAssignmentAsync(string providerName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignment"); scope.Start(); try { @@ -580,9 +753,17 @@ public virtual async Task> Crea /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. public virtual Response CreateOrUpdateConfigurationAssignment(string providerName, string resourceType, string resourceName, string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignment"); scope.Start(); try { @@ -614,9 +795,16 @@ public virtual Response CreateOrUpdateCo /// Resource identifier. /// Unique configuration assignment name. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual async Task> DeleteConfigurationAssignmentAsync(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignment"); scope.Start(); try { @@ -648,9 +836,16 @@ public virtual async Task> Dele /// Resource identifier. /// Unique configuration assignment name. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual Response DeleteConfigurationAssignment(string providerName, string resourceType, string resourceName, string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignment"); + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignment"); scope.Start(); try { @@ -683,11 +878,19 @@ public virtual Response DeleteConfigurat /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetConfigurationAssignmentsByParentAsync(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsRestClient.CreateListParentRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurationAssignmentsByParent", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentsByParent", "value", null, cancellationToken); } /// @@ -709,11 +912,19 @@ public virtual AsyncPageable GetConfigur /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetConfigurationAssignmentsByParent(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsRestClient.CreateListParentRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurationAssignmentsByParent", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentsByParent", "value", null, cancellationToken); } /// @@ -733,11 +944,17 @@ public virtual Pageable GetConfiguration /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetConfigurationAssignmentsAsync(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurationAssignments", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetConfigurationAssignments", "value", null, cancellationToken); } /// @@ -757,11 +974,17 @@ public virtual AsyncPageable GetConfigur /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetConfigurationAssignments(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurationAssignments", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetConfigurationAssignments", "value", null, cancellationToken); } /// @@ -782,7 +1005,7 @@ public virtual Pageable GetConfiguration public virtual AsyncPageable GetMaintenanceApplyUpdatesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplyUpdateForResourceGroupRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), ApplyUpdateForResourceGroupClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetMaintenanceApplyUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), ApplyUpdateForResourceGroupClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetMaintenanceApplyUpdates", "value", null, cancellationToken); } /// @@ -803,7 +1026,7 @@ public virtual AsyncPageable GetMaintenanceApply public virtual Pageable GetMaintenanceApplyUpdates(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplyUpdateForResourceGroupRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), ApplyUpdateForResourceGroupClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetMaintenanceApplyUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), ApplyUpdateForResourceGroupClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetMaintenanceApplyUpdates", "value", null, cancellationToken); } /// @@ -821,9 +1044,13 @@ public virtual Pageable GetMaintenanceApplyUpdat /// /// Configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -852,9 +1079,13 @@ public virtual async Task> GetC /// /// Configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetConfigurationAssignmentByResourceGroup(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.GetConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -884,9 +1115,14 @@ public virtual Response GetConfiguration /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> CreateOrUpdateConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -916,9 +1152,14 @@ public virtual async Task> Crea /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response CreateOrUpdateConfigurationAssignmentByResourceGroup(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.CreateOrUpdateConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -948,9 +1189,14 @@ public virtual Response CreateOrUpdateCo /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> UpdateConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.UpdateConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.UpdateConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -980,9 +1226,14 @@ public virtual async Task> Upda /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response UpdateConfigurationAssignmentByResourceGroup(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.UpdateConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.UpdateConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -1011,9 +1262,13 @@ public virtual Response UpdateConfigurat /// /// Unique configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> DeleteConfigurationAssignmentByResourceGroupAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -1042,9 +1297,13 @@ public virtual async Task> Dele /// /// Unique configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response DeleteConfigurationAssignmentByResourceGroup(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteConfigurationAssignmentByResourceGroup"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForResourceGroupClientDiagnostics.CreateScope("MaintenanceResourceGroupMockingExtension.DeleteConfigurationAssignmentByResourceGroup"); scope.Start(); try { @@ -1077,11 +1336,19 @@ public virtual Response DeleteConfigurat /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetUpdatesByParentAsync(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => UpdatesRestClient.CreateListParentRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetUpdatesByParent", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetUpdatesByParent", "value", null, cancellationToken); } /// @@ -1103,11 +1370,19 @@ public virtual AsyncPageable GetUpdatesByParentAsync(string p /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetUpdatesByParent(string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceParentType, nameof(resourceParentType)); + Argument.AssertNotNullOrEmpty(resourceParentName, nameof(resourceParentName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => UpdatesRestClient.CreateListParentRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetUpdatesByParent", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetUpdatesByParent", "value", null, cancellationToken); } /// @@ -1127,11 +1402,17 @@ public virtual Pageable GetUpdatesByParent(string providerNam /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetUpdatesAsync(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => UpdatesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetUpdates", "value", null, cancellationToken); } /// @@ -1151,11 +1432,17 @@ public virtual AsyncPageable GetUpdatesAsync(string providerN /// Resource type. /// Resource identifier. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetUpdates(string providerName, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); + Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => UpdatesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, providerName, resourceType, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceUpdate.DeserializeMaintenanceUpdate, UpdatesClientDiagnostics, Pipeline, "MaintenanceResourceGroupMockingExtension.GetUpdates", "value", null, cancellationToken); } } } diff --git a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceSubscriptionMockingExtension.cs similarity index 74% rename from sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceSubscriptionMockingExtension.cs index b921547d35e3..4f97cead2ecc 100644 --- a/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/maintenance/Azure.ResourceManager.Maintenance/src/Generated/Extensions/MaintenanceSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Maintenance; using Azure.ResourceManager.Maintenance.Models; -namespace Azure.ResourceManager.Maintenance +namespace Azure.ResourceManager.Maintenance.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MaintenanceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _maintenanceApplyUpdateApplyUpdatesClientDiagnostics; private ApplyUpdatesRestOperations _maintenanceApplyUpdateApplyUpdatesRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _configurationAssignmentsForSubscriptionsClientDiagnostics; private ConfigurationAssignmentsForSubscriptionsRestOperations _configurationAssignmentsForSubscriptionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MaintenanceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MaintenanceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of MaintenancePublicConfigurationResources and their operations over a MaintenancePublicConfigurationResource. public virtual MaintenancePublicConfigurationCollection GetMaintenancePublicConfigurations() { - return GetCachedClient(Client => new MaintenancePublicConfigurationCollection(Client, Id)); + return GetCachedClient(client => new MaintenancePublicConfigurationCollection(client, Id)); + } + + /// + /// Get Public Maintenance Configuration record + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName} + /// + /// + /// Operation Id + /// PublicMaintenanceConfigurations_Get + /// + /// + /// + /// Maintenance Configuration Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMaintenancePublicConfigurationAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetMaintenancePublicConfigurations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Public Maintenance Configuration record + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName} + /// + /// + /// Operation Id + /// PublicMaintenanceConfigurations_Get + /// + /// + /// + /// Maintenance Configuration Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMaintenancePublicConfiguration(string resourceName, CancellationToken cancellationToken = default) + { + return GetMaintenancePublicConfigurations().Get(resourceName, cancellationToken); } /// @@ -81,7 +128,7 @@ public virtual MaintenancePublicConfigurationCollection GetMaintenancePublicConf public virtual AsyncPageable GetMaintenanceApplyUpdatesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MaintenanceApplyUpdateApplyUpdatesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), MaintenanceApplyUpdateApplyUpdatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMaintenanceApplyUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), MaintenanceApplyUpdateApplyUpdatesClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetMaintenanceApplyUpdates", "value", null, cancellationToken); } /// @@ -102,7 +149,7 @@ public virtual AsyncPageable GetMaintenanceApply public virtual Pageable GetMaintenanceApplyUpdates(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MaintenanceApplyUpdateApplyUpdatesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), MaintenanceApplyUpdateApplyUpdatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMaintenanceApplyUpdates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceApplyUpdateResource(Client, MaintenanceApplyUpdateData.DeserializeMaintenanceApplyUpdateData(e)), MaintenanceApplyUpdateApplyUpdatesClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetMaintenanceApplyUpdates", "value", null, cancellationToken); } /// @@ -123,7 +170,7 @@ public virtual Pageable GetMaintenanceApplyUpdat public virtual AsyncPageable GetMaintenanceConfigurationsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MaintenanceConfigurationRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationData.DeserializeMaintenanceConfigurationData(e)), MaintenanceConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMaintenanceConfigurations", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationData.DeserializeMaintenanceConfigurationData(e)), MaintenanceConfigurationClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetMaintenanceConfigurations", "value", null, cancellationToken); } /// @@ -144,7 +191,7 @@ public virtual AsyncPageable GetMaintenanceCon public virtual Pageable GetMaintenanceConfigurations(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MaintenanceConfigurationRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationData.DeserializeMaintenanceConfigurationData(e)), MaintenanceConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMaintenanceConfigurations", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationData.DeserializeMaintenanceConfigurationData(e)), MaintenanceConfigurationClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetMaintenanceConfigurations", "value", null, cancellationToken); } /// @@ -165,7 +212,7 @@ public virtual Pageable GetMaintenanceConfigur public virtual AsyncPageable GetConfigurationAssignmentsBySubscriptionAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsWithinSubscriptionRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); } /// @@ -186,7 +233,7 @@ public virtual AsyncPageable GetConfigur public virtual Pageable GetConfigurationAssignmentsBySubscription(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationAssignmentsWithinSubscriptionRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MaintenanceConfigurationAssignmentData.DeserializeMaintenanceConfigurationAssignmentData, ConfigurationAssignmentsWithinSubscriptionClientDiagnostics, Pipeline, "MaintenanceSubscriptionMockingExtension.GetConfigurationAssignmentsBySubscription", "value", null, cancellationToken); } /// @@ -204,9 +251,13 @@ public virtual Pageable GetConfiguration /// /// Configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.GetConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -235,9 +286,13 @@ public virtual async Task> GetC /// /// Configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetConfigurationAssignmentBySubscription(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.GetConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -267,9 +322,14 @@ public virtual Response GetConfiguration /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> CreateOrUpdateConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.CreateOrUpdateConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -299,9 +359,14 @@ public virtual async Task> Crea /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response CreateOrUpdateConfigurationAssignmentBySubscription(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.CreateOrUpdateConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -331,9 +396,14 @@ public virtual Response CreateOrUpdateCo /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> UpdateConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.UpdateConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -363,9 +433,14 @@ public virtual async Task> Upda /// Configuration assignment name. /// The configurationAssignment. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response UpdateConfigurationAssignmentBySubscription(string configurationAssignmentName, MaintenanceConfigurationAssignmentData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.UpdateConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -394,9 +469,13 @@ public virtual Response UpdateConfigurat /// /// Unique configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> DeleteConfigurationAssignmentBySubscriptionAsync(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DeleteConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.DeleteConfigurationAssignmentBySubscription"); scope.Start(); try { @@ -425,9 +504,13 @@ public virtual async Task> Dele /// /// Unique configuration assignment name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response DeleteConfigurationAssignmentBySubscription(string configurationAssignmentName, CancellationToken cancellationToken = default) { - using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DeleteConfigurationAssignmentBySubscription"); + Argument.AssertNotNullOrEmpty(configurationAssignmentName, nameof(configurationAssignmentName)); + + using var scope = ConfigurationAssignmentsForSubscriptionsClientDiagnostics.CreateScope("MaintenanceSubscriptionMockingExtension.DeleteConfigurationAssignmentBySubscription"); scope.Start(); try { diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index b4748f270095..000000000000 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ManagedNetwork -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ScopeAssignmentResources in the ArmResource. - /// An object representing collection of ScopeAssignmentResources and their operations over a ScopeAssignmentResource. - public virtual ScopeAssignmentCollection GetScopeAssignments() - { - return GetCachedClient(Client => new ScopeAssignmentCollection(Client, Id)); - } - } -} diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkArmClientMockingExtension.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkArmClientMockingExtension.cs new file mode 100644 index 000000000000..d2d09ada8d87 --- /dev/null +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetwork; + +namespace Azure.ResourceManager.ManagedNetwork.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ManagedNetworkArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkArmClientMockingExtension() + { + } + + /// 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 ManagedNetworkArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ManagedNetworkArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ScopeAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ScopeAssignmentResources and their operations over a ScopeAssignmentResource. + public virtual ScopeAssignmentCollection GetScopeAssignments(ResourceIdentifier scope) + { + return new ScopeAssignmentCollection(Client, scope); + } + + /// + /// Get the specified scope assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} + /// + /// + /// Operation Id + /// ScopeAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the scope assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScopeAssignmentAsync(ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) + { + return await GetScopeAssignments(scope).GetAsync(scopeAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified scope assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} + /// + /// + /// Operation Id + /// ScopeAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the scope assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScopeAssignment(ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) + { + return GetScopeAssignments(scope).Get(scopeAssignmentName, 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 ManagedNetworkResource GetManagedNetworkResource(ResourceIdentifier id) + { + ManagedNetworkResource.ValidateResourceId(id); + return new ManagedNetworkResource(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 ScopeAssignmentResource GetScopeAssignmentResource(ResourceIdentifier id) + { + ScopeAssignmentResource.ValidateResourceId(id); + return new ScopeAssignmentResource(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 ManagedNetworkGroupResource GetManagedNetworkGroupResource(ResourceIdentifier id) + { + ManagedNetworkGroupResource.ValidateResourceId(id); + return new ManagedNetworkGroupResource(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 ManagedNetworkPeeringPolicyResource GetManagedNetworkPeeringPolicyResource(ResourceIdentifier id) + { + ManagedNetworkPeeringPolicyResource.ValidateResourceId(id); + return new ManagedNetworkPeeringPolicyResource(Client, id); + } + } +} diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkExtensions.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkExtensions.cs index e9a9c1f7afdb..33f0080904c5 100644 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkExtensions.cs +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetwork.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ManagedNetwork @@ -18,194 +19,170 @@ namespace Azure.ResourceManager.ManagedNetwork /// A class to add extension methods to Azure.ResourceManager.ManagedNetwork. public static partial class ManagedNetworkExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ManagedNetworkArmClientMockingExtension GetManagedNetworkArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ManagedNetworkArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ManagedNetworkResourceGroupMockingExtension GetManagedNetworkResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ManagedNetworkResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ManagedNetworkSubscriptionMockingExtension GetManagedNetworkSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ManagedNetworkSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// Gets a collection of ScopeAssignmentResources 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. + /// An object representing collection of ScopeAssignmentResources and their operations over a ScopeAssignmentResource. + public static ScopeAssignmentCollection GetScopeAssignments(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return GetManagedNetworkArmClientMockingExtension(client).GetScopeAssignments(scope); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + /// + /// Get the specified scope assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} + /// + /// + /// Operation Id + /// ScopeAssignments_Get + /// + /// + /// + /// 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 scope assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetScopeAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return await GetManagedNetworkArmClientMockingExtension(client).GetScopeAssignmentAsync(scope, scopeAssignmentName, cancellationToken).ConfigureAwait(false); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// Get the specified scope assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} + /// + /// + /// Operation Id + /// ScopeAssignments_Get + /// + /// + /// + /// 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 scope assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetScopeAssignment(this ArmClient client, ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return GetManagedNetworkArmClientMockingExtension(client).GetScopeAssignment(scope, scopeAssignmentName, cancellationToken); } - #region ManagedNetworkResource + /// /// 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. /// Returns a object. public static ManagedNetworkResource GetManagedNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedNetworkResource.ValidateResourceId(id); - return new ManagedNetworkResource(client, id); - } - ); + return GetManagedNetworkArmClientMockingExtension(client).GetManagedNetworkResource(id); } - #endregion - #region ScopeAssignmentResource /// /// 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. /// Returns a object. public static ScopeAssignmentResource GetScopeAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScopeAssignmentResource.ValidateResourceId(id); - return new ScopeAssignmentResource(client, id); - } - ); + return GetManagedNetworkArmClientMockingExtension(client).GetScopeAssignmentResource(id); } - #endregion - #region ManagedNetworkGroupResource /// /// 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. /// Returns a object. public static ManagedNetworkGroupResource GetManagedNetworkGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedNetworkGroupResource.ValidateResourceId(id); - return new ManagedNetworkGroupResource(client, id); - } - ); + return GetManagedNetworkArmClientMockingExtension(client).GetManagedNetworkGroupResource(id); } - #endregion - #region ManagedNetworkPeeringPolicyResource /// /// 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. /// Returns a object. public static ManagedNetworkPeeringPolicyResource GetManagedNetworkPeeringPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedNetworkPeeringPolicyResource.ValidateResourceId(id); - return new ManagedNetworkPeeringPolicyResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of ScopeAssignmentResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of ScopeAssignmentResources and their operations over a ScopeAssignmentResource. - public static ScopeAssignmentCollection GetScopeAssignments(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetScopeAssignments(); + return GetManagedNetworkArmClientMockingExtension(client).GetManagedNetworkPeeringPolicyResource(id); } /// - /// Get the specified scope assignment. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} - /// + /// Gets a collection of ManagedNetworkResources in the ResourceGroupResource. /// - /// Operation Id - /// ScopeAssignments_Get + /// 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 scope assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetScopeAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) - { - return await client.GetScopeAssignments(scope).GetAsync(scopeAssignmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified scope assignment. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.ManagedNetwork/scopeAssignments/{scopeAssignmentName} - /// - /// - /// Operation Id - /// ScopeAssignments_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of the scope assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetScopeAssignment(this ArmClient client, ResourceIdentifier scope, string scopeAssignmentName, CancellationToken cancellationToken = default) - { - return client.GetScopeAssignments(scope).Get(scopeAssignmentName, cancellationToken); - } - - /// Gets a collection of ManagedNetworkResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of ManagedNetworkResources and their operations over a ManagedNetworkResource. public static ManagedNetworkCollection GetManagedNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedNetworks(); + return GetManagedNetworkResourceGroupMockingExtension(resourceGroupResource).GetManagedNetworks(); } /// @@ -220,16 +197,20 @@ public static ManagedNetworkCollection GetManagedNetworks(this ResourceGroupReso /// ManagedNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Managed Network. /// The cancellation token to use. - /// 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 static async Task> GetManagedNetworkAsync(this ResourceGroupResource resourceGroupResource, string managedNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedNetworks().GetAsync(managedNetworkName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkResourceGroupMockingExtension(resourceGroupResource).GetManagedNetworkAsync(managedNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -244,16 +225,20 @@ public static async Task> GetManagedNetworkAsyn /// ManagedNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Managed Network. /// The cancellation token to use. - /// 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 static Response GetManagedNetwork(this ResourceGroupResource resourceGroupResource, string managedNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedNetworks().Get(managedNetworkName, cancellationToken); + return GetManagedNetworkResourceGroupMockingExtension(resourceGroupResource).GetManagedNetwork(managedNetworkName, cancellationToken); } /// @@ -268,6 +253,10 @@ public static Response GetManagedNetwork(this ResourceGr /// ManagedNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to limit the number of results in a page for list queries. @@ -276,7 +265,7 @@ public static Response GetManagedNetwork(this ResourceGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedNetworksAsync(this SubscriptionResource subscriptionResource, int? top = null, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedNetworksAsync(top, skiptoken, cancellationToken); + return GetManagedNetworkSubscriptionMockingExtension(subscriptionResource).GetManagedNetworksAsync(top, skiptoken, cancellationToken); } /// @@ -291,6 +280,10 @@ public static AsyncPageable GetManagedNetworksAsync(this /// ManagedNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to limit the number of results in a page for list queries. @@ -299,7 +292,7 @@ public static AsyncPageable GetManagedNetworksAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedNetworks(this SubscriptionResource subscriptionResource, int? top = null, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedNetworks(top, skiptoken, cancellationToken); + return GetManagedNetworkSubscriptionMockingExtension(subscriptionResource).GetManagedNetworks(top, skiptoken, cancellationToken); } } } diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkResourceGroupMockingExtension.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..b62fcbe20b13 --- /dev/null +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetwork; + +namespace Azure.ResourceManager.ManagedNetwork.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ManagedNetworkResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkResourceGroupMockingExtension() + { + } + + /// 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 ManagedNetworkResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ManagedNetworkResources in the ResourceGroupResource. + /// An object representing collection of ManagedNetworkResources and their operations over a ManagedNetworkResource. + public virtual ManagedNetworkCollection GetManagedNetworks() + { + return GetCachedClient(client => new ManagedNetworkCollection(client, Id)); + } + + /// + /// The Get ManagedNetworks operation gets a Managed Network Resource, specified by the resource group and Managed Network name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetwork/managedNetworks/{managedNetworkName} + /// + /// + /// Operation Id + /// ManagedNetworks_Get + /// + /// + /// + /// The name of the Managed Network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedNetworkAsync(string managedNetworkName, CancellationToken cancellationToken = default) + { + return await GetManagedNetworks().GetAsync(managedNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// The Get ManagedNetworks operation gets a Managed Network Resource, specified by the resource group and Managed Network name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetwork/managedNetworks/{managedNetworkName} + /// + /// + /// Operation Id + /// ManagedNetworks_Get + /// + /// + /// + /// The name of the Managed Network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedNetwork(string managedNetworkName, CancellationToken cancellationToken = default) + { + return GetManagedNetworks().Get(managedNetworkName, cancellationToken); + } + } +} diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkSubscriptionMockingExtension.cs similarity index 87% rename from sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkSubscriptionMockingExtension.cs index 72855a96bf58..3e920b642938 100644 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ManagedNetworkSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetwork; -namespace Azure.ResourceManager.ManagedNetwork +namespace Azure.ResourceManager.ManagedNetwork.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ManagedNetworkSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _managedNetworkClientDiagnostics; private ManagedNetworksRestOperations _managedNetworkRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ManagedNetworkSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -62,7 +63,7 @@ public virtual AsyncPageable GetManagedNetworksAsync(int { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedNetworkRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedNetworkRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedNetworkResource(Client, ManagedNetworkData.DeserializeManagedNetworkData(e)), ManagedNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedNetworkResource(Client, ManagedNetworkData.DeserializeManagedNetworkData(e)), ManagedNetworkClientDiagnostics, Pipeline, "ManagedNetworkSubscriptionMockingExtension.GetManagedNetworks", "value", "nextLink", cancellationToken); } /// @@ -86,7 +87,7 @@ public virtual Pageable GetManagedNetworks(int? top = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedNetworkRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedNetworkRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedNetworkResource(Client, ManagedNetworkData.DeserializeManagedNetworkData(e)), ManagedNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedNetworkResource(Client, ManagedNetworkData.DeserializeManagedNetworkData(e)), ManagedNetworkClientDiagnostics, Pipeline, "ManagedNetworkSubscriptionMockingExtension.GetManagedNetworks", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index fe9b5263ac21..000000000000 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ManagedNetwork -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ManagedNetworkResources in the ResourceGroupResource. - /// An object representing collection of ManagedNetworkResources and their operations over a ManagedNetworkResource. - public virtual ManagedNetworkCollection GetManagedNetworks() - { - return GetCachedClient(Client => new ManagedNetworkCollection(Client, Id)); - } - } -} diff --git a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/ManagedNetworkResource.cs b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/ManagedNetworkResource.cs index 684dab362b6c..4e3edcd9ae16 100644 --- a/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/ManagedNetworkResource.cs +++ b/sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/src/Generated/ManagedNetworkResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedNetworkGroupResources and their operations over a ManagedNetworkGroupResource. public virtual ManagedNetworkGroupCollection GetManagedNetworkGroups() { - return GetCachedClient(Client => new ManagedNetworkGroupCollection(Client, Id)); + return GetCachedClient(client => new ManagedNetworkGroupCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ManagedNetworkGroupCollection GetManagedNetworkGroups() /// /// The name of the Managed Network Group. /// The cancellation token to use. - /// 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> GetManagedNetworkGroupAsync(string managedNetworkGroupName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetManagedNetwo /// /// The name of the Managed Network Group. /// The cancellation token to use. - /// 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 GetManagedNetworkGroup(string managedNetworkGroupName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetManagedNetworkGroup(stri /// An object representing collection of ManagedNetworkPeeringPolicyResources and their operations over a ManagedNetworkPeeringPolicyResource. public virtual ManagedNetworkPeeringPolicyCollection GetManagedNetworkPeeringPolicies() { - return GetCachedClient(Client => new ManagedNetworkPeeringPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedNetworkPeeringPolicyCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ManagedNetworkPeeringPolicyCollection GetManagedNetworkPeeringPol /// /// The name of the Managed Network Peering Policy. /// The cancellation token to use. - /// 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> GetManagedNetworkPeeringPolicyAsync(string managedNetworkPeeringPolicyName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetMana /// /// The name of the Managed Network Peering Policy. /// The cancellation token to use. - /// 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 GetManagedNetworkPeeringPolicy(string managedNetworkPeeringPolicyName, CancellationToken cancellationToken = default) { diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricArmClientMockingExtension.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricArmClientMockingExtension.cs new file mode 100644 index 000000000000..de574071526d --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricArmClientMockingExtension.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetworkFabric; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ManagedNetworkFabricArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkFabricArmClientMockingExtension() + { + } + + /// 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 ManagedNetworkFabricArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ManagedNetworkFabricArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkFabricAccessControlListResource GetNetworkFabricAccessControlListResource(ResourceIdentifier id) + { + NetworkFabricAccessControlListResource.ValidateResourceId(id); + return new NetworkFabricAccessControlListResource(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 NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(ResourceIdentifier id) + { + NetworkFabricInternetGatewayResource.ValidateResourceId(id); + return new NetworkFabricInternetGatewayResource(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 NetworkFabricInternetGatewayRuleResource GetNetworkFabricInternetGatewayRuleResource(ResourceIdentifier id) + { + NetworkFabricInternetGatewayRuleResource.ValidateResourceId(id); + return new NetworkFabricInternetGatewayRuleResource(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 NetworkFabricIPCommunityResource GetNetworkFabricIPCommunityResource(ResourceIdentifier id) + { + NetworkFabricIPCommunityResource.ValidateResourceId(id); + return new NetworkFabricIPCommunityResource(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 NetworkFabricIPExtendedCommunityResource GetNetworkFabricIPExtendedCommunityResource(ResourceIdentifier id) + { + NetworkFabricIPExtendedCommunityResource.ValidateResourceId(id); + return new NetworkFabricIPExtendedCommunityResource(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 NetworkFabricIPPrefixResource GetNetworkFabricIPPrefixResource(ResourceIdentifier id) + { + NetworkFabricIPPrefixResource.ValidateResourceId(id); + return new NetworkFabricIPPrefixResource(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 NetworkFabricL2IsolationDomainResource GetNetworkFabricL2IsolationDomainResource(ResourceIdentifier id) + { + NetworkFabricL2IsolationDomainResource.ValidateResourceId(id); + return new NetworkFabricL2IsolationDomainResource(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 NetworkFabricL3IsolationDomainResource GetNetworkFabricL3IsolationDomainResource(ResourceIdentifier id) + { + NetworkFabricL3IsolationDomainResource.ValidateResourceId(id); + return new NetworkFabricL3IsolationDomainResource(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 NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(ResourceIdentifier id) + { + NetworkFabricInternalNetworkResource.ValidateResourceId(id); + return new NetworkFabricInternalNetworkResource(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 NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(ResourceIdentifier id) + { + NetworkFabricExternalNetworkResource.ValidateResourceId(id); + return new NetworkFabricExternalNetworkResource(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 NetworkFabricNeighborGroupResource GetNetworkFabricNeighborGroupResource(ResourceIdentifier id) + { + NetworkFabricNeighborGroupResource.ValidateResourceId(id); + return new NetworkFabricNeighborGroupResource(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 NetworkDeviceSkuResource GetNetworkDeviceSkuResource(ResourceIdentifier id) + { + NetworkDeviceSkuResource.ValidateResourceId(id); + return new NetworkDeviceSkuResource(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 NetworkDeviceResource GetNetworkDeviceResource(ResourceIdentifier id) + { + NetworkDeviceResource.ValidateResourceId(id); + return new NetworkDeviceResource(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 NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(ResourceIdentifier id) + { + NetworkDeviceInterfaceResource.ValidateResourceId(id); + return new NetworkDeviceInterfaceResource(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 NetworkFabricControllerResource GetNetworkFabricControllerResource(ResourceIdentifier id) + { + NetworkFabricControllerResource.ValidateResourceId(id); + return new NetworkFabricControllerResource(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 NetworkFabricSkuResource GetNetworkFabricSkuResource(ResourceIdentifier id) + { + NetworkFabricSkuResource.ValidateResourceId(id); + return new NetworkFabricSkuResource(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 NetworkFabricResource GetNetworkFabricResource(ResourceIdentifier id) + { + NetworkFabricResource.ValidateResourceId(id); + return new NetworkFabricResource(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 NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(ResourceIdentifier id) + { + NetworkToNetworkInterconnectResource.ValidateResourceId(id); + return new NetworkToNetworkInterconnectResource(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 NetworkPacketBrokerResource GetNetworkPacketBrokerResource(ResourceIdentifier id) + { + NetworkPacketBrokerResource.ValidateResourceId(id); + return new NetworkPacketBrokerResource(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 NetworkRackResource GetNetworkRackResource(ResourceIdentifier id) + { + NetworkRackResource.ValidateResourceId(id); + return new NetworkRackResource(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 NetworkTapRuleResource GetNetworkTapRuleResource(ResourceIdentifier id) + { + NetworkTapRuleResource.ValidateResourceId(id); + return new NetworkTapRuleResource(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 NetworkTapResource GetNetworkTapResource(ResourceIdentifier id) + { + NetworkTapResource.ValidateResourceId(id); + return new NetworkTapResource(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 NetworkFabricRoutePolicyResource GetNetworkFabricRoutePolicyResource(ResourceIdentifier id) + { + NetworkFabricRoutePolicyResource.ValidateResourceId(id); + return new NetworkFabricRoutePolicyResource(Client, id); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs index 6cab632a853a..64802fa40ea6 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetworkFabric.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ManagedNetworkFabric @@ -18,480 +19,401 @@ namespace Azure.ResourceManager.ManagedNetworkFabric /// A class to add extension methods to Azure.ResourceManager.ManagedNetworkFabric. public static partial class ManagedNetworkFabricExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ManagedNetworkFabricArmClientMockingExtension GetManagedNetworkFabricArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ManagedNetworkFabricArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ManagedNetworkFabricResourceGroupMockingExtension GetManagedNetworkFabricResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ManagedNetworkFabricResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ManagedNetworkFabricSubscriptionMockingExtension GetManagedNetworkFabricSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ManagedNetworkFabricSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NetworkFabricAccessControlListResource /// /// 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. /// Returns a object. public static NetworkFabricAccessControlListResource GetNetworkFabricAccessControlListResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricAccessControlListResource.ValidateResourceId(id); - return new NetworkFabricAccessControlListResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricAccessControlListResource(id); } - #endregion - #region NetworkFabricInternetGatewayResource /// /// 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. /// Returns a object. public static NetworkFabricInternetGatewayResource GetNetworkFabricInternetGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricInternetGatewayResource.ValidateResourceId(id); - return new NetworkFabricInternetGatewayResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricInternetGatewayResource(id); } - #endregion - #region NetworkFabricInternetGatewayRuleResource /// /// 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. /// Returns a object. public static NetworkFabricInternetGatewayRuleResource GetNetworkFabricInternetGatewayRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricInternetGatewayRuleResource.ValidateResourceId(id); - return new NetworkFabricInternetGatewayRuleResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricInternetGatewayRuleResource(id); } - #endregion - #region NetworkFabricIPCommunityResource /// /// 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. /// Returns a object. public static NetworkFabricIPCommunityResource GetNetworkFabricIPCommunityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricIPCommunityResource.ValidateResourceId(id); - return new NetworkFabricIPCommunityResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricIPCommunityResource(id); } - #endregion - #region NetworkFabricIPExtendedCommunityResource /// /// 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. /// Returns a object. public static NetworkFabricIPExtendedCommunityResource GetNetworkFabricIPExtendedCommunityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricIPExtendedCommunityResource.ValidateResourceId(id); - return new NetworkFabricIPExtendedCommunityResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricIPExtendedCommunityResource(id); } - #endregion - #region NetworkFabricIPPrefixResource /// /// 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. /// Returns a object. public static NetworkFabricIPPrefixResource GetNetworkFabricIPPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricIPPrefixResource.ValidateResourceId(id); - return new NetworkFabricIPPrefixResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricIPPrefixResource(id); } - #endregion - #region NetworkFabricL2IsolationDomainResource /// /// 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. /// Returns a object. public static NetworkFabricL2IsolationDomainResource GetNetworkFabricL2IsolationDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricL2IsolationDomainResource.ValidateResourceId(id); - return new NetworkFabricL2IsolationDomainResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricL2IsolationDomainResource(id); } - #endregion - #region NetworkFabricL3IsolationDomainResource /// /// 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. /// Returns a object. public static NetworkFabricL3IsolationDomainResource GetNetworkFabricL3IsolationDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricL3IsolationDomainResource.ValidateResourceId(id); - return new NetworkFabricL3IsolationDomainResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricL3IsolationDomainResource(id); } - #endregion - #region NetworkFabricInternalNetworkResource /// /// 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. /// Returns a object. public static NetworkFabricInternalNetworkResource GetNetworkFabricInternalNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricInternalNetworkResource.ValidateResourceId(id); - return new NetworkFabricInternalNetworkResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricInternalNetworkResource(id); } - #endregion - #region NetworkFabricExternalNetworkResource /// /// 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. /// Returns a object. public static NetworkFabricExternalNetworkResource GetNetworkFabricExternalNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricExternalNetworkResource.ValidateResourceId(id); - return new NetworkFabricExternalNetworkResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricExternalNetworkResource(id); } - #endregion - #region NetworkFabricNeighborGroupResource /// /// 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. /// Returns a object. public static NetworkFabricNeighborGroupResource GetNetworkFabricNeighborGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricNeighborGroupResource.ValidateResourceId(id); - return new NetworkFabricNeighborGroupResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricNeighborGroupResource(id); } - #endregion - #region NetworkDeviceSkuResource /// /// 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. /// Returns a object. public static NetworkDeviceSkuResource GetNetworkDeviceSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkDeviceSkuResource.ValidateResourceId(id); - return new NetworkDeviceSkuResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkDeviceSkuResource(id); } - #endregion - #region NetworkDeviceResource /// /// 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. /// Returns a object. public static NetworkDeviceResource GetNetworkDeviceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkDeviceResource.ValidateResourceId(id); - return new NetworkDeviceResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkDeviceResource(id); } - #endregion - #region NetworkDeviceInterfaceResource /// /// 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. /// Returns a object. public static NetworkDeviceInterfaceResource GetNetworkDeviceInterfaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkDeviceInterfaceResource.ValidateResourceId(id); - return new NetworkDeviceInterfaceResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkDeviceInterfaceResource(id); } - #endregion - #region NetworkFabricControllerResource /// /// 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. /// Returns a object. public static NetworkFabricControllerResource GetNetworkFabricControllerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricControllerResource.ValidateResourceId(id); - return new NetworkFabricControllerResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricControllerResource(id); } - #endregion - #region NetworkFabricSkuResource /// /// 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. /// Returns a object. public static NetworkFabricSkuResource GetNetworkFabricSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricSkuResource.ValidateResourceId(id); - return new NetworkFabricSkuResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricSkuResource(id); } - #endregion - #region NetworkFabricResource /// /// 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. /// Returns a object. public static NetworkFabricResource GetNetworkFabricResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricResource.ValidateResourceId(id); - return new NetworkFabricResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricResource(id); } - #endregion - #region NetworkToNetworkInterconnectResource /// /// 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. /// Returns a object. public static NetworkToNetworkInterconnectResource GetNetworkToNetworkInterconnectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkToNetworkInterconnectResource.ValidateResourceId(id); - return new NetworkToNetworkInterconnectResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkToNetworkInterconnectResource(id); } - #endregion - #region NetworkPacketBrokerResource /// /// 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. /// Returns a object. public static NetworkPacketBrokerResource GetNetworkPacketBrokerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkPacketBrokerResource.ValidateResourceId(id); - return new NetworkPacketBrokerResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkPacketBrokerResource(id); } - #endregion - #region NetworkRackResource /// /// 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. /// Returns a object. public static NetworkRackResource GetNetworkRackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkRackResource.ValidateResourceId(id); - return new NetworkRackResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkRackResource(id); } - #endregion - #region NetworkTapRuleResource /// /// 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. /// Returns a object. public static NetworkTapRuleResource GetNetworkTapRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkTapRuleResource.ValidateResourceId(id); - return new NetworkTapRuleResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkTapRuleResource(id); } - #endregion - #region NetworkTapResource /// /// 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. /// Returns a object. public static NetworkTapResource GetNetworkTapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkTapResource.ValidateResourceId(id); - return new NetworkTapResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkTapResource(id); } - #endregion - #region NetworkFabricRoutePolicyResource /// /// 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. /// Returns a object. public static NetworkFabricRoutePolicyResource GetNetworkFabricRoutePolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFabricRoutePolicyResource.ValidateResourceId(id); - return new NetworkFabricRoutePolicyResource(client, id); - } - ); + return GetManagedNetworkFabricArmClientMockingExtension(client).GetNetworkFabricRoutePolicyResource(id); } - #endregion - /// Gets a collection of NetworkFabricAccessControlListResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricAccessControlListResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricAccessControlListResources and their operations over a NetworkFabricAccessControlListResource. public static NetworkFabricAccessControlListCollection GetNetworkFabricAccessControlLists(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricAccessControlLists(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricAccessControlLists(); } /// @@ -506,16 +428,20 @@ public static NetworkFabricAccessControlListCollection GetNetworkFabricAccessCon /// AccessControlLists_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Access Control List. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricAccessControlListAsync(this ResourceGroupResource resourceGroupResource, string accessControlListName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricAccessControlLists().GetAsync(accessControlListName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricAccessControlListAsync(accessControlListName, cancellationToken).ConfigureAwait(false); } /// @@ -530,24 +456,34 @@ public static async Task> GetNe /// AccessControlLists_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Access Control List. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricAccessControlList(this ResourceGroupResource resourceGroupResource, string accessControlListName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricAccessControlLists().Get(accessControlListName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricAccessControlList(accessControlListName, cancellationToken); } - /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. public static NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricInternetGateways(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGateways(); } /// @@ -562,16 +498,20 @@ public static NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGat /// InternetGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Internet Gateway. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricInternetGatewayAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricInternetGateways().GetAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGatewayAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -586,24 +526,34 @@ public static async Task> GetNetw /// InternetGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Internet Gateway. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricInternetGateway(this ResourceGroupResource resourceGroupResource, string internetGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricInternetGateways().Get(internetGatewayName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGateway(internetGatewayName, cancellationToken); } - /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. public static NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricInternetGatewayRules(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGatewayRules(); } /// @@ -618,16 +568,20 @@ public static NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInterne /// InternetGatewayRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricInternetGatewayRuleAsync(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricInternetGatewayRules().GetAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGatewayRuleAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); } /// @@ -642,24 +596,34 @@ public static async Task> Get /// InternetGatewayRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Internet Gateway rule. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricInternetGatewayRule(this ResourceGroupResource resourceGroupResource, string internetGatewayRuleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricInternetGatewayRules().Get(internetGatewayRuleName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricInternetGatewayRule(internetGatewayRuleName, cancellationToken); } - /// Gets a collection of NetworkFabricIPCommunityResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricIPCommunityResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricIPCommunityResources and their operations over a NetworkFabricIPCommunityResource. public static NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricIPCommunities(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPCommunities(); } /// @@ -674,16 +638,20 @@ public static NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities(t /// IpCommunities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Community. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricIPCommunityAsync(this ResourceGroupResource resourceGroupResource, string ipCommunityName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricIPCommunities().GetAsync(ipCommunityName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPCommunityAsync(ipCommunityName, cancellationToken).ConfigureAwait(false); } /// @@ -698,24 +666,34 @@ public static async Task> GetNetworkF /// IpCommunities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Community. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricIPCommunity(this ResourceGroupResource resourceGroupResource, string ipCommunityName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricIPCommunities().Get(ipCommunityName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPCommunity(ipCommunityName, cancellationToken); } - /// Gets a collection of NetworkFabricIPExtendedCommunityResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricIPExtendedCommunityResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricIPExtendedCommunityResources and their operations over a NetworkFabricIPExtendedCommunityResource. public static NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExtendedCommunities(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricIPExtendedCommunities(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPExtendedCommunities(); } /// @@ -730,16 +708,20 @@ public static NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExten /// IpExtendedCommunities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Extended Community. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricIPExtendedCommunityAsync(this ResourceGroupResource resourceGroupResource, string ipExtendedCommunityName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricIPExtendedCommunities().GetAsync(ipExtendedCommunityName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPExtendedCommunityAsync(ipExtendedCommunityName, cancellationToken).ConfigureAwait(false); } /// @@ -754,24 +736,34 @@ public static async Task> Get /// IpExtendedCommunities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Extended Community. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricIPExtendedCommunity(this ResourceGroupResource resourceGroupResource, string ipExtendedCommunityName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricIPExtendedCommunities().Get(ipExtendedCommunityName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPExtendedCommunity(ipExtendedCommunityName, cancellationToken); } - /// Gets a collection of NetworkFabricIPPrefixResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricIPPrefixResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricIPPrefixResources and their operations over a NetworkFabricIPPrefixResource. public static NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricIPPrefixes(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPPrefixes(); } /// @@ -786,16 +778,20 @@ public static NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes(this Re /// IpPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Prefix. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricIPPrefixAsync(this ResourceGroupResource resourceGroupResource, string ipPrefixName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricIPPrefixes().GetAsync(ipPrefixName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPPrefixAsync(ipPrefixName, cancellationToken).ConfigureAwait(false); } /// @@ -810,24 +806,34 @@ public static async Task> GetNetworkFabr /// IpPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the IP Prefix. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricIPPrefix(this ResourceGroupResource resourceGroupResource, string ipPrefixName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricIPPrefixes().Get(ipPrefixName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricIPPrefix(ipPrefixName, cancellationToken); } - /// Gets a collection of NetworkFabricL2IsolationDomainResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricL2IsolationDomainResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricL2IsolationDomainResources and their operations over a NetworkFabricL2IsolationDomainResource. public static NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2IsolationDomains(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricL2IsolationDomains(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL2IsolationDomains(); } /// @@ -842,16 +848,20 @@ public static NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2Isolati /// L2IsolationDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricL2IsolationDomainAsync(this ResourceGroupResource resourceGroupResource, string l2IsolationDomainName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricL2IsolationDomains().GetAsync(l2IsolationDomainName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL2IsolationDomainAsync(l2IsolationDomainName, cancellationToken).ConfigureAwait(false); } /// @@ -866,24 +876,34 @@ public static async Task> GetNe /// L2IsolationDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the L2 Isolation Domain. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricL2IsolationDomain(this ResourceGroupResource resourceGroupResource, string l2IsolationDomainName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricL2IsolationDomains().Get(l2IsolationDomainName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL2IsolationDomain(l2IsolationDomainName, cancellationToken); } - /// Gets a collection of NetworkFabricL3IsolationDomainResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricL3IsolationDomainResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricL3IsolationDomainResources and their operations over a NetworkFabricL3IsolationDomainResource. public static NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3IsolationDomains(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricL3IsolationDomains(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL3IsolationDomains(); } /// @@ -898,16 +918,20 @@ public static NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3Isolati /// L3IsolationDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricL3IsolationDomainAsync(this ResourceGroupResource resourceGroupResource, string l3IsolationDomainName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricL3IsolationDomains().GetAsync(l3IsolationDomainName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL3IsolationDomainAsync(l3IsolationDomainName, cancellationToken).ConfigureAwait(false); } /// @@ -922,24 +946,34 @@ public static async Task> GetNe /// L3IsolationDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the L3 Isolation Domain. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricL3IsolationDomain(this ResourceGroupResource resourceGroupResource, string l3IsolationDomainName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricL3IsolationDomains().Get(l3IsolationDomainName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricL3IsolationDomain(l3IsolationDomainName, cancellationToken); } - /// Gets a collection of NetworkFabricNeighborGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricNeighborGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricNeighborGroupResources and their operations over a NetworkFabricNeighborGroupResource. public static NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricNeighborGroups(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricNeighborGroups(); } /// @@ -954,16 +988,20 @@ public static NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGroup /// NeighborGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Neighbor Group. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricNeighborGroupAsync(this ResourceGroupResource resourceGroupResource, string neighborGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricNeighborGroups().GetAsync(neighborGroupName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricNeighborGroupAsync(neighborGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -978,24 +1016,34 @@ public static async Task> GetNetwor /// NeighborGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Neighbor Group. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricNeighborGroup(this ResourceGroupResource resourceGroupResource, string neighborGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricNeighborGroups().Get(neighborGroupName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricNeighborGroup(neighborGroupName, cancellationToken); } - /// Gets a collection of NetworkDeviceResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkDeviceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkDeviceResources and their operations over a NetworkDeviceResource. public static NetworkDeviceCollection GetNetworkDevices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkDevices(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkDevices(); } /// @@ -1010,16 +1058,20 @@ public static NetworkDeviceCollection GetNetworkDevices(this ResourceGroupResour /// NetworkDevices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Device. /// The cancellation token to use. - /// 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 static async Task> GetNetworkDeviceAsync(this ResourceGroupResource resourceGroupResource, string networkDeviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkDevices().GetAsync(networkDeviceName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkDeviceAsync(networkDeviceName, cancellationToken).ConfigureAwait(false); } /// @@ -1034,24 +1086,34 @@ public static async Task> GetNetworkDeviceAsync( /// NetworkDevices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Device. /// The cancellation token to use. - /// 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 static Response GetNetworkDevice(this ResourceGroupResource resourceGroupResource, string networkDeviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkDevices().Get(networkDeviceName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkDevice(networkDeviceName, cancellationToken); } - /// Gets a collection of NetworkFabricControllerResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricControllerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricControllerResources and their operations over a NetworkFabricControllerResource. public static NetworkFabricControllerCollection GetNetworkFabricControllers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricControllers(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricControllers(); } /// @@ -1066,16 +1128,20 @@ public static NetworkFabricControllerCollection GetNetworkFabricControllers(this /// NetworkFabricControllers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric Controller. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricControllerAsync(this ResourceGroupResource resourceGroupResource, string networkFabricControllerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricControllers().GetAsync(networkFabricControllerName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricControllerAsync(networkFabricControllerName, cancellationToken).ConfigureAwait(false); } /// @@ -1090,24 +1156,34 @@ public static async Task> GetNetworkFa /// NetworkFabricControllers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric Controller. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricController(this ResourceGroupResource resourceGroupResource, string networkFabricControllerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricControllers().Get(networkFabricControllerName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricController(networkFabricControllerName, cancellationToken); } - /// Gets a collection of NetworkFabricResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricResources and their operations over a NetworkFabricResource. public static NetworkFabricCollection GetNetworkFabrics(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabrics(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabrics(); } /// @@ -1122,16 +1198,20 @@ public static NetworkFabricCollection GetNetworkFabrics(this ResourceGroupResour /// NetworkFabrics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricAsync(this ResourceGroupResource resourceGroupResource, string networkFabricName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabrics().GetAsync(networkFabricName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricAsync(networkFabricName, cancellationToken).ConfigureAwait(false); } /// @@ -1146,24 +1226,34 @@ public static async Task> GetNetworkFabricAsync( /// NetworkFabrics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric. /// The cancellation token to use. - /// 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 static Response GetNetworkFabric(this ResourceGroupResource resourceGroupResource, string networkFabricName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabrics().Get(networkFabricName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabric(networkFabricName, cancellationToken); } - /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkPacketBrokerResources and their operations over a NetworkPacketBrokerResource. public static NetworkPacketBrokerCollection GetNetworkPacketBrokers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkPacketBrokers(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkPacketBrokers(); } /// @@ -1178,16 +1268,20 @@ public static NetworkPacketBrokerCollection GetNetworkPacketBrokers(this Resourc /// NetworkPacketBrokers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Packet Broker. /// The cancellation token to use. - /// 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 static async Task> GetNetworkPacketBrokerAsync(this ResourceGroupResource resourceGroupResource, string networkPacketBrokerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkPacketBrokers().GetAsync(networkPacketBrokerName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkPacketBrokerAsync(networkPacketBrokerName, cancellationToken).ConfigureAwait(false); } /// @@ -1202,24 +1296,34 @@ public static async Task> GetNetworkPacket /// NetworkPacketBrokers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Packet Broker. /// The cancellation token to use. - /// 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 static Response GetNetworkPacketBroker(this ResourceGroupResource resourceGroupResource, string networkPacketBrokerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkPacketBrokers().Get(networkPacketBrokerName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkPacketBroker(networkPacketBrokerName, cancellationToken); } - /// Gets a collection of NetworkRackResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkRackResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkRackResources and their operations over a NetworkRackResource. public static NetworkRackCollection GetNetworkRacks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkRacks(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkRacks(); } /// @@ -1234,16 +1338,20 @@ public static NetworkRackCollection GetNetworkRacks(this ResourceGroupResource r /// NetworkRacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Rack. /// The cancellation token to use. - /// 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 static async Task> GetNetworkRackAsync(this ResourceGroupResource resourceGroupResource, string networkRackName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkRacks().GetAsync(networkRackName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkRackAsync(networkRackName, cancellationToken).ConfigureAwait(false); } /// @@ -1258,24 +1366,34 @@ public static async Task> GetNetworkRackAsync(this /// NetworkRacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Rack. /// The cancellation token to use. - /// 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 static Response GetNetworkRack(this ResourceGroupResource resourceGroupResource, string networkRackName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkRacks().Get(networkRackName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkRack(networkRackName, cancellationToken); } - /// Gets a collection of NetworkTapRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkTapRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkTapRuleResources and their operations over a NetworkTapRuleResource. public static NetworkTapRuleCollection GetNetworkTapRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkTapRules(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTapRules(); } /// @@ -1290,16 +1408,20 @@ public static NetworkTapRuleCollection GetNetworkTapRules(this ResourceGroupReso /// NetworkTapRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Tap Rule. /// The cancellation token to use. - /// 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 static async Task> GetNetworkTapRuleAsync(this ResourceGroupResource resourceGroupResource, string networkTapRuleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkTapRules().GetAsync(networkTapRuleName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTapRuleAsync(networkTapRuleName, cancellationToken).ConfigureAwait(false); } /// @@ -1314,24 +1436,34 @@ public static async Task> GetNetworkTapRuleAsyn /// NetworkTapRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Tap Rule. /// The cancellation token to use. - /// 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 static Response GetNetworkTapRule(this ResourceGroupResource resourceGroupResource, string networkTapRuleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkTapRules().Get(networkTapRuleName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTapRule(networkTapRuleName, cancellationToken); } - /// Gets a collection of NetworkTapResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkTapResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkTapResources and their operations over a NetworkTapResource. public static NetworkTapCollection GetNetworkTaps(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkTaps(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTaps(); } /// @@ -1346,16 +1478,20 @@ public static NetworkTapCollection GetNetworkTaps(this ResourceGroupResource res /// NetworkTaps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Tap. /// The cancellation token to use. - /// 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 static async Task> GetNetworkTapAsync(this ResourceGroupResource resourceGroupResource, string networkTapName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkTaps().GetAsync(networkTapName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTapAsync(networkTapName, cancellationToken).ConfigureAwait(false); } /// @@ -1370,24 +1506,34 @@ public static async Task> GetNetworkTapAsync(this R /// NetworkTaps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Tap. /// The cancellation token to use. - /// 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 static Response GetNetworkTap(this ResourceGroupResource resourceGroupResource, string networkTapName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkTaps().Get(networkTapName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkTap(networkTapName, cancellationToken); } - /// Gets a collection of NetworkFabricRoutePolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkFabricRoutePolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricRoutePolicyResources and their operations over a NetworkFabricRoutePolicyResource. public static NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkFabricRoutePolicies(); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricRoutePolicies(); } /// @@ -1402,16 +1548,20 @@ public static NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies(t /// RoutePolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Route Policy. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricRoutePolicyAsync(this ResourceGroupResource resourceGroupResource, string routePolicyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkFabricRoutePolicies().GetAsync(routePolicyName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricRoutePolicyAsync(routePolicyName, cancellationToken).ConfigureAwait(false); } /// @@ -1426,24 +1576,34 @@ public static async Task> GetNetworkF /// RoutePolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Route Policy. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricRoutePolicy(this ResourceGroupResource resourceGroupResource, string routePolicyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkFabricRoutePolicies().Get(routePolicyName, cancellationToken); + return GetManagedNetworkFabricResourceGroupMockingExtension(resourceGroupResource).GetNetworkFabricRoutePolicy(routePolicyName, cancellationToken); } - /// Gets a collection of NetworkDeviceSkuResources in the SubscriptionResource. + /// + /// Gets a collection of NetworkDeviceSkuResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkDeviceSkuResources and their operations over a NetworkDeviceSkuResource. public static NetworkDeviceSkuCollection GetNetworkDeviceSkus(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkDeviceSkus(); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkDeviceSkus(); } /// @@ -1458,16 +1618,20 @@ public static NetworkDeviceSkuCollection GetNetworkDeviceSkus(this SubscriptionR /// NetworkDeviceSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Device SKU. /// The cancellation token to use. - /// 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 static async Task> GetNetworkDeviceSkuAsync(this SubscriptionResource subscriptionResource, string networkDeviceSkuName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetNetworkDeviceSkus().GetAsync(networkDeviceSkuName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkDeviceSkuAsync(networkDeviceSkuName, cancellationToken).ConfigureAwait(false); } /// @@ -1482,24 +1646,34 @@ public static async Task> GetNetworkDeviceSku /// NetworkDeviceSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Device SKU. /// The cancellation token to use. - /// 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 static Response GetNetworkDeviceSku(this SubscriptionResource subscriptionResource, string networkDeviceSkuName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetNetworkDeviceSkus().Get(networkDeviceSkuName, cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkDeviceSku(networkDeviceSkuName, cancellationToken); } - /// Gets a collection of NetworkFabricSkuResources in the SubscriptionResource. + /// + /// Gets a collection of NetworkFabricSkuResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkFabricSkuResources and their operations over a NetworkFabricSkuResource. public static NetworkFabricSkuCollection GetNetworkFabricSkus(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricSkus(); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricSkus(); } /// @@ -1514,16 +1688,20 @@ public static NetworkFabricSkuCollection GetNetworkFabricSkus(this SubscriptionR /// NetworkFabricSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// 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 static async Task> GetNetworkFabricSkuAsync(this SubscriptionResource subscriptionResource, string networkFabricSkuName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetNetworkFabricSkus().GetAsync(networkFabricSkuName, cancellationToken).ConfigureAwait(false); + return await GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricSkuAsync(networkFabricSkuName, cancellationToken).ConfigureAwait(false); } /// @@ -1538,16 +1716,20 @@ public static async Task> GetNetworkFabricSku /// NetworkFabricSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Fabric SKU. /// The cancellation token to use. - /// 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 static Response GetNetworkFabricSku(this SubscriptionResource subscriptionResource, string networkFabricSkuName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetNetworkFabricSkus().Get(networkFabricSkuName, cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricSku(networkFabricSkuName, cancellationToken); } /// @@ -1562,13 +1744,17 @@ public static Response GetNetworkFabricSku(this Subscr /// AccessControlLists_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricAccessControlListsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricAccessControlListsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricAccessControlListsAsync(cancellationToken); } /// @@ -1583,13 +1769,17 @@ public static AsyncPageable GetNetworkFa /// AccessControlLists_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricAccessControlLists(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricAccessControlLists(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricAccessControlLists(cancellationToken); } /// @@ -1604,13 +1794,17 @@ public static Pageable GetNetworkFabricA /// InternetGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricInternetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricInternetGatewaysAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricInternetGatewaysAsync(cancellationToken); } /// @@ -1625,13 +1819,17 @@ public static AsyncPageable GetNetworkFabr /// InternetGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricInternetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricInternetGateways(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricInternetGateways(cancellationToken); } /// @@ -1646,13 +1844,17 @@ public static Pageable GetNetworkFabricInt /// InternetGatewayRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricInternetGatewayRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricInternetGatewayRulesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricInternetGatewayRulesAsync(cancellationToken); } /// @@ -1667,13 +1869,17 @@ public static AsyncPageable GetNetwork /// InternetGatewayRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricInternetGatewayRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricInternetGatewayRules(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricInternetGatewayRules(cancellationToken); } /// @@ -1688,13 +1894,17 @@ public static Pageable GetNetworkFabri /// IpCommunities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricIPCommunitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPCommunitiesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPCommunitiesAsync(cancellationToken); } /// @@ -1709,13 +1919,17 @@ public static AsyncPageable GetNetworkFabricIP /// IpCommunities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricIPCommunities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPCommunities(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPCommunities(cancellationToken); } /// @@ -1730,13 +1944,17 @@ public static Pageable GetNetworkFabricIPCommu /// IpExtendedCommunities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricIPExtendedCommunitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPExtendedCommunitiesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPExtendedCommunitiesAsync(cancellationToken); } /// @@ -1751,13 +1969,17 @@ public static AsyncPageable GetNetwork /// IpExtendedCommunities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricIPExtendedCommunities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPExtendedCommunities(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPExtendedCommunities(cancellationToken); } /// @@ -1772,13 +1994,17 @@ public static Pageable GetNetworkFabri /// IpPrefixes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricIPPrefixesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPPrefixesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPPrefixesAsync(cancellationToken); } /// @@ -1793,13 +2019,17 @@ public static AsyncPageable GetNetworkFabricIPPre /// IpPrefixes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricIPPrefixes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricIPPrefixes(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricIPPrefixes(cancellationToken); } /// @@ -1814,13 +2044,17 @@ public static Pageable GetNetworkFabricIPPrefixes /// L2IsolationDomains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricL2IsolationDomainsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricL2IsolationDomainsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricL2IsolationDomainsAsync(cancellationToken); } /// @@ -1835,13 +2069,17 @@ public static AsyncPageable GetNetworkFa /// L2IsolationDomains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricL2IsolationDomains(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricL2IsolationDomains(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricL2IsolationDomains(cancellationToken); } /// @@ -1856,13 +2094,17 @@ public static Pageable GetNetworkFabricL /// L3IsolationDomains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricL3IsolationDomainsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricL3IsolationDomainsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricL3IsolationDomainsAsync(cancellationToken); } /// @@ -1877,13 +2119,17 @@ public static AsyncPageable GetNetworkFa /// L3IsolationDomains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricL3IsolationDomains(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricL3IsolationDomains(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricL3IsolationDomains(cancellationToken); } /// @@ -1898,13 +2144,17 @@ public static Pageable GetNetworkFabricL /// NeighborGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricNeighborGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricNeighborGroupsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricNeighborGroupsAsync(cancellationToken); } /// @@ -1919,13 +2169,17 @@ public static AsyncPageable GetNetworkFabric /// NeighborGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricNeighborGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricNeighborGroups(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricNeighborGroups(cancellationToken); } /// @@ -1940,13 +2194,17 @@ public static Pageable GetNetworkFabricNeigh /// NetworkDevices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkDevicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkDevicesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkDevicesAsync(cancellationToken); } /// @@ -1961,13 +2219,17 @@ public static AsyncPageable GetNetworkDevicesAsync(this S /// NetworkDevices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkDevices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkDevices(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkDevices(cancellationToken); } /// @@ -1982,13 +2244,17 @@ public static Pageable GetNetworkDevices(this Subscriptio /// NetworkFabricControllers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricControllersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricControllersAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricControllersAsync(cancellationToken); } /// @@ -2003,13 +2269,17 @@ public static AsyncPageable GetNetworkFabricCon /// NetworkFabricControllers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricControllers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricControllers(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricControllers(cancellationToken); } /// @@ -2024,13 +2294,17 @@ public static Pageable GetNetworkFabricControll /// NetworkFabrics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricsAsync(cancellationToken); } /// @@ -2045,13 +2319,17 @@ public static AsyncPageable GetNetworkFabricsAsync(this S /// NetworkFabrics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabrics(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabrics(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabrics(cancellationToken); } /// @@ -2066,13 +2344,17 @@ public static Pageable GetNetworkFabrics(this Subscriptio /// NetworkPacketBrokers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkPacketBrokersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkPacketBrokersAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkPacketBrokersAsync(cancellationToken); } /// @@ -2087,13 +2369,17 @@ public static AsyncPageable GetNetworkPacketBrokers /// NetworkPacketBrokers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkPacketBrokers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkPacketBrokers(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkPacketBrokers(cancellationToken); } /// @@ -2108,13 +2394,17 @@ public static Pageable GetNetworkPacketBrokers(this /// NetworkRacks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkRacksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkRacksAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkRacksAsync(cancellationToken); } /// @@ -2129,13 +2419,17 @@ public static AsyncPageable GetNetworkRacksAsync(this Subsc /// NetworkRacks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkRacks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkRacks(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkRacks(cancellationToken); } /// @@ -2150,13 +2444,17 @@ public static Pageable GetNetworkRacks(this SubscriptionRes /// NetworkTapRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkTapRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkTapRulesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkTapRulesAsync(cancellationToken); } /// @@ -2171,13 +2469,17 @@ public static AsyncPageable GetNetworkTapRulesAsync(this /// NetworkTapRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkTapRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkTapRules(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkTapRules(cancellationToken); } /// @@ -2192,13 +2494,17 @@ public static Pageable GetNetworkTapRules(this Subscript /// NetworkTaps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkTapsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkTapsAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkTapsAsync(cancellationToken); } /// @@ -2213,13 +2519,17 @@ public static AsyncPageable GetNetworkTapsAsync(this Subscri /// NetworkTaps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkTaps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkTaps(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkTaps(cancellationToken); } /// @@ -2234,13 +2544,17 @@ public static Pageable GetNetworkTaps(this SubscriptionResou /// RoutePolicies_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkFabricRoutePoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricRoutePoliciesAsync(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricRoutePoliciesAsync(cancellationToken); } /// @@ -2255,13 +2569,17 @@ public static AsyncPageable GetNetworkFabricRo /// RoutePolicies_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkFabricRoutePolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkFabricRoutePolicies(cancellationToken); + return GetManagedNetworkFabricSubscriptionMockingExtension(subscriptionResource).GetNetworkFabricRoutePolicies(cancellationToken); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricResourceGroupMockingExtension.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..894c29b6f444 --- /dev/null +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricResourceGroupMockingExtension.cs @@ -0,0 +1,940 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetworkFabric; + +namespace Azure.ResourceManager.ManagedNetworkFabric.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ManagedNetworkFabricResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkFabricResourceGroupMockingExtension() + { + } + + /// 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 ManagedNetworkFabricResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NetworkFabricAccessControlListResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricAccessControlListResources and their operations over a NetworkFabricAccessControlListResource. + public virtual NetworkFabricAccessControlListCollection GetNetworkFabricAccessControlLists() + { + return GetCachedClient(client => new NetworkFabricAccessControlListCollection(client, Id)); + } + + /// + /// Implements Access Control List GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName} + /// + /// + /// Operation Id + /// AccessControlLists_Get + /// + /// + /// + /// Name of the Access Control List. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricAccessControlListAsync(string accessControlListName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricAccessControlLists().GetAsync(accessControlListName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements Access Control List GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/accessControlLists/{accessControlListName} + /// + /// + /// Operation Id + /// AccessControlLists_Get + /// + /// + /// + /// Name of the Access Control List. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricAccessControlList(string accessControlListName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricAccessControlLists().Get(accessControlListName, cancellationToken); + } + + /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. + public virtual NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways() + { + return GetCachedClient(client => new NetworkFabricInternetGatewayCollection(client, Id)); + } + + /// + /// Implements Gateway GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// + /// + /// Operation Id + /// InternetGateways_Get + /// + /// + /// + /// Name of the Internet Gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricInternetGatewayAsync(string internetGatewayName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricInternetGateways().GetAsync(internetGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements Gateway GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGateways/{internetGatewayName} + /// + /// + /// Operation Id + /// InternetGateways_Get + /// + /// + /// + /// Name of the Internet Gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricInternetGateway(string internetGatewayName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricInternetGateways().Get(internetGatewayName, cancellationToken); + } + + /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. + public virtual NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules() + { + return GetCachedClient(client => new NetworkFabricInternetGatewayRuleCollection(client, Id)); + } + + /// + /// Gets an Internet Gateway Rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// + /// + /// Operation Id + /// InternetGatewayRules_Get + /// + /// + /// + /// Name of the Internet Gateway rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricInternetGatewayRuleAsync(string internetGatewayRuleName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricInternetGatewayRules().GetAsync(internetGatewayRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Internet Gateway Rule resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/{internetGatewayRuleName} + /// + /// + /// Operation Id + /// InternetGatewayRules_Get + /// + /// + /// + /// Name of the Internet Gateway rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricInternetGatewayRule(string internetGatewayRuleName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricInternetGatewayRules().Get(internetGatewayRuleName, cancellationToken); + } + + /// Gets a collection of NetworkFabricIPCommunityResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricIPCommunityResources and their operations over a NetworkFabricIPCommunityResource. + public virtual NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities() + { + return GetCachedClient(client => new NetworkFabricIPCommunityCollection(client, Id)); + } + + /// + /// Implements an IP Community GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName} + /// + /// + /// Operation Id + /// IpCommunities_Get + /// + /// + /// + /// Name of the IP Community. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricIPCommunityAsync(string ipCommunityName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricIPCommunities().GetAsync(ipCommunityName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements an IP Community GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipCommunities/{ipCommunityName} + /// + /// + /// Operation Id + /// IpCommunities_Get + /// + /// + /// + /// Name of the IP Community. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricIPCommunity(string ipCommunityName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricIPCommunities().Get(ipCommunityName, cancellationToken); + } + + /// Gets a collection of NetworkFabricIPExtendedCommunityResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricIPExtendedCommunityResources and their operations over a NetworkFabricIPExtendedCommunityResource. + public virtual NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExtendedCommunities() + { + return GetCachedClient(client => new NetworkFabricIPExtendedCommunityCollection(client, Id)); + } + + /// + /// Implements IP Extended Community GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName} + /// + /// + /// Operation Id + /// IpExtendedCommunities_Get + /// + /// + /// + /// Name of the IP Extended Community. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricIPExtendedCommunityAsync(string ipExtendedCommunityName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricIPExtendedCommunities().GetAsync(ipExtendedCommunityName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements IP Extended Community GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/{ipExtendedCommunityName} + /// + /// + /// Operation Id + /// IpExtendedCommunities_Get + /// + /// + /// + /// Name of the IP Extended Community. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricIPExtendedCommunity(string ipExtendedCommunityName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricIPExtendedCommunities().Get(ipExtendedCommunityName, cancellationToken); + } + + /// Gets a collection of NetworkFabricIPPrefixResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricIPPrefixResources and their operations over a NetworkFabricIPPrefixResource. + public virtual NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes() + { + return GetCachedClient(client => new NetworkFabricIPPrefixCollection(client, Id)); + } + + /// + /// Implements IP Prefix GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName} + /// + /// + /// Operation Id + /// IpPrefixes_Get + /// + /// + /// + /// Name of the IP Prefix. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricIPPrefixAsync(string ipPrefixName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricIPPrefixes().GetAsync(ipPrefixName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements IP Prefix GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/{ipPrefixName} + /// + /// + /// Operation Id + /// IpPrefixes_Get + /// + /// + /// + /// Name of the IP Prefix. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricIPPrefix(string ipPrefixName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricIPPrefixes().Get(ipPrefixName, cancellationToken); + } + + /// Gets a collection of NetworkFabricL2IsolationDomainResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricL2IsolationDomainResources and their operations over a NetworkFabricL2IsolationDomainResource. + public virtual NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2IsolationDomains() + { + return GetCachedClient(client => new NetworkFabricL2IsolationDomainCollection(client, Id)); + } + + /// + /// Implements L2 Isolation Domain GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName} + /// + /// + /// Operation Id + /// L2IsolationDomains_Get + /// + /// + /// + /// Name of the L2 Isolation Domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricL2IsolationDomainAsync(string l2IsolationDomainName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricL2IsolationDomains().GetAsync(l2IsolationDomainName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements L2 Isolation Domain GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/{l2IsolationDomainName} + /// + /// + /// Operation Id + /// L2IsolationDomains_Get + /// + /// + /// + /// Name of the L2 Isolation Domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricL2IsolationDomain(string l2IsolationDomainName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricL2IsolationDomains().Get(l2IsolationDomainName, cancellationToken); + } + + /// Gets a collection of NetworkFabricL3IsolationDomainResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricL3IsolationDomainResources and their operations over a NetworkFabricL3IsolationDomainResource. + public virtual NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3IsolationDomains() + { + return GetCachedClient(client => new NetworkFabricL3IsolationDomainCollection(client, Id)); + } + + /// + /// Retrieves details of this L3 Isolation Domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName} + /// + /// + /// Operation Id + /// L3IsolationDomains_Get + /// + /// + /// + /// Name of the L3 Isolation Domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricL3IsolationDomainAsync(string l3IsolationDomainName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricL3IsolationDomains().GetAsync(l3IsolationDomainName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves details of this L3 Isolation Domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName} + /// + /// + /// Operation Id + /// L3IsolationDomains_Get + /// + /// + /// + /// Name of the L3 Isolation Domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricL3IsolationDomain(string l3IsolationDomainName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricL3IsolationDomains().Get(l3IsolationDomainName, cancellationToken); + } + + /// Gets a collection of NetworkFabricNeighborGroupResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricNeighborGroupResources and their operations over a NetworkFabricNeighborGroupResource. + public virtual NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGroups() + { + return GetCachedClient(client => new NetworkFabricNeighborGroupCollection(client, Id)); + } + + /// + /// Gets the Neighbor Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName} + /// + /// + /// Operation Id + /// NeighborGroups_Get + /// + /// + /// + /// Name of the Neighbor Group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricNeighborGroupAsync(string neighborGroupName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricNeighborGroups().GetAsync(neighborGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Neighbor Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/neighborGroups/{neighborGroupName} + /// + /// + /// Operation Id + /// NeighborGroups_Get + /// + /// + /// + /// Name of the Neighbor Group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricNeighborGroup(string neighborGroupName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricNeighborGroups().Get(neighborGroupName, cancellationToken); + } + + /// Gets a collection of NetworkDeviceResources in the ResourceGroupResource. + /// An object representing collection of NetworkDeviceResources and their operations over a NetworkDeviceResource. + public virtual NetworkDeviceCollection GetNetworkDevices() + { + return GetCachedClient(client => new NetworkDeviceCollection(client, Id)); + } + + /// + /// Gets the Network Device resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName} + /// + /// + /// Operation Id + /// NetworkDevices_Get + /// + /// + /// + /// Name of the Network Device. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkDeviceAsync(string networkDeviceName, CancellationToken cancellationToken = default) + { + return await GetNetworkDevices().GetAsync(networkDeviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Network Device resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkDevices/{networkDeviceName} + /// + /// + /// Operation Id + /// NetworkDevices_Get + /// + /// + /// + /// Name of the Network Device. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkDevice(string networkDeviceName, CancellationToken cancellationToken = default) + { + return GetNetworkDevices().Get(networkDeviceName, cancellationToken); + } + + /// Gets a collection of NetworkFabricControllerResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricControllerResources and their operations over a NetworkFabricControllerResource. + public virtual NetworkFabricControllerCollection GetNetworkFabricControllers() + { + return GetCachedClient(client => new NetworkFabricControllerCollection(client, Id)); + } + + /// + /// Shows the provisioning status of Network Fabric Controller. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName} + /// + /// + /// Operation Id + /// NetworkFabricControllers_Get + /// + /// + /// + /// Name of the Network Fabric Controller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricControllerAsync(string networkFabricControllerName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricControllers().GetAsync(networkFabricControllerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Shows the provisioning status of Network Fabric Controller. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/{networkFabricControllerName} + /// + /// + /// Operation Id + /// NetworkFabricControllers_Get + /// + /// + /// + /// Name of the Network Fabric Controller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricController(string networkFabricControllerName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricControllers().Get(networkFabricControllerName, cancellationToken); + } + + /// Gets a collection of NetworkFabricResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricResources and their operations over a NetworkFabricResource. + public virtual NetworkFabricCollection GetNetworkFabrics() + { + return GetCachedClient(client => new NetworkFabricCollection(client, Id)); + } + + /// + /// Get Network Fabric resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName} + /// + /// + /// Operation Id + /// NetworkFabrics_Get + /// + /// + /// + /// Name of the Network Fabric. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricAsync(string networkFabricName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabrics().GetAsync(networkFabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Network Fabric resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName} + /// + /// + /// Operation Id + /// NetworkFabrics_Get + /// + /// + /// + /// Name of the Network Fabric. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabric(string networkFabricName, CancellationToken cancellationToken = default) + { + return GetNetworkFabrics().Get(networkFabricName, cancellationToken); + } + + /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. + /// An object representing collection of NetworkPacketBrokerResources and their operations over a NetworkPacketBrokerResource. + public virtual NetworkPacketBrokerCollection GetNetworkPacketBrokers() + { + return GetCachedClient(client => new NetworkPacketBrokerCollection(client, Id)); + } + + /// + /// Retrieves details of this Network Packet Broker. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName} + /// + /// + /// Operation Id + /// NetworkPacketBrokers_Get + /// + /// + /// + /// Name of the Network Packet Broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkPacketBrokerAsync(string networkPacketBrokerName, CancellationToken cancellationToken = default) + { + return await GetNetworkPacketBrokers().GetAsync(networkPacketBrokerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves details of this Network Packet Broker. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/{networkPacketBrokerName} + /// + /// + /// Operation Id + /// NetworkPacketBrokers_Get + /// + /// + /// + /// Name of the Network Packet Broker. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkPacketBroker(string networkPacketBrokerName, CancellationToken cancellationToken = default) + { + return GetNetworkPacketBrokers().Get(networkPacketBrokerName, cancellationToken); + } + + /// Gets a collection of NetworkRackResources in the ResourceGroupResource. + /// An object representing collection of NetworkRackResources and their operations over a NetworkRackResource. + public virtual NetworkRackCollection GetNetworkRacks() + { + return GetCachedClient(client => new NetworkRackCollection(client, Id)); + } + + /// + /// Get Network Rack resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName} + /// + /// + /// Operation Id + /// NetworkRacks_Get + /// + /// + /// + /// Name of the Network Rack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkRackAsync(string networkRackName, CancellationToken cancellationToken = default) + { + return await GetNetworkRacks().GetAsync(networkRackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Network Rack resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkRacks/{networkRackName} + /// + /// + /// Operation Id + /// NetworkRacks_Get + /// + /// + /// + /// Name of the Network Rack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkRack(string networkRackName, CancellationToken cancellationToken = default) + { + return GetNetworkRacks().Get(networkRackName, cancellationToken); + } + + /// Gets a collection of NetworkTapRuleResources in the ResourceGroupResource. + /// An object representing collection of NetworkTapRuleResources and their operations over a NetworkTapRuleResource. + public virtual NetworkTapRuleCollection GetNetworkTapRules() + { + return GetCachedClient(client => new NetworkTapRuleCollection(client, Id)); + } + + /// + /// Get Network Tap Rule resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName} + /// + /// + /// Operation Id + /// NetworkTapRules_Get + /// + /// + /// + /// Name of the Network Tap Rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkTapRuleAsync(string networkTapRuleName, CancellationToken cancellationToken = default) + { + return await GetNetworkTapRules().GetAsync(networkTapRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Network Tap Rule resource details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTapRules/{networkTapRuleName} + /// + /// + /// Operation Id + /// NetworkTapRules_Get + /// + /// + /// + /// Name of the Network Tap Rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkTapRule(string networkTapRuleName, CancellationToken cancellationToken = default) + { + return GetNetworkTapRules().Get(networkTapRuleName, cancellationToken); + } + + /// Gets a collection of NetworkTapResources in the ResourceGroupResource. + /// An object representing collection of NetworkTapResources and their operations over a NetworkTapResource. + public virtual NetworkTapCollection GetNetworkTaps() + { + return GetCachedClient(client => new NetworkTapCollection(client, Id)); + } + + /// + /// Retrieves details of this Network Tap. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName} + /// + /// + /// Operation Id + /// NetworkTaps_Get + /// + /// + /// + /// Name of the Network Tap. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkTapAsync(string networkTapName, CancellationToken cancellationToken = default) + { + return await GetNetworkTaps().GetAsync(networkTapName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves details of this Network Tap. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkTaps/{networkTapName} + /// + /// + /// Operation Id + /// NetworkTaps_Get + /// + /// + /// + /// Name of the Network Tap. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkTap(string networkTapName, CancellationToken cancellationToken = default) + { + return GetNetworkTaps().Get(networkTapName, cancellationToken); + } + + /// Gets a collection of NetworkFabricRoutePolicyResources in the ResourceGroupResource. + /// An object representing collection of NetworkFabricRoutePolicyResources and their operations over a NetworkFabricRoutePolicyResource. + public virtual NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies() + { + return GetCachedClient(client => new NetworkFabricRoutePolicyCollection(client, Id)); + } + + /// + /// Implements Route Policy GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName} + /// + /// + /// Operation Id + /// RoutePolicies_Get + /// + /// + /// + /// Name of the Route Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricRoutePolicyAsync(string routePolicyName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricRoutePolicies().GetAsync(routePolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements Route Policy GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/routePolicies/{routePolicyName} + /// + /// + /// Operation Id + /// RoutePolicies_Get + /// + /// + /// + /// Name of the Route Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricRoutePolicy(string routePolicyName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricRoutePolicies().Get(routePolicyName, cancellationToken); + } + } +} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricSubscriptionMockingExtension.cs similarity index 85% rename from sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricSubscriptionMockingExtension.cs index 32775a8812e8..b6bd20406978 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ManagedNetworkFabricSubscriptionMockingExtension.cs @@ -5,17 +5,20 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedNetworkFabric; -namespace Azure.ResourceManager.ManagedNetworkFabric +namespace Azure.ResourceManager.ManagedNetworkFabric.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ManagedNetworkFabricSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _networkFabricAccessControlListAccessControlListsClientDiagnostics; private AccessControlListsRestOperations _networkFabricAccessControlListAccessControlListsRestClient; @@ -52,15 +55,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _networkFabricRoutePolicyRoutePoliciesClientDiagnostics; private RoutePoliciesRestOperations _networkFabricRoutePolicyRoutePoliciesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ManagedNetworkFabricSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ManagedNetworkFabricSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -109,14 +112,106 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of NetworkDeviceSkuResources and their operations over a NetworkDeviceSkuResource. public virtual NetworkDeviceSkuCollection GetNetworkDeviceSkus() { - return GetCachedClient(Client => new NetworkDeviceSkuCollection(Client, Id)); + return GetCachedClient(client => new NetworkDeviceSkuCollection(client, Id)); + } + + /// + /// Get a Network Device SKU details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName} + /// + /// + /// Operation Id + /// NetworkDeviceSkus_Get + /// + /// + /// + /// Name of the Network Device SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkDeviceSkuAsync(string networkDeviceSkuName, CancellationToken cancellationToken = default) + { + return await GetNetworkDeviceSkus().GetAsync(networkDeviceSkuName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Network Device SKU details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/{networkDeviceSkuName} + /// + /// + /// Operation Id + /// NetworkDeviceSkus_Get + /// + /// + /// + /// Name of the Network Device SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkDeviceSku(string networkDeviceSkuName, CancellationToken cancellationToken = default) + { + return GetNetworkDeviceSkus().Get(networkDeviceSkuName, cancellationToken); } /// Gets a collection of NetworkFabricSkuResources in the SubscriptionResource. /// An object representing collection of NetworkFabricSkuResources and their operations over a NetworkFabricSkuResource. public virtual NetworkFabricSkuCollection GetNetworkFabricSkus() { - return GetCachedClient(Client => new NetworkFabricSkuCollection(Client, Id)); + return GetCachedClient(client => new NetworkFabricSkuCollection(client, Id)); + } + + /// + /// Implements Network Fabric SKU GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName} + /// + /// + /// Operation Id + /// NetworkFabricSkus_Get + /// + /// + /// + /// Name of the Network Fabric SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkFabricSkuAsync(string networkFabricSkuName, CancellationToken cancellationToken = default) + { + return await GetNetworkFabricSkus().GetAsync(networkFabricSkuName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements Network Fabric SKU GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/{networkFabricSkuName} + /// + /// + /// Operation Id + /// NetworkFabricSkus_Get + /// + /// + /// + /// Name of the Network Fabric SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkFabricSku(string networkFabricSkuName, CancellationToken cancellationToken = default) + { + return GetNetworkFabricSkus().Get(networkFabricSkuName, cancellationToken); } /// @@ -138,7 +233,7 @@ public virtual AsyncPageable GetNetworkF { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricAccessControlListAccessControlListsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricAccessControlListAccessControlListsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricAccessControlListResource(Client, NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(e)), NetworkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricAccessControlLists", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricAccessControlListResource(Client, NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(e)), NetworkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricAccessControlLists", "value", "nextLink", cancellationToken); } /// @@ -160,7 +255,7 @@ public virtual Pageable GetNetworkFabric { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricAccessControlListAccessControlListsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricAccessControlListAccessControlListsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricAccessControlListResource(Client, NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(e)), NetworkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricAccessControlLists", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricAccessControlListResource(Client, NetworkFabricAccessControlListData.DeserializeNetworkFabricAccessControlListData(e)), NetworkFabricAccessControlListAccessControlListsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricAccessControlLists", "value", "nextLink", cancellationToken); } /// @@ -182,7 +277,7 @@ public virtual AsyncPageable GetNetworkFab { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); } /// @@ -204,7 +299,7 @@ public virtual Pageable GetNetworkFabricIn { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayInternetGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayResource(Client, NetworkFabricInternetGatewayData.DeserializeNetworkFabricInternetGatewayData(e)), NetworkFabricInternetGatewayInternetGatewaysClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricInternetGateways", "value", "nextLink", cancellationToken); } /// @@ -226,7 +321,7 @@ public virtual AsyncPageable GetNetwor { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); } /// @@ -248,7 +343,7 @@ public virtual Pageable GetNetworkFabr { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricInternetGatewayRuleInternetGatewayRulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricInternetGatewayRuleResource(Client, NetworkFabricInternetGatewayRuleData.DeserializeNetworkFabricInternetGatewayRuleData(e)), NetworkFabricInternetGatewayRuleInternetGatewayRulesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricInternetGatewayRules", "value", "nextLink", cancellationToken); } /// @@ -270,7 +365,7 @@ public virtual AsyncPageable GetNetworkFabricI { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPCommunityIpCommunitiesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPCommunityIpCommunitiesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPCommunityResource(Client, NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(e)), NetworkFabricIPCommunityIpCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPCommunityResource(Client, NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(e)), NetworkFabricIPCommunityIpCommunitiesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPCommunities", "value", "nextLink", cancellationToken); } /// @@ -292,7 +387,7 @@ public virtual Pageable GetNetworkFabricIPComm { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPCommunityIpCommunitiesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPCommunityIpCommunitiesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPCommunityResource(Client, NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(e)), NetworkFabricIPCommunityIpCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPCommunityResource(Client, NetworkFabricIPCommunityData.DeserializeNetworkFabricIPCommunityData(e)), NetworkFabricIPCommunityIpCommunitiesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPCommunities", "value", "nextLink", cancellationToken); } /// @@ -314,7 +409,7 @@ public virtual AsyncPageable GetNetwor { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPExtendedCommunityIpExtendedCommunitiesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPExtendedCommunityIpExtendedCommunitiesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPExtendedCommunityResource(Client, NetworkFabricIPExtendedCommunityData.DeserializeNetworkFabricIPExtendedCommunityData(e)), NetworkFabricIPExtendedCommunityIpExtendedCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPExtendedCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPExtendedCommunityResource(Client, NetworkFabricIPExtendedCommunityData.DeserializeNetworkFabricIPExtendedCommunityData(e)), NetworkFabricIPExtendedCommunityIpExtendedCommunitiesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPExtendedCommunities", "value", "nextLink", cancellationToken); } /// @@ -336,7 +431,7 @@ public virtual Pageable GetNetworkFabr { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPExtendedCommunityIpExtendedCommunitiesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPExtendedCommunityIpExtendedCommunitiesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPExtendedCommunityResource(Client, NetworkFabricIPExtendedCommunityData.DeserializeNetworkFabricIPExtendedCommunityData(e)), NetworkFabricIPExtendedCommunityIpExtendedCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPExtendedCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPExtendedCommunityResource(Client, NetworkFabricIPExtendedCommunityData.DeserializeNetworkFabricIPExtendedCommunityData(e)), NetworkFabricIPExtendedCommunityIpExtendedCommunitiesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPExtendedCommunities", "value", "nextLink", cancellationToken); } /// @@ -358,7 +453,7 @@ public virtual AsyncPageable GetNetworkFabricIPPr { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPPrefixIpPrefixesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPPrefixIpPrefixesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPPrefixResource(Client, NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(e)), NetworkFabricIPPrefixIpPrefixesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPPrefixResource(Client, NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(e)), NetworkFabricIPPrefixIpPrefixesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -380,7 +475,7 @@ public virtual Pageable GetNetworkFabricIPPrefixe { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricIPPrefixIpPrefixesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricIPPrefixIpPrefixesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPPrefixResource(Client, NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(e)), NetworkFabricIPPrefixIpPrefixesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricIPPrefixResource(Client, NetworkFabricIPPrefixData.DeserializeNetworkFabricIPPrefixData(e)), NetworkFabricIPPrefixIpPrefixesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -402,7 +497,7 @@ public virtual AsyncPageable GetNetworkF { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL2IsolationDomainResource(Client, NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(e)), NetworkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricL2IsolationDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL2IsolationDomainResource(Client, NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(e)), NetworkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricL2IsolationDomains", "value", "nextLink", cancellationToken); } /// @@ -424,7 +519,7 @@ public virtual Pageable GetNetworkFabric { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricL2IsolationDomainL2IsolationDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL2IsolationDomainResource(Client, NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(e)), NetworkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricL2IsolationDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL2IsolationDomainResource(Client, NetworkFabricL2IsolationDomainData.DeserializeNetworkFabricL2IsolationDomainData(e)), NetworkFabricL2IsolationDomainL2IsolationDomainsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricL2IsolationDomains", "value", "nextLink", cancellationToken); } /// @@ -446,7 +541,7 @@ public virtual AsyncPageable GetNetworkF { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL3IsolationDomainResource(Client, NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(e)), NetworkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricL3IsolationDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL3IsolationDomainResource(Client, NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(e)), NetworkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricL3IsolationDomains", "value", "nextLink", cancellationToken); } /// @@ -468,7 +563,7 @@ public virtual Pageable GetNetworkFabric { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricL3IsolationDomainL3IsolationDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL3IsolationDomainResource(Client, NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(e)), NetworkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricL3IsolationDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricL3IsolationDomainResource(Client, NetworkFabricL3IsolationDomainData.DeserializeNetworkFabricL3IsolationDomainData(e)), NetworkFabricL3IsolationDomainL3IsolationDomainsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricL3IsolationDomains", "value", "nextLink", cancellationToken); } /// @@ -490,7 +585,7 @@ public virtual AsyncPageable GetNetworkFabri { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricNeighborGroupNeighborGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricNeighborGroupNeighborGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricNeighborGroupResource(Client, NetworkFabricNeighborGroupData.DeserializeNetworkFabricNeighborGroupData(e)), NetworkFabricNeighborGroupNeighborGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricNeighborGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricNeighborGroupResource(Client, NetworkFabricNeighborGroupData.DeserializeNetworkFabricNeighborGroupData(e)), NetworkFabricNeighborGroupNeighborGroupsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricNeighborGroups", "value", "nextLink", cancellationToken); } /// @@ -512,7 +607,7 @@ public virtual Pageable GetNetworkFabricNeig { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricNeighborGroupNeighborGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricNeighborGroupNeighborGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricNeighborGroupResource(Client, NetworkFabricNeighborGroupData.DeserializeNetworkFabricNeighborGroupData(e)), NetworkFabricNeighborGroupNeighborGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricNeighborGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricNeighborGroupResource(Client, NetworkFabricNeighborGroupData.DeserializeNetworkFabricNeighborGroupData(e)), NetworkFabricNeighborGroupNeighborGroupsClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricNeighborGroups", "value", "nextLink", cancellationToken); } /// @@ -534,7 +629,7 @@ public virtual AsyncPageable GetNetworkDevicesAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkDeviceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkDeviceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkDeviceResource(Client, NetworkDeviceData.DeserializeNetworkDeviceData(e)), NetworkDeviceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkDevices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkDeviceResource(Client, NetworkDeviceData.DeserializeNetworkDeviceData(e)), NetworkDeviceClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkDevices", "value", "nextLink", cancellationToken); } /// @@ -556,7 +651,7 @@ public virtual Pageable GetNetworkDevices(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkDeviceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkDeviceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkDeviceResource(Client, NetworkDeviceData.DeserializeNetworkDeviceData(e)), NetworkDeviceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkDevices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkDeviceResource(Client, NetworkDeviceData.DeserializeNetworkDeviceData(e)), NetworkDeviceClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkDevices", "value", "nextLink", cancellationToken); } /// @@ -578,7 +673,7 @@ public virtual AsyncPageable GetNetworkFabricCo { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricControllerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricControllerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricControllerResource(Client, NetworkFabricControllerData.DeserializeNetworkFabricControllerData(e)), NetworkFabricControllerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricControllerResource(Client, NetworkFabricControllerData.DeserializeNetworkFabricControllerData(e)), NetworkFabricControllerClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricControllers", "value", "nextLink", cancellationToken); } /// @@ -600,7 +695,7 @@ public virtual Pageable GetNetworkFabricControl { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricControllerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricControllerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricControllerResource(Client, NetworkFabricControllerData.DeserializeNetworkFabricControllerData(e)), NetworkFabricControllerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricControllerResource(Client, NetworkFabricControllerData.DeserializeNetworkFabricControllerData(e)), NetworkFabricControllerClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricControllers", "value", "nextLink", cancellationToken); } /// @@ -622,7 +717,7 @@ public virtual AsyncPageable GetNetworkFabricsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricResource(Client, NetworkFabricData.DeserializeNetworkFabricData(e)), NetworkFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabrics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricResource(Client, NetworkFabricData.DeserializeNetworkFabricData(e)), NetworkFabricClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabrics", "value", "nextLink", cancellationToken); } /// @@ -644,7 +739,7 @@ public virtual Pageable GetNetworkFabrics(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricResource(Client, NetworkFabricData.DeserializeNetworkFabricData(e)), NetworkFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabrics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricResource(Client, NetworkFabricData.DeserializeNetworkFabricData(e)), NetworkFabricClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabrics", "value", "nextLink", cancellationToken); } /// @@ -666,7 +761,7 @@ public virtual AsyncPageable GetNetworkPacketBroker { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkPacketBrokerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkPacketBrokerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkPacketBrokerResource(Client, NetworkPacketBrokerData.DeserializeNetworkPacketBrokerData(e)), NetworkPacketBrokerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkPacketBrokers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkPacketBrokerResource(Client, NetworkPacketBrokerData.DeserializeNetworkPacketBrokerData(e)), NetworkPacketBrokerClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkPacketBrokers", "value", "nextLink", cancellationToken); } /// @@ -688,7 +783,7 @@ public virtual Pageable GetNetworkPacketBrokers(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkPacketBrokerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkPacketBrokerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkPacketBrokerResource(Client, NetworkPacketBrokerData.DeserializeNetworkPacketBrokerData(e)), NetworkPacketBrokerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkPacketBrokers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkPacketBrokerResource(Client, NetworkPacketBrokerData.DeserializeNetworkPacketBrokerData(e)), NetworkPacketBrokerClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkPacketBrokers", "value", "nextLink", cancellationToken); } /// @@ -710,7 +805,7 @@ public virtual AsyncPageable GetNetworkRacksAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkRackRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkRackRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkRackResource(Client, NetworkRackData.DeserializeNetworkRackData(e)), NetworkRackClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkRacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkRackResource(Client, NetworkRackData.DeserializeNetworkRackData(e)), NetworkRackClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkRacks", "value", "nextLink", cancellationToken); } /// @@ -732,7 +827,7 @@ public virtual Pageable GetNetworkRacks(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkRackRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkRackRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkRackResource(Client, NetworkRackData.DeserializeNetworkRackData(e)), NetworkRackClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkRacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkRackResource(Client, NetworkRackData.DeserializeNetworkRackData(e)), NetworkRackClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkRacks", "value", "nextLink", cancellationToken); } /// @@ -754,7 +849,7 @@ public virtual AsyncPageable GetNetworkTapRulesAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkTapRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkTapRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkTapRuleResource(Client, NetworkTapRuleData.DeserializeNetworkTapRuleData(e)), NetworkTapRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkTapRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkTapRuleResource(Client, NetworkTapRuleData.DeserializeNetworkTapRuleData(e)), NetworkTapRuleClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkTapRules", "value", "nextLink", cancellationToken); } /// @@ -776,7 +871,7 @@ public virtual Pageable GetNetworkTapRules(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkTapRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkTapRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkTapRuleResource(Client, NetworkTapRuleData.DeserializeNetworkTapRuleData(e)), NetworkTapRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkTapRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkTapRuleResource(Client, NetworkTapRuleData.DeserializeNetworkTapRuleData(e)), NetworkTapRuleClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkTapRules", "value", "nextLink", cancellationToken); } /// @@ -798,7 +893,7 @@ public virtual AsyncPageable GetNetworkTapsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkTapRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkTapRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkTapResource(Client, NetworkTapData.DeserializeNetworkTapData(e)), NetworkTapClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkTaps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkTapResource(Client, NetworkTapData.DeserializeNetworkTapData(e)), NetworkTapClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkTaps", "value", "nextLink", cancellationToken); } /// @@ -820,7 +915,7 @@ public virtual Pageable GetNetworkTaps(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkTapRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkTapRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkTapResource(Client, NetworkTapData.DeserializeNetworkTapData(e)), NetworkTapClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkTaps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkTapResource(Client, NetworkTapData.DeserializeNetworkTapData(e)), NetworkTapClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkTaps", "value", "nextLink", cancellationToken); } /// @@ -842,7 +937,7 @@ public virtual AsyncPageable GetNetworkFabricR { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricRoutePolicyRoutePoliciesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricRoutePolicyRoutePoliciesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricRoutePolicyResource(Client, NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(e)), NetworkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricRoutePolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricRoutePolicyResource(Client, NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(e)), NetworkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricRoutePolicies", "value", "nextLink", cancellationToken); } /// @@ -864,7 +959,7 @@ public virtual Pageable GetNetworkFabricRouteP { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkFabricRoutePolicyRoutePoliciesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkFabricRoutePolicyRoutePoliciesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricRoutePolicyResource(Client, NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(e)), NetworkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkFabricRoutePolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkFabricRoutePolicyResource(Client, NetworkFabricRoutePolicyData.DeserializeNetworkFabricRoutePolicyData(e)), NetworkFabricRoutePolicyRoutePoliciesClientDiagnostics, Pipeline, "ManagedNetworkFabricSubscriptionMockingExtension.GetNetworkFabricRoutePolicies", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 30435260e317..000000000000 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ManagedNetworkFabric -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NetworkFabricAccessControlListResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricAccessControlListResources and their operations over a NetworkFabricAccessControlListResource. - public virtual NetworkFabricAccessControlListCollection GetNetworkFabricAccessControlLists() - { - return GetCachedClient(Client => new NetworkFabricAccessControlListCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricInternetGatewayResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricInternetGatewayResources and their operations over a NetworkFabricInternetGatewayResource. - public virtual NetworkFabricInternetGatewayCollection GetNetworkFabricInternetGateways() - { - return GetCachedClient(Client => new NetworkFabricInternetGatewayCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricInternetGatewayRuleResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricInternetGatewayRuleResources and their operations over a NetworkFabricInternetGatewayRuleResource. - public virtual NetworkFabricInternetGatewayRuleCollection GetNetworkFabricInternetGatewayRules() - { - return GetCachedClient(Client => new NetworkFabricInternetGatewayRuleCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricIPCommunityResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricIPCommunityResources and their operations over a NetworkFabricIPCommunityResource. - public virtual NetworkFabricIPCommunityCollection GetNetworkFabricIPCommunities() - { - return GetCachedClient(Client => new NetworkFabricIPCommunityCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricIPExtendedCommunityResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricIPExtendedCommunityResources and their operations over a NetworkFabricIPExtendedCommunityResource. - public virtual NetworkFabricIPExtendedCommunityCollection GetNetworkFabricIPExtendedCommunities() - { - return GetCachedClient(Client => new NetworkFabricIPExtendedCommunityCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricIPPrefixResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricIPPrefixResources and their operations over a NetworkFabricIPPrefixResource. - public virtual NetworkFabricIPPrefixCollection GetNetworkFabricIPPrefixes() - { - return GetCachedClient(Client => new NetworkFabricIPPrefixCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricL2IsolationDomainResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricL2IsolationDomainResources and their operations over a NetworkFabricL2IsolationDomainResource. - public virtual NetworkFabricL2IsolationDomainCollection GetNetworkFabricL2IsolationDomains() - { - return GetCachedClient(Client => new NetworkFabricL2IsolationDomainCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricL3IsolationDomainResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricL3IsolationDomainResources and their operations over a NetworkFabricL3IsolationDomainResource. - public virtual NetworkFabricL3IsolationDomainCollection GetNetworkFabricL3IsolationDomains() - { - return GetCachedClient(Client => new NetworkFabricL3IsolationDomainCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricNeighborGroupResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricNeighborGroupResources and their operations over a NetworkFabricNeighborGroupResource. - public virtual NetworkFabricNeighborGroupCollection GetNetworkFabricNeighborGroups() - { - return GetCachedClient(Client => new NetworkFabricNeighborGroupCollection(Client, Id)); - } - - /// Gets a collection of NetworkDeviceResources in the ResourceGroupResource. - /// An object representing collection of NetworkDeviceResources and their operations over a NetworkDeviceResource. - public virtual NetworkDeviceCollection GetNetworkDevices() - { - return GetCachedClient(Client => new NetworkDeviceCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricControllerResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricControllerResources and their operations over a NetworkFabricControllerResource. - public virtual NetworkFabricControllerCollection GetNetworkFabricControllers() - { - return GetCachedClient(Client => new NetworkFabricControllerCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricResources and their operations over a NetworkFabricResource. - public virtual NetworkFabricCollection GetNetworkFabrics() - { - return GetCachedClient(Client => new NetworkFabricCollection(Client, Id)); - } - - /// Gets a collection of NetworkPacketBrokerResources in the ResourceGroupResource. - /// An object representing collection of NetworkPacketBrokerResources and their operations over a NetworkPacketBrokerResource. - public virtual NetworkPacketBrokerCollection GetNetworkPacketBrokers() - { - return GetCachedClient(Client => new NetworkPacketBrokerCollection(Client, Id)); - } - - /// Gets a collection of NetworkRackResources in the ResourceGroupResource. - /// An object representing collection of NetworkRackResources and their operations over a NetworkRackResource. - public virtual NetworkRackCollection GetNetworkRacks() - { - return GetCachedClient(Client => new NetworkRackCollection(Client, Id)); - } - - /// Gets a collection of NetworkTapRuleResources in the ResourceGroupResource. - /// An object representing collection of NetworkTapRuleResources and their operations over a NetworkTapRuleResource. - public virtual NetworkTapRuleCollection GetNetworkTapRules() - { - return GetCachedClient(Client => new NetworkTapRuleCollection(Client, Id)); - } - - /// Gets a collection of NetworkTapResources in the ResourceGroupResource. - /// An object representing collection of NetworkTapResources and their operations over a NetworkTapResource. - public virtual NetworkTapCollection GetNetworkTaps() - { - return GetCachedClient(Client => new NetworkTapCollection(Client, Id)); - } - - /// Gets a collection of NetworkFabricRoutePolicyResources in the ResourceGroupResource. - /// An object representing collection of NetworkFabricRoutePolicyResources and their operations over a NetworkFabricRoutePolicyResource. - public virtual NetworkFabricRoutePolicyCollection GetNetworkFabricRoutePolicies() - { - return GetCachedClient(Client => new NetworkFabricRoutePolicyCollection(Client, Id)); - } - } -} diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs index 8a8317071473..392430886ddd 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkDeviceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkDeviceInterfaceResources and their operations over a NetworkDeviceInterfaceResource. public virtual NetworkDeviceInterfaceCollection GetNetworkDeviceInterfaces() { - return GetCachedClient(Client => new NetworkDeviceInterfaceCollection(Client, Id)); + return GetCachedClient(client => new NetworkDeviceInterfaceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkDeviceInterfaceCollection GetNetworkDeviceInterfaces() /// /// Name of the Network Interface. /// The cancellation token to use. - /// 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> GetNetworkDeviceInterfaceAsync(string networkInterfaceName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetNetworkDe /// /// Name of the Network Interface. /// The cancellation token to use. - /// 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 GetNetworkDeviceInterface(string networkInterfaceName, CancellationToken cancellationToken = default) { diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs index 9cd47592c951..5c26e190e413 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricL3IsolationDomainResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkFabricInternalNetworkResources and their operations over a NetworkFabricInternalNetworkResource. public virtual NetworkFabricInternalNetworkCollection GetNetworkFabricInternalNetworks() { - return GetCachedClient(Client => new NetworkFabricInternalNetworkCollection(Client, Id)); + return GetCachedClient(client => new NetworkFabricInternalNetworkCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkFabricInternalNetworkCollection GetNetworkFabricInternalNe /// /// Name of the Internal Network. /// The cancellation token to use. - /// 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> GetNetworkFabricInternalNetworkAsync(string internalNetworkName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetNet /// /// Name of the Internal Network. /// The cancellation token to use. - /// 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 GetNetworkFabricInternalNetwork(string internalNetworkName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetNetworkFabricIn /// An object representing collection of NetworkFabricExternalNetworkResources and their operations over a NetworkFabricExternalNetworkResource. public virtual NetworkFabricExternalNetworkCollection GetNetworkFabricExternalNetworks() { - return GetCachedClient(Client => new NetworkFabricExternalNetworkCollection(Client, Id)); + return GetCachedClient(client => new NetworkFabricExternalNetworkCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual NetworkFabricExternalNetworkCollection GetNetworkFabricExternalNe /// /// Name of the External Network. /// The cancellation token to use. - /// 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> GetNetworkFabricExternalNetworkAsync(string externalNetworkName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetNet /// /// Name of the External Network. /// The cancellation token to use. - /// 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 GetNetworkFabricExternalNetwork(string externalNetworkName, CancellationToken cancellationToken = default) { diff --git a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs index 032b8574ed3a..0f03558e3bfb 100644 --- a/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs +++ b/sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/src/Generated/NetworkFabricResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkToNetworkInterconnectResources and their operations over a NetworkToNetworkInterconnectResource. public virtual NetworkToNetworkInterconnectCollection GetNetworkToNetworkInterconnects() { - return GetCachedClient(Client => new NetworkToNetworkInterconnectCollection(Client, Id)); + return GetCachedClient(client => new NetworkToNetworkInterconnectCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkToNetworkInterconnectCollection GetNetworkToNetworkInterco /// /// Name of the Network to Network Interconnect. /// The cancellation token to use. - /// 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> GetNetworkToNetworkInterconnectAsync(string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetNet /// /// Name of the Network to Network Interconnect. /// The cancellation token to use. - /// 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 GetNetworkToNetworkInterconnect(string networkToNetworkInterconnectName, CancellationToken cancellationToken = default) { diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmClientMockingExtension.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmClientMockingExtension.cs new file mode 100644 index 000000000000..3f3aa738f7ab --- /dev/null +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmClientMockingExtension.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServiceIdentities; + +namespace Azure.ResourceManager.ManagedServiceIdentities.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ManagedServiceIdentitiesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedServiceIdentitiesArmClientMockingExtension() + { + } + + /// 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 ManagedServiceIdentitiesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ManagedServiceIdentitiesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets an object representing a SystemAssignedIdentityResource along with the instance operations that can be performed on it in the ArmClient. + /// The scope that the resource will apply against. + /// Returns a object. + public virtual SystemAssignedIdentityResource GetSystemAssignedIdentity(ResourceIdentifier scope) + { + return new SystemAssignedIdentityResource(Client, scope.AppendProviderResource("Microsoft.ManagedIdentity", "identities", "default")); + } + + /// + /// 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 SystemAssignedIdentityResource GetSystemAssignedIdentityResource(ResourceIdentifier id) + { + SystemAssignedIdentityResource.ValidateResourceId(id); + return new SystemAssignedIdentityResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UserAssignedIdentityResource GetUserAssignedIdentityResource(ResourceIdentifier id) + { + UserAssignedIdentityResource.ValidateResourceId(id); + return new UserAssignedIdentityResource(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 FederatedIdentityCredentialResource GetFederatedIdentityCredentialResource(ResourceIdentifier id) + { + FederatedIdentityCredentialResource.ValidateResourceId(id); + return new FederatedIdentityCredentialResource(Client, id); + } + } +} diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmMockingExtension.cs similarity index 71% rename from sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ArmResourceExtensionClient.cs rename to sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmMockingExtension.cs index 9ba7f0fbb094..2514c7a55303 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesArmMockingExtension.cs @@ -7,21 +7,22 @@ using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServiceIdentities; -namespace Azure.ResourceManager.ManagedServiceIdentities +namespace Azure.ResourceManager.ManagedServiceIdentities.Mocking { /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource + public partial class ManagedServiceIdentitiesArmMockingExtension : ArmResource { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ManagedServiceIdentitiesArmMockingExtension() { } - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ManagedServiceIdentitiesArmMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesExtensions.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesExtensions.cs index 9495b5e68ddb..6367b73e2671 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesExtensions.cs +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServiceIdentities.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ManagedServiceIdentities @@ -18,133 +19,115 @@ namespace Azure.ResourceManager.ManagedServiceIdentities /// A class to add extension methods to Azure.ResourceManager.ManagedServiceIdentities. public static partial class ManagedServiceIdentitiesExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ManagedServiceIdentitiesArmClientMockingExtension GetManagedServiceIdentitiesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ManagedServiceIdentitiesArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ManagedServiceIdentitiesArmMockingExtension GetManagedServiceIdentitiesArmMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ManagedServiceIdentitiesArmMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ManagedServiceIdentitiesResourceGroupMockingExtension GetManagedServiceIdentitiesResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ManagedServiceIdentitiesResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ManagedServiceIdentitiesSubscriptionMockingExtension GetManagedServiceIdentitiesSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ManagedServiceIdentitiesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + /// + /// Gets an object representing a SystemAssignedIdentityResource along with the instance operations that can be performed on it 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. + /// Returns a object. + public static SystemAssignedIdentityResource GetSystemAssignedIdentity(this ArmClient client, ResourceIdentifier scope) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return GetManagedServiceIdentitiesArmClientMockingExtension(client).GetSystemAssignedIdentity(scope); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SystemAssignedIdentityResource /// /// 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. /// Returns a object. public static SystemAssignedIdentityResource GetSystemAssignedIdentityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SystemAssignedIdentityResource.ValidateResourceId(id); - return new SystemAssignedIdentityResource(client, id); - } - ); + return GetManagedServiceIdentitiesArmClientMockingExtension(client).GetSystemAssignedIdentityResource(id); } - #endregion - #region UserAssignedIdentityResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static UserAssignedIdentityResource GetUserAssignedIdentityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - UserAssignedIdentityResource.ValidateResourceId(id); - return new UserAssignedIdentityResource(client, id); - } - ); + return GetManagedServiceIdentitiesArmClientMockingExtension(client).GetUserAssignedIdentityResource(id); } - #endregion - #region FederatedIdentityCredentialResource /// /// 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. /// Returns a object. public static FederatedIdentityCredentialResource GetFederatedIdentityCredentialResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FederatedIdentityCredentialResource.ValidateResourceId(id); - return new FederatedIdentityCredentialResource(client, id); - } - ); + return GetManagedServiceIdentitiesArmClientMockingExtension(client).GetFederatedIdentityCredentialResource(id); } - #endregion - /// Gets an object representing a SystemAssignedIdentityResource along with the instance operations that can be performed on it in the ArmResource. + /// + /// Gets an object representing a SystemAssignedIdentityResource along with the instance operations that can be performed on it in the ArmResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static SystemAssignedIdentityResource GetSystemAssignedIdentity(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetSystemAssignedIdentity(); + return GetManagedServiceIdentitiesArmMockingExtension(armResource).GetSystemAssignedIdentity(); } - /// Gets an object representing a SystemAssignedIdentityResource along with the instance operations that can be performed on it in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Returns a object. - public static SystemAssignedIdentityResource GetSystemAssignedIdentity(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetSystemAssignedIdentity(); - } - - /// Gets a collection of UserAssignedIdentityResources in the ResourceGroupResource. + /// + /// Gets a collection of UserAssignedIdentityResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of UserAssignedIdentityResources and their operations over a UserAssignedIdentityResource. public static UserAssignedIdentityCollection GetUserAssignedIdentities(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetUserAssignedIdentities(); + return GetManagedServiceIdentitiesResourceGroupMockingExtension(resourceGroupResource).GetUserAssignedIdentities(); } /// @@ -159,16 +142,20 @@ public static UserAssignedIdentityCollection GetUserAssignedIdentities(this Reso /// UserAssignedIdentities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the identity resource. /// The cancellation token to use. - /// 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 static async Task> GetUserAssignedIdentityAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetUserAssignedIdentities().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetManagedServiceIdentitiesResourceGroupMockingExtension(resourceGroupResource).GetUserAssignedIdentityAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -183,16 +170,20 @@ public static async Task> GetUserAssigned /// UserAssignedIdentities_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the identity resource. /// The cancellation token to use. - /// 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 static Response GetUserAssignedIdentity(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetUserAssignedIdentities().Get(resourceName, cancellationToken); + return GetManagedServiceIdentitiesResourceGroupMockingExtension(resourceGroupResource).GetUserAssignedIdentity(resourceName, cancellationToken); } /// @@ -207,13 +198,17 @@ public static Response GetUserAssignedIdentity(thi /// UserAssignedIdentities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUserAssignedIdentitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUserAssignedIdentitiesAsync(cancellationToken); + return GetManagedServiceIdentitiesSubscriptionMockingExtension(subscriptionResource).GetUserAssignedIdentitiesAsync(cancellationToken); } /// @@ -228,13 +223,17 @@ public static AsyncPageable GetUserAssignedIdentit /// UserAssignedIdentities_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUserAssignedIdentities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUserAssignedIdentities(cancellationToken); + return GetManagedServiceIdentitiesSubscriptionMockingExtension(subscriptionResource).GetUserAssignedIdentities(cancellationToken); } } } diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesResourceGroupMockingExtension.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..0ad2deafd38f --- /dev/null +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServiceIdentities; + +namespace Azure.ResourceManager.ManagedServiceIdentities.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ManagedServiceIdentitiesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedServiceIdentitiesResourceGroupMockingExtension() + { + } + + /// 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 ManagedServiceIdentitiesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of UserAssignedIdentityResources in the ResourceGroupResource. + /// An object representing collection of UserAssignedIdentityResources and their operations over a UserAssignedIdentityResource. + public virtual UserAssignedIdentityCollection GetUserAssignedIdentities() + { + return GetCachedClient(client => new UserAssignedIdentityCollection(client, Id)); + } + + /// + /// Gets the identity. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName} + /// + /// + /// Operation Id + /// UserAssignedIdentities_Get + /// + /// + /// + /// The name of the identity resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetUserAssignedIdentityAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetUserAssignedIdentities().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the identity. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName} + /// + /// + /// Operation Id + /// UserAssignedIdentities_Get + /// + /// + /// + /// The name of the identity resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetUserAssignedIdentity(string resourceName, CancellationToken cancellationToken = default) + { + return GetUserAssignedIdentities().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesSubscriptionMockingExtension.cs similarity index 85% rename from sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesSubscriptionMockingExtension.cs index b42f49247034..ca9aa483b523 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ManagedServiceIdentitiesSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServiceIdentities; -namespace Azure.ResourceManager.ManagedServiceIdentities +namespace Azure.ResourceManager.ManagedServiceIdentities.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ManagedServiceIdentitiesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _userAssignedIdentityClientDiagnostics; private UserAssignedIdentitiesRestOperations _userAssignedIdentityRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ManagedServiceIdentitiesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ManagedServiceIdentitiesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetUserAssignedIdenti { HttpMessage FirstPageRequest(int? pageSizeHint) => UserAssignedIdentityRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UserAssignedIdentityRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new UserAssignedIdentityResource(Client, UserAssignedIdentityData.DeserializeUserAssignedIdentityData(e)), UserAssignedIdentityClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUserAssignedIdentities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new UserAssignedIdentityResource(Client, UserAssignedIdentityData.DeserializeUserAssignedIdentityData(e)), UserAssignedIdentityClientDiagnostics, Pipeline, "ManagedServiceIdentitiesSubscriptionMockingExtension.GetUserAssignedIdentities", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetUserAssignedIdentities( { HttpMessage FirstPageRequest(int? pageSizeHint) => UserAssignedIdentityRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UserAssignedIdentityRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new UserAssignedIdentityResource(Client, UserAssignedIdentityData.DeserializeUserAssignedIdentityData(e)), UserAssignedIdentityClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUserAssignedIdentities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new UserAssignedIdentityResource(Client, UserAssignedIdentityData.DeserializeUserAssignedIdentityData(e)), UserAssignedIdentityClientDiagnostics, Pipeline, "ManagedServiceIdentitiesSubscriptionMockingExtension.GetUserAssignedIdentities", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 76c9977e20fa..000000000000 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ManagedServiceIdentities -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of UserAssignedIdentityResources in the ResourceGroupResource. - /// An object representing collection of UserAssignedIdentityResources and their operations over a UserAssignedIdentityResource. - public virtual UserAssignedIdentityCollection GetUserAssignedIdentities() - { - return GetCachedClient(Client => new UserAssignedIdentityCollection(Client, Id)); - } - } -} diff --git a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/UserAssignedIdentityResource.cs b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/UserAssignedIdentityResource.cs index f155d5e64861..198ea6ee2d98 100644 --- a/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/UserAssignedIdentityResource.cs +++ b/sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/src/Generated/UserAssignedIdentityResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FederatedIdentityCredentialResources and their operations over a FederatedIdentityCredentialResource. public virtual FederatedIdentityCredentialCollection GetFederatedIdentityCredentials() { - return GetCachedClient(Client => new FederatedIdentityCredentialCollection(Client, Id)); + return GetCachedClient(client => new FederatedIdentityCredentialCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual FederatedIdentityCredentialCollection GetFederatedIdentityCredent /// /// The name of the federated identity credential resource. /// The cancellation token to use. - /// 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> GetFederatedIdentityCredentialAsync(string federatedIdentityCredentialResourceName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetFede /// /// The name of the federated identity credential resource. /// The cancellation token to use. - /// 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 GetFederatedIdentityCredential(string federatedIdentityCredentialResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index c908067ab823..000000000000 --- a/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ManagedServices -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ManagedServicesRegistrationResources in the ArmResource. - /// An object representing collection of ManagedServicesRegistrationResources and their operations over a ManagedServicesRegistrationResource. - public virtual ManagedServicesRegistrationCollection GetManagedServicesRegistrations() - { - return GetCachedClient(Client => new ManagedServicesRegistrationCollection(Client, Id)); - } - - /// Gets a collection of ManagedServicesRegistrationAssignmentResources in the ArmResource. - /// An object representing collection of ManagedServicesRegistrationAssignmentResources and their operations over a ManagedServicesRegistrationAssignmentResource. - public virtual ManagedServicesRegistrationAssignmentCollection GetManagedServicesRegistrationAssignments() - { - return GetCachedClient(Client => new ManagedServicesRegistrationAssignmentCollection(Client, Id)); - } - - /// Gets a collection of ManagedServicesMarketplaceRegistrationResources in the ArmResource. - /// An object representing collection of ManagedServicesMarketplaceRegistrationResources and their operations over a ManagedServicesMarketplaceRegistrationResource. - public virtual ManagedServicesMarketplaceRegistrationCollection GetManagedServicesMarketplaceRegistrations() - { - return GetCachedClient(Client => new ManagedServicesMarketplaceRegistrationCollection(Client, Id)); - } - } -} diff --git a/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesArmClientMockingExtension.cs b/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..3a09b5f015d9 --- /dev/null +++ b/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesArmClientMockingExtension.cs @@ -0,0 +1,249 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServices; + +namespace Azure.ResourceManager.ManagedServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ManagedServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagedServicesArmClientMockingExtension() + { + } + + /// 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 ManagedServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ManagedServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ManagedServicesRegistrationResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ManagedServicesRegistrationResources and their operations over a ManagedServicesRegistrationResource. + public virtual ManagedServicesRegistrationCollection GetManagedServicesRegistrations(ResourceIdentifier scope) + { + return new ManagedServicesRegistrationCollection(Client, scope); + } + + /// + /// Gets the registration definition details. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId} + /// + /// + /// Operation Id + /// RegistrationDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The GUID of the registration definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedServicesRegistrationAsync(ResourceIdentifier scope, string registrationId, CancellationToken cancellationToken = default) + { + return await GetManagedServicesRegistrations(scope).GetAsync(registrationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the registration definition details. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId} + /// + /// + /// Operation Id + /// RegistrationDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The GUID of the registration definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedServicesRegistration(ResourceIdentifier scope, string registrationId, CancellationToken cancellationToken = default) + { + return GetManagedServicesRegistrations(scope).Get(registrationId, cancellationToken); + } + + /// Gets a collection of ManagedServicesRegistrationAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ManagedServicesRegistrationAssignmentResources and their operations over a ManagedServicesRegistrationAssignmentResource. + public virtual ManagedServicesRegistrationAssignmentCollection GetManagedServicesRegistrationAssignments(ResourceIdentifier scope) + { + return new ManagedServicesRegistrationAssignmentCollection(Client, scope); + } + + /// + /// Gets the details of the specified registration assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId} + /// + /// + /// Operation Id + /// RegistrationAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The GUID of the registration assignment. + /// The flag indicating whether to return the registration definition details along with the registration assignment details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedServicesRegistrationAssignmentAsync(ResourceIdentifier scope, string registrationAssignmentId, bool? expandRegistrationDefinition = null, CancellationToken cancellationToken = default) + { + return await GetManagedServicesRegistrationAssignments(scope).GetAsync(registrationAssignmentId, expandRegistrationDefinition, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the specified registration assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId} + /// + /// + /// Operation Id + /// RegistrationAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The GUID of the registration assignment. + /// The flag indicating whether to return the registration definition details along with the registration assignment details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedServicesRegistrationAssignment(ResourceIdentifier scope, string registrationAssignmentId, bool? expandRegistrationDefinition = null, CancellationToken cancellationToken = default) + { + return GetManagedServicesRegistrationAssignments(scope).Get(registrationAssignmentId, expandRegistrationDefinition, cancellationToken); + } + + /// Gets a collection of ManagedServicesMarketplaceRegistrationResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ManagedServicesMarketplaceRegistrationResources and their operations over a ManagedServicesMarketplaceRegistrationResource. + public virtual ManagedServicesMarketplaceRegistrationCollection GetManagedServicesMarketplaceRegistrations(ResourceIdentifier scope) + { + return new ManagedServicesMarketplaceRegistrationCollection(Client, scope); + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier} + /// + /// + /// Operation Id + /// MarketplaceRegistrationDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The Azure Marketplace identifier. Expected formats: {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or {publisher}.{product[-preview]} or {publisher}). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedServicesMarketplaceRegistrationAsync(ResourceIdentifier scope, string marketplaceIdentifier, CancellationToken cancellationToken = default) + { + return await GetManagedServicesMarketplaceRegistrations(scope).GetAsync(marketplaceIdentifier, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier} + /// + /// + /// Operation Id + /// MarketplaceRegistrationDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The Azure Marketplace identifier. Expected formats: {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or {publisher}.{product[-preview]} or {publisher}). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedServicesMarketplaceRegistration(ResourceIdentifier scope, string marketplaceIdentifier, CancellationToken cancellationToken = default) + { + return GetManagedServicesMarketplaceRegistrations(scope).Get(marketplaceIdentifier, 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 ManagedServicesRegistrationResource GetManagedServicesRegistrationResource(ResourceIdentifier id) + { + ManagedServicesRegistrationResource.ValidateResourceId(id); + return new ManagedServicesRegistrationResource(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 ManagedServicesRegistrationAssignmentResource GetManagedServicesRegistrationAssignmentResource(ResourceIdentifier id) + { + ManagedServicesRegistrationAssignmentResource.ValidateResourceId(id); + return new ManagedServicesRegistrationAssignmentResource(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 ManagedServicesMarketplaceRegistrationResource GetManagedServicesMarketplaceRegistrationResource(ResourceIdentifier id) + { + ManagedServicesMarketplaceRegistrationResource.ValidateResourceId(id); + return new ManagedServicesMarketplaceRegistrationResource(Client, id); + } + } +} diff --git a/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesExtensions.cs b/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesExtensions.cs index fdfce2421449..5e0bc4db40c2 100644 --- a/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesExtensions.cs +++ b/sdk/managedservices/Azure.ResourceManager.ManagedServices/src/Generated/Extensions/ManagedServicesExtensions.cs @@ -11,91 +11,31 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagedServices.Mocking; namespace Azure.ResourceManager.ManagedServices { /// A class to add extension methods to Azure.ResourceManager.ManagedServices. public static partial class ManagedServicesExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ManagedServicesArmClientMockingExtension GetManagedServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ManagedServicesArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); - } - #region ManagedServicesRegistrationResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ManagedServicesRegistrationResource GetManagedServicesRegistrationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ManagedServicesRegistrationResource.ValidateResourceId(id); - return new ManagedServicesRegistrationResource(client, id); - } - ); - } - #endregion - - #region ManagedServicesRegistrationAssignmentResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ManagedServicesRegistrationAssignmentResource GetManagedServicesRegistrationAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ManagedServicesRegistrationAssignmentResource.ValidateResourceId(id); - return new ManagedServicesRegistrationAssignmentResource(client, id); - } - ); - } - #endregion - - #region ManagedServicesMarketplaceRegistrationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of ManagedServicesRegistrationResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ManagedServicesMarketplaceRegistrationResource GetManagedServicesMarketplaceRegistrationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ManagedServicesMarketplaceRegistrationResource.ValidateResourceId(id); - return new ManagedServicesMarketplaceRegistrationResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of ManagedServicesRegistrationResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of ManagedServicesRegistrationResources and their operations over a ManagedServicesRegistrationResource. public static ManagedServicesRegistrationCollection GetManagedServicesRegistrations(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetManagedServicesRegistrations(); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrations(scope); } /// @@ -110,17 +50,21 @@ public static ManagedServicesRegistrationCollection GetManagedServicesRegistrati /// RegistrationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The GUID of the registration definition. /// The cancellation token to use. - /// 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 static async Task> GetManagedServicesRegistrationAsync(this ArmClient client, ResourceIdentifier scope, string registrationId, CancellationToken cancellationToken = default) { - return await client.GetManagedServicesRegistrations(scope).GetAsync(registrationId, cancellationToken).ConfigureAwait(false); + return await GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationAsync(scope, registrationId, cancellationToken).ConfigureAwait(false); } /// @@ -135,26 +79,36 @@ public static async Task> GetManag /// RegistrationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The GUID of the registration definition. /// The cancellation token to use. - /// 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 static Response GetManagedServicesRegistration(this ArmClient client, ResourceIdentifier scope, string registrationId, CancellationToken cancellationToken = default) { - return client.GetManagedServicesRegistrations(scope).Get(registrationId, cancellationToken); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistration(scope, registrationId, cancellationToken); } - /// Gets a collection of ManagedServicesRegistrationAssignmentResources in the ArmResource. + /// + /// Gets a collection of ManagedServicesRegistrationAssignmentResources 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. /// An object representing collection of ManagedServicesRegistrationAssignmentResources and their operations over a ManagedServicesRegistrationAssignmentResource. public static ManagedServicesRegistrationAssignmentCollection GetManagedServicesRegistrationAssignments(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetManagedServicesRegistrationAssignments(); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationAssignments(scope); } /// @@ -169,18 +123,22 @@ public static ManagedServicesRegistrationAssignmentCollection GetManagedServices /// RegistrationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The GUID of the registration assignment. /// The flag indicating whether to return the registration definition details along with the registration assignment details. /// The cancellation token to use. - /// 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 static async Task> GetManagedServicesRegistrationAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string registrationAssignmentId, bool? expandRegistrationDefinition = null, CancellationToken cancellationToken = default) { - return await client.GetManagedServicesRegistrationAssignments(scope).GetAsync(registrationAssignmentId, expandRegistrationDefinition, cancellationToken).ConfigureAwait(false); + return await GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationAssignmentAsync(scope, registrationAssignmentId, expandRegistrationDefinition, cancellationToken).ConfigureAwait(false); } /// @@ -195,27 +153,37 @@ public static async Task /// RegistrationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The GUID of the registration assignment. /// The flag indicating whether to return the registration definition details along with the registration assignment details. /// The cancellation token to use. - /// 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 static Response GetManagedServicesRegistrationAssignment(this ArmClient client, ResourceIdentifier scope, string registrationAssignmentId, bool? expandRegistrationDefinition = null, CancellationToken cancellationToken = default) { - return client.GetManagedServicesRegistrationAssignments(scope).Get(registrationAssignmentId, expandRegistrationDefinition, cancellationToken); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationAssignment(scope, registrationAssignmentId, expandRegistrationDefinition, cancellationToken); } - /// Gets a collection of ManagedServicesMarketplaceRegistrationResources in the ArmResource. + /// + /// Gets a collection of ManagedServicesMarketplaceRegistrationResources 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. /// An object representing collection of ManagedServicesMarketplaceRegistrationResources and their operations over a ManagedServicesMarketplaceRegistrationResource. public static ManagedServicesMarketplaceRegistrationCollection GetManagedServicesMarketplaceRegistrations(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetManagedServicesMarketplaceRegistrations(); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesMarketplaceRegistrations(scope); } /// @@ -230,17 +198,21 @@ public static ManagedServicesMarketplaceRegistrationCollection GetManagedService /// MarketplaceRegistrationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The Azure Marketplace identifier. Expected formats: {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or {publisher}.{product[-preview]} or {publisher}). /// The cancellation token to use. - /// 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 static async Task> GetManagedServicesMarketplaceRegistrationAsync(this ArmClient client, ResourceIdentifier scope, string marketplaceIdentifier, CancellationToken cancellationToken = default) { - return await client.GetManagedServicesMarketplaceRegistrations(scope).GetAsync(marketplaceIdentifier, cancellationToken).ConfigureAwait(false); + return await GetManagedServicesArmClientMockingExtension(client).GetManagedServicesMarketplaceRegistrationAsync(scope, marketplaceIdentifier, cancellationToken).ConfigureAwait(false); } /// @@ -255,17 +227,69 @@ public static async TaskMarketplaceRegistrationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The Azure Marketplace identifier. Expected formats: {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or {publisher}.{product[-preview]} or {publisher}). /// The cancellation token to use. - /// 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 static Response GetManagedServicesMarketplaceRegistration(this ArmClient client, ResourceIdentifier scope, string marketplaceIdentifier, CancellationToken cancellationToken = default) { - return client.GetManagedServicesMarketplaceRegistrations(scope).Get(marketplaceIdentifier, cancellationToken); + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesMarketplaceRegistration(scope, marketplaceIdentifier, 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. + /// Returns a object. + public static ManagedServicesRegistrationResource GetManagedServicesRegistrationResource(this ArmClient client, ResourceIdentifier id) + { + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationResource(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. + /// Returns a object. + public static ManagedServicesRegistrationAssignmentResource GetManagedServicesRegistrationAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesRegistrationAssignmentResource(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. + /// Returns a object. + public static ManagedServicesMarketplaceRegistrationResource GetManagedServicesMarketplaceRegistrationResource(this ArmClient client, ResourceIdentifier id) + { + return GetManagedServicesArmClientMockingExtension(client).GetManagedServicesMarketplaceRegistrationResource(id); } } } diff --git a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerArmClientMockingExtension.cs b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerArmClientMockingExtension.cs new file mode 100644 index 000000000000..32943605aa91 --- /dev/null +++ b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ManagementPartner; + +namespace Azure.ResourceManager.ManagementPartner.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ManagementPartnerArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ManagementPartnerArmClientMockingExtension() + { + } + + /// 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 ManagementPartnerArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ManagementPartnerArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PartnerResponseResource GetPartnerResponseResource(ResourceIdentifier id) + { + PartnerResponseResource.ValidateResourceId(id); + return new PartnerResponseResource(Client, id); + } + } +} diff --git a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerExtensions.cs b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerExtensions.cs index 285122844e26..4de00ef70702 100644 --- a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerExtensions.cs +++ b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ManagementPartner.Mocking; using Azure.ResourceManager.ManagementPartner.Models; using Azure.ResourceManager.Resources; @@ -19,46 +20,44 @@ namespace Azure.ResourceManager.ManagementPartner /// A class to add extension methods to Azure.ResourceManager.ManagementPartner. public static partial class ManagementPartnerExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static ManagementPartnerArmClientMockingExtension GetManagementPartnerArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ManagementPartnerArmClientMockingExtension(client0)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ManagementPartnerTenantMockingExtension GetManagementPartnerTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ManagementPartnerTenantMockingExtension(client, resource.Id)); } - #region PartnerResponseResource + /// /// 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. /// Returns a object. public static PartnerResponseResource GetPartnerResponseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerResponseResource.ValidateResourceId(id); - return new PartnerResponseResource(client, id); - } - ); + return GetManagementPartnerArmClientMockingExtension(client).GetPartnerResponseResource(id); } - #endregion - /// Gets a collection of PartnerResponseResources in the TenantResource. + /// + /// Gets a collection of PartnerResponseResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PartnerResponseResources and their operations over a PartnerResponseResource. public static PartnerResponseCollection GetPartnerResponses(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetPartnerResponses(); + return GetManagementPartnerTenantMockingExtension(tenantResource).GetPartnerResponses(); } /// @@ -73,16 +72,20 @@ public static PartnerResponseCollection GetPartnerResponses(this TenantResource /// Partner_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Id of the Partner. /// The cancellation token to use. - /// 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 static async Task> GetPartnerResponseAsync(this TenantResource tenantResource, string partnerId, CancellationToken cancellationToken = default) { - return await tenantResource.GetPartnerResponses().GetAsync(partnerId, cancellationToken).ConfigureAwait(false); + return await GetManagementPartnerTenantMockingExtension(tenantResource).GetPartnerResponseAsync(partnerId, cancellationToken).ConfigureAwait(false); } /// @@ -97,16 +100,20 @@ public static async Task> GetPartnerResponseAs /// Partner_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Id of the Partner. /// The cancellation token to use. - /// 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 static Response GetPartnerResponse(this TenantResource tenantResource, string partnerId, CancellationToken cancellationToken = default) { - return tenantResource.GetPartnerResponses().Get(partnerId, cancellationToken); + return GetManagementPartnerTenantMockingExtension(tenantResource).GetPartnerResponse(partnerId, cancellationToken); } /// @@ -121,13 +128,17 @@ public static Response GetPartnerResponse(this TenantRe /// Operation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsAsync(cancellationToken); + return GetManagementPartnerTenantMockingExtension(tenantResource).GetOperationsAsync(cancellationToken); } /// @@ -142,13 +153,17 @@ public static AsyncPageable GetOperationsAsync(this TenantRes /// Operation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperations(cancellationToken); + return GetManagementPartnerTenantMockingExtension(tenantResource).GetOperations(cancellationToken); } } } diff --git a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerTenantMockingExtension.cs similarity index 56% rename from sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerTenantMockingExtension.cs index e9325d7068d6..54a2a4985215 100644 --- a/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/managementpartner/Azure.ResourceManager.ManagementPartner/src/Generated/Extensions/ManagementPartnerTenantMockingExtension.cs @@ -5,31 +5,34 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ManagementPartner; using Azure.ResourceManager.ManagementPartner.Models; -namespace Azure.ResourceManager.ManagementPartner +namespace Azure.ResourceManager.ManagementPartner.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ManagementPartnerTenantMockingExtension : ArmResource { private ClientDiagnostics _operationClientDiagnostics; private OperationRestOperations _operationRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ManagementPartnerTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ManagementPartnerTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +49,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of PartnerResponseResources and their operations over a PartnerResponseResource. public virtual PartnerResponseCollection GetPartnerResponses() { - return GetCachedClient(Client => new PartnerResponseCollection(Client, Id)); + return GetCachedClient(client => new PartnerResponseCollection(client, Id)); + } + + /// + /// Get the management partner using the partnerId, objectId and tenantId. + /// + /// + /// Request Path + /// /providers/Microsoft.ManagementPartner/partners/{partnerId} + /// + /// + /// Operation Id + /// Partner_Get + /// + /// + /// + /// Id of the Partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPartnerResponseAsync(string partnerId, CancellationToken cancellationToken = default) + { + return await GetPartnerResponses().GetAsync(partnerId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the management partner using the partnerId, objectId and tenantId. + /// + /// + /// Request Path + /// /providers/Microsoft.ManagementPartner/partners/{partnerId} + /// + /// + /// Operation Id + /// Partner_Get + /// + /// + /// + /// Id of the Partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPartnerResponse(string partnerId, CancellationToken cancellationToken = default) + { + return GetPartnerResponses().Get(partnerId, cancellationToken); } /// @@ -68,7 +117,7 @@ public virtual AsyncPageable GetOperationsAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, OperationResponse.DeserializeOperationResponse, OperationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, OperationResponse.DeserializeOperationResponse, OperationClientDiagnostics, Pipeline, "ManagementPartnerTenantMockingExtension.GetOperations", "value", "nextLink", cancellationToken); } /// @@ -90,7 +139,7 @@ public virtual Pageable GetOperations(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, OperationResponse.DeserializeOperationResponse, OperationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, OperationResponse.DeserializeOperationResponse, OperationClientDiagnostics, Pipeline, "ManagementPartnerTenantMockingExtension.GetOperations", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsArmClientMockingExtension.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsArmClientMockingExtension.cs new file mode 100644 index 000000000000..310f2f487e0e --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Maps; + +namespace Azure.ResourceManager.Maps.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MapsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MapsArmClientMockingExtension() + { + } + + /// 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 MapsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MapsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MapsAccountResource GetMapsAccountResource(ResourceIdentifier id) + { + MapsAccountResource.ValidateResourceId(id); + return new MapsAccountResource(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 MapsCreatorResource GetMapsCreatorResource(ResourceIdentifier id) + { + MapsCreatorResource.ValidateResourceId(id); + return new MapsCreatorResource(Client, id); + } + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs index 4a488bdbecb2..706c35ef4dc2 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Maps.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Maps @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.Maps /// A class to add extension methods to Azure.ResourceManager.Maps. public static partial class MapsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MapsArmClientMockingExtension GetMapsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MapsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MapsResourceGroupMockingExtension GetMapsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MapsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MapsSubscriptionMockingExtension GetMapsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MapsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region MapsAccountResource /// /// 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. /// Returns a object. public static MapsAccountResource GetMapsAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MapsAccountResource.ValidateResourceId(id); - return new MapsAccountResource(client, id); - } - ); + return GetMapsArmClientMockingExtension(client).GetMapsAccountResource(id); } - #endregion - #region MapsCreatorResource /// /// 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. /// Returns a object. public static MapsCreatorResource GetMapsCreatorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MapsCreatorResource.ValidateResourceId(id); - return new MapsCreatorResource(client, id); - } - ); + return GetMapsArmClientMockingExtension(client).GetMapsCreatorResource(id); } - #endregion - /// Gets a collection of MapsAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of MapsAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MapsAccountResources and their operations over a MapsAccountResource. public static MapsAccountCollection GetMapsAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMapsAccounts(); + return GetMapsResourceGroupMockingExtension(resourceGroupResource).GetMapsAccounts(); } /// @@ -107,16 +92,20 @@ public static MapsAccountCollection GetMapsAccounts(this ResourceGroupResource r /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Maps Account. /// The cancellation token to use. - /// 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 static async Task> GetMapsAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMapsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetMapsResourceGroupMockingExtension(resourceGroupResource).GetMapsAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetMapsAccountAsync(this /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Maps Account. /// The cancellation token to use. - /// 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 static Response GetMapsAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMapsAccounts().Get(accountName, cancellationToken); + return GetMapsResourceGroupMockingExtension(resourceGroupResource).GetMapsAccount(accountName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetMapsAccount(this ResourceGroupRes /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMapsAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMapsAccountsAsync(cancellationToken); + return GetMapsSubscriptionMockingExtension(subscriptionResource).GetMapsAccountsAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetMapsAccountsAsync(this Subsc /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMapsAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMapsAccounts(cancellationToken); + return GetMapsSubscriptionMockingExtension(subscriptionResource).GetMapsAccounts(cancellationToken); } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsResourceGroupMockingExtension.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8c3d0ffd37ab --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Maps; + +namespace Azure.ResourceManager.Maps.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MapsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MapsResourceGroupMockingExtension() + { + } + + /// 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 MapsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MapsAccountResources in the ResourceGroupResource. + /// An object representing collection of MapsAccountResources and their operations over a MapsAccountResource. + public virtual MapsAccountCollection GetMapsAccounts() + { + return GetCachedClient(client => new MapsAccountCollection(client, Id)); + } + + /// + /// Get a Maps Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Maps Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMapsAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetMapsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Maps Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Maps Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMapsAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetMapsAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsSubscriptionMockingExtension.cs similarity index 85% rename from sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsSubscriptionMockingExtension.cs index df78aca24d49..16521c6b2fc7 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Maps; -namespace Azure.ResourceManager.Maps +namespace Azure.ResourceManager.Maps.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MapsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mapsAccountAccountsClientDiagnostics; private AccountsRestOperations _mapsAccountAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MapsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MapsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetMapsAccountsAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => MapsAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MapsAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MapsAccountResource(Client, MapsAccountData.DeserializeMapsAccountData(e)), MapsAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMapsAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MapsAccountResource(Client, MapsAccountData.DeserializeMapsAccountData(e)), MapsAccountAccountsClientDiagnostics, Pipeline, "MapsSubscriptionMockingExtension.GetMapsAccounts", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetMapsAccounts(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => MapsAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MapsAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MapsAccountResource(Client, MapsAccountData.DeserializeMapsAccountData(e)), MapsAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMapsAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MapsAccountResource(Client, MapsAccountData.DeserializeMapsAccountData(e)), MapsAccountAccountsClientDiagnostics, Pipeline, "MapsSubscriptionMockingExtension.GetMapsAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 5349ad48c415..000000000000 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Maps -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MapsAccountResources in the ResourceGroupResource. - /// An object representing collection of MapsAccountResources and their operations over a MapsAccountResource. - public virtual MapsAccountCollection GetMapsAccounts() - { - return GetCachedClient(Client => new MapsAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs index bf73dbdf4791..d1b44251ee99 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MapsCreatorResources and their operations over a MapsCreatorResource. public virtual MapsCreatorCollection GetMapsCreators() { - return GetCachedClient(Client => new MapsCreatorCollection(Client, Id)); + return GetCachedClient(client => new MapsCreatorCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MapsCreatorCollection GetMapsCreators() /// /// The name of the Maps Creator instance. /// The cancellation token to use. - /// 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> GetMapsCreatorAsync(string creatorName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetMapsCreatorAsync(str /// /// The name of the Maps Creator instance. /// The cancellation token to use. - /// 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 GetMapsCreator(string creatorName, CancellationToken cancellationToken = default) { diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceArmClientMockingExtension.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceArmClientMockingExtension.cs new file mode 100644 index 000000000000..31d865b3df8c --- /dev/null +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Marketplace; + +namespace Azure.ResourceManager.Marketplace.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MarketplaceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MarketplaceArmClientMockingExtension() + { + } + + /// 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 MarketplaceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MarketplaceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PrivateStoreResource GetPrivateStoreResource(ResourceIdentifier id) + { + PrivateStoreResource.ValidateResourceId(id); + return new PrivateStoreResource(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 MarketplaceApprovalRequestResource GetMarketplaceApprovalRequestResource(ResourceIdentifier id) + { + MarketplaceApprovalRequestResource.ValidateResourceId(id); + return new MarketplaceApprovalRequestResource(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 MarketplaceAdminApprovalRequestResource GetMarketplaceAdminApprovalRequestResource(ResourceIdentifier id) + { + MarketplaceAdminApprovalRequestResource.ValidateResourceId(id); + return new MarketplaceAdminApprovalRequestResource(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 PrivateStoreCollectionInfoResource GetPrivateStoreCollectionInfoResource(ResourceIdentifier id) + { + PrivateStoreCollectionInfoResource.ValidateResourceId(id); + return new PrivateStoreCollectionInfoResource(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 PrivateStoreOfferResource GetPrivateStoreOfferResource(ResourceIdentifier id) + { + PrivateStoreOfferResource.ValidateResourceId(id); + return new PrivateStoreOfferResource(Client, id); + } + } +} diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceExtensions.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceExtensions.cs index 98f3d4541655..678b0daa3301 100644 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceExtensions.cs +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Marketplace.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Marketplace @@ -18,122 +19,108 @@ namespace Azure.ResourceManager.Marketplace /// A class to add extension methods to Azure.ResourceManager.Marketplace. public static partial class MarketplaceExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static MarketplaceArmClientMockingExtension GetMarketplaceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MarketplaceArmClientMockingExtension(client0)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MarketplaceTenantMockingExtension GetMarketplaceTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MarketplaceTenantMockingExtension(client, resource.Id)); } - #region PrivateStoreResource + /// /// 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. /// Returns a object. public static PrivateStoreResource GetPrivateStoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateStoreResource.ValidateResourceId(id); - return new PrivateStoreResource(client, id); - } - ); + return GetMarketplaceArmClientMockingExtension(client).GetPrivateStoreResource(id); } - #endregion - #region MarketplaceApprovalRequestResource /// /// 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. /// Returns a object. public static MarketplaceApprovalRequestResource GetMarketplaceApprovalRequestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MarketplaceApprovalRequestResource.ValidateResourceId(id); - return new MarketplaceApprovalRequestResource(client, id); - } - ); + return GetMarketplaceArmClientMockingExtension(client).GetMarketplaceApprovalRequestResource(id); } - #endregion - #region MarketplaceAdminApprovalRequestResource /// /// 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. /// Returns a object. public static MarketplaceAdminApprovalRequestResource GetMarketplaceAdminApprovalRequestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MarketplaceAdminApprovalRequestResource.ValidateResourceId(id); - return new MarketplaceAdminApprovalRequestResource(client, id); - } - ); + return GetMarketplaceArmClientMockingExtension(client).GetMarketplaceAdminApprovalRequestResource(id); } - #endregion - #region PrivateStoreCollectionInfoResource /// /// 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. /// Returns a object. public static PrivateStoreCollectionInfoResource GetPrivateStoreCollectionInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateStoreCollectionInfoResource.ValidateResourceId(id); - return new PrivateStoreCollectionInfoResource(client, id); - } - ); + return GetMarketplaceArmClientMockingExtension(client).GetPrivateStoreCollectionInfoResource(id); } - #endregion - #region PrivateStoreOfferResource /// /// 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. /// Returns a object. public static PrivateStoreOfferResource GetPrivateStoreOfferResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateStoreOfferResource.ValidateResourceId(id); - return new PrivateStoreOfferResource(client, id); - } - ); + return GetMarketplaceArmClientMockingExtension(client).GetPrivateStoreOfferResource(id); } - #endregion - /// Gets a collection of PrivateStoreResources in the TenantResource. + /// + /// Gets a collection of PrivateStoreResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PrivateStoreResources and their operations over a PrivateStoreResource. public static PrivateStoreCollection GetPrivateStores(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetPrivateStores(); + return GetMarketplaceTenantMockingExtension(tenantResource).GetPrivateStores(); } /// @@ -148,6 +135,10 @@ public static PrivateStoreCollection GetPrivateStores(this TenantResource tenant /// PrivateStore_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The store ID - must use the tenant ID. @@ -155,7 +146,7 @@ public static PrivateStoreCollection GetPrivateStores(this TenantResource tenant [ForwardsClientCalls] public static async Task> GetPrivateStoreAsync(this TenantResource tenantResource, Guid privateStoreId, CancellationToken cancellationToken = default) { - return await tenantResource.GetPrivateStores().GetAsync(privateStoreId, cancellationToken).ConfigureAwait(false); + return await GetMarketplaceTenantMockingExtension(tenantResource).GetPrivateStoreAsync(privateStoreId, cancellationToken).ConfigureAwait(false); } /// @@ -170,6 +161,10 @@ public static async Task> GetPrivateStoreAsync(th /// PrivateStore_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The store ID - must use the tenant ID. @@ -177,7 +172,7 @@ public static async Task> GetPrivateStoreAsync(th [ForwardsClientCalls] public static Response GetPrivateStore(this TenantResource tenantResource, Guid privateStoreId, CancellationToken cancellationToken = default) { - return tenantResource.GetPrivateStores().Get(privateStoreId, cancellationToken); + return GetMarketplaceTenantMockingExtension(tenantResource).GetPrivateStore(privateStoreId, cancellationToken); } } } diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceTenantMockingExtension.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceTenantMockingExtension.cs new file mode 100644 index 000000000000..596e36f717eb --- /dev/null +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/MarketplaceTenantMockingExtension.cs @@ -0,0 +1,88 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Marketplace; + +namespace Azure.ResourceManager.Marketplace.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MarketplaceTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MarketplaceTenantMockingExtension() + { + } + + /// 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 MarketplaceTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PrivateStoreResources in the TenantResource. + /// An object representing collection of PrivateStoreResources and their operations over a PrivateStoreResource. + public virtual PrivateStoreCollection GetPrivateStores() + { + return GetCachedClient(client => new PrivateStoreCollection(client, Id)); + } + + /// + /// Get information about the private store + /// + /// + /// Request Path + /// /providers/Microsoft.Marketplace/privateStores/{privateStoreId} + /// + /// + /// Operation Id + /// PrivateStore_Get + /// + /// + /// + /// The store ID - must use the tenant ID. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetPrivateStoreAsync(Guid privateStoreId, CancellationToken cancellationToken = default) + { + return await GetPrivateStores().GetAsync(privateStoreId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about the private store + /// + /// + /// Request Path + /// /providers/Microsoft.Marketplace/privateStores/{privateStoreId} + /// + /// + /// Operation Id + /// PrivateStore_Get + /// + /// + /// + /// The store ID - must use the tenant ID. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetPrivateStore(Guid privateStoreId, CancellationToken cancellationToken = default) + { + return GetPrivateStores().Get(privateStoreId, cancellationToken); + } + } +} diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 731bbb4feb2e..000000000000 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Marketplace -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PrivateStoreResources in the TenantResource. - /// An object representing collection of PrivateStoreResources and their operations over a PrivateStoreResource. - public virtual PrivateStoreCollection GetPrivateStores() - { - return GetCachedClient(Client => new PrivateStoreCollection(Client, Id)); - } - } -} diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreCollectionInfoResource.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreCollectionInfoResource.cs index 7670a1e53d18..053b36245966 100644 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreCollectionInfoResource.cs +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreCollectionInfoResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PrivateStoreOfferResources and their operations over a PrivateStoreOfferResource. public virtual PrivateStoreOfferCollection GetPrivateStoreOffers() { - return GetCachedClient(Client => new PrivateStoreOfferCollection(Client, Id)); + return GetCachedClient(client => new PrivateStoreOfferCollection(client, Id)); } /// @@ -119,8 +119,8 @@ public virtual PrivateStoreOfferCollection GetPrivateStoreOffers() /// /// The offer ID to update or delete. /// The cancellation token to use. - /// 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> GetPrivateStoreOfferAsync(string offerId, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> GetPrivateStoreOf /// /// The offer ID to update or delete. /// The cancellation token to use. - /// 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 GetPrivateStoreOffer(string offerId, CancellationToken cancellationToken = default) { diff --git a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreResource.cs b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreResource.cs index 3a9f725385d6..37c81c281984 100644 --- a/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreResource.cs +++ b/sdk/marketplace/Azure.ResourceManager.Marketplace/src/Generated/PrivateStoreResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MarketplaceApprovalRequestResources and their operations over a MarketplaceApprovalRequestResource. public virtual MarketplaceApprovalRequestCollection GetMarketplaceApprovalRequests() { - return GetCachedClient(Client => new MarketplaceApprovalRequestCollection(Client, Id)); + return GetCachedClient(client => new MarketplaceApprovalRequestCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual MarketplaceApprovalRequestCollection GetMarketplaceApprovalReques /// /// The request approval ID to get create or update. /// The cancellation token to use. - /// 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> GetMarketplaceApprovalRequestAsync(string requestApprovalId, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetMarke /// /// The request approval ID to get create or update. /// The cancellation token to use. - /// 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 GetMarketplaceApprovalRequest(string requestApprovalId, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetMarketplaceApprov /// An object representing collection of MarketplaceAdminApprovalRequestResources and their operations over a MarketplaceAdminApprovalRequestResource. public virtual MarketplaceAdminApprovalRequestCollection GetMarketplaceAdminApprovalRequests() { - return GetCachedClient(Client => new MarketplaceAdminApprovalRequestCollection(Client, Id)); + return GetCachedClient(client => new MarketplaceAdminApprovalRequestCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual MarketplaceAdminApprovalRequestCollection GetMarketplaceAdminAppr /// The admin request approval ID to get create or update. /// The publisher id of this offer. /// The cancellation token to use. - /// 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 virtual async Task> GetMarketplaceAdminApprovalRequestAsync(string adminRequestApprovalId, string publisherId, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> Get /// The admin request approval ID to get create or update. /// The publisher id of this offer. /// The cancellation token to use. - /// 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 virtual Response GetMarketplaceAdminApprovalRequest(string adminRequestApprovalId, string publisherId, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetMarketplaceA /// An object representing collection of PrivateStoreCollectionInfoResources and their operations over a PrivateStoreCollectionInfoResource. public virtual PrivateStoreCollectionInfoCollection GetPrivateStoreCollectionInfos() { - return GetCachedClient(Client => new PrivateStoreCollectionInfoCollection(Client, Id)); + return GetCachedClient(client => new PrivateStoreCollectionInfoCollection(client, Id)); } /// diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingArmClientMockingExtension.cs b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingArmClientMockingExtension.cs new file mode 100644 index 000000000000..b273f9b7aad3 --- /dev/null +++ b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MarketplaceOrdering; + +namespace Azure.ResourceManager.MarketplaceOrdering.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MarketplaceOrderingArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MarketplaceOrderingArmClientMockingExtension() + { + } + + /// 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 MarketplaceOrderingArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MarketplaceOrderingArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MarketplaceAgreementTermResource GetMarketplaceAgreementTermResource(ResourceIdentifier id) + { + MarketplaceAgreementTermResource.ValidateResourceId(id); + return new MarketplaceAgreementTermResource(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 MarketplaceAgreementResource GetMarketplaceAgreementResource(ResourceIdentifier id) + { + MarketplaceAgreementResource.ValidateResourceId(id); + return new MarketplaceAgreementResource(Client, id); + } + } +} diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingExtensions.cs b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingExtensions.cs index 623eefb2d9b8..0ad4d5a78f47 100644 --- a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingExtensions.cs +++ b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MarketplaceOrdering.Mocking; using Azure.ResourceManager.MarketplaceOrdering.Models; using Azure.ResourceManager.Resources; @@ -19,65 +20,60 @@ namespace Azure.ResourceManager.MarketplaceOrdering /// A class to add extension methods to Azure.ResourceManager.MarketplaceOrdering. public static partial class MarketplaceOrderingExtensions { - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MarketplaceOrderingArmClientMockingExtension GetMarketplaceOrderingArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MarketplaceOrderingArmClientMockingExtension(client0)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MarketplaceOrderingSubscriptionMockingExtension GetMarketplaceOrderingSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MarketplaceOrderingSubscriptionMockingExtension(client, resource.Id)); } - #region MarketplaceAgreementTermResource + /// /// 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. /// Returns a object. public static MarketplaceAgreementTermResource GetMarketplaceAgreementTermResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MarketplaceAgreementTermResource.ValidateResourceId(id); - return new MarketplaceAgreementTermResource(client, id); - } - ); + return GetMarketplaceOrderingArmClientMockingExtension(client).GetMarketplaceAgreementTermResource(id); } - #endregion - #region MarketplaceAgreementResource /// /// 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. /// Returns a object. public static MarketplaceAgreementResource GetMarketplaceAgreementResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MarketplaceAgreementResource.ValidateResourceId(id); - return new MarketplaceAgreementResource(client, id); - } - ); + return GetMarketplaceOrderingArmClientMockingExtension(client).GetMarketplaceAgreementResource(id); } - #endregion - /// Gets a collection of MarketplaceAgreementTermResources in the SubscriptionResource. + /// + /// Gets a collection of MarketplaceAgreementTermResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MarketplaceAgreementTermResources and their operations over a MarketplaceAgreementTermResource. public static MarketplaceAgreementTermCollection GetMarketplaceAgreementTerms(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreementTerms(); + return GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementTerms(); } /// @@ -92,6 +88,10 @@ public static MarketplaceAgreementTermCollection GetMarketplaceAgreementTerms(th /// MarketplaceAgreements_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Offer Type, currently only virtualmachine type is supported. @@ -99,12 +99,12 @@ public static MarketplaceAgreementTermCollection GetMarketplaceAgreementTerms(th /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetMarketplaceAgreementTermAsync(this SubscriptionResource subscriptionResource, AgreementOfferType offerType, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetMarketplaceAgreementTerms().GetAsync(offerType, publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); + return await GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementTermAsync(offerType, publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); } /// @@ -119,6 +119,10 @@ public static async Task> GetMarketpl /// MarketplaceAgreements_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Offer Type, currently only virtualmachine type is supported. @@ -126,20 +130,26 @@ public static async Task> GetMarketpl /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetMarketplaceAgreementTerm(this SubscriptionResource subscriptionResource, AgreementOfferType offerType, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetMarketplaceAgreementTerms().Get(offerType, publisherId, offerId, planId, cancellationToken); + return GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementTerm(offerType, publisherId, offerId, planId, cancellationToken); } - /// Gets a collection of MarketplaceAgreementResources in the SubscriptionResource. + /// + /// Gets a collection of MarketplaceAgreementResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MarketplaceAgreementResources and their operations over a MarketplaceAgreementResource. public static MarketplaceAgreementCollection GetMarketplaceAgreements(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreements(); + return GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreements(); } /// @@ -154,18 +164,22 @@ public static MarketplaceAgreementCollection GetMarketplaceAgreements(this Subsc /// MarketplaceAgreements_GetAgreement /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Publisher identifier string of image being deployed. /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetMarketplaceAgreementAsync(this SubscriptionResource subscriptionResource, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetMarketplaceAgreements().GetAsync(publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); + return await GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementAsync(publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); } /// @@ -180,18 +194,22 @@ public static async Task> GetMarketplaceA /// MarketplaceAgreements_GetAgreement /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Publisher identifier string of image being deployed. /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetMarketplaceAgreement(this SubscriptionResource subscriptionResource, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetMarketplaceAgreements().Get(publisherId, offerId, planId, cancellationToken); + return GetMarketplaceOrderingSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreement(publisherId, offerId, planId, cancellationToken); } } } diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingSubscriptionMockingExtension.cs b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingSubscriptionMockingExtension.cs new file mode 100644 index 000000000000..4b2dbf318e9d --- /dev/null +++ b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/MarketplaceOrderingSubscriptionMockingExtension.cs @@ -0,0 +1,156 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MarketplaceOrdering; +using Azure.ResourceManager.MarketplaceOrdering.Models; + +namespace Azure.ResourceManager.MarketplaceOrdering.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MarketplaceOrderingSubscriptionMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MarketplaceOrderingSubscriptionMockingExtension() + { + } + + /// 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 MarketplaceOrderingSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MarketplaceAgreementTermResources in the SubscriptionResource. + /// An object representing collection of MarketplaceAgreementTermResources and their operations over a MarketplaceAgreementTermResource. + public virtual MarketplaceAgreementTermCollection GetMarketplaceAgreementTerms() + { + return GetCachedClient(client => new MarketplaceAgreementTermCollection(client, Id)); + } + + /// + /// Get marketplace terms. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current + /// + /// + /// Operation Id + /// MarketplaceAgreements_Get + /// + /// + /// + /// Offer Type, currently only virtualmachine type is supported. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMarketplaceAgreementTermAsync(AgreementOfferType offerType, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) + { + return await GetMarketplaceAgreementTerms().GetAsync(offerType, publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get marketplace terms. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current + /// + /// + /// Operation Id + /// MarketplaceAgreements_Get + /// + /// + /// + /// Offer Type, currently only virtualmachine type is supported. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMarketplaceAgreementTerm(AgreementOfferType offerType, string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) + { + return GetMarketplaceAgreementTerms().Get(offerType, publisherId, offerId, planId, cancellationToken); + } + + /// Gets a collection of MarketplaceAgreementResources in the SubscriptionResource. + /// An object representing collection of MarketplaceAgreementResources and their operations over a MarketplaceAgreementResource. + public virtual MarketplaceAgreementCollection GetMarketplaceAgreements() + { + return GetCachedClient(client => new MarketplaceAgreementCollection(client, Id)); + } + + /// + /// Get marketplace agreement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId} + /// + /// + /// Operation Id + /// MarketplaceAgreements_GetAgreement + /// + /// + /// + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMarketplaceAgreementAsync(string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) + { + return await GetMarketplaceAgreements().GetAsync(publisherId, offerId, planId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get marketplace agreement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId} + /// + /// + /// Operation Id + /// MarketplaceAgreements_GetAgreement + /// + /// + /// + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMarketplaceAgreement(string publisherId, string offerId, string planId, CancellationToken cancellationToken = default) + { + return GetMarketplaceAgreements().Get(publisherId, offerId, planId, cancellationToken); + } + } +} diff --git a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs deleted file mode 100644 index 7450d69a5cdc..000000000000 --- a/sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MarketplaceOrdering -{ - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() - { - } - - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MarketplaceAgreementTermResources in the SubscriptionResource. - /// An object representing collection of MarketplaceAgreementTermResources and their operations over a MarketplaceAgreementTermResource. - public virtual MarketplaceAgreementTermCollection GetMarketplaceAgreementTerms() - { - return GetCachedClient(Client => new MarketplaceAgreementTermCollection(Client, Id)); - } - - /// Gets a collection of MarketplaceAgreementResources in the SubscriptionResource. - /// An object representing collection of MarketplaceAgreementResources and their operations over a MarketplaceAgreementResource. - public virtual MarketplaceAgreementCollection GetMarketplaceAgreements() - { - return GetCachedClient(Client => new MarketplaceAgreementCollection(Client, Id)); - } - } -} From 25a14d6fc408bf41b5af1b692e7d719aa4ab298b Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:20:41 +0000 Subject: [PATCH 3/8] Update SDK codes ad_co_0 --- .../AdvisorArmClientMockingExtension.cs | 135 ++ .../Generated/Extensions/AdvisorExtensions.cs | 305 +-- ...> AdvisorResourceGroupMockingExtension.cs} | 27 +- ...=> AdvisorSubscriptionMockingExtension.cs} | 39 +- .../AdvisorTenantMockingExtension.cs | 92 + .../Extensions/ArmResourceExtensionClient.cs | 41 - .../TenantResourceExtensionClient.cs | 41 - .../ResourceRecommendationBaseResource.cs | 6 +- ...AgFoodPlatformArmClientMockingExtension.cs | 99 + .../Extensions/AgFoodPlatformExtensions.cs | 189 +- ...odPlatformResourceGroupMockingExtension.cs | 92 + ...odPlatformSubscriptionMockingExtension.cs} | 27 +- .../AgFoodPlatformTenantMockingExtension.cs | 92 + .../ResourceGroupResourceExtensionClient.cs | 41 - .../TenantResourceExtensionClient.cs | 41 - .../src/Generated/FarmBeatResource.cs | 18 +- ...ertsManagementArmClientMockingExtension.cs | 75 + .../Extensions/AlertsManagementExtensions.cs | 193 +- ...ManagementResourceGroupMockingExtension.cs | 92 + ...ManagementSubscriptionMockingExtension.cs} | 115 +- ...AlertsManagementTenantMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../AnalysisArmClientMockingExtension.cs | 51 + .../Extensions/AnalysisExtensions.cs | 108 +- .../AnalysisResourceGroupMockingExtension.cs | 92 + ...> AnalysisSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ApiCenterArmClientMockingExtension.cs | 51 + .../Extensions/ApiCenterExtensions.cs | 80 +- .../ApiCenterResourceGroupMockingExtension.cs | 92 + ... ApiCenterSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/ApiIssueResource.cs | 12 +- .../Generated/ApiManagementGatewayResource.cs | 12 +- .../Generated/ApiManagementProductResource.cs | 8 +- .../Generated/ApiManagementServiceResource.cs | 138 +- .../Generated/ApiManagementUserResource.cs | 6 +- .../src/Generated/ApiOperationResource.cs | 8 +- .../src/Generated/ApiResource.cs | 44 +- .../ApiManagementArmClientMockingExtension.cs | 627 +++++ .../Extensions/ApiManagementExtensions.cs | 782 +++---- ...ManagementResourceGroupMockingExtension.cs | 92 + ...ManagementSubscriptionMockingExtension.cs} | 89 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...anceAutomationArmClientMockingExtension.cs | 63 + .../AppComplianceAutomationExtensions.cs | 68 +- ...plianceAutomationTenantMockingExtension.cs | 92 + .../TenantResourceExtensionClient.cs | 41 - .../src/Generated/ReportResource.cs | 6 +- .../AppConfigurationStoreResource.cs | 18 +- ...pConfigurationArmClientMockingExtension.cs | 99 + .../Extensions/AppConfigurationExtensions.cs | 174 +- ...figurationResourceGroupMockingExtension.cs | 92 + ...figurationSubscriptionMockingExtension.cs} | 77 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ApplicationInsightsComponentResource.cs | 2 +- ...cationInsightsArmClientMockingExtension.cs | 196 ++ .../ApplicationInsightsExtensions.cs | 386 ++-- ...onInsightsResourceGroupMockingExtension.cs | 306 +++ ...onInsightsSubscriptionMockingExtension.cs} | 29 +- .../Extensions/ArmResourceExtensionClient.cs | 106 - .../ResourceGroupResourceExtensionClient.cs | 69 - .../src/Generated/WorkbookResource.cs | 6 +- .../Generated/AppPlatformApiPortalResource.cs | 6 +- .../src/Generated/AppPlatformAppResource.cs | 18 +- .../src/Generated/AppPlatformBuildResource.cs | 6 +- .../AppPlatformBuildServiceResource.cs | 30 +- .../Generated/AppPlatformBuilderResource.cs | 6 +- .../Generated/AppPlatformGatewayResource.cs | 12 +- .../Generated/AppPlatformServiceResource.cs | 48 +- .../AppPlatformArmClientMockingExtension.cs | 327 +++ .../Extensions/AppPlatformExtensions.cs | 434 ++-- ...ppPlatformResourceGroupMockingExtension.cs | 92 + ...ppPlatformSubscriptionMockingExtension.cs} | 31 +- ...s => AppPlatformTenantMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ArcScVmmArmClientMockingExtension.cs | 123 + .../Extensions/ArcScVmmExtensions.cs | 348 +-- .../ArcScVmmResourceGroupMockingExtension.cs | 357 +++ ...> ArcScVmmSubscriptionMockingExtension.cs} | 37 +- .../ResourceGroupResourceExtensionClient.cs | 76 - .../src/Generated/ScVmmServerResource.cs | 6 +- .../Generated/AttestationProviderResource.cs | 6 +- .../AttestationArmClientMockingExtension.cs | 63 + .../Extensions/AttestationExtensions.cs | 117 +- ...ttestationResourceGroupMockingExtension.cs | 92 + ...ttestationSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Samples/Sample_ArmResourceExtensions.cs | 44 - .../Extensions/ArmResourceExtensionClient.cs | 168 -- .../AuthorizationArmClientMockingExtension.cs | 857 +++++++ .../AuthorizationArmMockingExtension.cs | 620 +++++ .../Extensions/AuthorizationExtensions.cs | 2015 ++++++++++------- ...orizationResourceGroupMockingExtension.cs} | 36 +- ...horizationSubscriptionMockingExtension.cs} | 17 +- ...=> AuthorizationTenantMockingExtension.cs} | 65 +- .../AutomanageConfigurationProfileResource.cs | 6 +- ...rConfigurationProfileAssignmentResource.cs | 6 +- ...pConfigurationProfileAssignmentResource.cs | 6 +- ...mConfigurationProfileAssignmentResource.cs | 6 +- .../Extensions/ArmResourceExtensionClient.cs | 55 - .../AutomanageArmClientMockingExtension.cs | 331 +++ .../Extensions/AutomanageExtensions.cs | 573 +++-- ...AutomanageResourceGroupMockingExtension.cs | 92 + ...AutomanageSubscriptionMockingExtension.cs} | 25 +- .../AutomanageTenantMockingExtension.cs | 92 + .../ResourceGroupResourceExtensionClient.cs | 41 - .../TenantResourceExtensionClient.cs | 41 - .../Generated/AutomationAccountResource.cs | 122 +- .../AutomationArmClientMockingExtension.cs | 315 +++ .../Extensions/AutomationExtensions.cs | 378 ++-- ...AutomationResourceGroupMockingExtension.cs | 92 + ...AutomationSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../HybridRunbookWorkerGroupResource.cs | 6 +- .../AvsPrivateCloudClusterResource.cs | 18 +- .../src/Generated/AvsPrivateCloudResource.cs | 104 +- .../AvsArmClientMockingExtension.cs | 315 +++ .../src/Generated/Extensions/AvsExtensions.cs | 390 ++-- .../AvsResourceGroupMockingExtension.cs | 92 + ....cs => AvsSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/ScriptPackageResource.cs | 6 +- .../src/Generated/ArcSettingResource.cs | 6 +- .../HciArmClientMockingExtension.cs | 147 ++ .../src/Generated/Extensions/HciExtensions.cs | 184 +- .../HciResourceGroupMockingExtension.cs | 92 + ....cs => HciSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/HciClusterResource.cs | 18 +- .../src/Generated/OfferResource.cs | 6 +- .../src/Generated/PublisherResource.cs | 6 +- .../src/Generated/UpdateResource.cs | 6 +- .../src/Generated/BatchAccountResource.cs | 36 +- .../src/Generated/BatchApplicationResource.cs | 6 +- .../BatchArmClientMockingExtension.cs | 135 ++ .../Generated/Extensions/BatchExtensions.cs | 223 +- .../BatchResourceGroupMockingExtension.cs | 92 + ...s => BatchSubscriptionMockingExtension.cs} | 39 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../BillingArmClientMockingExtension.cs | 99 + .../Generated/Extensions/BillingExtensions.cs | 228 +- .../BillingTenantMockingExtension.cs | 327 +++ .../TenantResourceExtensionClient.cs | 74 - ...BillingBenefitsSavingsPlanOrderResource.cs | 6 +- ...illingBenefitsArmClientMockingExtension.cs | 87 + .../Extensions/BillingBenefitsExtensions.cs | 178 +- ... BillingBenefitsTenantMockingExtension.cs} | 179 +- .../src/Generated/AssignmentResource.cs | 6 +- .../src/Generated/BlueprintResource.cs | 12 +- .../Extensions/ArmResourceExtensionClient.cs | 48 - .../BlueprintArmClientMockingExtension.cs | 227 ++ .../Extensions/BlueprintExtensions.cs | 273 +-- .../Generated/PublishedBlueprintResource.cs | 6 +- .../src/Generated/BotResource.cs | 14 +- .../BotServiceArmClientMockingExtension.cs | 87 + .../Extensions/BotServiceExtensions.cs | 190 +- ...BotServiceResourceGroupMockingExtension.cs | 92 + ...BotServiceSubscriptionMockingExtension.cs} | 35 +- ...cs => BotServiceTenantMockingExtension.cs} | 23 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/CdnEndpointResource.cs | 18 +- .../CdnArmClientMockingExtension.cs | 219 ++ .../src/Generated/Extensions/CdnExtensions.cs | 403 ++-- .../CdnResourceGroupMockingExtension.cs | 221 ++ ....cs => CdnSubscriptionMockingExtension.cs} | 45 +- ...Client.cs => CdnTenantMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 122 - .../Generated/FrontDoorEndpointResource.cs | 6 +- .../Generated/FrontDoorOriginGroupResource.cs | 6 +- .../src/Generated/FrontDoorRuleSetResource.cs | 6 +- .../src/Generated/ProfileResource.cs | 42 +- .../Extensions/ChangeAnalysisExtensions.cs | 87 +- ...eAnalysisResourceGroupMockingExtension.cs} | 17 +- ...geAnalysisSubscriptionMockingExtension.cs} | 17 +- ...> ChangeAnalysisTenantMockingExtension.cs} | 25 +- .../src/Generated/ExperimentResource.cs | 12 +- .../ChaosArmClientMockingExtension.cs | 123 + .../Generated/Extensions/ChaosExtensions.cs | 220 +- .../ChaosResourceGroupMockingExtension.cs | 156 ++ ...s => ChaosSubscriptionMockingExtension.cs} | 69 +- .../ResourceGroupResourceExtensionClient.cs | 51 - .../src/Generated/TargetResource.cs | 6 +- .../src/Generated/TargetTypeResource.cs | 6 +- .../CognitiveServicesAccountResource.cs | 18 +- ...CognitiveServicesCommitmentPlanResource.cs | 6 +- ...nitiveServicesArmClientMockingExtension.cs | 123 + .../Extensions/CognitiveServicesExtensions.cs | 314 ++- ...veServicesResourceGroupMockingExtension.cs | 145 ++ ...veServicesSubscriptionMockingExtension.cs} | 113 +- .../ResourceGroupResourceExtensionClient.cs | 48 - 191 files changed, 14870 insertions(+), 6701 deletions(-) create mode 100644 sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorArmClientMockingExtension.cs rename sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => AdvisorResourceGroupMockingExtension.cs} (86%) rename sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AdvisorSubscriptionMockingExtension.cs} (91%) create mode 100644 sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorTenantMockingExtension.cs delete mode 100644 sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ArmResourceExtensionClient.cs delete mode 100644 sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformArmClientMockingExtension.cs create mode 100644 sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformResourceGroupMockingExtension.cs rename sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AgFoodPlatformSubscriptionMockingExtension.cs} (86%) create mode 100644 sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformTenantMockingExtension.cs delete mode 100644 sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementArmClientMockingExtension.cs create mode 100644 sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementResourceGroupMockingExtension.cs rename sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AlertsManagementSubscriptionMockingExtension.cs} (64%) rename sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/{TenantResourceExtensionClient.cs => AlertsManagementTenantMockingExtension.cs} (86%) delete mode 100644 sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisArmClientMockingExtension.cs create mode 100644 sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisResourceGroupMockingExtension.cs rename sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AnalysisSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterArmClientMockingExtension.cs create mode 100644 sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterResourceGroupMockingExtension.cs rename sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ApiCenterSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementArmClientMockingExtension.cs create mode 100644 sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementResourceGroupMockingExtension.cs rename sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ApiManagementSubscriptionMockingExtension.cs} (77%) delete mode 100644 sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationArmClientMockingExtension.cs create mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationTenantMockingExtension.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationArmClientMockingExtension.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationResourceGroupMockingExtension.cs rename sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AppConfigurationSubscriptionMockingExtension.cs} (68%) delete mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsArmClientMockingExtension.cs create mode 100644 sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsResourceGroupMockingExtension.cs rename sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ApplicationInsightsSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs delete mode 100644 sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformArmClientMockingExtension.cs create mode 100644 sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformResourceGroupMockingExtension.cs rename sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AppPlatformSubscriptionMockingExtension.cs} (88%) rename sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/{TenantResourceExtensionClient.cs => AppPlatformTenantMockingExtension.cs} (85%) delete mode 100644 sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmArmClientMockingExtension.cs create mode 100644 sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmResourceGroupMockingExtension.cs rename sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ArcScVmmSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationArmClientMockingExtension.cs create mode 100644 sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationResourceGroupMockingExtension.cs rename sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AttestationSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs delete mode 100644 sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmClientMockingExtension.cs create mode 100644 sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmMockingExtension.cs rename sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => AuthorizationResourceGroupMockingExtension.cs} (79%) rename sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AuthorizationSubscriptionMockingExtension.cs} (85%) rename sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/{TenantResourceExtensionClient.cs => AuthorizationTenantMockingExtension.cs} (54%) delete mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageArmClientMockingExtension.cs create mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageResourceGroupMockingExtension.cs rename sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AutomanageSubscriptionMockingExtension.cs} (89%) create mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageTenantMockingExtension.cs delete mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationArmClientMockingExtension.cs create mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationResourceGroupMockingExtension.cs rename sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AutomationSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsArmClientMockingExtension.cs create mode 100644 sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsResourceGroupMockingExtension.cs rename sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AvsSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciArmClientMockingExtension.cs create mode 100644 sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciResourceGroupMockingExtension.cs rename sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HciSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchArmClientMockingExtension.cs create mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchResourceGroupMockingExtension.cs rename sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => BatchSubscriptionMockingExtension.cs} (90%) delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingArmClientMockingExtension.cs create mode 100644 sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingTenantMockingExtension.cs delete mode 100644 sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsArmClientMockingExtension.cs rename sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/{TenantResourceExtensionClient.cs => BillingBenefitsTenantMockingExtension.cs} (50%) delete mode 100644 sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintArmClientMockingExtension.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceArmClientMockingExtension.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceResourceGroupMockingExtension.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => BotServiceSubscriptionMockingExtension.cs} (89%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/{TenantResourceExtensionClient.cs => BotServiceTenantMockingExtension.cs} (81%) delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnArmClientMockingExtension.cs create mode 100644 sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnResourceGroupMockingExtension.cs rename sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CdnSubscriptionMockingExtension.cs} (89%) rename sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/{TenantResourceExtensionClient.cs => CdnTenantMockingExtension.cs} (86%) delete mode 100644 sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => ChangeAnalysisResourceGroupMockingExtension.cs} (87%) rename sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ChangeAnalysisSubscriptionMockingExtension.cs} (86%) rename sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ChangeAnalysisTenantMockingExtension.cs} (80%) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosArmClientMockingExtension.cs create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosResourceGroupMockingExtension.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ChaosSubscriptionMockingExtension.cs} (58%) delete mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesArmClientMockingExtension.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesResourceGroupMockingExtension.cs rename sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CognitiveServicesSubscriptionMockingExtension.cs} (82%) delete mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorArmClientMockingExtension.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorArmClientMockingExtension.cs new file mode 100644 index 000000000000..a7751bbf04ef --- /dev/null +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorArmClientMockingExtension.cs @@ -0,0 +1,135 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Advisor; + +namespace Azure.ResourceManager.Advisor.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AdvisorArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AdvisorArmClientMockingExtension() + { + } + + /// 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 AdvisorArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AdvisorArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ResourceRecommendationBaseResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ResourceRecommendationBaseResources and their operations over a ResourceRecommendationBaseResource. + public virtual ResourceRecommendationBaseCollection GetResourceRecommendationBases(ResourceIdentifier scope) + { + return new ResourceRecommendationBaseCollection(Client, scope); + } + + /// + /// Obtains details of a cached recommendation. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId} + /// + /// + /// Operation Id + /// Recommendations_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The recommendation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceRecommendationBaseAsync(ResourceIdentifier scope, string recommendationId, CancellationToken cancellationToken = default) + { + return await GetResourceRecommendationBases(scope).GetAsync(recommendationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Obtains details of a cached recommendation. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId} + /// + /// + /// Operation Id + /// Recommendations_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The recommendation ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceRecommendationBase(ResourceIdentifier scope, string recommendationId, CancellationToken cancellationToken = default) + { + return GetResourceRecommendationBases(scope).Get(recommendationId, 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 MetadataEntityResource GetMetadataEntityResource(ResourceIdentifier id) + { + MetadataEntityResource.ValidateResourceId(id); + return new MetadataEntityResource(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 ResourceRecommendationBaseResource GetResourceRecommendationBaseResource(ResourceIdentifier id) + { + ResourceRecommendationBaseResource.ValidateResourceId(id); + return new ResourceRecommendationBaseResource(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 SuppressionContractResource GetSuppressionContractResource(ResourceIdentifier id) + { + SuppressionContractResource.ValidateResourceId(id); + return new SuppressionContractResource(Client, id); + } + } +} diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorExtensions.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorExtensions.cs index 25075484a230..b5d9712c28b1 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorExtensions.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Advisor.Mocking; using Azure.ResourceManager.Advisor.Models; using Azure.ResourceManager.Resources; @@ -19,133 +20,39 @@ namespace Azure.ResourceManager.Advisor /// A class to add extension methods to Azure.ResourceManager.Advisor. public static partial class AdvisorExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static AdvisorArmClientMockingExtension GetAdvisorArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AdvisorArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AdvisorResourceGroupMockingExtension GetAdvisorResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AdvisorResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AdvisorSubscriptionMockingExtension GetAdvisorSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AdvisorSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AdvisorTenantMockingExtension GetAdvisorTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AdvisorTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region MetadataEntityResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MetadataEntityResource GetMetadataEntityResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MetadataEntityResource.ValidateResourceId(id); - return new MetadataEntityResource(client, id); - } - ); - } - #endregion - - #region ResourceRecommendationBaseResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceRecommendationBaseResource GetResourceRecommendationBaseResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceRecommendationBaseResource.ValidateResourceId(id); - return new ResourceRecommendationBaseResource(client, id); - } - ); - } - #endregion - - #region SuppressionContractResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of ResourceRecommendationBaseResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SuppressionContractResource GetSuppressionContractResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SuppressionContractResource.ValidateResourceId(id); - return new SuppressionContractResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of ResourceRecommendationBaseResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of ResourceRecommendationBaseResources and their operations over a ResourceRecommendationBaseResource. public static ResourceRecommendationBaseCollection GetResourceRecommendationBases(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetResourceRecommendationBases(); + return GetAdvisorArmClientMockingExtension(client).GetResourceRecommendationBases(scope); } /// @@ -160,17 +67,21 @@ public static ResourceRecommendationBaseCollection GetResourceRecommendationBase /// Recommendations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The recommendation ID. /// The cancellation token to use. - /// 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 static async Task> GetResourceRecommendationBaseAsync(this ArmClient client, ResourceIdentifier scope, string recommendationId, CancellationToken cancellationToken = default) { - return await client.GetResourceRecommendationBases(scope).GetAsync(recommendationId, cancellationToken).ConfigureAwait(false); + return await GetAdvisorArmClientMockingExtension(client).GetResourceRecommendationBaseAsync(scope, recommendationId, cancellationToken).ConfigureAwait(false); } /// @@ -185,17 +96,69 @@ public static async Task> GetResour /// Recommendations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The recommendation ID. /// The cancellation token to use. - /// 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 static Response GetResourceRecommendationBase(this ArmClient client, ResourceIdentifier scope, string recommendationId, CancellationToken cancellationToken = default) { - return client.GetResourceRecommendationBases(scope).Get(recommendationId, cancellationToken); + return GetAdvisorArmClientMockingExtension(client).GetResourceRecommendationBase(scope, recommendationId, 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. + /// Returns a object. + public static MetadataEntityResource GetMetadataEntityResource(this ArmClient client, ResourceIdentifier id) + { + return GetAdvisorArmClientMockingExtension(client).GetMetadataEntityResource(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. + /// Returns a object. + public static ResourceRecommendationBaseResource GetResourceRecommendationBaseResource(this ArmClient client, ResourceIdentifier id) + { + return GetAdvisorArmClientMockingExtension(client).GetResourceRecommendationBaseResource(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. + /// Returns a object. + public static SuppressionContractResource GetSuppressionContractResource(this ArmClient client, ResourceIdentifier id) + { + return GetAdvisorArmClientMockingExtension(client).GetSuppressionContractResource(id); } /// @@ -210,13 +173,17 @@ public static Response GetResourceRecommenda /// Configurations_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationsAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurationsAsync(cancellationToken); + return GetAdvisorResourceGroupMockingExtension(resourceGroupResource).GetConfigurationsAsync(cancellationToken); } /// @@ -231,13 +198,17 @@ public static AsyncPageable GetConfigurationsAsync(this ResourceGrou /// Configurations_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurations(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfigurations(cancellationToken); + return GetAdvisorResourceGroupMockingExtension(resourceGroupResource).GetConfigurations(cancellationToken); } /// @@ -252,6 +223,10 @@ public static Pageable GetConfigurations(this ResourceGroupResource /// Configurations_CreateInResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Advisor configuration name. Value must be 'default'. @@ -260,9 +235,7 @@ public static Pageable GetConfigurations(this ResourceGroupResource /// is null. public static async Task> CreateConfigurationAsync(this ResourceGroupResource resourceGroupResource, ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateConfigurationAsync(configurationName, data, cancellationToken).ConfigureAwait(false); + return await GetAdvisorResourceGroupMockingExtension(resourceGroupResource).CreateConfigurationAsync(configurationName, data, cancellationToken).ConfigureAwait(false); } /// @@ -277,6 +250,10 @@ public static async Task> CreateConfigurationAsync(this Res /// Configurations_CreateInResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Advisor configuration name. Value must be 'default'. @@ -285,9 +262,7 @@ public static async Task> CreateConfigurationAsync(this Res /// is null. public static Response CreateConfiguration(this ResourceGroupResource resourceGroupResource, ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateConfiguration(configurationName, data, cancellationToken); + return GetAdvisorResourceGroupMockingExtension(resourceGroupResource).CreateConfiguration(configurationName, data, cancellationToken); } /// @@ -302,13 +277,17 @@ public static Response CreateConfiguration(this ResourceGroupResourc /// Configurations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationsAsync(cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetConfigurationsAsync(cancellationToken); } /// @@ -323,13 +302,17 @@ public static AsyncPageable GetConfigurationsAsync(this Subscription /// Configurations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurations(cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetConfigurations(cancellationToken); } /// @@ -344,6 +327,10 @@ public static Pageable GetConfigurations(this SubscriptionResource s /// Configurations_CreateInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Advisor configuration name. Value must be 'default'. @@ -352,9 +339,7 @@ public static Pageable GetConfigurations(this SubscriptionResource s /// is null. public static async Task> CreateConfigurationAsync(this SubscriptionResource subscriptionResource, ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CreateConfigurationAsync(configurationName, data, cancellationToken).ConfigureAwait(false); + return await GetAdvisorSubscriptionMockingExtension(subscriptionResource).CreateConfigurationAsync(configurationName, data, cancellationToken).ConfigureAwait(false); } /// @@ -369,6 +354,10 @@ public static async Task> CreateConfigurationAsync(this Sub /// Configurations_CreateInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Advisor configuration name. Value must be 'default'. @@ -377,9 +366,7 @@ public static async Task> CreateConfigurationAsync(this Sub /// is null. public static Response CreateConfiguration(this SubscriptionResource subscriptionResource, ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateConfiguration(configurationName, data, cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).CreateConfiguration(configurationName, data, cancellationToken); } /// @@ -394,12 +381,16 @@ public static Response CreateConfiguration(this SubscriptionResource /// Recommendations_Generate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task GenerateRecommendationAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GenerateRecommendationAsync(cancellationToken).ConfigureAwait(false); + return await GetAdvisorSubscriptionMockingExtension(subscriptionResource).GenerateRecommendationAsync(cancellationToken).ConfigureAwait(false); } /// @@ -414,12 +405,16 @@ public static async Task GenerateRecommendationAsync(this Subscription /// Recommendations_Generate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GenerateRecommendation(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GenerateRecommendation(cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GenerateRecommendation(cancellationToken); } /// @@ -434,13 +429,17 @@ public static Response GenerateRecommendation(this SubscriptionResource subscrip /// Recommendations_GetGenerateStatus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The operation ID, which can be found from the Location field in the generate recommendation response header. /// The cancellation token to use. public static async Task GetGenerateStatusRecommendationAsync(this SubscriptionResource subscriptionResource, Guid operationId, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetGenerateStatusRecommendationAsync(operationId, cancellationToken).ConfigureAwait(false); + return await GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetGenerateStatusRecommendationAsync(operationId, cancellationToken).ConfigureAwait(false); } /// @@ -455,13 +454,17 @@ public static async Task GetGenerateStatusRecommendationAsync(this Sub /// Recommendations_GetGenerateStatus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The operation ID, which can be found from the Location field in the generate recommendation response header. /// The cancellation token to use. public static Response GetGenerateStatusRecommendation(this SubscriptionResource subscriptionResource, Guid operationId, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGenerateStatusRecommendation(operationId, cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetGenerateStatusRecommendation(operationId, cancellationToken); } /// @@ -476,6 +479,10 @@ public static Response GetGenerateStatusRecommendation(this SubscriptionResource /// Suppressions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of suppressions per page if a paged version of this API is being used. @@ -484,7 +491,7 @@ public static Response GetGenerateStatusRecommendation(this SubscriptionResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSuppressionContractsAsync(this SubscriptionResource subscriptionResource, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSuppressionContractsAsync(top, skipToken, cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetSuppressionContractsAsync(top, skipToken, cancellationToken); } /// @@ -499,6 +506,10 @@ public static AsyncPageable GetSuppressionContracts /// Suppressions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The number of suppressions per page if a paged version of this API is being used. @@ -507,15 +518,21 @@ public static AsyncPageable GetSuppressionContracts /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSuppressionContracts(this SubscriptionResource subscriptionResource, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSuppressionContracts(top, skipToken, cancellationToken); + return GetAdvisorSubscriptionMockingExtension(subscriptionResource).GetSuppressionContracts(top, skipToken, cancellationToken); } - /// Gets a collection of MetadataEntityResources in the TenantResource. + /// + /// Gets a collection of MetadataEntityResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MetadataEntityResources and their operations over a MetadataEntityResource. public static MetadataEntityCollection GetMetadataEntities(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetMetadataEntities(); + return GetAdvisorTenantMockingExtension(tenantResource).GetMetadataEntities(); } /// @@ -530,16 +547,20 @@ public static MetadataEntityCollection GetMetadataEntities(this TenantResource t /// RecommendationMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of metadata entity. /// The cancellation token to use. - /// 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 static async Task> GetMetadataEntityAsync(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return await tenantResource.GetMetadataEntities().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAdvisorTenantMockingExtension(tenantResource).GetMetadataEntityAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -554,16 +575,20 @@ public static async Task> GetMetadataEntityAsyn /// RecommendationMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of metadata entity. /// The cancellation token to use. - /// 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 static Response GetMetadataEntity(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return tenantResource.GetMetadataEntities().Get(name, cancellationToken); + return GetAdvisorTenantMockingExtension(tenantResource).GetMetadataEntity(name, cancellationToken); } } } diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorResourceGroupMockingExtension.cs similarity index 86% rename from sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorResourceGroupMockingExtension.cs index 82d84ad30583..59f6bd0c8220 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorResourceGroupMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Advisor; using Azure.ResourceManager.Advisor.Models; -namespace Azure.ResourceManager.Advisor +namespace Azure.ResourceManager.Advisor.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class AdvisorResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _configurationsClientDiagnostics; private ConfigurationsRestOperations _configurationsRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AdvisorResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AdvisorResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -62,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetConfigurationsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurations", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "AdvisorResourceGroupMockingExtension.GetConfigurations", "value", null, cancellationToken); } /// @@ -83,7 +84,7 @@ public virtual AsyncPageable GetConfigurationsAsync(CancellationToke public virtual Pageable GetConfigurations(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetConfigurations", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "AdvisorResourceGroupMockingExtension.GetConfigurations", "value", null, cancellationToken); } /// @@ -102,9 +103,12 @@ public virtual Pageable GetConfigurations(CancellationToken cancella /// Advisor configuration name. Value must be 'default'. /// The Azure Advisor configuration data structure. /// The cancellation token to use. + /// is null. public virtual async Task> CreateConfigurationAsync(ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateConfiguration"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationsClientDiagnostics.CreateScope("AdvisorResourceGroupMockingExtension.CreateConfiguration"); scope.Start(); try { @@ -134,9 +138,12 @@ public virtual async Task> CreateConfigurationAsync(Configu /// Advisor configuration name. Value must be 'default'. /// The Azure Advisor configuration data structure. /// The cancellation token to use. + /// is null. public virtual Response CreateConfiguration(ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateConfiguration"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationsClientDiagnostics.CreateScope("AdvisorResourceGroupMockingExtension.CreateConfiguration"); scope.Start(); try { diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorSubscriptionMockingExtension.cs similarity index 91% rename from sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorSubscriptionMockingExtension.cs index 8522f25ddb5e..b714333a57e6 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Advisor; using Azure.ResourceManager.Advisor.Models; -namespace Azure.ResourceManager.Advisor +namespace Azure.ResourceManager.Advisor.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AdvisorSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _configurationsClientDiagnostics; private ConfigurationsRestOperations _configurationsRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _suppressionContractSuppressionsClientDiagnostics; private SuppressionsRestOperations _suppressionContractSuppressionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AdvisorSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AdvisorSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +72,7 @@ public virtual AsyncPageable GetConfigurationsAsync(CancellationToke { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfigurationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "AdvisorSubscriptionMockingExtension.GetConfigurations", "value", "nextLink", cancellationToken); } /// @@ -93,7 +94,7 @@ public virtual Pageable GetConfigurations(CancellationToken cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfigurationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfigurationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfigData.DeserializeConfigData, ConfigurationsClientDiagnostics, Pipeline, "AdvisorSubscriptionMockingExtension.GetConfigurations", "value", "nextLink", cancellationToken); } /// @@ -112,9 +113,12 @@ public virtual Pageable GetConfigurations(CancellationToken cancella /// Advisor configuration name. Value must be 'default'. /// The Azure Advisor configuration data structure. /// The cancellation token to use. + /// is null. public virtual async Task> CreateConfigurationAsync(ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateConfiguration"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.CreateConfiguration"); scope.Start(); try { @@ -144,9 +148,12 @@ public virtual async Task> CreateConfigurationAsync(Configu /// Advisor configuration name. Value must be 'default'. /// The Azure Advisor configuration data structure. /// The cancellation token to use. + /// is null. public virtual Response CreateConfiguration(ConfigurationName configurationName, ConfigData data, CancellationToken cancellationToken = default) { - using var scope = ConfigurationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateConfiguration"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ConfigurationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.CreateConfiguration"); scope.Start(); try { @@ -176,7 +183,7 @@ public virtual Response CreateConfiguration(ConfigurationName config /// The cancellation token to use. public virtual async Task GenerateRecommendationAsync(CancellationToken cancellationToken = default) { - using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GenerateRecommendation"); + using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.GenerateRecommendation"); scope.Start(); try { @@ -206,7 +213,7 @@ public virtual async Task GenerateRecommendationAsync(CancellationToke /// The cancellation token to use. public virtual Response GenerateRecommendation(CancellationToken cancellationToken = default) { - using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GenerateRecommendation"); + using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.GenerateRecommendation"); scope.Start(); try { @@ -237,7 +244,7 @@ public virtual Response GenerateRecommendation(CancellationToken cancellationTok /// The cancellation token to use. public virtual async Task GetGenerateStatusRecommendationAsync(Guid operationId, CancellationToken cancellationToken = default) { - using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetGenerateStatusRecommendation"); + using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.GetGenerateStatusRecommendation"); scope.Start(); try { @@ -268,7 +275,7 @@ public virtual async Task GetGenerateStatusRecommendationAsync(Guid op /// The cancellation token to use. public virtual Response GetGenerateStatusRecommendation(Guid operationId, CancellationToken cancellationToken = default) { - using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetGenerateStatusRecommendation"); + using var scope = ResourceRecommendationBaseRecommendationsClientDiagnostics.CreateScope("AdvisorSubscriptionMockingExtension.GetGenerateStatusRecommendation"); scope.Start(); try { @@ -303,7 +310,7 @@ public virtual AsyncPageable GetSuppressionContract { HttpMessage FirstPageRequest(int? pageSizeHint) => SuppressionContractSuppressionsRestClient.CreateListRequest(Id.SubscriptionId, top, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SuppressionContractSuppressionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SuppressionContractResource(Client, SuppressionContractData.DeserializeSuppressionContractData(e)), SuppressionContractSuppressionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSuppressionContracts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SuppressionContractResource(Client, SuppressionContractData.DeserializeSuppressionContractData(e)), SuppressionContractSuppressionsClientDiagnostics, Pipeline, "AdvisorSubscriptionMockingExtension.GetSuppressionContracts", "value", "nextLink", cancellationToken); } /// @@ -327,7 +334,7 @@ public virtual Pageable GetSuppressionContracts(int { HttpMessage FirstPageRequest(int? pageSizeHint) => SuppressionContractSuppressionsRestClient.CreateListRequest(Id.SubscriptionId, top, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SuppressionContractSuppressionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SuppressionContractResource(Client, SuppressionContractData.DeserializeSuppressionContractData(e)), SuppressionContractSuppressionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSuppressionContracts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SuppressionContractResource(Client, SuppressionContractData.DeserializeSuppressionContractData(e)), SuppressionContractSuppressionsClientDiagnostics, Pipeline, "AdvisorSubscriptionMockingExtension.GetSuppressionContracts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorTenantMockingExtension.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorTenantMockingExtension.cs new file mode 100644 index 000000000000..b98fbdc48815 --- /dev/null +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/AdvisorTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Advisor; + +namespace Azure.ResourceManager.Advisor.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class AdvisorTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AdvisorTenantMockingExtension() + { + } + + /// 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 AdvisorTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MetadataEntityResources in the TenantResource. + /// An object representing collection of MetadataEntityResources and their operations over a MetadataEntityResource. + public virtual MetadataEntityCollection GetMetadataEntities() + { + return GetCachedClient(client => new MetadataEntityCollection(client, Id)); + } + + /// + /// Gets the metadata entity. + /// + /// + /// Request Path + /// /providers/Microsoft.Advisor/metadata/{name} + /// + /// + /// Operation Id + /// RecommendationMetadata_Get + /// + /// + /// + /// Name of metadata entity. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMetadataEntityAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMetadataEntities().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the metadata entity. + /// + /// + /// Request Path + /// /providers/Microsoft.Advisor/metadata/{name} + /// + /// + /// Operation Id + /// RecommendationMetadata_Get + /// + /// + /// + /// Name of metadata entity. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMetadataEntity(string name, CancellationToken cancellationToken = default) + { + return GetMetadataEntities().Get(name, cancellationToken); + } + } +} diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index fad87f407baa..000000000000 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Advisor -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ResourceRecommendationBaseResources in the ArmResource. - /// An object representing collection of ResourceRecommendationBaseResources and their operations over a ResourceRecommendationBaseResource. - public virtual ResourceRecommendationBaseCollection GetResourceRecommendationBases() - { - return GetCachedClient(Client => new ResourceRecommendationBaseCollection(Client, Id)); - } - } -} diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 80d853e6ef1b..000000000000 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Advisor -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MetadataEntityResources in the TenantResource. - /// An object representing collection of MetadataEntityResources and their operations over a MetadataEntityResource. - public virtual MetadataEntityCollection GetMetadataEntities() - { - return GetCachedClient(Client => new MetadataEntityCollection(Client, Id)); - } - } -} diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseResource.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseResource.cs index ac101318f892..b25c8da7b2f1 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseResource.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SuppressionContractResources and their operations over a SuppressionContractResource. public virtual SuppressionContractCollection GetSuppressionContracts() { - return GetCachedClient(Client => new SuppressionContractCollection(Client, Id)); + return GetCachedClient(client => new SuppressionContractCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SuppressionContractCollection GetSuppressionContracts() /// /// The name of the suppression. /// The cancellation token to use. - /// 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> GetSuppressionContractAsync(string name, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSuppressionC /// /// The name of the suppression. /// The cancellation token to use. - /// 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 GetSuppressionContract(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformArmClientMockingExtension.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformArmClientMockingExtension.cs new file mode 100644 index 000000000000..929c5ea20f94 --- /dev/null +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AgFoodPlatform; + +namespace Azure.ResourceManager.AgFoodPlatform.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AgFoodPlatformArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AgFoodPlatformArmClientMockingExtension() + { + } + + /// 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 AgFoodPlatformArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AgFoodPlatformArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExtensionResource GetExtensionResource(ResourceIdentifier id) + { + ExtensionResource.ValidateResourceId(id); + return new ExtensionResource(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 FarmBeatsExtensionResource GetFarmBeatsExtensionResource(ResourceIdentifier id) + { + FarmBeatsExtensionResource.ValidateResourceId(id); + return new FarmBeatsExtensionResource(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 FarmBeatResource GetFarmBeatResource(ResourceIdentifier id) + { + FarmBeatResource.ValidateResourceId(id); + return new FarmBeatResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AgFoodPlatformPrivateEndpointConnectionResource GetAgFoodPlatformPrivateEndpointConnectionResource(ResourceIdentifier id) + { + AgFoodPlatformPrivateEndpointConnectionResource.ValidateResourceId(id); + return new AgFoodPlatformPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AgFoodPlatformPrivateLinkResource GetAgFoodPlatformPrivateLinkResource(ResourceIdentifier id) + { + AgFoodPlatformPrivateLinkResource.ValidateResourceId(id); + return new AgFoodPlatformPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformExtensions.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformExtensions.cs index b8c180120633..bcd6eea1a4cf 100644 --- a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformExtensions.cs +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AgFoodPlatform.Mocking; using Azure.ResourceManager.AgFoodPlatform.Models; using Azure.ResourceManager.Resources; @@ -19,154 +20,118 @@ namespace Azure.ResourceManager.AgFoodPlatform /// A class to add extension methods to Azure.ResourceManager.AgFoodPlatform. public static partial class AgFoodPlatformExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AgFoodPlatformArmClientMockingExtension GetAgFoodPlatformArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AgFoodPlatformArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AgFoodPlatformResourceGroupMockingExtension GetAgFoodPlatformResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AgFoodPlatformResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AgFoodPlatformSubscriptionMockingExtension GetAgFoodPlatformSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AgFoodPlatformSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AgFoodPlatformTenantMockingExtension GetAgFoodPlatformTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AgFoodPlatformTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region ExtensionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExtensionResource GetExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExtensionResource.ValidateResourceId(id); - return new ExtensionResource(client, id); - } - ); + return GetAgFoodPlatformArmClientMockingExtension(client).GetExtensionResource(id); } - #endregion - #region FarmBeatsExtensionResource /// /// 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. /// Returns a object. public static FarmBeatsExtensionResource GetFarmBeatsExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FarmBeatsExtensionResource.ValidateResourceId(id); - return new FarmBeatsExtensionResource(client, id); - } - ); + return GetAgFoodPlatformArmClientMockingExtension(client).GetFarmBeatsExtensionResource(id); } - #endregion - #region FarmBeatResource /// /// 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. /// Returns a object. public static FarmBeatResource GetFarmBeatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FarmBeatResource.ValidateResourceId(id); - return new FarmBeatResource(client, id); - } - ); + return GetAgFoodPlatformArmClientMockingExtension(client).GetFarmBeatResource(id); } - #endregion - #region AgFoodPlatformPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AgFoodPlatformPrivateEndpointConnectionResource GetAgFoodPlatformPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AgFoodPlatformPrivateEndpointConnectionResource.ValidateResourceId(id); - return new AgFoodPlatformPrivateEndpointConnectionResource(client, id); - } - ); + return GetAgFoodPlatformArmClientMockingExtension(client).GetAgFoodPlatformPrivateEndpointConnectionResource(id); } - #endregion - #region AgFoodPlatformPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AgFoodPlatformPrivateLinkResource GetAgFoodPlatformPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AgFoodPlatformPrivateLinkResource.ValidateResourceId(id); - return new AgFoodPlatformPrivateLinkResource(client, id); - } - ); + return GetAgFoodPlatformArmClientMockingExtension(client).GetAgFoodPlatformPrivateLinkResource(id); } - #endregion - /// Gets a collection of FarmBeatResources in the ResourceGroupResource. + /// + /// Gets a collection of FarmBeatResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FarmBeatResources and their operations over a FarmBeatResource. public static FarmBeatCollection GetFarmBeats(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFarmBeats(); + return GetAgFoodPlatformResourceGroupMockingExtension(resourceGroupResource).GetFarmBeats(); } /// @@ -181,16 +146,20 @@ public static FarmBeatCollection GetFarmBeats(this ResourceGroupResource resourc /// FarmBeatsModels_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// FarmBeats resource name. /// The cancellation token to use. - /// 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 static async Task> GetFarmBeatAsync(this ResourceGroupResource resourceGroupResource, string farmBeatsResourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFarmBeats().GetAsync(farmBeatsResourceName, cancellationToken).ConfigureAwait(false); + return await GetAgFoodPlatformResourceGroupMockingExtension(resourceGroupResource).GetFarmBeatAsync(farmBeatsResourceName, cancellationToken).ConfigureAwait(false); } /// @@ -205,16 +174,20 @@ public static async Task> GetFarmBeatAsync(this Resou /// FarmBeatsModels_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// FarmBeats resource name. /// The cancellation token to use. - /// 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 static Response GetFarmBeat(this ResourceGroupResource resourceGroupResource, string farmBeatsResourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFarmBeats().Get(farmBeatsResourceName, cancellationToken); + return GetAgFoodPlatformResourceGroupMockingExtension(resourceGroupResource).GetFarmBeat(farmBeatsResourceName, cancellationToken); } /// @@ -229,6 +202,10 @@ public static Response GetFarmBeat(this ResourceGroupResource /// FarmBeatsModels_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// @@ -240,7 +217,7 @@ public static Response GetFarmBeat(this ResourceGroupResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFarmBeatsAsync(this SubscriptionResource subscriptionResource, int? maxPageSize = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFarmBeatsAsync(maxPageSize, skipToken, cancellationToken); + return GetAgFoodPlatformSubscriptionMockingExtension(subscriptionResource).GetFarmBeatsAsync(maxPageSize, skipToken, cancellationToken); } /// @@ -255,6 +232,10 @@ public static AsyncPageable GetFarmBeatsAsync(this Subscriptio /// FarmBeatsModels_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// @@ -266,7 +247,7 @@ public static AsyncPageable GetFarmBeatsAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFarmBeats(this SubscriptionResource subscriptionResource, int? maxPageSize = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFarmBeats(maxPageSize, skipToken, cancellationToken); + return GetAgFoodPlatformSubscriptionMockingExtension(subscriptionResource).GetFarmBeats(maxPageSize, skipToken, cancellationToken); } /// @@ -281,6 +262,10 @@ public static Pageable GetFarmBeats(this SubscriptionResource /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// NameAvailabilityRequest object. @@ -288,9 +273,7 @@ public static Pageable GetFarmBeats(this SubscriptionResource /// is null. public static async Task> CheckNameAvailabilityLocationAsync(this SubscriptionResource subscriptionResource, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityLocationAsync(content, cancellationToken).ConfigureAwait(false); + return await GetAgFoodPlatformSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityLocationAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -305,6 +288,10 @@ public static async Task> CheckNameAvail /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// NameAvailabilityRequest object. @@ -312,17 +299,21 @@ public static async Task> CheckNameAvail /// is null. public static Response CheckNameAvailabilityLocation(this SubscriptionResource subscriptionResource, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityLocation(content, cancellationToken); + return GetAgFoodPlatformSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityLocation(content, cancellationToken); } - /// Gets a collection of FarmBeatsExtensionResources in the TenantResource. + /// + /// Gets a collection of FarmBeatsExtensionResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FarmBeatsExtensionResources and their operations over a FarmBeatsExtensionResource. public static FarmBeatsExtensionCollection GetFarmBeatsExtensions(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetFarmBeatsExtensions(); + return GetAgFoodPlatformTenantMockingExtension(tenantResource).GetFarmBeatsExtensions(); } /// @@ -337,16 +328,20 @@ public static FarmBeatsExtensionCollection GetFarmBeatsExtensions(this TenantRes /// FarmBeatsExtensions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// farmBeatsExtensionId to be queried. /// The cancellation token to use. - /// 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 static async Task> GetFarmBeatsExtensionAsync(this TenantResource tenantResource, string farmBeatsExtensionId, CancellationToken cancellationToken = default) { - return await tenantResource.GetFarmBeatsExtensions().GetAsync(farmBeatsExtensionId, cancellationToken).ConfigureAwait(false); + return await GetAgFoodPlatformTenantMockingExtension(tenantResource).GetFarmBeatsExtensionAsync(farmBeatsExtensionId, cancellationToken).ConfigureAwait(false); } /// @@ -361,16 +356,20 @@ public static async Task> GetFarmBeatsExten /// FarmBeatsExtensions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// farmBeatsExtensionId to be queried. /// The cancellation token to use. - /// 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 static Response GetFarmBeatsExtension(this TenantResource tenantResource, string farmBeatsExtensionId, CancellationToken cancellationToken = default) { - return tenantResource.GetFarmBeatsExtensions().Get(farmBeatsExtensionId, cancellationToken); + return GetAgFoodPlatformTenantMockingExtension(tenantResource).GetFarmBeatsExtension(farmBeatsExtensionId, cancellationToken); } } } diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformResourceGroupMockingExtension.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..a8f12e801da0 --- /dev/null +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AgFoodPlatform; + +namespace Azure.ResourceManager.AgFoodPlatform.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AgFoodPlatformResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AgFoodPlatformResourceGroupMockingExtension() + { + } + + /// 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 AgFoodPlatformResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FarmBeatResources in the ResourceGroupResource. + /// An object representing collection of FarmBeatResources and their operations over a FarmBeatResource. + public virtual FarmBeatCollection GetFarmBeats() + { + return GetCachedClient(client => new FarmBeatCollection(client, Id)); + } + + /// + /// Get FarmBeats resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName} + /// + /// + /// Operation Id + /// FarmBeatsModels_Get + /// + /// + /// + /// FarmBeats resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFarmBeatAsync(string farmBeatsResourceName, CancellationToken cancellationToken = default) + { + return await GetFarmBeats().GetAsync(farmBeatsResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get FarmBeats resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgFoodPlatform/farmBeats/{farmBeatsResourceName} + /// + /// + /// Operation Id + /// FarmBeatsModels_Get + /// + /// + /// + /// FarmBeats resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFarmBeat(string farmBeatsResourceName, CancellationToken cancellationToken = default) + { + return GetFarmBeats().Get(farmBeatsResourceName, cancellationToken); + } + } +} diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformSubscriptionMockingExtension.cs similarity index 86% rename from sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformSubscriptionMockingExtension.cs index 515f535a6c99..5763811cc333 100644 --- a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AgFoodPlatform; using Azure.ResourceManager.AgFoodPlatform.Models; -namespace Azure.ResourceManager.AgFoodPlatform +namespace Azure.ResourceManager.AgFoodPlatform.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AgFoodPlatformSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _farmBeatFarmBeatsModelsClientDiagnostics; private FarmBeatsModelsRestOperations _farmBeatFarmBeatsModelsRestClient; private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AgFoodPlatformSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AgFoodPlatformSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -72,7 +73,7 @@ public virtual AsyncPageable GetFarmBeatsAsync(int? maxPageSiz { HttpMessage FirstPageRequest(int? pageSizeHint) => FarmBeatFarmBeatsModelsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, pageSizeHint, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FarmBeatFarmBeatsModelsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FarmBeatResource(Client, FarmBeatData.DeserializeFarmBeatData(e)), FarmBeatFarmBeatsModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFarmBeats", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FarmBeatResource(Client, FarmBeatData.DeserializeFarmBeatData(e)), FarmBeatFarmBeatsModelsClientDiagnostics, Pipeline, "AgFoodPlatformSubscriptionMockingExtension.GetFarmBeats", "value", "nextLink", cancellationToken); } /// @@ -99,7 +100,7 @@ public virtual Pageable GetFarmBeats(int? maxPageSize = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => FarmBeatFarmBeatsModelsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, pageSizeHint, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FarmBeatFarmBeatsModelsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FarmBeatResource(Client, FarmBeatData.DeserializeFarmBeatData(e)), FarmBeatFarmBeatsModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFarmBeats", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FarmBeatResource(Client, FarmBeatData.DeserializeFarmBeatData(e)), FarmBeatFarmBeatsModelsClientDiagnostics, Pipeline, "AgFoodPlatformSubscriptionMockingExtension.GetFarmBeats", "value", "nextLink", cancellationToken); } /// @@ -117,9 +118,12 @@ public virtual Pageable GetFarmBeats(int? maxPageSize = null, /// /// NameAvailabilityRequest object. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNameAvailabilityLocationAsync(CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("AgFoodPlatformSubscriptionMockingExtension.CheckNameAvailabilityLocation"); scope.Start(); try { @@ -148,9 +152,12 @@ public virtual async Task> CheckNameAvai /// /// NameAvailabilityRequest object. /// The cancellation token to use. + /// is null. public virtual Response CheckNameAvailabilityLocation(CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("AgFoodPlatformSubscriptionMockingExtension.CheckNameAvailabilityLocation"); scope.Start(); try { diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformTenantMockingExtension.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformTenantMockingExtension.cs new file mode 100644 index 000000000000..26050612053f --- /dev/null +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/AgFoodPlatformTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AgFoodPlatform; + +namespace Azure.ResourceManager.AgFoodPlatform.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class AgFoodPlatformTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AgFoodPlatformTenantMockingExtension() + { + } + + /// 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 AgFoodPlatformTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FarmBeatsExtensionResources in the TenantResource. + /// An object representing collection of FarmBeatsExtensionResources and their operations over a FarmBeatsExtensionResource. + public virtual FarmBeatsExtensionCollection GetFarmBeatsExtensions() + { + return GetCachedClient(client => new FarmBeatsExtensionCollection(client, Id)); + } + + /// + /// Get farmBeats extension. + /// + /// + /// Request Path + /// /providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId} + /// + /// + /// Operation Id + /// FarmBeatsExtensions_Get + /// + /// + /// + /// farmBeatsExtensionId to be queried. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFarmBeatsExtensionAsync(string farmBeatsExtensionId, CancellationToken cancellationToken = default) + { + return await GetFarmBeatsExtensions().GetAsync(farmBeatsExtensionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get farmBeats extension. + /// + /// + /// Request Path + /// /providers/Microsoft.AgFoodPlatform/farmBeatsExtensionDefinitions/{farmBeatsExtensionId} + /// + /// + /// Operation Id + /// FarmBeatsExtensions_Get + /// + /// + /// + /// farmBeatsExtensionId to be queried. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFarmBeatsExtension(string farmBeatsExtensionId, CancellationToken cancellationToken = default) + { + return GetFarmBeatsExtensions().Get(farmBeatsExtensionId, cancellationToken); + } + } +} diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e81402522c47..000000000000 --- a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AgFoodPlatform -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of FarmBeatResources in the ResourceGroupResource. - /// An object representing collection of FarmBeatResources and their operations over a FarmBeatResource. - public virtual FarmBeatCollection GetFarmBeats() - { - return GetCachedClient(Client => new FarmBeatCollection(Client, Id)); - } - } -} diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 5d348e71c364..000000000000 --- a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AgFoodPlatform -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of FarmBeatsExtensionResources in the TenantResource. - /// An object representing collection of FarmBeatsExtensionResources and their operations over a FarmBeatsExtensionResource. - public virtual FarmBeatsExtensionCollection GetFarmBeatsExtensions() - { - return GetCachedClient(Client => new FarmBeatsExtensionCollection(Client, Id)); - } - } -} diff --git a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/FarmBeatResource.cs b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/FarmBeatResource.cs index 921bc54e5779..c2aef9d04164 100644 --- a/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/FarmBeatResource.cs +++ b/sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/src/Generated/FarmBeatResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExtensionResources and their operations over a ExtensionResource. public virtual ExtensionCollection GetExtensions() { - return GetCachedClient(Client => new ExtensionCollection(Client, Id)); + return GetCachedClient(client => new ExtensionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ExtensionCollection GetExtensions() /// /// Id of extension resource. /// The cancellation token to use. - /// 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> GetExtensionAsync(string extensionId, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetExtensionAsync(string /// /// Id of extension resource. /// The cancellation token to use. - /// 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 GetExtension(string extensionId, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetExtension(string extensionId, Canc /// An object representing collection of AgFoodPlatformPrivateEndpointConnectionResources and their operations over a AgFoodPlatformPrivateEndpointConnectionResource. public virtual AgFoodPlatformPrivateEndpointConnectionCollection GetAgFoodPlatformPrivateEndpointConnections() { - return GetCachedClient(Client => new AgFoodPlatformPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new AgFoodPlatformPrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual AgFoodPlatformPrivateEndpointConnectionCollection GetAgFoodPlatfo /// /// Private endpoint connection name. /// The cancellation token to use. - /// 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> GetAgFoodPlatformPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// Private endpoint connection name. /// The cancellation token to use. - /// 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 GetAgFoodPlatformPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetAgFo /// An object representing collection of AgFoodPlatformPrivateLinkResources and their operations over a AgFoodPlatformPrivateLinkResource. public virtual AgFoodPlatformPrivateLinkResourceCollection GetAgFoodPlatformPrivateLinkResources() { - return GetCachedClient(Client => new AgFoodPlatformPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new AgFoodPlatformPrivateLinkResourceCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual AgFoodPlatformPrivateLinkResourceCollection GetAgFoodPlatformPriv /// /// Sub resource name. /// The cancellation token to use. - /// 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> GetAgFoodPlatformPrivateLinkResourceAsync(string subResourceName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetAgFood /// /// Sub resource name. /// The cancellation token to use. - /// 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 GetAgFoodPlatformPrivateLinkResource(string subResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementArmClientMockingExtension.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementArmClientMockingExtension.cs new file mode 100644 index 000000000000..c94854f59fb0 --- /dev/null +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AlertsManagement; + +namespace Azure.ResourceManager.AlertsManagement.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AlertsManagementArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AlertsManagementArmClientMockingExtension() + { + } + + /// 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 AlertsManagementArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AlertsManagementArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AlertProcessingRuleResource GetAlertProcessingRuleResource(ResourceIdentifier id) + { + AlertProcessingRuleResource.ValidateResourceId(id); + return new AlertProcessingRuleResource(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 ServiceAlertResource GetServiceAlertResource(ResourceIdentifier id) + { + ServiceAlertResource.ValidateResourceId(id); + return new ServiceAlertResource(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 SmartGroupResource GetSmartGroupResource(ResourceIdentifier id) + { + SmartGroupResource.ValidateResourceId(id); + return new SmartGroupResource(Client, id); + } + } +} diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementExtensions.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementExtensions.cs index 696c1cd905bf..15a2c05397d5 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementExtensions.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AlertsManagement.Mocking; using Azure.ResourceManager.AlertsManagement.Models; using Azure.ResourceManager.Resources; @@ -19,116 +20,86 @@ namespace Azure.ResourceManager.AlertsManagement /// A class to add extension methods to Azure.ResourceManager.AlertsManagement. public static partial class AlertsManagementExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AlertsManagementArmClientMockingExtension GetAlertsManagementArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AlertsManagementArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AlertsManagementResourceGroupMockingExtension GetAlertsManagementResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AlertsManagementResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AlertsManagementSubscriptionMockingExtension GetAlertsManagementSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AlertsManagementSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AlertsManagementTenantMockingExtension GetAlertsManagementTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AlertsManagementTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region AlertProcessingRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AlertProcessingRuleResource GetAlertProcessingRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AlertProcessingRuleResource.ValidateResourceId(id); - return new AlertProcessingRuleResource(client, id); - } - ); + return GetAlertsManagementArmClientMockingExtension(client).GetAlertProcessingRuleResource(id); } - #endregion - #region ServiceAlertResource /// /// 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. /// Returns a object. public static ServiceAlertResource GetServiceAlertResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceAlertResource.ValidateResourceId(id); - return new ServiceAlertResource(client, id); - } - ); + return GetAlertsManagementArmClientMockingExtension(client).GetServiceAlertResource(id); } - #endregion - #region SmartGroupResource /// /// 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. /// Returns a object. public static SmartGroupResource GetSmartGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SmartGroupResource.ValidateResourceId(id); - return new SmartGroupResource(client, id); - } - ); + return GetAlertsManagementArmClientMockingExtension(client).GetSmartGroupResource(id); } - #endregion - /// Gets a collection of AlertProcessingRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of AlertProcessingRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AlertProcessingRuleResources and their operations over a AlertProcessingRuleResource. public static AlertProcessingRuleCollection GetAlertProcessingRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAlertProcessingRules(); + return GetAlertsManagementResourceGroupMockingExtension(resourceGroupResource).GetAlertProcessingRules(); } /// @@ -143,16 +114,20 @@ public static AlertProcessingRuleCollection GetAlertProcessingRules(this Resourc /// AlertProcessingRules_GetByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the alert processing rule that needs to be fetched. /// The cancellation token to use. - /// 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 static async Task> GetAlertProcessingRuleAsync(this ResourceGroupResource resourceGroupResource, string alertProcessingRuleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAlertProcessingRules().GetAsync(alertProcessingRuleName, cancellationToken).ConfigureAwait(false); + return await GetAlertsManagementResourceGroupMockingExtension(resourceGroupResource).GetAlertProcessingRuleAsync(alertProcessingRuleName, cancellationToken).ConfigureAwait(false); } /// @@ -167,24 +142,34 @@ public static async Task> GetAlertProcessi /// AlertProcessingRules_GetByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the alert processing rule that needs to be fetched. /// The cancellation token to use. - /// 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 static Response GetAlertProcessingRule(this ResourceGroupResource resourceGroupResource, string alertProcessingRuleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAlertProcessingRules().Get(alertProcessingRuleName, cancellationToken); + return GetAlertsManagementResourceGroupMockingExtension(resourceGroupResource).GetAlertProcessingRule(alertProcessingRuleName, cancellationToken); } - /// Gets a collection of ServiceAlertResources in the SubscriptionResource. + /// + /// Gets a collection of ServiceAlertResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceAlertResources and their operations over a ServiceAlertResource. public static ServiceAlertCollection GetServiceAlerts(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceAlerts(); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetServiceAlerts(); } /// @@ -199,6 +184,10 @@ public static ServiceAlertCollection GetServiceAlerts(this SubscriptionResource /// Alerts_GetById /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique ID of an alert instance. @@ -206,7 +195,7 @@ public static ServiceAlertCollection GetServiceAlerts(this SubscriptionResource [ForwardsClientCalls] public static async Task> GetServiceAlertAsync(this SubscriptionResource subscriptionResource, Guid alertId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetServiceAlerts().GetAsync(alertId, cancellationToken).ConfigureAwait(false); + return await GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetServiceAlertAsync(alertId, cancellationToken).ConfigureAwait(false); } /// @@ -221,6 +210,10 @@ public static async Task> GetServiceAlertAsync(th /// Alerts_GetById /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique ID of an alert instance. @@ -228,15 +221,21 @@ public static async Task> GetServiceAlertAsync(th [ForwardsClientCalls] public static Response GetServiceAlert(this SubscriptionResource subscriptionResource, Guid alertId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetServiceAlerts().Get(alertId, cancellationToken); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetServiceAlert(alertId, cancellationToken); } - /// Gets a collection of SmartGroupResources in the SubscriptionResource. + /// + /// Gets a collection of SmartGroupResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SmartGroupResources and their operations over a SmartGroupResource. public static SmartGroupCollection GetSmartGroups(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSmartGroups(); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetSmartGroups(); } /// @@ -251,6 +250,10 @@ public static SmartGroupCollection GetSmartGroups(this SubscriptionResource subs /// SmartGroups_GetById /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Smart group unique id. @@ -258,7 +261,7 @@ public static SmartGroupCollection GetSmartGroups(this SubscriptionResource subs [ForwardsClientCalls] public static async Task> GetSmartGroupAsync(this SubscriptionResource subscriptionResource, Guid smartGroupId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSmartGroups().GetAsync(smartGroupId, cancellationToken).ConfigureAwait(false); + return await GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetSmartGroupAsync(smartGroupId, cancellationToken).ConfigureAwait(false); } /// @@ -273,6 +276,10 @@ public static async Task> GetSmartGroupAsync(this S /// SmartGroups_GetById /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Smart group unique id. @@ -280,7 +287,7 @@ public static async Task> GetSmartGroupAsync(this S [ForwardsClientCalls] public static Response GetSmartGroup(this SubscriptionResource subscriptionResource, Guid smartGroupId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSmartGroups().Get(smartGroupId, cancellationToken); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetSmartGroup(smartGroupId, cancellationToken); } /// @@ -295,13 +302,17 @@ public static Response GetSmartGroup(this SubscriptionResour /// AlertProcessingRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAlertProcessingRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlertProcessingRulesAsync(cancellationToken); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetAlertProcessingRulesAsync(cancellationToken); } /// @@ -316,13 +327,17 @@ public static AsyncPageable GetAlertProcessingRules /// AlertProcessingRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAlertProcessingRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlertProcessingRules(cancellationToken); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetAlertProcessingRules(cancellationToken); } /// @@ -337,6 +352,10 @@ public static Pageable GetAlertProcessingRules(this /// Alerts_GetSummary /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -344,9 +363,7 @@ public static Pageable GetAlertProcessingRules(this /// is null. public static async Task> GetServiceAlertSummaryAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetServiceAlertSummaryOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceAlertSummaryAsync(options, cancellationToken).ConfigureAwait(false); + return await GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetServiceAlertSummaryAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -361,6 +378,10 @@ public static async Task> GetServiceAlertSummaryAs /// Alerts_GetSummary /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -368,9 +389,7 @@ public static async Task> GetServiceAlertSummaryAs /// is null. public static Response GetServiceAlertSummary(this SubscriptionResource subscriptionResource, SubscriptionResourceGetServiceAlertSummaryOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceAlertSummary(options, cancellationToken); + return GetAlertsManagementSubscriptionMockingExtension(subscriptionResource).GetServiceAlertSummary(options, cancellationToken); } /// @@ -385,13 +404,17 @@ public static Response GetServiceAlertSummary(this Subscrip /// Alerts_MetaData /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Identification of the information to be retrieved by API call. /// The cancellation token to use. public static async Task> GetServiceAlertMetadataAsync(this TenantResource tenantResource, RetrievedInformationIdentifier identifier, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).GetServiceAlertMetadataAsync(identifier, cancellationToken).ConfigureAwait(false); + return await GetAlertsManagementTenantMockingExtension(tenantResource).GetServiceAlertMetadataAsync(identifier, cancellationToken).ConfigureAwait(false); } /// @@ -406,13 +429,17 @@ public static async Task> GetServiceAlertMetadata /// Alerts_MetaData /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Identification of the information to be retrieved by API call. /// The cancellation token to use. public static Response GetServiceAlertMetadata(this TenantResource tenantResource, RetrievedInformationIdentifier identifier, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetServiceAlertMetadata(identifier, cancellationToken); + return GetAlertsManagementTenantMockingExtension(tenantResource).GetServiceAlertMetadata(identifier, cancellationToken); } } } diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementResourceGroupMockingExtension.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..7794b248300c --- /dev/null +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AlertsManagement; + +namespace Azure.ResourceManager.AlertsManagement.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AlertsManagementResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AlertsManagementResourceGroupMockingExtension() + { + } + + /// 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 AlertsManagementResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AlertProcessingRuleResources in the ResourceGroupResource. + /// An object representing collection of AlertProcessingRuleResources and their operations over a AlertProcessingRuleResource. + public virtual AlertProcessingRuleCollection GetAlertProcessingRules() + { + return GetCachedClient(client => new AlertProcessingRuleCollection(client, Id)); + } + + /// + /// Get an alert processing rule by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName} + /// + /// + /// Operation Id + /// AlertProcessingRules_GetByName + /// + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAlertProcessingRuleAsync(string alertProcessingRuleName, CancellationToken cancellationToken = default) + { + return await GetAlertProcessingRules().GetAsync(alertProcessingRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an alert processing rule by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName} + /// + /// + /// Operation Id + /// AlertProcessingRules_GetByName + /// + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAlertProcessingRule(string alertProcessingRuleName, CancellationToken cancellationToken = default) + { + return GetAlertProcessingRules().Get(alertProcessingRuleName, cancellationToken); + } + } +} diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementSubscriptionMockingExtension.cs similarity index 64% rename from sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementSubscriptionMockingExtension.cs index a877d5bacda0..b45c6dcb2320 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AlertsManagement; using Azure.ResourceManager.AlertsManagement.Models; -namespace Azure.ResourceManager.AlertsManagement +namespace Azure.ResourceManager.AlertsManagement.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AlertsManagementSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _alertProcessingRuleClientDiagnostics; private AlertProcessingRulesRestOperations _alertProcessingRuleRestClient; private ClientDiagnostics _serviceAlertAlertsClientDiagnostics; private AlertsRestOperations _serviceAlertAlertsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AlertsManagementSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AlertsManagementSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -52,14 +53,98 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ServiceAlertResources and their operations over a ServiceAlertResource. public virtual ServiceAlertCollection GetServiceAlerts() { - return GetCachedClient(Client => new ServiceAlertCollection(Client, Id)); + return GetCachedClient(client => new ServiceAlertCollection(client, Id)); + } + + /// + /// Get information related to a specific alert + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId} + /// + /// + /// Operation Id + /// Alerts_GetById + /// + /// + /// + /// Unique ID of an alert instance. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetServiceAlertAsync(Guid alertId, CancellationToken cancellationToken = default) + { + return await GetServiceAlerts().GetAsync(alertId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information related to a specific alert + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId} + /// + /// + /// Operation Id + /// Alerts_GetById + /// + /// + /// + /// Unique ID of an alert instance. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetServiceAlert(Guid alertId, CancellationToken cancellationToken = default) + { + return GetServiceAlerts().Get(alertId, cancellationToken); } /// Gets a collection of SmartGroupResources in the SubscriptionResource. /// An object representing collection of SmartGroupResources and their operations over a SmartGroupResource. public virtual SmartGroupCollection GetSmartGroups() { - return GetCachedClient(Client => new SmartGroupCollection(Client, Id)); + return GetCachedClient(client => new SmartGroupCollection(client, Id)); + } + + /// + /// Get information related to a specific Smart Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId} + /// + /// + /// Operation Id + /// SmartGroups_GetById + /// + /// + /// + /// Smart group unique id. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetSmartGroupAsync(Guid smartGroupId, CancellationToken cancellationToken = default) + { + return await GetSmartGroups().GetAsync(smartGroupId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information related to a specific Smart Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId} + /// + /// + /// Operation Id + /// SmartGroups_GetById + /// + /// + /// + /// Smart group unique id. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetSmartGroup(Guid smartGroupId, CancellationToken cancellationToken = default) + { + return GetSmartGroups().Get(smartGroupId, cancellationToken); } /// @@ -81,7 +166,7 @@ public virtual AsyncPageable GetAlertProcessingRule { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertProcessingRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertProcessingRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AlertProcessingRuleResource(Client, AlertProcessingRuleData.DeserializeAlertProcessingRuleData(e)), AlertProcessingRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlertProcessingRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AlertProcessingRuleResource(Client, AlertProcessingRuleData.DeserializeAlertProcessingRuleData(e)), AlertProcessingRuleClientDiagnostics, Pipeline, "AlertsManagementSubscriptionMockingExtension.GetAlertProcessingRules", "value", "nextLink", cancellationToken); } /// @@ -103,7 +188,7 @@ public virtual Pageable GetAlertProcessingRules(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertProcessingRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertProcessingRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AlertProcessingRuleResource(Client, AlertProcessingRuleData.DeserializeAlertProcessingRuleData(e)), AlertProcessingRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlertProcessingRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AlertProcessingRuleResource(Client, AlertProcessingRuleData.DeserializeAlertProcessingRuleData(e)), AlertProcessingRuleClientDiagnostics, Pipeline, "AlertsManagementSubscriptionMockingExtension.GetAlertProcessingRules", "value", "nextLink", cancellationToken); } /// @@ -121,9 +206,12 @@ public virtual Pageable GetAlertProcessingRules(Can /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> GetServiceAlertSummaryAsync(SubscriptionResourceGetServiceAlertSummaryOptions options, CancellationToken cancellationToken = default) { - using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServiceAlertSummary"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("AlertsManagementSubscriptionMockingExtension.GetServiceAlertSummary"); scope.Start(); try { @@ -152,9 +240,12 @@ public virtual async Task> GetServiceAlertSummaryA /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response GetServiceAlertSummary(SubscriptionResourceGetServiceAlertSummaryOptions options, CancellationToken cancellationToken = default) { - using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServiceAlertSummary"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("AlertsManagementSubscriptionMockingExtension.GetServiceAlertSummary"); scope.Start(); try { diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementTenantMockingExtension.cs similarity index 86% rename from sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementTenantMockingExtension.cs index 6044f8925f41..66aaf586c599 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/AlertsManagementTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AlertsManagement; using Azure.ResourceManager.AlertsManagement.Models; -namespace Azure.ResourceManager.AlertsManagement +namespace Azure.ResourceManager.AlertsManagement.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class AlertsManagementTenantMockingExtension : ArmResource { private ClientDiagnostics _serviceAlertAlertsClientDiagnostics; private AlertsRestOperations _serviceAlertAlertsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AlertsManagementTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AlertsManagementTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> GetServiceAlertMetadataAsync(RetrievedInformationIdentifier identifier, CancellationToken cancellationToken = default) { - using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetServiceAlertMetadata"); + using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("AlertsManagementTenantMockingExtension.GetServiceAlertMetadata"); scope.Start(); try { @@ -91,7 +92,7 @@ public virtual async Task> GetServiceAlertMetadat /// The cancellation token to use. public virtual Response GetServiceAlertMetadata(RetrievedInformationIdentifier identifier, CancellationToken cancellationToken = default) { - using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetServiceAlertMetadata"); + using var scope = ServiceAlertAlertsClientDiagnostics.CreateScope("AlertsManagementTenantMockingExtension.GetServiceAlertMetadata"); scope.Start(); try { diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3fb689387e6c..000000000000 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AlertsManagement -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AlertProcessingRuleResources in the ResourceGroupResource. - /// An object representing collection of AlertProcessingRuleResources and their operations over a AlertProcessingRuleResource. - public virtual AlertProcessingRuleCollection GetAlertProcessingRules() - { - return GetCachedClient(Client => new AlertProcessingRuleCollection(Client, Id)); - } - } -} diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisArmClientMockingExtension.cs b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisArmClientMockingExtension.cs new file mode 100644 index 000000000000..53b347bd944b --- /dev/null +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Analysis; + +namespace Azure.ResourceManager.Analysis.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AnalysisArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AnalysisArmClientMockingExtension() + { + } + + /// 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 AnalysisArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AnalysisArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AnalysisServerResource GetAnalysisServerResource(ResourceIdentifier id) + { + AnalysisServerResource.ValidateResourceId(id); + return new AnalysisServerResource(Client, id); + } + } +} diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisExtensions.cs b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisExtensions.cs index 7c9add1f4564..35e59f9d3d2c 100644 --- a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisExtensions.cs +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Analysis.Mocking; using Azure.ResourceManager.Analysis.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.Analysis /// A class to add extension methods to Azure.ResourceManager.Analysis. public static partial class AnalysisExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AnalysisArmClientMockingExtension GetAnalysisArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AnalysisArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AnalysisResourceGroupMockingExtension GetAnalysisResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AnalysisResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AnalysisSubscriptionMockingExtension GetAnalysisSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AnalysisSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AnalysisServerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AnalysisServerResource GetAnalysisServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AnalysisServerResource.ValidateResourceId(id); - return new AnalysisServerResource(client, id); - } - ); + return GetAnalysisArmClientMockingExtension(client).GetAnalysisServerResource(id); } - #endregion - /// Gets a collection of AnalysisServerResources in the ResourceGroupResource. + /// + /// Gets a collection of AnalysisServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AnalysisServerResources and their operations over a AnalysisServerResource. public static AnalysisServerCollection GetAnalysisServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAnalysisServers(); + return GetAnalysisResourceGroupMockingExtension(resourceGroupResource).GetAnalysisServers(); } /// @@ -89,16 +77,20 @@ public static AnalysisServerCollection GetAnalysisServers(this ResourceGroupReso /// Servers_GetDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static async Task> GetAnalysisServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAnalysisServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + return await GetAnalysisResourceGroupMockingExtension(resourceGroupResource).GetAnalysisServerAsync(serverName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetAnalysisServerAsyn /// Servers_GetDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static Response GetAnalysisServer(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAnalysisServers().Get(serverName, cancellationToken); + return GetAnalysisResourceGroupMockingExtension(resourceGroupResource).GetAnalysisServer(serverName, cancellationToken); } /// @@ -137,13 +133,17 @@ public static Response GetAnalysisServer(this ResourceGr /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAnalysisServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAnalysisServersAsync(cancellationToken); + return GetAnalysisSubscriptionMockingExtension(subscriptionResource).GetAnalysisServersAsync(cancellationToken); } /// @@ -158,13 +158,17 @@ public static AsyncPageable GetAnalysisServersAsync(this /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAnalysisServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAnalysisServers(cancellationToken); + return GetAnalysisSubscriptionMockingExtension(subscriptionResource).GetAnalysisServers(cancellationToken); } /// @@ -179,13 +183,17 @@ public static Pageable GetAnalysisServers(this Subscript /// Servers_ListSkusForNew /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEligibleSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEligibleSkusAsync(cancellationToken); + return GetAnalysisSubscriptionMockingExtension(subscriptionResource).GetEligibleSkusAsync(cancellationToken); } /// @@ -200,13 +208,17 @@ public static AsyncPageable GetEligibleSkusAsync(this Subsc /// Servers_ListSkusForNew /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEligibleSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEligibleSkus(cancellationToken); + return GetAnalysisSubscriptionMockingExtension(subscriptionResource).GetEligibleSkus(cancellationToken); } /// @@ -221,6 +233,10 @@ public static Pageable GetEligibleSkus(this SubscriptionRes /// Servers_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region name which the operation will lookup into. @@ -229,9 +245,7 @@ public static Pageable GetEligibleSkus(this SubscriptionRes /// is null. public static async Task> CheckAnalysisServerNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, AnalysisServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAnalysisServerNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetAnalysisSubscriptionMockingExtension(subscriptionResource).CheckAnalysisServerNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -246,6 +260,10 @@ public static async Task> CheckAn /// Servers_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region name which the operation will lookup into. @@ -254,9 +272,7 @@ public static async Task> CheckAn /// is null. public static Response CheckAnalysisServerNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, AnalysisServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAnalysisServerNameAvailability(location, content, cancellationToken); + return GetAnalysisSubscriptionMockingExtension(subscriptionResource).CheckAnalysisServerNameAvailability(location, content, cancellationToken); } } } diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisResourceGroupMockingExtension.cs b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..1164f5e5163e --- /dev/null +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Analysis; + +namespace Azure.ResourceManager.Analysis.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AnalysisResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AnalysisResourceGroupMockingExtension() + { + } + + /// 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 AnalysisResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AnalysisServerResources in the ResourceGroupResource. + /// An object representing collection of AnalysisServerResources and their operations over a AnalysisServerResource. + public virtual AnalysisServerCollection GetAnalysisServers() + { + return GetCachedClient(client => new AnalysisServerCollection(client, Id)); + } + + /// + /// Gets details about the specified Analysis Services server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_GetDetails + /// + /// + /// + /// The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAnalysisServerAsync(string serverName, CancellationToken cancellationToken = default) + { + return await GetAnalysisServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details about the specified Analysis Services server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_GetDetails + /// + /// + /// + /// The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAnalysisServer(string serverName, CancellationToken cancellationToken = default) + { + return GetAnalysisServers().Get(serverName, cancellationToken); + } + } +} diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisSubscriptionMockingExtension.cs similarity index 85% rename from sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisSubscriptionMockingExtension.cs index 26ad12d2073c..ace35656d6e2 100644 --- a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/AnalysisSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Analysis; using Azure.ResourceManager.Analysis.Models; -namespace Azure.ResourceManager.Analysis +namespace Azure.ResourceManager.Analysis.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AnalysisSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _analysisServerServersClientDiagnostics; private ServersRestOperations _analysisServerServersRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AnalysisSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AnalysisSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -62,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetAnalysisServersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AnalysisServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AnalysisServerResource(Client, AnalysisServerData.DeserializeAnalysisServerData(e)), AnalysisServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAnalysisServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AnalysisServerResource(Client, AnalysisServerData.DeserializeAnalysisServerData(e)), AnalysisServerServersClientDiagnostics, Pipeline, "AnalysisSubscriptionMockingExtension.GetAnalysisServers", "value", null, cancellationToken); } /// @@ -83,7 +84,7 @@ public virtual AsyncPageable GetAnalysisServersAsync(Can public virtual Pageable GetAnalysisServers(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AnalysisServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AnalysisServerResource(Client, AnalysisServerData.DeserializeAnalysisServerData(e)), AnalysisServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAnalysisServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AnalysisServerResource(Client, AnalysisServerData.DeserializeAnalysisServerData(e)), AnalysisServerServersClientDiagnostics, Pipeline, "AnalysisSubscriptionMockingExtension.GetAnalysisServers", "value", null, cancellationToken); } /// @@ -104,7 +105,7 @@ public virtual Pageable GetAnalysisServers(CancellationT public virtual AsyncPageable GetEligibleSkusAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AnalysisServerServersRestClient.CreateListSkusForNewRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AnalysisResourceSku.DeserializeAnalysisResourceSku, AnalysisServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEligibleSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AnalysisResourceSku.DeserializeAnalysisResourceSku, AnalysisServerServersClientDiagnostics, Pipeline, "AnalysisSubscriptionMockingExtension.GetEligibleSkus", "value", null, cancellationToken); } /// @@ -125,7 +126,7 @@ public virtual AsyncPageable GetEligibleSkusAsync(Cancellat public virtual Pageable GetEligibleSkus(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AnalysisServerServersRestClient.CreateListSkusForNewRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AnalysisResourceSku.DeserializeAnalysisResourceSku, AnalysisServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEligibleSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AnalysisResourceSku.DeserializeAnalysisResourceSku, AnalysisServerServersClientDiagnostics, Pipeline, "AnalysisSubscriptionMockingExtension.GetEligibleSkus", "value", null, cancellationToken); } /// @@ -144,9 +145,12 @@ public virtual Pageable GetEligibleSkus(CancellationToken c /// The region name which the operation will lookup into. /// Contains the information used to provision the Analysis Services server. /// The cancellation token to use. + /// is null. public virtual async Task> CheckAnalysisServerNameAvailabilityAsync(AzureLocation location, AnalysisServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = AnalysisServerServersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAnalysisServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = AnalysisServerServersClientDiagnostics.CreateScope("AnalysisSubscriptionMockingExtension.CheckAnalysisServerNameAvailability"); scope.Start(); try { @@ -176,9 +180,12 @@ public virtual async Task> CheckA /// The region name which the operation will lookup into. /// Contains the information used to provision the Analysis Services server. /// The cancellation token to use. + /// is null. public virtual Response CheckAnalysisServerNameAvailability(AzureLocation location, AnalysisServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = AnalysisServerServersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAnalysisServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = AnalysisServerServersClientDiagnostics.CreateScope("AnalysisSubscriptionMockingExtension.CheckAnalysisServerNameAvailability"); scope.Start(); try { diff --git a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index a8e8918ddb9e..000000000000 --- a/sdk/analysisservices/Azure.ResourceManager.Analysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Analysis -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AnalysisServerResources in the ResourceGroupResource. - /// An object representing collection of AnalysisServerResources and their operations over a AnalysisServerResource. - public virtual AnalysisServerCollection GetAnalysisServers() - { - return GetCachedClient(Client => new AnalysisServerCollection(Client, Id)); - } - } -} diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterArmClientMockingExtension.cs b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterArmClientMockingExtension.cs new file mode 100644 index 000000000000..9e431ef84c58 --- /dev/null +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ApiCenter; + +namespace Azure.ResourceManager.ApiCenter.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ApiCenterArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ApiCenterArmClientMockingExtension() + { + } + + /// 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 ApiCenterArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ApiCenterArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiCenterServiceResource GetApiCenterServiceResource(ResourceIdentifier id) + { + ApiCenterServiceResource.ValidateResourceId(id); + return new ApiCenterServiceResource(Client, id); + } + } +} diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterExtensions.cs b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterExtensions.cs index 49aee9aaaf89..3c94a3fd8240 100644 --- a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterExtensions.cs +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ApiCenter.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ApiCenter @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.ApiCenter /// A class to add extension methods to Azure.ResourceManager.ApiCenter. public static partial class ApiCenterExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ApiCenterArmClientMockingExtension GetApiCenterArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ApiCenterArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ApiCenterResourceGroupMockingExtension GetApiCenterResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ApiCenterResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ApiCenterSubscriptionMockingExtension GetApiCenterSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ApiCenterSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ApiCenterServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiCenterServiceResource GetApiCenterServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiCenterServiceResource.ValidateResourceId(id); - return new ApiCenterServiceResource(client, id); - } - ); + return GetApiCenterArmClientMockingExtension(client).GetApiCenterServiceResource(id); } - #endregion - /// Gets a collection of ApiCenterServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of ApiCenterServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ApiCenterServiceResources and their operations over a ApiCenterServiceResource. public static ApiCenterServiceCollection GetApiCenterServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApiCenterServices(); + return GetApiCenterResourceGroupMockingExtension(resourceGroupResource).GetApiCenterServices(); } /// @@ -88,16 +76,20 @@ public static ApiCenterServiceCollection GetApiCenterServices(this ResourceGroup /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Service name. /// The cancellation token to use. - /// 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 static async Task> GetApiCenterServiceAsync(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetApiCenterServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetApiCenterResourceGroupMockingExtension(resourceGroupResource).GetApiCenterServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetApiCenterService /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Service name. /// The cancellation token to use. - /// 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 static Response GetApiCenterService(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetApiCenterServices().Get(serviceName, cancellationToken); + return GetApiCenterResourceGroupMockingExtension(resourceGroupResource).GetApiCenterService(serviceName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetApiCenterService(this Resour /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApiCenterServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiCenterServicesAsync(cancellationToken); + return GetApiCenterSubscriptionMockingExtension(subscriptionResource).GetApiCenterServicesAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetApiCenterServicesAsync( /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApiCenterServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiCenterServices(cancellationToken); + return GetApiCenterSubscriptionMockingExtension(subscriptionResource).GetApiCenterServices(cancellationToken); } } } diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterResourceGroupMockingExtension.cs b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..4ee3c4dc4117 --- /dev/null +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ApiCenter; + +namespace Azure.ResourceManager.ApiCenter.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ApiCenterResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ApiCenterResourceGroupMockingExtension() + { + } + + /// 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 ApiCenterResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ApiCenterServiceResources in the ResourceGroupResource. + /// An object representing collection of ApiCenterServiceResources and their operations over a ApiCenterServiceResource. + public virtual ApiCenterServiceCollection GetApiCenterServices() + { + return GetCachedClient(client => new ApiCenterServiceCollection(client, Id)); + } + + /// + /// Get service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Service name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApiCenterServiceAsync(string serviceName, CancellationToken cancellationToken = default) + { + return await GetApiCenterServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Service name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApiCenterService(string serviceName, CancellationToken cancellationToken = default) + { + return GetApiCenterServices().Get(serviceName, cancellationToken); + } + } +} diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterSubscriptionMockingExtension.cs similarity index 84% rename from sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterSubscriptionMockingExtension.cs index b92d0fd59902..d71a6cbfe61b 100644 --- a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ApiCenterSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ApiCenter; -namespace Azure.ResourceManager.ApiCenter +namespace Azure.ResourceManager.ApiCenter.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ApiCenterSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _apiCenterServiceServicesClientDiagnostics; private ServicesRestOperations _apiCenterServiceServicesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ApiCenterSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ApiCenterSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetApiCenterServicesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiCenterServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiCenterServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiCenterServiceResource(Client, ApiCenterServiceData.DeserializeApiCenterServiceData(e)), ApiCenterServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiCenterServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiCenterServiceResource(Client, ApiCenterServiceData.DeserializeApiCenterServiceData(e)), ApiCenterServiceServicesClientDiagnostics, Pipeline, "ApiCenterSubscriptionMockingExtension.GetApiCenterServices", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetApiCenterServices(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiCenterServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiCenterServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiCenterServiceResource(Client, ApiCenterServiceData.DeserializeApiCenterServiceData(e)), ApiCenterServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiCenterServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiCenterServiceResource(Client, ApiCenterServiceData.DeserializeApiCenterServiceData(e)), ApiCenterServiceServicesClientDiagnostics, Pipeline, "ApiCenterSubscriptionMockingExtension.GetApiCenterServices", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index bdd156bb3e0d..000000000000 --- a/sdk/apicenter/Azure.ResourceManager.ApiCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ApiCenter -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ApiCenterServiceResources in the ResourceGroupResource. - /// An object representing collection of ApiCenterServiceResources and their operations over a ApiCenterServiceResource. - public virtual ApiCenterServiceCollection GetApiCenterServices() - { - return GetCachedClient(Client => new ApiCenterServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiIssueResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiIssueResource.cs index b3b97299b544..16d098f15f8b 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiIssueResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiIssueResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiIssueCommentResources and their operations over a ApiIssueCommentResource. public virtual ApiIssueCommentCollection GetApiIssueComments() { - return GetCachedClient(Client => new ApiIssueCommentCollection(Client, Id)); + return GetCachedClient(client => new ApiIssueCommentCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ApiIssueCommentCollection GetApiIssueComments() /// /// Comment identifier within an Issue. Must be unique in the current Issue. /// The cancellation token to use. - /// 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> GetApiIssueCommentAsync(string commentId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetApiIssueCommentA /// /// Comment identifier within an Issue. Must be unique in the current Issue. /// The cancellation token to use. - /// 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 GetApiIssueComment(string commentId, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetApiIssueComment(string comme /// An object representing collection of ApiIssueAttachmentResources and their operations over a ApiIssueAttachmentResource. public virtual ApiIssueAttachmentCollection GetApiIssueAttachments() { - return GetCachedClient(Client => new ApiIssueAttachmentCollection(Client, Id)); + return GetCachedClient(client => new ApiIssueAttachmentCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual ApiIssueAttachmentCollection GetApiIssueAttachments() /// /// Attachment identifier within an Issue. Must be unique in the current Issue. /// The cancellation token to use. - /// 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> GetApiIssueAttachmentAsync(string attachmentId, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetApiIssueAttac /// /// Attachment identifier within an Issue. Must be unique in the current Issue. /// The cancellation token to use. - /// 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 GetApiIssueAttachment(string attachmentId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementGatewayResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementGatewayResource.cs index 3763ef75b01e..0f58cdc5f151 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementGatewayResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementGatewayResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiManagementGatewayHostnameConfigurationResources and their operations over a ApiManagementGatewayHostnameConfigurationResource. public virtual ApiManagementGatewayHostnameConfigurationCollection GetApiManagementGatewayHostnameConfigurations() { - return GetCachedClient(Client => new ApiManagementGatewayHostnameConfigurationCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementGatewayHostnameConfigurationCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual ApiManagementGatewayHostnameConfigurationCollection GetApiManagem /// /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. /// The cancellation token to use. - /// 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> GetApiManagementGatewayHostnameConfigurationAsync(string hcId, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task /// Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. /// The cancellation token to use. - /// 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 GetApiManagementGatewayHostnameConfiguration(string hcId, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetAp /// An object representing collection of ApiManagementGatewayCertificateAuthorityResources and their operations over a ApiManagementGatewayCertificateAuthorityResource. public virtual ApiManagementGatewayCertificateAuthorityCollection GetApiManagementGatewayCertificateAuthorities() { - return GetCachedClient(Client => new ApiManagementGatewayCertificateAuthorityCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementGatewayCertificateAuthorityCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual ApiManagementGatewayCertificateAuthorityCollection GetApiManageme /// /// Identifier of the certificate entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementGatewayCertificateAuthorityAsync(string certificateId, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task /// Identifier of the certificate entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementGatewayCertificateAuthority(string certificateId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementProductResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementProductResource.cs index 35ab6ba07b7c..af6d300f2e3c 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementProductResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementProductResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiManagementProductPolicyResources and their operations over a ApiManagementProductPolicyResource. public virtual ApiManagementProductPolicyCollection GetApiManagementProductPolicies() { - return GetCachedClient(Client => new ApiManagementProductPolicyCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementProductPolicyCollection(client, Id)); } /// @@ -155,7 +155,7 @@ public virtual Response GetApiManagementProd /// An object representing collection of ApiManagementProductTagResources and their operations over a ApiManagementProductTagResource. public virtual ApiManagementProductTagCollection GetApiManagementProductTags() { - return GetCachedClient(Client => new ApiManagementProductTagCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementProductTagCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual ApiManagementProductTagCollection GetApiManagementProductTags() /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementProductTagAsync(string tagId, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task> GetApiManag /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementProductTag(string tagId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementServiceResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementServiceResource.cs index 1b89d70f1f12..84e9bb4578fd 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementServiceResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementServiceResource.cs @@ -161,7 +161,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiResources and their operations over a ApiResource. public virtual ApiCollection GetApis() { - return GetCachedClient(Client => new ApiCollection(Client, Id)); + return GetCachedClient(client => new ApiCollection(client, Id)); } /// @@ -179,8 +179,8 @@ public virtual ApiCollection GetApis() /// /// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. /// The cancellation token to use. - /// 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> GetApiAsync(string apiId, CancellationToken cancellationToken = default) { @@ -202,8 +202,8 @@ public virtual async Task> GetApiAsync(string apiId, Cance /// /// API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. /// The cancellation token to use. - /// 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 GetApi(string apiId, CancellationToken cancellationToken = default) { @@ -214,7 +214,7 @@ public virtual Response GetApi(string apiId, CancellationToken canc /// An object representing collection of ApiManagementPolicyResources and their operations over a ApiManagementPolicyResource. public virtual ApiManagementPolicyCollection GetApiManagementPolicies() { - return GetCachedClient(Client => new ApiManagementPolicyCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementPolicyCollection(client, Id)); } /// @@ -265,7 +265,7 @@ public virtual Response GetApiManagementPolicy(Poli /// An object representing collection of ApiManagementTagResources and their operations over a ApiManagementTagResource. public virtual ApiManagementTagCollection GetApiManagementTags() { - return GetCachedClient(Client => new ApiManagementTagCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementTagCollection(client, Id)); } /// @@ -283,8 +283,8 @@ public virtual ApiManagementTagCollection GetApiManagementTags() /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementTagAsync(string tagId, CancellationToken cancellationToken = default) { @@ -306,8 +306,8 @@ public virtual async Task> GetApiManagementTa /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementTag(string tagId, CancellationToken cancellationToken = default) { @@ -318,7 +318,7 @@ public virtual Response GetApiManagementTag(string tag /// An object representing collection of ApiManagementDiagnosticResources and their operations over a ApiManagementDiagnosticResource. public virtual ApiManagementDiagnosticCollection GetApiManagementDiagnostics() { - return GetCachedClient(Client => new ApiManagementDiagnosticCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementDiagnosticCollection(client, Id)); } /// @@ -336,8 +336,8 @@ public virtual ApiManagementDiagnosticCollection GetApiManagementDiagnostics() /// /// Diagnostic identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementDiagnosticAsync(string diagnosticId, CancellationToken cancellationToken = default) { @@ -359,8 +359,8 @@ public virtual async Task> GetApiManag /// /// Diagnostic identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementDiagnostic(string diagnosticId, CancellationToken cancellationToken = default) { @@ -371,7 +371,7 @@ public virtual Response GetApiManagementDiagnos /// An object representing collection of ApiManagementIssueResources and their operations over a ApiManagementIssueResource. public virtual ApiManagementIssueCollection GetApiManagementIssues() { - return GetCachedClient(Client => new ApiManagementIssueCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementIssueCollection(client, Id)); } /// @@ -389,8 +389,8 @@ public virtual ApiManagementIssueCollection GetApiManagementIssues() /// /// Issue identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementIssueAsync(string issueId, CancellationToken cancellationToken = default) { @@ -412,8 +412,8 @@ public virtual async Task> GetApiManagement /// /// Issue identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementIssue(string issueId, CancellationToken cancellationToken = default) { @@ -424,7 +424,7 @@ public virtual Response GetApiManagementIssue(string /// An object representing collection of ApiVersionSetResources and their operations over a ApiVersionSetResource. public virtual ApiVersionSetCollection GetApiVersionSets() { - return GetCachedClient(Client => new ApiVersionSetCollection(Client, Id)); + return GetCachedClient(client => new ApiVersionSetCollection(client, Id)); } /// @@ -442,8 +442,8 @@ public virtual ApiVersionSetCollection GetApiVersionSets() /// /// Api Version Set identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiVersionSetAsync(string versionSetId, CancellationToken cancellationToken = default) { @@ -465,8 +465,8 @@ public virtual async Task> GetApiVersionSetAsync /// /// Api Version Set identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiVersionSet(string versionSetId, CancellationToken cancellationToken = default) { @@ -477,7 +477,7 @@ public virtual Response GetApiVersionSet(string versionSe /// An object representing collection of ApiManagementAuthorizationServerResources and their operations over a ApiManagementAuthorizationServerResource. public virtual ApiManagementAuthorizationServerCollection GetApiManagementAuthorizationServers() { - return GetCachedClient(Client => new ApiManagementAuthorizationServerCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementAuthorizationServerCollection(client, Id)); } /// @@ -495,8 +495,8 @@ public virtual ApiManagementAuthorizationServerCollection GetApiManagementAuthor /// /// Identifier of the authorization server. /// The cancellation token to use. - /// 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> GetApiManagementAuthorizationServerAsync(string authsid, CancellationToken cancellationToken = default) { @@ -518,8 +518,8 @@ public virtual async Task> Ge /// /// Identifier of the authorization server. /// The cancellation token to use. - /// 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 GetApiManagementAuthorizationServer(string authsid, CancellationToken cancellationToken = default) { @@ -530,7 +530,7 @@ public virtual Response GetApiManageme /// An object representing collection of ApiManagementBackendResources and their operations over a ApiManagementBackendResource. public virtual ApiManagementBackendCollection GetApiManagementBackends() { - return GetCachedClient(Client => new ApiManagementBackendCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementBackendCollection(client, Id)); } /// @@ -548,8 +548,8 @@ public virtual ApiManagementBackendCollection GetApiManagementBackends() /// /// Identifier of the Backend entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementBackendAsync(string backendId, CancellationToken cancellationToken = default) { @@ -571,8 +571,8 @@ public virtual async Task> GetApiManageme /// /// Identifier of the Backend entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementBackend(string backendId, CancellationToken cancellationToken = default) { @@ -583,7 +583,7 @@ public virtual Response GetApiManagementBackend(st /// An object representing collection of ApiManagementCacheResources and their operations over a ApiManagementCacheResource. public virtual ApiManagementCacheCollection GetApiManagementCaches() { - return GetCachedClient(Client => new ApiManagementCacheCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementCacheCollection(client, Id)); } /// @@ -601,8 +601,8 @@ public virtual ApiManagementCacheCollection GetApiManagementCaches() /// /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). /// The cancellation token to use. - /// 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> GetApiManagementCacheAsync(string cacheId, CancellationToken cancellationToken = default) { @@ -624,8 +624,8 @@ public virtual async Task> GetApiManagement /// /// Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). /// The cancellation token to use. - /// 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 GetApiManagementCache(string cacheId, CancellationToken cancellationToken = default) { @@ -636,7 +636,7 @@ public virtual Response GetApiManagementCache(string /// An object representing collection of ApiManagementCertificateResources and their operations over a ApiManagementCertificateResource. public virtual ApiManagementCertificateCollection GetApiManagementCertificates() { - return GetCachedClient(Client => new ApiManagementCertificateCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementCertificateCollection(client, Id)); } /// @@ -654,8 +654,8 @@ public virtual ApiManagementCertificateCollection GetApiManagementCertificates() /// /// Identifier of the certificate entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementCertificateAsync(string certificateId, CancellationToken cancellationToken = default) { @@ -677,8 +677,8 @@ public virtual async Task> GetApiMana /// /// Identifier of the certificate entity. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementCertificate(string certificateId, CancellationToken cancellationToken = default) { @@ -689,7 +689,7 @@ public virtual Response GetApiManagementCertif /// An object representing collection of ApiManagementEmailTemplateResources and their operations over a ApiManagementEmailTemplateResource. public virtual ApiManagementEmailTemplateCollection GetApiManagementEmailTemplates() { - return GetCachedClient(Client => new ApiManagementEmailTemplateCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementEmailTemplateCollection(client, Id)); } /// @@ -738,7 +738,7 @@ public virtual Response GetApiManagementEmai /// An object representing collection of ApiManagementGatewayResources and their operations over a ApiManagementGatewayResource. public virtual ApiManagementGatewayCollection GetApiManagementGateways() { - return GetCachedClient(Client => new ApiManagementGatewayCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementGatewayCollection(client, Id)); } /// @@ -756,8 +756,8 @@ public virtual ApiManagementGatewayCollection GetApiManagementGateways() /// /// Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'. /// The cancellation token to use. - /// 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> GetApiManagementGatewayAsync(string gatewayId, CancellationToken cancellationToken = default) { @@ -779,8 +779,8 @@ public virtual async Task> GetApiManageme /// /// Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'. /// The cancellation token to use. - /// 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 GetApiManagementGateway(string gatewayId, CancellationToken cancellationToken = default) { @@ -791,7 +791,7 @@ public virtual Response GetApiManagementGateway(st /// An object representing collection of ApiManagementGroupResources and their operations over a ApiManagementGroupResource. public virtual ApiManagementGroupCollection GetApiManagementGroups() { - return GetCachedClient(Client => new ApiManagementGroupCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementGroupCollection(client, Id)); } /// @@ -809,8 +809,8 @@ public virtual ApiManagementGroupCollection GetApiManagementGroups() /// /// Group identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementGroupAsync(string groupId, CancellationToken cancellationToken = default) { @@ -832,8 +832,8 @@ public virtual async Task> GetApiManagement /// /// Group identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementGroup(string groupId, CancellationToken cancellationToken = default) { @@ -844,7 +844,7 @@ public virtual Response GetApiManagementGroup(string /// An object representing collection of ApiManagementIdentityProviderResources and their operations over a ApiManagementIdentityProviderResource. public virtual ApiManagementIdentityProviderCollection GetApiManagementIdentityProviders() { - return GetCachedClient(Client => new ApiManagementIdentityProviderCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementIdentityProviderCollection(client, Id)); } /// @@ -893,7 +893,7 @@ public virtual Response GetApiManagementI /// An object representing collection of ApiManagementLoggerResources and their operations over a ApiManagementLoggerResource. public virtual ApiManagementLoggerCollection GetApiManagementLoggers() { - return GetCachedClient(Client => new ApiManagementLoggerCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementLoggerCollection(client, Id)); } /// @@ -911,8 +911,8 @@ public virtual ApiManagementLoggerCollection GetApiManagementLoggers() /// /// Logger identifier. Must be unique in the API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementLoggerAsync(string loggerId, CancellationToken cancellationToken = default) { @@ -934,8 +934,8 @@ public virtual async Task> GetApiManagemen /// /// Logger identifier. Must be unique in the API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementLogger(string loggerId, CancellationToken cancellationToken = default) { @@ -946,7 +946,7 @@ public virtual Response GetApiManagementLogger(stri /// An object representing collection of ApiManagementNamedValueResources and their operations over a ApiManagementNamedValueResource. public virtual ApiManagementNamedValueCollection GetApiManagementNamedValues() { - return GetCachedClient(Client => new ApiManagementNamedValueCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementNamedValueCollection(client, Id)); } /// @@ -964,8 +964,8 @@ public virtual ApiManagementNamedValueCollection GetApiManagementNamedValues() /// /// Identifier of the NamedValue. /// The cancellation token to use. - /// 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> GetApiManagementNamedValueAsync(string namedValueId, CancellationToken cancellationToken = default) { @@ -987,8 +987,8 @@ public virtual async Task> GetApiManag /// /// Identifier of the NamedValue. /// The cancellation token to use. - /// 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 GetApiManagementNamedValue(string namedValueId, CancellationToken cancellationToken = default) { @@ -999,7 +999,7 @@ public virtual Response GetApiManagementNamedVa /// An object representing collection of ApiManagementNotificationResources and their operations over a ApiManagementNotificationResource. public virtual ApiManagementNotificationCollection GetApiManagementNotifications() { - return GetCachedClient(Client => new ApiManagementNotificationCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementNotificationCollection(client, Id)); } /// @@ -1048,7 +1048,7 @@ public virtual Response GetApiManagementNotif /// An object representing collection of ApiManagementOpenIdConnectProviderResources and their operations over a ApiManagementOpenIdConnectProviderResource. public virtual ApiManagementOpenIdConnectProviderCollection GetApiManagementOpenIdConnectProviders() { - return GetCachedClient(Client => new ApiManagementOpenIdConnectProviderCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementOpenIdConnectProviderCollection(client, Id)); } /// @@ -1066,8 +1066,8 @@ public virtual ApiManagementOpenIdConnectProviderCollection GetApiManagementOpen /// /// Identifier of the OpenID Connect Provider. /// The cancellation token to use. - /// 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> GetApiManagementOpenIdConnectProviderAsync(string openId, CancellationToken cancellationToken = default) { @@ -1089,8 +1089,8 @@ public virtual async Task> /// /// Identifier of the OpenID Connect Provider. /// The cancellation token to use. - /// 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 GetApiManagementOpenIdConnectProvider(string openId, CancellationToken cancellationToken = default) { @@ -1101,7 +1101,7 @@ public virtual Response GetApiManage /// An object representing collection of ApiManagementPortalRevisionResources and their operations over a ApiManagementPortalRevisionResource. public virtual ApiManagementPortalRevisionCollection GetApiManagementPortalRevisions() { - return GetCachedClient(Client => new ApiManagementPortalRevisionCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementPortalRevisionCollection(client, Id)); } /// @@ -1119,8 +1119,8 @@ public virtual ApiManagementPortalRevisionCollection GetApiManagementPortalRevis /// /// Portal revision identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementPortalRevisionAsync(string portalRevisionId, CancellationToken cancellationToken = default) { @@ -1142,8 +1142,8 @@ public virtual async Task> GetApiM /// /// Portal revision identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementPortalRevision(string portalRevisionId, CancellationToken cancellationToken = default) { @@ -1175,7 +1175,7 @@ public virtual ApiManagementPortalDelegationSettingResource GetApiManagementPort /// An object representing collection of ApiManagementPrivateEndpointConnectionResources and their operations over a ApiManagementPrivateEndpointConnectionResource. public virtual ApiManagementPrivateEndpointConnectionCollection GetApiManagementPrivateEndpointConnections() { - return GetCachedClient(Client => new ApiManagementPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementPrivateEndpointConnectionCollection(client, Id)); } /// @@ -1193,8 +1193,8 @@ public virtual ApiManagementPrivateEndpointConnectionCollection GetApiManagement /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetApiManagementPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -1216,8 +1216,8 @@ public virtual async Task /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetApiManagementPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -1228,7 +1228,7 @@ public virtual Response GetApiMa /// An object representing collection of ApiManagementPrivateLinkResources and their operations over a ApiManagementPrivateLinkResource. public virtual ApiManagementPrivateLinkResourceCollection GetApiManagementPrivateLinkResources() { - return GetCachedClient(Client => new ApiManagementPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementPrivateLinkResourceCollection(client, Id)); } /// @@ -1246,8 +1246,8 @@ public virtual ApiManagementPrivateLinkResourceCollection GetApiManagementPrivat /// /// Name of the private link resource. /// The cancellation token to use. - /// 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> GetApiManagementPrivateLinkResourceAsync(string privateLinkSubResourceName, CancellationToken cancellationToken = default) { @@ -1269,8 +1269,8 @@ public virtual async Task> GetApiMana /// /// Name of the private link resource. /// The cancellation token to use. - /// 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 GetApiManagementPrivateLinkResource(string privateLinkSubResourceName, CancellationToken cancellationToken = default) { @@ -1281,7 +1281,7 @@ public virtual Response GetApiManagementPrivat /// An object representing collection of ApiManagementProductResources and their operations over a ApiManagementProductResource. public virtual ApiManagementProductCollection GetApiManagementProducts() { - return GetCachedClient(Client => new ApiManagementProductCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementProductCollection(client, Id)); } /// @@ -1299,8 +1299,8 @@ public virtual ApiManagementProductCollection GetApiManagementProducts() /// /// Product identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementProductAsync(string productId, CancellationToken cancellationToken = default) { @@ -1322,8 +1322,8 @@ public virtual async Task> GetApiManageme /// /// Product identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementProduct(string productId, CancellationToken cancellationToken = default) { @@ -1334,7 +1334,7 @@ public virtual Response GetApiManagementProduct(st /// An object representing collection of ApiManagementGlobalSchemaResources and their operations over a ApiManagementGlobalSchemaResource. public virtual ApiManagementGlobalSchemaCollection GetApiManagementGlobalSchemas() { - return GetCachedClient(Client => new ApiManagementGlobalSchemaCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementGlobalSchemaCollection(client, Id)); } /// @@ -1352,8 +1352,8 @@ public virtual ApiManagementGlobalSchemaCollection GetApiManagementGlobalSchemas /// /// Schema id identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementGlobalSchemaAsync(string schemaId, CancellationToken cancellationToken = default) { @@ -1375,8 +1375,8 @@ public virtual async Task> GetApiMan /// /// Schema id identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementGlobalSchema(string schemaId, CancellationToken cancellationToken = default) { @@ -1387,7 +1387,7 @@ public virtual Response GetApiManagementGloba /// An object representing collection of ApiManagementTenantSettingResources and their operations over a ApiManagementTenantSettingResource. public virtual ApiManagementTenantSettingCollection GetApiManagementTenantSettings() { - return GetCachedClient(Client => new ApiManagementTenantSettingCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementTenantSettingCollection(client, Id)); } /// @@ -1436,7 +1436,7 @@ public virtual Response GetApiManagementTena /// An object representing collection of ApiManagementSubscriptionResources and their operations over a ApiManagementSubscriptionResource. public virtual ApiManagementSubscriptionCollection GetApiManagementSubscriptions() { - return GetCachedClient(Client => new ApiManagementSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementSubscriptionCollection(client, Id)); } /// @@ -1454,8 +1454,8 @@ public virtual ApiManagementSubscriptionCollection GetApiManagementSubscriptions /// /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. /// The cancellation token to use. - /// 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> GetApiManagementSubscriptionAsync(string sid, CancellationToken cancellationToken = default) { @@ -1477,8 +1477,8 @@ public virtual async Task> GetApiMan /// /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. /// The cancellation token to use. - /// 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 GetApiManagementSubscription(string sid, CancellationToken cancellationToken = default) { @@ -1489,7 +1489,7 @@ public virtual Response GetApiManagementSubsc /// An object representing collection of TenantAccessInfoResources and their operations over a TenantAccessInfoResource. public virtual TenantAccessInfoCollection GetTenantAccessInfos() { - return GetCachedClient(Client => new TenantAccessInfoCollection(Client, Id)); + return GetCachedClient(client => new TenantAccessInfoCollection(client, Id)); } /// @@ -1538,7 +1538,7 @@ public virtual Response GetTenantAccessInfo(AccessName /// An object representing collection of ApiManagementUserResources and their operations over a ApiManagementUserResource. public virtual ApiManagementUserCollection GetApiManagementUsers() { - return GetCachedClient(Client => new ApiManagementUserCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementUserCollection(client, Id)); } /// @@ -1556,8 +1556,8 @@ public virtual ApiManagementUserCollection GetApiManagementUsers() /// /// User identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiManagementUserAsync(string userId, CancellationToken cancellationToken = default) { @@ -1579,8 +1579,8 @@ public virtual async Task> GetApiManagementU /// /// User identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiManagementUser(string userId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementUserResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementUserResource.cs index 287453f9eafd..16ea4e0fe799 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementUserResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiManagementUserResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiManagementUserSubscriptionResources and their operations over a ApiManagementUserSubscriptionResource. public virtual ApiManagementUserSubscriptionCollection GetApiManagementUserSubscriptions() { - return GetCachedClient(Client => new ApiManagementUserSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementUserSubscriptionCollection(client, Id)); } /// @@ -122,8 +122,8 @@ public virtual ApiManagementUserSubscriptionCollection GetApiManagementUserSubsc /// /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. /// The cancellation token to use. - /// 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> GetApiManagementUserSubscriptionAsync(string sid, CancellationToken cancellationToken = default) { @@ -145,8 +145,8 @@ public virtual async Task> GetAp /// /// Subscription entity Identifier. The entity represents the association between a user and a product in API Management. /// The cancellation token to use. - /// 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 GetApiManagementUserSubscription(string sid, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiOperationResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiOperationResource.cs index 2aedff01129d..5baf287eafe3 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiOperationResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiOperationResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiOperationPolicyResources and their operations over a ApiOperationPolicyResource. public virtual ApiOperationPolicyCollection GetApiOperationPolicies() { - return GetCachedClient(Client => new ApiOperationPolicyCollection(Client, Id)); + return GetCachedClient(client => new ApiOperationPolicyCollection(client, Id)); } /// @@ -142,7 +142,7 @@ public virtual Response GetApiOperationPolicy(Policy /// An object representing collection of ApiOperationTagResources and their operations over a ApiOperationTagResource. public virtual ApiOperationTagCollection GetApiOperationTags() { - return GetCachedClient(Client => new ApiOperationTagCollection(Client, Id)); + return GetCachedClient(client => new ApiOperationTagCollection(client, Id)); } /// @@ -160,8 +160,8 @@ public virtual ApiOperationTagCollection GetApiOperationTags() /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiOperationTagAsync(string tagId, CancellationToken cancellationToken = default) { @@ -183,8 +183,8 @@ public virtual async Task> GetApiOperationTagA /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiOperationTag(string tagId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiResource.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiResource.cs index 4cf65f833cf0..e3da564d1a95 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiResource.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/ApiResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApiReleaseResources and their operations over a ApiReleaseResource. public virtual ApiReleaseCollection GetApiReleases() { - return GetCachedClient(Client => new ApiReleaseCollection(Client, Id)); + return GetCachedClient(client => new ApiReleaseCollection(client, Id)); } /// @@ -122,8 +122,8 @@ public virtual ApiReleaseCollection GetApiReleases() /// /// Release identifier within an API. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiReleaseAsync(string releaseId, CancellationToken cancellationToken = default) { @@ -145,8 +145,8 @@ public virtual async Task> GetApiReleaseAsync(strin /// /// Release identifier within an API. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiRelease(string releaseId, CancellationToken cancellationToken = default) { @@ -157,7 +157,7 @@ public virtual Response GetApiRelease(string releaseId, Canc /// An object representing collection of ApiOperationResources and their operations over a ApiOperationResource. public virtual ApiOperationCollection GetApiOperations() { - return GetCachedClient(Client => new ApiOperationCollection(Client, Id)); + return GetCachedClient(client => new ApiOperationCollection(client, Id)); } /// @@ -175,8 +175,8 @@ public virtual ApiOperationCollection GetApiOperations() /// /// Operation identifier within an API. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiOperationAsync(string operationId, CancellationToken cancellationToken = default) { @@ -198,8 +198,8 @@ public virtual async Task> GetApiOperationAsync(s /// /// Operation identifier within an API. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiOperation(string operationId, CancellationToken cancellationToken = default) { @@ -210,7 +210,7 @@ public virtual Response GetApiOperation(string operationId /// An object representing collection of ApiPolicyResources and their operations over a ApiPolicyResource. public virtual ApiPolicyCollection GetApiPolicies() { - return GetCachedClient(Client => new ApiPolicyCollection(Client, Id)); + return GetCachedClient(client => new ApiPolicyCollection(client, Id)); } /// @@ -261,7 +261,7 @@ public virtual Response GetApiPolicy(PolicyName policyId, Pol /// An object representing collection of ApiTagResources and their operations over a ApiTagResource. public virtual ApiTagCollection GetApiTags() { - return GetCachedClient(Client => new ApiTagCollection(Client, Id)); + return GetCachedClient(client => new ApiTagCollection(client, Id)); } /// @@ -279,8 +279,8 @@ public virtual ApiTagCollection GetApiTags() /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiTagAsync(string tagId, CancellationToken cancellationToken = default) { @@ -302,8 +302,8 @@ public virtual async Task> GetApiTagAsync(string tagId, /// /// Tag identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiTag(string tagId, CancellationToken cancellationToken = default) { @@ -314,7 +314,7 @@ public virtual Response GetApiTag(string tagId, CancellationToke /// An object representing collection of ApiSchemaResources and their operations over a ApiSchemaResource. public virtual ApiSchemaCollection GetApiSchemas() { - return GetCachedClient(Client => new ApiSchemaCollection(Client, Id)); + return GetCachedClient(client => new ApiSchemaCollection(client, Id)); } /// @@ -332,8 +332,8 @@ public virtual ApiSchemaCollection GetApiSchemas() /// /// Schema id identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiSchemaAsync(string schemaId, CancellationToken cancellationToken = default) { @@ -355,8 +355,8 @@ public virtual async Task> GetApiSchemaAsync(string /// /// Schema id identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiSchema(string schemaId, CancellationToken cancellationToken = default) { @@ -367,7 +367,7 @@ public virtual Response GetApiSchema(string schemaId, Cancell /// An object representing collection of ApiDiagnosticResources and their operations over a ApiDiagnosticResource. public virtual ApiDiagnosticCollection GetApiDiagnostics() { - return GetCachedClient(Client => new ApiDiagnosticCollection(Client, Id)); + return GetCachedClient(client => new ApiDiagnosticCollection(client, Id)); } /// @@ -385,8 +385,8 @@ public virtual ApiDiagnosticCollection GetApiDiagnostics() /// /// Diagnostic identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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> GetApiDiagnosticAsync(string diagnosticId, CancellationToken cancellationToken = default) { @@ -408,8 +408,8 @@ public virtual async Task> GetApiDiagnosticAsync /// /// Diagnostic identifier. Must be unique in the current API Management service instance. /// The cancellation token to use. - /// 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 GetApiDiagnostic(string diagnosticId, CancellationToken cancellationToken = default) { @@ -420,7 +420,7 @@ public virtual Response GetApiDiagnostic(string diagnosti /// An object representing collection of ApiIssueResources and their operations over a ApiIssueResource. public virtual ApiIssueCollection GetApiIssues() { - return GetCachedClient(Client => new ApiIssueCollection(Client, Id)); + return GetCachedClient(client => new ApiIssueCollection(client, Id)); } /// @@ -439,8 +439,8 @@ public virtual ApiIssueCollection GetApiIssues() /// Issue identifier. Must be unique in the current API Management service instance. /// Expand the comment attachments. /// The cancellation token to use. - /// 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> GetApiIssueAsync(string issueId, bool? expandCommentsAttachments = null, CancellationToken cancellationToken = default) { @@ -463,8 +463,8 @@ public virtual async Task> GetApiIssueAsync(string is /// Issue identifier. Must be unique in the current API Management service instance. /// Expand the comment attachments. /// The cancellation token to use. - /// 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 GetApiIssue(string issueId, bool? expandCommentsAttachments = null, CancellationToken cancellationToken = default) { @@ -475,7 +475,7 @@ public virtual Response GetApiIssue(string issueId, bool? expa /// An object representing collection of ApiTagDescriptionResources and their operations over a ApiTagDescriptionResource. public virtual ApiTagDescriptionCollection GetApiTagDescriptions() { - return GetCachedClient(Client => new ApiTagDescriptionCollection(Client, Id)); + return GetCachedClient(client => new ApiTagDescriptionCollection(client, Id)); } /// @@ -493,8 +493,8 @@ public virtual ApiTagDescriptionCollection GetApiTagDescriptions() /// /// Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names. /// The cancellation token to use. - /// 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> GetApiTagDescriptionAsync(string tagDescriptionId, CancellationToken cancellationToken = default) { @@ -516,8 +516,8 @@ public virtual async Task> GetApiTagDescript /// /// Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names. /// The cancellation token to use. - /// 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 GetApiTagDescription(string tagDescriptionId, CancellationToken cancellationToken = default) { diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementArmClientMockingExtension.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementArmClientMockingExtension.cs new file mode 100644 index 000000000000..69a77875cf13 --- /dev/null +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementArmClientMockingExtension.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ApiManagement; + +namespace Azure.ResourceManager.ApiManagement.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ApiManagementArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ApiManagementArmClientMockingExtension() + { + } + + /// 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 ApiManagementArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ApiManagementArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiResource GetApiResource(ResourceIdentifier id) + { + ApiResource.ValidateResourceId(id); + return new ApiResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiReleaseResource GetApiReleaseResource(ResourceIdentifier id) + { + ApiReleaseResource.ValidateResourceId(id); + return new ApiReleaseResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiOperationResource GetApiOperationResource(ResourceIdentifier id) + { + ApiOperationResource.ValidateResourceId(id); + return new ApiOperationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiOperationPolicyResource GetApiOperationPolicyResource(ResourceIdentifier id) + { + ApiOperationPolicyResource.ValidateResourceId(id); + return new ApiOperationPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiPolicyResource GetApiPolicyResource(ResourceIdentifier id) + { + ApiPolicyResource.ValidateResourceId(id); + return new ApiPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPolicyResource GetApiManagementPolicyResource(ResourceIdentifier id) + { + ApiManagementPolicyResource.ValidateResourceId(id); + return new ApiManagementPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementProductPolicyResource GetApiManagementProductPolicyResource(ResourceIdentifier id) + { + ApiManagementProductPolicyResource.ValidateResourceId(id); + return new ApiManagementProductPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiOperationTagResource GetApiOperationTagResource(ResourceIdentifier id) + { + ApiOperationTagResource.ValidateResourceId(id); + return new ApiOperationTagResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiTagResource GetApiTagResource(ResourceIdentifier id) + { + ApiTagResource.ValidateResourceId(id); + return new ApiTagResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementProductTagResource GetApiManagementProductTagResource(ResourceIdentifier id) + { + ApiManagementProductTagResource.ValidateResourceId(id); + return new ApiManagementProductTagResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementTagResource GetApiManagementTagResource(ResourceIdentifier id) + { + ApiManagementTagResource.ValidateResourceId(id); + return new ApiManagementTagResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiSchemaResource GetApiSchemaResource(ResourceIdentifier id) + { + ApiSchemaResource.ValidateResourceId(id); + return new ApiSchemaResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiDiagnosticResource GetApiDiagnosticResource(ResourceIdentifier id) + { + ApiDiagnosticResource.ValidateResourceId(id); + return new ApiDiagnosticResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementDiagnosticResource GetApiManagementDiagnosticResource(ResourceIdentifier id) + { + ApiManagementDiagnosticResource.ValidateResourceId(id); + return new ApiManagementDiagnosticResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiIssueResource GetApiIssueResource(ResourceIdentifier id) + { + ApiIssueResource.ValidateResourceId(id); + return new ApiIssueResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementIssueResource GetApiManagementIssueResource(ResourceIdentifier id) + { + ApiManagementIssueResource.ValidateResourceId(id); + return new ApiManagementIssueResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiIssueCommentResource GetApiIssueCommentResource(ResourceIdentifier id) + { + ApiIssueCommentResource.ValidateResourceId(id); + return new ApiIssueCommentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiIssueAttachmentResource GetApiIssueAttachmentResource(ResourceIdentifier id) + { + ApiIssueAttachmentResource.ValidateResourceId(id); + return new ApiIssueAttachmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiTagDescriptionResource GetApiTagDescriptionResource(ResourceIdentifier id) + { + ApiTagDescriptionResource.ValidateResourceId(id); + return new ApiTagDescriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiVersionSetResource GetApiVersionSetResource(ResourceIdentifier id) + { + ApiVersionSetResource.ValidateResourceId(id); + return new ApiVersionSetResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementAuthorizationServerResource GetApiManagementAuthorizationServerResource(ResourceIdentifier id) + { + ApiManagementAuthorizationServerResource.ValidateResourceId(id); + return new ApiManagementAuthorizationServerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementBackendResource GetApiManagementBackendResource(ResourceIdentifier id) + { + ApiManagementBackendResource.ValidateResourceId(id); + return new ApiManagementBackendResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementCacheResource GetApiManagementCacheResource(ResourceIdentifier id) + { + ApiManagementCacheResource.ValidateResourceId(id); + return new ApiManagementCacheResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementCertificateResource GetApiManagementCertificateResource(ResourceIdentifier id) + { + ApiManagementCertificateResource.ValidateResourceId(id); + return new ApiManagementCertificateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementDeletedServiceResource GetApiManagementDeletedServiceResource(ResourceIdentifier id) + { + ApiManagementDeletedServiceResource.ValidateResourceId(id); + return new ApiManagementDeletedServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementServiceResource GetApiManagementServiceResource(ResourceIdentifier id) + { + ApiManagementServiceResource.ValidateResourceId(id); + return new ApiManagementServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementEmailTemplateResource GetApiManagementEmailTemplateResource(ResourceIdentifier id) + { + ApiManagementEmailTemplateResource.ValidateResourceId(id); + return new ApiManagementEmailTemplateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementGatewayResource GetApiManagementGatewayResource(ResourceIdentifier id) + { + ApiManagementGatewayResource.ValidateResourceId(id); + return new ApiManagementGatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementGatewayHostnameConfigurationResource GetApiManagementGatewayHostnameConfigurationResource(ResourceIdentifier id) + { + ApiManagementGatewayHostnameConfigurationResource.ValidateResourceId(id); + return new ApiManagementGatewayHostnameConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementGatewayCertificateAuthorityResource GetApiManagementGatewayCertificateAuthorityResource(ResourceIdentifier id) + { + ApiManagementGatewayCertificateAuthorityResource.ValidateResourceId(id); + return new ApiManagementGatewayCertificateAuthorityResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementGroupResource GetApiManagementGroupResource(ResourceIdentifier id) + { + ApiManagementGroupResource.ValidateResourceId(id); + return new ApiManagementGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementIdentityProviderResource GetApiManagementIdentityProviderResource(ResourceIdentifier id) + { + ApiManagementIdentityProviderResource.ValidateResourceId(id); + return new ApiManagementIdentityProviderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementLoggerResource GetApiManagementLoggerResource(ResourceIdentifier id) + { + ApiManagementLoggerResource.ValidateResourceId(id); + return new ApiManagementLoggerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementNamedValueResource GetApiManagementNamedValueResource(ResourceIdentifier id) + { + ApiManagementNamedValueResource.ValidateResourceId(id); + return new ApiManagementNamedValueResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementNotificationResource GetApiManagementNotificationResource(ResourceIdentifier id) + { + ApiManagementNotificationResource.ValidateResourceId(id); + return new ApiManagementNotificationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementOpenIdConnectProviderResource GetApiManagementOpenIdConnectProviderResource(ResourceIdentifier id) + { + ApiManagementOpenIdConnectProviderResource.ValidateResourceId(id); + return new ApiManagementOpenIdConnectProviderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPortalRevisionResource GetApiManagementPortalRevisionResource(ResourceIdentifier id) + { + ApiManagementPortalRevisionResource.ValidateResourceId(id); + return new ApiManagementPortalRevisionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPortalSignInSettingResource GetApiManagementPortalSignInSettingResource(ResourceIdentifier id) + { + ApiManagementPortalSignInSettingResource.ValidateResourceId(id); + return new ApiManagementPortalSignInSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPortalSignUpSettingResource GetApiManagementPortalSignUpSettingResource(ResourceIdentifier id) + { + ApiManagementPortalSignUpSettingResource.ValidateResourceId(id); + return new ApiManagementPortalSignUpSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPortalDelegationSettingResource GetApiManagementPortalDelegationSettingResource(ResourceIdentifier id) + { + ApiManagementPortalDelegationSettingResource.ValidateResourceId(id); + return new ApiManagementPortalDelegationSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPrivateEndpointConnectionResource GetApiManagementPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ApiManagementPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ApiManagementPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementPrivateLinkResource GetApiManagementPrivateLinkResource(ResourceIdentifier id) + { + ApiManagementPrivateLinkResource.ValidateResourceId(id); + return new ApiManagementPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementProductResource GetApiManagementProductResource(ResourceIdentifier id) + { + ApiManagementProductResource.ValidateResourceId(id); + return new ApiManagementProductResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementGlobalSchemaResource GetApiManagementGlobalSchemaResource(ResourceIdentifier id) + { + ApiManagementGlobalSchemaResource.ValidateResourceId(id); + return new ApiManagementGlobalSchemaResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementTenantSettingResource GetApiManagementTenantSettingResource(ResourceIdentifier id) + { + ApiManagementTenantSettingResource.ValidateResourceId(id); + return new ApiManagementTenantSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementSubscriptionResource GetApiManagementSubscriptionResource(ResourceIdentifier id) + { + ApiManagementSubscriptionResource.ValidateResourceId(id); + return new ApiManagementSubscriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementUserSubscriptionResource GetApiManagementUserSubscriptionResource(ResourceIdentifier id) + { + ApiManagementUserSubscriptionResource.ValidateResourceId(id); + return new ApiManagementUserSubscriptionResource(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 TenantAccessInfoResource GetTenantAccessInfoResource(ResourceIdentifier id) + { + TenantAccessInfoResource.ValidateResourceId(id); + return new TenantAccessInfoResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApiManagementUserResource GetApiManagementUserResource(ResourceIdentifier id) + { + ApiManagementUserResource.ValidateResourceId(id); + return new ApiManagementUserResource(Client, id); + } + } +} diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementExtensions.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementExtensions.cs index 21bf4ef2b572..4c04d043bf79 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementExtensions.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ApiManagement.Mocking; using Azure.ResourceManager.ApiManagement.Models; using Azure.ResourceManager.Resources; @@ -19,974 +20,817 @@ namespace Azure.ResourceManager.ApiManagement /// A class to add extension methods to Azure.ResourceManager.ApiManagement. public static partial class ApiManagementExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ApiManagementArmClientMockingExtension GetApiManagementArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ApiManagementArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ApiManagementResourceGroupMockingExtension GetApiManagementResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ApiManagementResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ApiManagementSubscriptionMockingExtension GetApiManagementSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ApiManagementSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ApiResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiResource GetApiResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiResource.ValidateResourceId(id); - return new ApiResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiResource(id); } - #endregion - #region ApiReleaseResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiReleaseResource GetApiReleaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiReleaseResource.ValidateResourceId(id); - return new ApiReleaseResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiReleaseResource(id); } - #endregion - #region ApiOperationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiOperationResource GetApiOperationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiOperationResource.ValidateResourceId(id); - return new ApiOperationResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiOperationResource(id); } - #endregion - #region ApiOperationPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiOperationPolicyResource GetApiOperationPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiOperationPolicyResource.ValidateResourceId(id); - return new ApiOperationPolicyResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiOperationPolicyResource(id); } - #endregion - #region ApiPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiPolicyResource GetApiPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiPolicyResource.ValidateResourceId(id); - return new ApiPolicyResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiPolicyResource(id); } - #endregion - #region ApiManagementPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPolicyResource GetApiManagementPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPolicyResource.ValidateResourceId(id); - return new ApiManagementPolicyResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPolicyResource(id); } - #endregion - #region ApiManagementProductPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementProductPolicyResource GetApiManagementProductPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementProductPolicyResource.ValidateResourceId(id); - return new ApiManagementProductPolicyResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementProductPolicyResource(id); } - #endregion - #region ApiOperationTagResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiOperationTagResource GetApiOperationTagResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiOperationTagResource.ValidateResourceId(id); - return new ApiOperationTagResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiOperationTagResource(id); } - #endregion - #region ApiTagResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiTagResource GetApiTagResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiTagResource.ValidateResourceId(id); - return new ApiTagResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiTagResource(id); } - #endregion - #region ApiManagementProductTagResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementProductTagResource GetApiManagementProductTagResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementProductTagResource.ValidateResourceId(id); - return new ApiManagementProductTagResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementProductTagResource(id); } - #endregion - #region ApiManagementTagResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementTagResource GetApiManagementTagResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementTagResource.ValidateResourceId(id); - return new ApiManagementTagResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementTagResource(id); } - #endregion - #region ApiSchemaResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiSchemaResource GetApiSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiSchemaResource.ValidateResourceId(id); - return new ApiSchemaResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiSchemaResource(id); } - #endregion - #region ApiDiagnosticResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiDiagnosticResource GetApiDiagnosticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiDiagnosticResource.ValidateResourceId(id); - return new ApiDiagnosticResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiDiagnosticResource(id); } - #endregion - #region ApiManagementDiagnosticResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementDiagnosticResource GetApiManagementDiagnosticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementDiagnosticResource.ValidateResourceId(id); - return new ApiManagementDiagnosticResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementDiagnosticResource(id); } - #endregion - #region ApiIssueResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiIssueResource GetApiIssueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiIssueResource.ValidateResourceId(id); - return new ApiIssueResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiIssueResource(id); } - #endregion - #region ApiManagementIssueResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementIssueResource GetApiManagementIssueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementIssueResource.ValidateResourceId(id); - return new ApiManagementIssueResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementIssueResource(id); } - #endregion - #region ApiIssueCommentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiIssueCommentResource GetApiIssueCommentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiIssueCommentResource.ValidateResourceId(id); - return new ApiIssueCommentResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiIssueCommentResource(id); } - #endregion - #region ApiIssueAttachmentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiIssueAttachmentResource GetApiIssueAttachmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiIssueAttachmentResource.ValidateResourceId(id); - return new ApiIssueAttachmentResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiIssueAttachmentResource(id); } - #endregion - #region ApiTagDescriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiTagDescriptionResource GetApiTagDescriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiTagDescriptionResource.ValidateResourceId(id); - return new ApiTagDescriptionResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiTagDescriptionResource(id); } - #endregion - #region ApiVersionSetResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiVersionSetResource GetApiVersionSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiVersionSetResource.ValidateResourceId(id); - return new ApiVersionSetResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiVersionSetResource(id); } - #endregion - #region ApiManagementAuthorizationServerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementAuthorizationServerResource GetApiManagementAuthorizationServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementAuthorizationServerResource.ValidateResourceId(id); - return new ApiManagementAuthorizationServerResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementAuthorizationServerResource(id); } - #endregion - #region ApiManagementBackendResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementBackendResource GetApiManagementBackendResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementBackendResource.ValidateResourceId(id); - return new ApiManagementBackendResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementBackendResource(id); } - #endregion - #region ApiManagementCacheResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementCacheResource GetApiManagementCacheResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementCacheResource.ValidateResourceId(id); - return new ApiManagementCacheResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementCacheResource(id); } - #endregion - #region ApiManagementCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementCertificateResource GetApiManagementCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementCertificateResource.ValidateResourceId(id); - return new ApiManagementCertificateResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementCertificateResource(id); } - #endregion - #region ApiManagementDeletedServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementDeletedServiceResource GetApiManagementDeletedServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementDeletedServiceResource.ValidateResourceId(id); - return new ApiManagementDeletedServiceResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementDeletedServiceResource(id); } - #endregion - #region ApiManagementServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementServiceResource GetApiManagementServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementServiceResource.ValidateResourceId(id); - return new ApiManagementServiceResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementServiceResource(id); } - #endregion - #region ApiManagementEmailTemplateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementEmailTemplateResource GetApiManagementEmailTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementEmailTemplateResource.ValidateResourceId(id); - return new ApiManagementEmailTemplateResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementEmailTemplateResource(id); } - #endregion - #region ApiManagementGatewayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementGatewayResource GetApiManagementGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementGatewayResource.ValidateResourceId(id); - return new ApiManagementGatewayResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementGatewayResource(id); } - #endregion - #region ApiManagementGatewayHostnameConfigurationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementGatewayHostnameConfigurationResource GetApiManagementGatewayHostnameConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementGatewayHostnameConfigurationResource.ValidateResourceId(id); - return new ApiManagementGatewayHostnameConfigurationResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementGatewayHostnameConfigurationResource(id); } - #endregion - #region ApiManagementGatewayCertificateAuthorityResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementGatewayCertificateAuthorityResource GetApiManagementGatewayCertificateAuthorityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementGatewayCertificateAuthorityResource.ValidateResourceId(id); - return new ApiManagementGatewayCertificateAuthorityResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementGatewayCertificateAuthorityResource(id); } - #endregion - #region ApiManagementGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementGroupResource GetApiManagementGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementGroupResource.ValidateResourceId(id); - return new ApiManagementGroupResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementGroupResource(id); } - #endregion - #region ApiManagementIdentityProviderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementIdentityProviderResource GetApiManagementIdentityProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementIdentityProviderResource.ValidateResourceId(id); - return new ApiManagementIdentityProviderResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementIdentityProviderResource(id); } - #endregion - #region ApiManagementLoggerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementLoggerResource GetApiManagementLoggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementLoggerResource.ValidateResourceId(id); - return new ApiManagementLoggerResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementLoggerResource(id); } - #endregion - #region ApiManagementNamedValueResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementNamedValueResource GetApiManagementNamedValueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementNamedValueResource.ValidateResourceId(id); - return new ApiManagementNamedValueResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementNamedValueResource(id); } - #endregion - #region ApiManagementNotificationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementNotificationResource GetApiManagementNotificationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementNotificationResource.ValidateResourceId(id); - return new ApiManagementNotificationResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementNotificationResource(id); } - #endregion - #region ApiManagementOpenIdConnectProviderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementOpenIdConnectProviderResource GetApiManagementOpenIdConnectProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementOpenIdConnectProviderResource.ValidateResourceId(id); - return new ApiManagementOpenIdConnectProviderResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementOpenIdConnectProviderResource(id); } - #endregion - #region ApiManagementPortalRevisionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPortalRevisionResource GetApiManagementPortalRevisionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPortalRevisionResource.ValidateResourceId(id); - return new ApiManagementPortalRevisionResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPortalRevisionResource(id); } - #endregion - #region ApiManagementPortalSignInSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPortalSignInSettingResource GetApiManagementPortalSignInSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPortalSignInSettingResource.ValidateResourceId(id); - return new ApiManagementPortalSignInSettingResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPortalSignInSettingResource(id); } - #endregion - #region ApiManagementPortalSignUpSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPortalSignUpSettingResource GetApiManagementPortalSignUpSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPortalSignUpSettingResource.ValidateResourceId(id); - return new ApiManagementPortalSignUpSettingResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPortalSignUpSettingResource(id); } - #endregion - #region ApiManagementPortalDelegationSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPortalDelegationSettingResource GetApiManagementPortalDelegationSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPortalDelegationSettingResource.ValidateResourceId(id); - return new ApiManagementPortalDelegationSettingResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPortalDelegationSettingResource(id); } - #endregion - #region ApiManagementPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPrivateEndpointConnectionResource GetApiManagementPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ApiManagementPrivateEndpointConnectionResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPrivateEndpointConnectionResource(id); } - #endregion - #region ApiManagementPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementPrivateLinkResource GetApiManagementPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementPrivateLinkResource.ValidateResourceId(id); - return new ApiManagementPrivateLinkResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementPrivateLinkResource(id); } - #endregion - #region ApiManagementProductResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementProductResource GetApiManagementProductResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementProductResource.ValidateResourceId(id); - return new ApiManagementProductResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementProductResource(id); } - #endregion - #region ApiManagementGlobalSchemaResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementGlobalSchemaResource GetApiManagementGlobalSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementGlobalSchemaResource.ValidateResourceId(id); - return new ApiManagementGlobalSchemaResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementGlobalSchemaResource(id); } - #endregion - #region ApiManagementTenantSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementTenantSettingResource GetApiManagementTenantSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementTenantSettingResource.ValidateResourceId(id); - return new ApiManagementTenantSettingResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementTenantSettingResource(id); } - #endregion - #region ApiManagementSubscriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementSubscriptionResource GetApiManagementSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementSubscriptionResource.ValidateResourceId(id); - return new ApiManagementSubscriptionResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementSubscriptionResource(id); } - #endregion - #region ApiManagementUserSubscriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementUserSubscriptionResource GetApiManagementUserSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementUserSubscriptionResource.ValidateResourceId(id); - return new ApiManagementUserSubscriptionResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementUserSubscriptionResource(id); } - #endregion - #region TenantAccessInfoResource /// /// 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. /// Returns a object. public static TenantAccessInfoResource GetTenantAccessInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TenantAccessInfoResource.ValidateResourceId(id); - return new TenantAccessInfoResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetTenantAccessInfoResource(id); } - #endregion - #region ApiManagementUserResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApiManagementUserResource GetApiManagementUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApiManagementUserResource.ValidateResourceId(id); - return new ApiManagementUserResource(client, id); - } - ); + return GetApiManagementArmClientMockingExtension(client).GetApiManagementUserResource(id); } - #endregion - /// Gets a collection of ApiManagementServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of ApiManagementServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ApiManagementServiceResources and their operations over a ApiManagementServiceResource. public static ApiManagementServiceCollection GetApiManagementServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApiManagementServices(); + return GetApiManagementResourceGroupMockingExtension(resourceGroupResource).GetApiManagementServices(); } /// @@ -1001,16 +845,20 @@ public static ApiManagementServiceCollection GetApiManagementServices(this Resou /// ApiManagementService_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the API Management service. /// The cancellation token to use. - /// 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 static async Task> GetApiManagementServiceAsync(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetApiManagementServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetApiManagementResourceGroupMockingExtension(resourceGroupResource).GetApiManagementServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -1025,24 +873,34 @@ public static async Task> GetApiManagemen /// ApiManagementService_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the API Management service. /// The cancellation token to use. - /// 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 static Response GetApiManagementService(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetApiManagementServices().Get(serviceName, cancellationToken); + return GetApiManagementResourceGroupMockingExtension(resourceGroupResource).GetApiManagementService(serviceName, cancellationToken); } - /// Gets a collection of ApiManagementDeletedServiceResources in the SubscriptionResource. + /// + /// Gets a collection of ApiManagementDeletedServiceResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ApiManagementDeletedServiceResources and their operations over a ApiManagementDeletedServiceResource. public static ApiManagementDeletedServiceCollection GetApiManagementDeletedServices(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementDeletedServices(); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementDeletedServices(); } /// @@ -1057,17 +915,21 @@ public static ApiManagementDeletedServiceCollection GetApiManagementDeletedServi /// DeletedServices_GetByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted API Management service. /// The name of the API Management service. /// The cancellation token to use. - /// 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 static async Task> GetApiManagementDeletedServiceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string serviceName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetApiManagementDeletedServices().GetAsync(location, serviceName, cancellationToken).ConfigureAwait(false); + return await GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementDeletedServiceAsync(location, serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -1082,17 +944,21 @@ public static async Task> GetApiMa /// DeletedServices_GetByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted API Management service. /// The name of the API Management service. /// The cancellation token to use. - /// 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 static Response GetApiManagementDeletedService(this SubscriptionResource subscriptionResource, AzureLocation location, string serviceName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetApiManagementDeletedServices().Get(location, serviceName, cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementDeletedService(location, serviceName, cancellationToken); } /// @@ -1107,13 +973,17 @@ public static Response GetApiManagementDele /// DeletedServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApiManagementDeletedServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementDeletedServicesAsync(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementDeletedServicesAsync(cancellationToken); } /// @@ -1128,13 +998,17 @@ public static AsyncPageable GetApiManagemen /// DeletedServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApiManagementDeletedServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementDeletedServices(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementDeletedServices(cancellationToken); } /// @@ -1149,13 +1023,17 @@ public static Pageable GetApiManagementDele /// ApiManagementService_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApiManagementServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementServicesAsync(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementServicesAsync(cancellationToken); } /// @@ -1170,13 +1048,17 @@ public static AsyncPageable GetApiManagementServic /// ApiManagementService_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApiManagementServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementServices(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementServices(cancellationToken); } /// @@ -1191,6 +1073,10 @@ public static Pageable GetApiManagementServices(th /// ApiManagementService_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the CheckNameAvailability operation. @@ -1198,9 +1084,7 @@ public static Pageable GetApiManagementServices(th /// is null. public static async Task> CheckApiManagementServiceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ApiManagementServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckApiManagementServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetApiManagementSubscriptionMockingExtension(subscriptionResource).CheckApiManagementServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -1215,6 +1099,10 @@ public static async Task> C /// ApiManagementService_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the CheckNameAvailability operation. @@ -1222,9 +1110,7 @@ public static async Task> C /// is null. public static Response CheckApiManagementServiceNameAvailability(this SubscriptionResource subscriptionResource, ApiManagementServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckApiManagementServiceNameAvailability(content, cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).CheckApiManagementServiceNameAvailability(content, cancellationToken); } /// @@ -1239,12 +1125,16 @@ public static Response CheckApiManag /// ApiManagementService_GetDomainOwnershipIdentifier /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetApiManagementServiceDomainOwnershipIdentifierAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementServiceDomainOwnershipIdentifierAsync(cancellationToken).ConfigureAwait(false); + return await GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementServiceDomainOwnershipIdentifierAsync(cancellationToken).ConfigureAwait(false); } /// @@ -1259,12 +1149,16 @@ public static async TaskApiManagementService_GetDomainOwnershipIdentifier /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetApiManagementServiceDomainOwnershipIdentifier(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementServiceDomainOwnershipIdentifier(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementServiceDomainOwnershipIdentifier(cancellationToken); } /// @@ -1279,13 +1173,17 @@ public static Response G /// ApiManagementSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApiManagementSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementSkusAsync(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementSkusAsync(cancellationToken); } /// @@ -1300,13 +1198,17 @@ public static AsyncPageable GetApiManagementSkusAsync(this Sub /// ApiManagementSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApiManagementSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApiManagementSkus(cancellationToken); + return GetApiManagementSubscriptionMockingExtension(subscriptionResource).GetApiManagementSkus(cancellationToken); } } } diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementResourceGroupMockingExtension.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..d51af69b9fb8 --- /dev/null +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ApiManagement; + +namespace Azure.ResourceManager.ApiManagement.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ApiManagementResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ApiManagementResourceGroupMockingExtension() + { + } + + /// 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 ApiManagementResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ApiManagementServiceResources in the ResourceGroupResource. + /// An object representing collection of ApiManagementServiceResources and their operations over a ApiManagementServiceResource. + public virtual ApiManagementServiceCollection GetApiManagementServices() + { + return GetCachedClient(client => new ApiManagementServiceCollection(client, Id)); + } + + /// + /// Gets an API Management service resource description. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName} + /// + /// + /// Operation Id + /// ApiManagementService_Get + /// + /// + /// + /// The name of the API Management service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApiManagementServiceAsync(string serviceName, CancellationToken cancellationToken = default) + { + return await GetApiManagementServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an API Management service resource description. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName} + /// + /// + /// Operation Id + /// ApiManagementService_Get + /// + /// + /// + /// The name of the API Management service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApiManagementService(string serviceName, CancellationToken cancellationToken = default) + { + return GetApiManagementServices().Get(serviceName, cancellationToken); + } + } +} diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementSubscriptionMockingExtension.cs similarity index 77% rename from sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementSubscriptionMockingExtension.cs index b0e7d9db183e..6614bf1442ff 100644 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ApiManagementSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ApiManagement; using Azure.ResourceManager.ApiManagement.Models; -namespace Azure.ResourceManager.ApiManagement +namespace Azure.ResourceManager.ApiManagement.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ApiManagementSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _apiManagementDeletedServiceDeletedServicesClientDiagnostics; private DeletedServicesRestOperations _apiManagementDeletedServiceDeletedServicesRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _apiManagementSkusClientDiagnostics; private ApiManagementSkusRestOperations _apiManagementSkusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ApiManagementSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ApiManagementSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -56,7 +57,55 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ApiManagementDeletedServiceResources and their operations over a ApiManagementDeletedServiceResource. public virtual ApiManagementDeletedServiceCollection GetApiManagementDeletedServices() { - return GetCachedClient(Client => new ApiManagementDeletedServiceCollection(Client, Id)); + return GetCachedClient(client => new ApiManagementDeletedServiceCollection(client, Id)); + } + + /// + /// Get soft-deleted Api Management Service by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName} + /// + /// + /// Operation Id + /// DeletedServices_GetByName + /// + /// + /// + /// The location of the deleted API Management service. + /// The name of the API Management service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApiManagementDeletedServiceAsync(AzureLocation location, string serviceName, CancellationToken cancellationToken = default) + { + return await GetApiManagementDeletedServices().GetAsync(location, serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get soft-deleted Api Management Service by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName} + /// + /// + /// Operation Id + /// DeletedServices_GetByName + /// + /// + /// + /// The location of the deleted API Management service. + /// The name of the API Management service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApiManagementDeletedService(AzureLocation location, string serviceName, CancellationToken cancellationToken = default) + { + return GetApiManagementDeletedServices().Get(location, serviceName, cancellationToken); } /// @@ -78,7 +127,7 @@ public virtual AsyncPageable GetApiManageme { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementDeletedServiceDeletedServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementDeletedServiceDeletedServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiManagementDeletedServiceResource(Client, ApiManagementDeletedServiceData.DeserializeApiManagementDeletedServiceData(e)), ApiManagementDeletedServiceDeletedServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementDeletedServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiManagementDeletedServiceResource(Client, ApiManagementDeletedServiceData.DeserializeApiManagementDeletedServiceData(e)), ApiManagementDeletedServiceDeletedServicesClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementDeletedServices", "value", "nextLink", cancellationToken); } /// @@ -100,7 +149,7 @@ public virtual Pageable GetApiManagementDel { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementDeletedServiceDeletedServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementDeletedServiceDeletedServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiManagementDeletedServiceResource(Client, ApiManagementDeletedServiceData.DeserializeApiManagementDeletedServiceData(e)), ApiManagementDeletedServiceDeletedServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementDeletedServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiManagementDeletedServiceResource(Client, ApiManagementDeletedServiceData.DeserializeApiManagementDeletedServiceData(e)), ApiManagementDeletedServiceDeletedServicesClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementDeletedServices", "value", "nextLink", cancellationToken); } /// @@ -122,7 +171,7 @@ public virtual AsyncPageable GetApiManagementServi { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementServiceRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementServiceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiManagementServiceResource(Client, ApiManagementServiceData.DeserializeApiManagementServiceData(e)), ApiManagementServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApiManagementServiceResource(Client, ApiManagementServiceData.DeserializeApiManagementServiceData(e)), ApiManagementServiceClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementServices", "value", "nextLink", cancellationToken); } /// @@ -144,7 +193,7 @@ public virtual Pageable GetApiManagementServices(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementServiceRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementServiceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiManagementServiceResource(Client, ApiManagementServiceData.DeserializeApiManagementServiceData(e)), ApiManagementServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApiManagementServiceResource(Client, ApiManagementServiceData.DeserializeApiManagementServiceData(e)), ApiManagementServiceClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementServices", "value", "nextLink", cancellationToken); } /// @@ -162,9 +211,12 @@ public virtual Pageable GetApiManagementServices(C /// /// Parameters supplied to the CheckNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckApiManagementServiceNameAvailabilityAsync(ApiManagementServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ApiManagementServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckApiManagementServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ApiManagementServiceClientDiagnostics.CreateScope("ApiManagementSubscriptionMockingExtension.CheckApiManagementServiceNameAvailability"); scope.Start(); try { @@ -193,9 +245,12 @@ public virtual async Task> /// /// Parameters supplied to the CheckNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual Response CheckApiManagementServiceNameAvailability(ApiManagementServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ApiManagementServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckApiManagementServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ApiManagementServiceClientDiagnostics.CreateScope("ApiManagementSubscriptionMockingExtension.CheckApiManagementServiceNameAvailability"); scope.Start(); try { @@ -225,7 +280,7 @@ public virtual Response CheckApiMana /// The cancellation token to use. public virtual async Task> GetApiManagementServiceDomainOwnershipIdentifierAsync(CancellationToken cancellationToken = default) { - using var scope = ApiManagementServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApiManagementServiceDomainOwnershipIdentifier"); + using var scope = ApiManagementServiceClientDiagnostics.CreateScope("ApiManagementSubscriptionMockingExtension.GetApiManagementServiceDomainOwnershipIdentifier"); scope.Start(); try { @@ -255,7 +310,7 @@ public virtual async Task The cancellation token to use. public virtual Response GetApiManagementServiceDomainOwnershipIdentifier(CancellationToken cancellationToken = default) { - using var scope = ApiManagementServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApiManagementServiceDomainOwnershipIdentifier"); + using var scope = ApiManagementServiceClientDiagnostics.CreateScope("ApiManagementSubscriptionMockingExtension.GetApiManagementServiceDomainOwnershipIdentifier"); scope.Start(); try { @@ -288,7 +343,7 @@ public virtual AsyncPageable GetApiManagementSkusAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApiManagementSku.DeserializeApiManagementSku, ApiManagementSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApiManagementSku.DeserializeApiManagementSku, ApiManagementSkusClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementSkus", "value", "nextLink", cancellationToken); } /// @@ -310,7 +365,7 @@ public virtual Pageable GetApiManagementSkus(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => ApiManagementSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApiManagementSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApiManagementSku.DeserializeApiManagementSku, ApiManagementSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApiManagementSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApiManagementSku.DeserializeApiManagementSku, ApiManagementSkusClientDiagnostics, Pipeline, "ApiManagementSubscriptionMockingExtension.GetApiManagementSkus", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 424939d021d5..000000000000 --- a/sdk/apimanagement/Azure.ResourceManager.ApiManagement/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ApiManagement -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ApiManagementServiceResources in the ResourceGroupResource. - /// An object representing collection of ApiManagementServiceResources and their operations over a ApiManagementServiceResource. - public virtual ApiManagementServiceCollection GetApiManagementServices() - { - return GetCachedClient(Client => new ApiManagementServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationArmClientMockingExtension.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationArmClientMockingExtension.cs new file mode 100644 index 000000000000..c7c1d5117596 --- /dev/null +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppComplianceAutomation; + +namespace Azure.ResourceManager.AppComplianceAutomation.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AppComplianceAutomationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppComplianceAutomationArmClientMockingExtension() + { + } + + /// 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 AppComplianceAutomationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AppComplianceAutomationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ReportResource GetReportResource(ResourceIdentifier id) + { + ReportResource.ValidateResourceId(id); + return new ReportResource(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 SnapshotResource GetSnapshotResource(ResourceIdentifier id) + { + SnapshotResource.ValidateResourceId(id); + return new SnapshotResource(Client, id); + } + } +} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationExtensions.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationExtensions.cs index ff726ecb921f..219136f62749 100644 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationExtensions.cs +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AppComplianceAutomation.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.AppComplianceAutomation @@ -18,65 +19,60 @@ namespace Azure.ResourceManager.AppComplianceAutomation /// A class to add extension methods to Azure.ResourceManager.AppComplianceAutomation. public static partial class AppComplianceAutomationExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static AppComplianceAutomationArmClientMockingExtension GetAppComplianceAutomationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AppComplianceAutomationArmClientMockingExtension(client0)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppComplianceAutomationTenantMockingExtension GetAppComplianceAutomationTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppComplianceAutomationTenantMockingExtension(client, resource.Id)); } - #region ReportResource + /// /// 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. /// Returns a object. public static ReportResource GetReportResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReportResource.ValidateResourceId(id); - return new ReportResource(client, id); - } - ); + return GetAppComplianceAutomationArmClientMockingExtension(client).GetReportResource(id); } - #endregion - #region SnapshotResource /// /// 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. /// Returns a object. public static SnapshotResource GetSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SnapshotResource.ValidateResourceId(id); - return new SnapshotResource(client, id); - } - ); + return GetAppComplianceAutomationArmClientMockingExtension(client).GetSnapshotResource(id); } - #endregion - /// Gets a collection of ReportResources in the TenantResource. + /// + /// Gets a collection of ReportResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ReportResources and their operations over a ReportResource. public static ReportResourceCollection GetReportResources(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetReportResources(); + return GetAppComplianceAutomationTenantMockingExtension(tenantResource).GetReportResources(); } /// @@ -91,16 +87,20 @@ public static ReportResourceCollection GetReportResources(this TenantResource te /// Report_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Report Name. /// The cancellation token to use. - /// 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 static async Task> GetReportResourceAsync(this TenantResource tenantResource, string reportName, CancellationToken cancellationToken = default) { - return await tenantResource.GetReportResources().GetAsync(reportName, cancellationToken).ConfigureAwait(false); + return await GetAppComplianceAutomationTenantMockingExtension(tenantResource).GetReportResourceAsync(reportName, cancellationToken).ConfigureAwait(false); } /// @@ -115,16 +115,20 @@ public static async Task> GetReportResourceAsync(this T /// Report_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Report Name. /// The cancellation token to use. - /// 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 static Response GetReportResource(this TenantResource tenantResource, string reportName, CancellationToken cancellationToken = default) { - return tenantResource.GetReportResources().Get(reportName, cancellationToken); + return GetAppComplianceAutomationTenantMockingExtension(tenantResource).GetReportResource(reportName, cancellationToken); } } } diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationTenantMockingExtension.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationTenantMockingExtension.cs new file mode 100644 index 000000000000..9b955f85bc7c --- /dev/null +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/AppComplianceAutomationTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppComplianceAutomation; + +namespace Azure.ResourceManager.AppComplianceAutomation.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class AppComplianceAutomationTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppComplianceAutomationTenantMockingExtension() + { + } + + /// 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 AppComplianceAutomationTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ReportResources in the TenantResource. + /// An object representing collection of ReportResources and their operations over a ReportResource. + public virtual ReportResourceCollection GetReportResources() + { + return GetCachedClient(client => new ReportResourceCollection(client, Id)); + } + + /// + /// Get the AppComplianceAutomation report and its properties. + /// + /// + /// Request Path + /// /providers/Microsoft.AppComplianceAutomation/reports/{reportName} + /// + /// + /// Operation Id + /// Report_Get + /// + /// + /// + /// Report Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReportResourceAsync(string reportName, CancellationToken cancellationToken = default) + { + return await GetReportResources().GetAsync(reportName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the AppComplianceAutomation report and its properties. + /// + /// + /// Request Path + /// /providers/Microsoft.AppComplianceAutomation/reports/{reportName} + /// + /// + /// Operation Id + /// Report_Get + /// + /// + /// + /// Report Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReportResource(string reportName, CancellationToken cancellationToken = default) + { + return GetReportResources().Get(reportName, cancellationToken); + } + } +} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 4aa288688b79..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AppComplianceAutomation -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ReportResources in the TenantResource. - /// An object representing collection of ReportResources and their operations over a ReportResource. - public virtual ReportResourceCollection GetReportResources() - { - return GetCachedClient(Client => new ReportResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/ReportResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/ReportResource.cs index ef8c111c5c9e..f78158d5aa8a 100644 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/ReportResource.cs +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/Generated/ReportResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SnapshotResources and their operations over a SnapshotResource. public virtual SnapshotResourceCollection GetSnapshotResources() { - return GetCachedClient(Client => new SnapshotResourceCollection(Client, Id)); + return GetCachedClient(client => new SnapshotResourceCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SnapshotResourceCollection GetSnapshotResources() /// /// Snapshot Name. /// The cancellation token to use. - /// 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> GetSnapshotResourceAsync(string snapshotName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSnapshotResourceAsync(s /// /// Snapshot Name. /// The cancellation token to use. - /// 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 GetSnapshotResource(string snapshotName, CancellationToken cancellationToken = default) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs index f8e89f86a9ec..7e57eaf5509c 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationStoreResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppConfigurationPrivateEndpointConnectionResources and their operations over a AppConfigurationPrivateEndpointConnectionResource. public virtual AppConfigurationPrivateEndpointConnectionCollection GetAppConfigurationPrivateEndpointConnections() { - return GetCachedClient(Client => new AppConfigurationPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new AppConfigurationPrivateEndpointConnectionCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual AppConfigurationPrivateEndpointConnectionCollection GetAppConfigu /// /// Private endpoint connection name. /// The cancellation token to use. - /// 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> GetAppConfigurationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task /// Private endpoint connection name. /// The cancellation token to use. - /// 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 GetAppConfigurationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetAp /// An object representing collection of AppConfigurationPrivateLinkResources and their operations over a AppConfigurationPrivateLinkResource. public virtual AppConfigurationPrivateLinkResourceCollection GetAppConfigurationPrivateLinkResources() { - return GetCachedClient(Client => new AppConfigurationPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new AppConfigurationPrivateLinkResourceCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual AppConfigurationPrivateLinkResourceCollection GetAppConfiguration /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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> GetAppConfigurationPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetAppC /// /// The name of the private link resource group. /// The cancellation token to use. - /// 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 GetAppConfigurationPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetAppConfiguration /// An object representing collection of AppConfigurationKeyValueResources and their operations over a AppConfigurationKeyValueResource. public virtual AppConfigurationKeyValueCollection GetAppConfigurationKeyValues() { - return GetCachedClient(Client => new AppConfigurationKeyValueCollection(Client, Id)); + return GetCachedClient(client => new AppConfigurationKeyValueCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual AppConfigurationKeyValueCollection GetAppConfigurationKeyValues() /// /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. /// The cancellation token to use. - /// 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> GetAppConfigurationKeyValueAsync(string keyValueName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetAppConf /// /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. /// The cancellation token to use. - /// 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 GetAppConfigurationKeyValue(string keyValueName, CancellationToken cancellationToken = default) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationArmClientMockingExtension.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationArmClientMockingExtension.cs new file mode 100644 index 000000000000..8b6cb3a998a0 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppConfiguration; + +namespace Azure.ResourceManager.AppConfiguration.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AppConfigurationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppConfigurationArmClientMockingExtension() + { + } + + /// 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 AppConfigurationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AppConfigurationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppConfigurationStoreResource GetAppConfigurationStoreResource(ResourceIdentifier id) + { + AppConfigurationStoreResource.ValidateResourceId(id); + return new AppConfigurationStoreResource(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 DeletedAppConfigurationStoreResource GetDeletedAppConfigurationStoreResource(ResourceIdentifier id) + { + DeletedAppConfigurationStoreResource.ValidateResourceId(id); + return new DeletedAppConfigurationStoreResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + AppConfigurationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new AppConfigurationPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(ResourceIdentifier id) + { + AppConfigurationPrivateLinkResource.ValidateResourceId(id); + return new AppConfigurationPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppConfigurationKeyValueResource GetAppConfigurationKeyValueResource(ResourceIdentifier id) + { + AppConfigurationKeyValueResource.ValidateResourceId(id); + return new AppConfigurationKeyValueResource(Client, id); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs index 19bdec3a69ec..7ad4677be311 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AppConfiguration.Mocking; using Azure.ResourceManager.AppConfiguration.Models; using Azure.ResourceManager.Resources; @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.AppConfiguration /// A class to add extension methods to Azure.ResourceManager.AppConfiguration. public static partial class AppConfigurationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AppConfigurationArmClientMockingExtension GetAppConfigurationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AppConfigurationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppConfigurationResourceGroupMockingExtension GetAppConfigurationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppConfigurationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AppConfigurationSubscriptionMockingExtension GetAppConfigurationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AppConfigurationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AppConfigurationStoreResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppConfigurationStoreResource GetAppConfigurationStoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppConfigurationStoreResource.ValidateResourceId(id); - return new AppConfigurationStoreResource(client, id); - } - ); + return GetAppConfigurationArmClientMockingExtension(client).GetAppConfigurationStoreResource(id); } - #endregion - #region DeletedAppConfigurationStoreResource /// /// 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. /// Returns a object. public static DeletedAppConfigurationStoreResource GetDeletedAppConfigurationStoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedAppConfigurationStoreResource.ValidateResourceId(id); - return new DeletedAppConfigurationStoreResource(client, id); - } - ); + return GetAppConfigurationArmClientMockingExtension(client).GetDeletedAppConfigurationStoreResource(id); } - #endregion - #region AppConfigurationPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppConfigurationPrivateEndpointConnectionResource GetAppConfigurationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppConfigurationPrivateEndpointConnectionResource.ValidateResourceId(id); - return new AppConfigurationPrivateEndpointConnectionResource(client, id); - } - ); + return GetAppConfigurationArmClientMockingExtension(client).GetAppConfigurationPrivateEndpointConnectionResource(id); } - #endregion - #region AppConfigurationPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppConfigurationPrivateLinkResource GetAppConfigurationPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppConfigurationPrivateLinkResource.ValidateResourceId(id); - return new AppConfigurationPrivateLinkResource(client, id); - } - ); + return GetAppConfigurationArmClientMockingExtension(client).GetAppConfigurationPrivateLinkResource(id); } - #endregion - #region AppConfigurationKeyValueResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppConfigurationKeyValueResource GetAppConfigurationKeyValueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppConfigurationKeyValueResource.ValidateResourceId(id); - return new AppConfigurationKeyValueResource(client, id); - } - ); + return GetAppConfigurationArmClientMockingExtension(client).GetAppConfigurationKeyValueResource(id); } - #endregion - /// Gets a collection of AppConfigurationStoreResources in the ResourceGroupResource. + /// + /// Gets a collection of AppConfigurationStoreResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppConfigurationStoreResources and their operations over a AppConfigurationStoreResource. public static AppConfigurationStoreCollection GetAppConfigurationStores(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppConfigurationStores(); + return GetAppConfigurationResourceGroupMockingExtension(resourceGroupResource).GetAppConfigurationStores(); } /// @@ -165,16 +141,20 @@ public static AppConfigurationStoreCollection GetAppConfigurationStores(this Res /// ConfigurationStores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the configuration store. /// The cancellation token to use. - /// 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 static async Task> GetAppConfigurationStoreAsync(this ResourceGroupResource resourceGroupResource, string configStoreName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppConfigurationStores().GetAsync(configStoreName, cancellationToken).ConfigureAwait(false); + return await GetAppConfigurationResourceGroupMockingExtension(resourceGroupResource).GetAppConfigurationStoreAsync(configStoreName, cancellationToken).ConfigureAwait(false); } /// @@ -189,24 +169,34 @@ public static async Task> GetAppConfigur /// ConfigurationStores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the configuration store. /// The cancellation token to use. - /// 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 static Response GetAppConfigurationStore(this ResourceGroupResource resourceGroupResource, string configStoreName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppConfigurationStores().Get(configStoreName, cancellationToken); + return GetAppConfigurationResourceGroupMockingExtension(resourceGroupResource).GetAppConfigurationStore(configStoreName, cancellationToken); } - /// Gets a collection of DeletedAppConfigurationStoreResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedAppConfigurationStoreResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeletedAppConfigurationStoreResources and their operations over a DeletedAppConfigurationStoreResource. public static DeletedAppConfigurationStoreCollection GetDeletedAppConfigurationStores(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAppConfigurationStores(); + return GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).GetDeletedAppConfigurationStores(); } /// @@ -221,17 +211,21 @@ public static DeletedAppConfigurationStoreCollection GetDeletedAppConfigurationS /// ConfigurationStores_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. /// The name of the configuration store. /// The cancellation token to use. - /// 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 static async Task> GetDeletedAppConfigurationStoreAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string configStoreName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedAppConfigurationStores().GetAsync(location, configStoreName, cancellationToken).ConfigureAwait(false); + return await GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).GetDeletedAppConfigurationStoreAsync(location, configStoreName, cancellationToken).ConfigureAwait(false); } /// @@ -246,17 +240,21 @@ public static async Task> GetDele /// ConfigurationStores_GetDeleted /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. /// The name of the configuration store. /// The cancellation token to use. - /// 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 static Response GetDeletedAppConfigurationStore(this SubscriptionResource subscriptionResource, AzureLocation location, string configStoreName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedAppConfigurationStores().Get(location, configStoreName, cancellationToken); + return GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).GetDeletedAppConfigurationStore(location, configStoreName, cancellationToken); } /// @@ -271,6 +269,10 @@ public static Response GetDeletedAppConfig /// ConfigurationStores_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @@ -278,7 +280,7 @@ public static Response GetDeletedAppConfig /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppConfigurationStoresAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppConfigurationStoresAsync(skipToken, cancellationToken); + return GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).GetAppConfigurationStoresAsync(skipToken, cancellationToken); } /// @@ -293,6 +295,10 @@ public static AsyncPageable GetAppConfigurationSt /// ConfigurationStores_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @@ -300,7 +306,7 @@ public static AsyncPageable GetAppConfigurationSt /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppConfigurationStores(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppConfigurationStores(skipToken, cancellationToken); + return GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).GetAppConfigurationStores(skipToken, cancellationToken); } /// @@ -315,6 +321,10 @@ public static Pageable GetAppConfigurationStores( /// CheckAppConfigurationNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The object containing information for the availability request. @@ -322,9 +332,7 @@ public static Pageable GetAppConfigurationStores( /// is null. public static async Task> CheckAppConfigurationNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AppConfigurationNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppConfigurationNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).CheckAppConfigurationNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -339,6 +347,10 @@ public static async Task> Check /// CheckAppConfigurationNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The object containing information for the availability request. @@ -346,9 +358,7 @@ public static async Task> Check /// is null. public static Response CheckAppConfigurationNameAvailability(this SubscriptionResource subscriptionResource, AppConfigurationNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppConfigurationNameAvailability(content, cancellationToken); + return GetAppConfigurationSubscriptionMockingExtension(subscriptionResource).CheckAppConfigurationNameAvailability(content, cancellationToken); } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationResourceGroupMockingExtension.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..098522dc497b --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppConfiguration; + +namespace Azure.ResourceManager.AppConfiguration.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AppConfigurationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppConfigurationResourceGroupMockingExtension() + { + } + + /// 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 AppConfigurationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AppConfigurationStoreResources in the ResourceGroupResource. + /// An object representing collection of AppConfigurationStoreResources and their operations over a AppConfigurationStoreResource. + public virtual AppConfigurationStoreCollection GetAppConfigurationStores() + { + return GetCachedClient(client => new AppConfigurationStoreCollection(client, Id)); + } + + /// + /// Gets the properties of the specified configuration store. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName} + /// + /// + /// Operation Id + /// ConfigurationStores_Get + /// + /// + /// + /// The name of the configuration store. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppConfigurationStoreAsync(string configStoreName, CancellationToken cancellationToken = default) + { + return await GetAppConfigurationStores().GetAsync(configStoreName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified configuration store. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName} + /// + /// + /// Operation Id + /// ConfigurationStores_Get + /// + /// + /// + /// The name of the configuration store. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppConfigurationStore(string configStoreName, CancellationToken cancellationToken = default) + { + return GetAppConfigurationStores().Get(configStoreName, cancellationToken); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationSubscriptionMockingExtension.cs similarity index 68% rename from sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationSubscriptionMockingExtension.cs index 38b913e098b6..698d3991d4d7 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/AppConfigurationSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppConfiguration; using Azure.ResourceManager.AppConfiguration.Models; -namespace Azure.ResourceManager.AppConfiguration +namespace Azure.ResourceManager.AppConfiguration.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AppConfigurationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _appConfigurationStoreConfigurationStoresClientDiagnostics; private ConfigurationStoresRestOperations _appConfigurationStoreConfigurationStoresRestClient; private ClientDiagnostics _defaultClientDiagnostics; private AppConfigurationManagementRestOperations _defaultRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppConfigurationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppConfigurationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -52,7 +53,55 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of DeletedAppConfigurationStoreResources and their operations over a DeletedAppConfigurationStoreResource. public virtual DeletedAppConfigurationStoreCollection GetDeletedAppConfigurationStores() { - return GetCachedClient(Client => new DeletedAppConfigurationStoreCollection(Client, Id)); + return GetCachedClient(client => new DeletedAppConfigurationStoreCollection(client, Id)); + } + + /// + /// Gets a deleted Azure app configuration store. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName} + /// + /// + /// Operation Id + /// ConfigurationStores_GetDeleted + /// + /// + /// + /// The location in which uniqueness will be verified. + /// The name of the configuration store. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedAppConfigurationStoreAsync(AzureLocation location, string configStoreName, CancellationToken cancellationToken = default) + { + return await GetDeletedAppConfigurationStores().GetAsync(location, configStoreName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deleted Azure app configuration store. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName} + /// + /// + /// Operation Id + /// ConfigurationStores_GetDeleted + /// + /// + /// + /// The location in which uniqueness will be verified. + /// The name of the configuration store. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedAppConfigurationStore(AzureLocation location, string configStoreName, CancellationToken cancellationToken = default) + { + return GetDeletedAppConfigurationStores().Get(location, configStoreName, cancellationToken); } /// @@ -75,7 +124,7 @@ public virtual AsyncPageable GetAppConfigurationS { HttpMessage FirstPageRequest(int? pageSizeHint) => AppConfigurationStoreConfigurationStoresRestClient.CreateListRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppConfigurationStoreConfigurationStoresRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppConfigurationStoreResource(Client, AppConfigurationStoreData.DeserializeAppConfigurationStoreData(e)), AppConfigurationStoreConfigurationStoresClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppConfigurationStores", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppConfigurationStoreResource(Client, AppConfigurationStoreData.DeserializeAppConfigurationStoreData(e)), AppConfigurationStoreConfigurationStoresClientDiagnostics, Pipeline, "AppConfigurationSubscriptionMockingExtension.GetAppConfigurationStores", "value", "nextLink", cancellationToken); } /// @@ -98,7 +147,7 @@ public virtual Pageable GetAppConfigurationStores { HttpMessage FirstPageRequest(int? pageSizeHint) => AppConfigurationStoreConfigurationStoresRestClient.CreateListRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppConfigurationStoreConfigurationStoresRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppConfigurationStoreResource(Client, AppConfigurationStoreData.DeserializeAppConfigurationStoreData(e)), AppConfigurationStoreConfigurationStoresClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppConfigurationStores", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppConfigurationStoreResource(Client, AppConfigurationStoreData.DeserializeAppConfigurationStoreData(e)), AppConfigurationStoreConfigurationStoresClientDiagnostics, Pipeline, "AppConfigurationSubscriptionMockingExtension.GetAppConfigurationStores", "value", "nextLink", cancellationToken); } /// @@ -116,9 +165,12 @@ public virtual Pageable GetAppConfigurationStores /// /// The object containing information for the availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckAppConfigurationNameAvailabilityAsync(AppConfigurationNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppConfigurationNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppConfigurationSubscriptionMockingExtension.CheckAppConfigurationNameAvailability"); scope.Start(); try { @@ -147,9 +199,12 @@ public virtual async Task> Chec /// /// The object containing information for the availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckAppConfigurationNameAvailability(AppConfigurationNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppConfigurationNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppConfigurationSubscriptionMockingExtension.CheckAppConfigurationNameAvailability"); scope.Start(); try { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index aeccdc3ce25d..000000000000 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AppConfiguration -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AppConfigurationStoreResources in the ResourceGroupResource. - /// An object representing collection of AppConfigurationStoreResources and their operations over a AppConfigurationStoreResource. - public virtual AppConfigurationStoreCollection GetAppConfigurationStores() - { - return GetCachedClient(Client => new AppConfigurationStoreCollection(Client, Id)); - } - } -} diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/ApplicationInsightsComponentResource.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/ApplicationInsightsComponentResource.cs index cf8e7b14dbbc..d007486758d5 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/ApplicationInsightsComponentResource.cs +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/ApplicationInsightsComponentResource.cs @@ -147,7 +147,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ComponentLinkedStorageAccountResources and their operations over a ComponentLinkedStorageAccountResource. public virtual ComponentLinkedStorageAccountCollection GetComponentLinkedStorageAccounts() { - return GetCachedClient(Client => new ComponentLinkedStorageAccountCollection(Client, Id)); + return GetCachedClient(client => new ComponentLinkedStorageAccountCollection(client, Id)); } /// diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsArmClientMockingExtension.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsArmClientMockingExtension.cs new file mode 100644 index 000000000000..49c786bfd3f1 --- /dev/null +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsArmClientMockingExtension.cs @@ -0,0 +1,196 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ApplicationInsights; +using Azure.ResourceManager.ApplicationInsights.Models; + +namespace Azure.ResourceManager.ApplicationInsights.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ApplicationInsightsArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _liveTokenClientDiagnostics; + private LiveTokenRestOperations _liveTokenRestClient; + + /// Initializes a new instance of the class for mocking. + protected ApplicationInsightsArmClientMockingExtension() + { + } + + /// 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 ApplicationInsightsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ApplicationInsightsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics LiveTokenClientDiagnostics => _liveTokenClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ApplicationInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private LiveTokenRestOperations LiveTokenRestClient => _liveTokenRestClient ??= new LiveTokenRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// **Gets an access token for live metrics stream data.** + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken + /// + /// + /// Operation Id + /// LiveToken_Get + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual async Task> GetLiveTokenAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = LiveTokenClientDiagnostics.CreateScope("ApplicationInsightsArmClientMockingExtension.GetLiveToken"); + scope0.Start(); + try + { + var response = await LiveTokenRestClient.GetAsync(scope, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// **Gets an access token for live metrics stream data.** + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken + /// + /// + /// Operation Id + /// LiveToken_Get + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + public virtual Response GetLiveToken(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + using var scope0 = LiveTokenClientDiagnostics.CreateScope("ApplicationInsightsArmClientMockingExtension.GetLiveToken"); + scope0.Start(); + try + { + var response = LiveTokenRestClient.Get(scope, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationInsightsComponentResource GetApplicationInsightsComponentResource(ResourceIdentifier id) + { + ApplicationInsightsComponentResource.ValidateResourceId(id); + return new ApplicationInsightsComponentResource(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 WebTestResource GetWebTestResource(ResourceIdentifier id) + { + WebTestResource.ValidateResourceId(id); + return new WebTestResource(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 WorkbookTemplateResource GetWorkbookTemplateResource(ResourceIdentifier id) + { + WorkbookTemplateResource.ValidateResourceId(id); + return new WorkbookTemplateResource(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 MyWorkbookResource GetMyWorkbookResource(ResourceIdentifier id) + { + MyWorkbookResource.ValidateResourceId(id); + return new MyWorkbookResource(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 WorkbookResource GetWorkbookResource(ResourceIdentifier id) + { + WorkbookResource.ValidateResourceId(id); + return new WorkbookResource(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 WorkbookRevisionResource GetWorkbookRevisionResource(ResourceIdentifier id) + { + WorkbookRevisionResource.ValidateResourceId(id); + return new WorkbookRevisionResource(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 ComponentLinkedStorageAccountResource GetComponentLinkedStorageAccountResource(ResourceIdentifier id) + { + ComponentLinkedStorageAccountResource.ValidateResourceId(id); + return new ComponentLinkedStorageAccountResource(Client, id); + } + } +} diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsExtensions.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsExtensions.cs index d6ac02a73524..ece7e1985439 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsExtensions.cs +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsExtensions.cs @@ -12,6 +12,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ApplicationInsights.Mocking; using Azure.ResourceManager.ApplicationInsights.Models; using Azure.ResourceManager.Resources; @@ -20,234 +21,195 @@ namespace Azure.ResourceManager.ApplicationInsights /// A class to add extension methods to Azure.ResourceManager.ApplicationInsights. public static partial class ApplicationInsightsExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ApplicationInsightsArmClientMockingExtension GetApplicationInsightsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ApplicationInsightsArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ApplicationInsightsResourceGroupMockingExtension GetApplicationInsightsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ApplicationInsightsResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ApplicationInsightsSubscriptionMockingExtension GetApplicationInsightsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ApplicationInsightsSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// **Gets an access token for live metrics stream data.** + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken + /// + /// + /// Operation Id + /// LiveToken_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static async Task> GetLiveTokenAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return await GetApplicationInsightsArmClientMockingExtension(client).GetLiveTokenAsync(scope, cancellationToken).ConfigureAwait(false); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + /// + /// **Gets an access token for live metrics stream data.** + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken + /// + /// + /// Operation Id + /// LiveToken_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static Response GetLiveToken(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return GetApplicationInsightsArmClientMockingExtension(client).GetLiveToken(scope, cancellationToken); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ApplicationInsightsComponentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApplicationInsightsComponentResource GetApplicationInsightsComponentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApplicationInsightsComponentResource.ValidateResourceId(id); - return new ApplicationInsightsComponentResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetApplicationInsightsComponentResource(id); } - #endregion - #region WebTestResource /// /// 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. /// Returns a object. public static WebTestResource GetWebTestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebTestResource.ValidateResourceId(id); - return new WebTestResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetWebTestResource(id); } - #endregion - #region WorkbookTemplateResource /// /// 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. /// Returns a object. public static WorkbookTemplateResource GetWorkbookTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkbookTemplateResource.ValidateResourceId(id); - return new WorkbookTemplateResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetWorkbookTemplateResource(id); } - #endregion - #region MyWorkbookResource /// /// 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. /// Returns a object. public static MyWorkbookResource GetMyWorkbookResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MyWorkbookResource.ValidateResourceId(id); - return new MyWorkbookResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetMyWorkbookResource(id); } - #endregion - #region WorkbookResource /// /// 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. /// Returns a object. public static WorkbookResource GetWorkbookResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkbookResource.ValidateResourceId(id); - return new WorkbookResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetWorkbookResource(id); } - #endregion - #region WorkbookRevisionResource /// /// 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. /// Returns a object. public static WorkbookRevisionResource GetWorkbookRevisionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkbookRevisionResource.ValidateResourceId(id); - return new WorkbookRevisionResource(client, id); - } - ); + return GetApplicationInsightsArmClientMockingExtension(client).GetWorkbookRevisionResource(id); } - #endregion - #region ComponentLinkedStorageAccountResource /// /// 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. /// Returns a object. public static ComponentLinkedStorageAccountResource GetComponentLinkedStorageAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ComponentLinkedStorageAccountResource.ValidateResourceId(id); - return new ComponentLinkedStorageAccountResource(client, id); - } - ); - } - #endregion - - /// - /// **Gets an access token for live metrics stream data.** - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken - /// - /// - /// Operation Id - /// LiveToken_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static async Task> GetLiveTokenAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) - { - return await GetArmResourceExtensionClient(client, scope).GetLiveTokenAsync(cancellationToken).ConfigureAwait(false); + return GetApplicationInsightsArmClientMockingExtension(client).GetComponentLinkedStorageAccountResource(id); } /// - /// **Gets an access token for live metrics stream data.** - /// + /// Gets a collection of ApplicationInsightsComponentResources in the ResourceGroupResource. /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken - /// - /// - /// Operation Id - /// LiveToken_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static Response GetLiveToken(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) - { - return GetArmResourceExtensionClient(client, scope).GetLiveToken(cancellationToken); - } - - /// Gets a collection of ApplicationInsightsComponentResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of ApplicationInsightsComponentResources and their operations over a ApplicationInsightsComponentResource. public static ApplicationInsightsComponentCollection GetApplicationInsightsComponents(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApplicationInsightsComponents(); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetApplicationInsightsComponents(); } /// @@ -262,16 +224,20 @@ public static ApplicationInsightsComponentCollection GetApplicationInsightsCompo /// Components_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static async Task> GetApplicationInsightsComponentAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetApplicationInsightsComponents().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetApplicationInsightsComponentAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -286,24 +252,34 @@ public static async Task> GetAppl /// Components_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static Response GetApplicationInsightsComponent(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetApplicationInsightsComponents().Get(resourceName, cancellationToken); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetApplicationInsightsComponent(resourceName, cancellationToken); } - /// Gets a collection of WebTestResources in the ResourceGroupResource. + /// + /// Gets a collection of WebTestResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WebTestResources and their operations over a WebTestResource. public static WebTestCollection GetWebTests(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWebTests(); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWebTests(); } /// @@ -318,16 +294,20 @@ public static WebTestCollection GetWebTests(this ResourceGroupResource resourceG /// WebTests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights WebTest resource. /// The cancellation token to use. - /// 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 static async Task> GetWebTestAsync(this ResourceGroupResource resourceGroupResource, string webTestName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWebTests().GetAsync(webTestName, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWebTestAsync(webTestName, cancellationToken).ConfigureAwait(false); } /// @@ -342,24 +322,34 @@ public static async Task> GetWebTestAsync(this Resourc /// WebTests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights WebTest resource. /// The cancellation token to use. - /// 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 static Response GetWebTest(this ResourceGroupResource resourceGroupResource, string webTestName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWebTests().Get(webTestName, cancellationToken); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWebTest(webTestName, cancellationToken); } - /// Gets a collection of WorkbookTemplateResources in the ResourceGroupResource. + /// + /// Gets a collection of WorkbookTemplateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WorkbookTemplateResources and their operations over a WorkbookTemplateResource. public static WorkbookTemplateCollection GetWorkbookTemplates(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWorkbookTemplates(); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbookTemplates(); } /// @@ -374,16 +364,20 @@ public static WorkbookTemplateCollection GetWorkbookTemplates(this ResourceGroup /// WorkbookTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static async Task> GetWorkbookTemplateAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWorkbookTemplates().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbookTemplateAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -398,24 +392,34 @@ public static async Task> GetWorkbookTemplate /// WorkbookTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static Response GetWorkbookTemplate(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWorkbookTemplates().Get(resourceName, cancellationToken); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbookTemplate(resourceName, cancellationToken); } - /// Gets a collection of MyWorkbookResources in the ResourceGroupResource. + /// + /// Gets a collection of MyWorkbookResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MyWorkbookResources and their operations over a MyWorkbookResource. public static MyWorkbookCollection GetMyWorkbooks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMyWorkbooks(); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetMyWorkbooks(); } /// @@ -430,16 +434,20 @@ public static MyWorkbookCollection GetMyWorkbooks(this ResourceGroupResource res /// MyWorkbooks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static async Task> GetMyWorkbookAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMyWorkbooks().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetMyWorkbookAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -454,24 +462,34 @@ public static async Task> GetMyWorkbookAsync(this R /// MyWorkbooks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Application Insights component resource. /// The cancellation token to use. - /// 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 static Response GetMyWorkbook(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMyWorkbooks().Get(resourceName, cancellationToken); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetMyWorkbook(resourceName, cancellationToken); } - /// Gets a collection of WorkbookResources in the ResourceGroupResource. + /// + /// Gets a collection of WorkbookResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WorkbookResources and their operations over a WorkbookResource. public static WorkbookCollection GetWorkbooks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWorkbooks(); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbooks(); } /// @@ -486,17 +504,21 @@ public static WorkbookCollection GetWorkbooks(this ResourceGroupResource resourc /// Workbooks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. /// The cancellation token to use. - /// 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 static async Task> GetWorkbookAsync(this ResourceGroupResource resourceGroupResource, string resourceName, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWorkbooks().GetAsync(resourceName, canFetchContent, cancellationToken).ConfigureAwait(false); + return await GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbookAsync(resourceName, canFetchContent, cancellationToken).ConfigureAwait(false); } /// @@ -511,17 +533,21 @@ public static async Task> GetWorkbookAsync(this Resou /// Workbooks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. /// The cancellation token to use. - /// 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 static Response GetWorkbook(this ResourceGroupResource resourceGroupResource, string resourceName, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWorkbooks().Get(resourceName, canFetchContent, cancellationToken); + return GetApplicationInsightsResourceGroupMockingExtension(resourceGroupResource).GetWorkbook(resourceName, canFetchContent, cancellationToken); } /// @@ -536,13 +562,17 @@ public static Response GetWorkbook(this ResourceGroupResource /// Components_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApplicationInsightsComponentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationInsightsComponentsAsync(cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetApplicationInsightsComponentsAsync(cancellationToken); } /// @@ -557,13 +587,17 @@ public static AsyncPageable GetApplication /// Components_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApplicationInsightsComponents(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationInsightsComponents(cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetApplicationInsightsComponents(cancellationToken); } /// @@ -578,13 +612,17 @@ public static Pageable GetApplicationInsig /// WebTests_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebTestsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebTestsAsync(cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetWebTestsAsync(cancellationToken); } /// @@ -599,13 +637,17 @@ public static AsyncPageable GetWebTestsAsync(this SubscriptionR /// WebTests_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebTests(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebTests(cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetWebTests(cancellationToken); } /// @@ -620,6 +662,10 @@ public static Pageable GetWebTests(this SubscriptionResource su /// MyWorkbooks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Category of workbook to return. @@ -629,7 +675,7 @@ public static Pageable GetWebTests(this SubscriptionResource su /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMyWorkbooksAsync(this SubscriptionResource subscriptionResource, CategoryType category, IEnumerable tags = null, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMyWorkbooksAsync(category, tags, canFetchContent, cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetMyWorkbooksAsync(category, tags, canFetchContent, cancellationToken); } /// @@ -644,6 +690,10 @@ public static AsyncPageable GetMyWorkbooksAsync(this Subscri /// MyWorkbooks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Category of workbook to return. @@ -653,7 +703,7 @@ public static AsyncPageable GetMyWorkbooksAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMyWorkbooks(this SubscriptionResource subscriptionResource, CategoryType category, IEnumerable tags = null, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMyWorkbooks(category, tags, canFetchContent, cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetMyWorkbooks(category, tags, canFetchContent, cancellationToken); } /// @@ -668,6 +718,10 @@ public static Pageable GetMyWorkbooks(this SubscriptionResou /// Workbooks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Category of workbook to return. @@ -677,7 +731,7 @@ public static Pageable GetMyWorkbooks(this SubscriptionResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWorkbooksAsync(this SubscriptionResource subscriptionResource, CategoryType category, IEnumerable tags = null, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWorkbooksAsync(category, tags, canFetchContent, cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetWorkbooksAsync(category, tags, canFetchContent, cancellationToken); } /// @@ -692,6 +746,10 @@ public static AsyncPageable GetWorkbooksAsync(this Subscriptio /// Workbooks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Category of workbook to return. @@ -701,7 +759,7 @@ public static AsyncPageable GetWorkbooksAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWorkbooks(this SubscriptionResource subscriptionResource, CategoryType category, IEnumerable tags = null, bool? canFetchContent = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWorkbooks(category, tags, canFetchContent, cancellationToken); + return GetApplicationInsightsSubscriptionMockingExtension(subscriptionResource).GetWorkbooks(category, tags, canFetchContent, cancellationToken); } } } diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsResourceGroupMockingExtension.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..75b848124a75 --- /dev/null +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsResourceGroupMockingExtension.cs @@ -0,0 +1,306 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ApplicationInsights; + +namespace Azure.ResourceManager.ApplicationInsights.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ApplicationInsightsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ApplicationInsightsResourceGroupMockingExtension() + { + } + + /// 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 ApplicationInsightsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ApplicationInsightsComponentResources in the ResourceGroupResource. + /// An object representing collection of ApplicationInsightsComponentResources and their operations over a ApplicationInsightsComponentResource. + public virtual ApplicationInsightsComponentCollection GetApplicationInsightsComponents() + { + return GetCachedClient(client => new ApplicationInsightsComponentCollection(client, Id)); + } + + /// + /// Returns an Application Insights component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName} + /// + /// + /// Operation Id + /// Components_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApplicationInsightsComponentAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetApplicationInsightsComponents().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns an Application Insights component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName} + /// + /// + /// Operation Id + /// Components_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApplicationInsightsComponent(string resourceName, CancellationToken cancellationToken = default) + { + return GetApplicationInsightsComponents().Get(resourceName, cancellationToken); + } + + /// Gets a collection of WebTestResources in the ResourceGroupResource. + /// An object representing collection of WebTestResources and their operations over a WebTestResource. + public virtual WebTestCollection GetWebTests() + { + return GetCachedClient(client => new WebTestCollection(client, Id)); + } + + /// + /// Get a specific Application Insights web test definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName} + /// + /// + /// Operation Id + /// WebTests_Get + /// + /// + /// + /// The name of the Application Insights WebTest resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebTestAsync(string webTestName, CancellationToken cancellationToken = default) + { + return await GetWebTests().GetAsync(webTestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific Application Insights web test definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName} + /// + /// + /// Operation Id + /// WebTests_Get + /// + /// + /// + /// The name of the Application Insights WebTest resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebTest(string webTestName, CancellationToken cancellationToken = default) + { + return GetWebTests().Get(webTestName, cancellationToken); + } + + /// Gets a collection of WorkbookTemplateResources in the ResourceGroupResource. + /// An object representing collection of WorkbookTemplateResources and their operations over a WorkbookTemplateResource. + public virtual WorkbookTemplateCollection GetWorkbookTemplates() + { + return GetCachedClient(client => new WorkbookTemplateCollection(client, Id)); + } + + /// + /// Get a single workbook template by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName} + /// + /// + /// Operation Id + /// WorkbookTemplates_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkbookTemplateAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetWorkbookTemplates().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a single workbook template by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName} + /// + /// + /// Operation Id + /// WorkbookTemplates_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkbookTemplate(string resourceName, CancellationToken cancellationToken = default) + { + return GetWorkbookTemplates().Get(resourceName, cancellationToken); + } + + /// Gets a collection of MyWorkbookResources in the ResourceGroupResource. + /// An object representing collection of MyWorkbookResources and their operations over a MyWorkbookResource. + public virtual MyWorkbookCollection GetMyWorkbooks() + { + return GetCachedClient(client => new MyWorkbookCollection(client, Id)); + } + + /// + /// Get a single private workbook by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName} + /// + /// + /// Operation Id + /// MyWorkbooks_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMyWorkbookAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetMyWorkbooks().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a single private workbook by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName} + /// + /// + /// Operation Id + /// MyWorkbooks_Get + /// + /// + /// + /// The name of the Application Insights component resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMyWorkbook(string resourceName, CancellationToken cancellationToken = default) + { + return GetMyWorkbooks().Get(resourceName, cancellationToken); + } + + /// Gets a collection of WorkbookResources in the ResourceGroupResource. + /// An object representing collection of WorkbookResources and their operations over a WorkbookResource. + public virtual WorkbookCollection GetWorkbooks() + { + return GetCachedClient(client => new WorkbookCollection(client, Id)); + } + + /// + /// Get a single workbook by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName} + /// + /// + /// Operation Id + /// Workbooks_Get + /// + /// + /// + /// The name of the resource. + /// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkbookAsync(string resourceName, bool? canFetchContent = null, CancellationToken cancellationToken = default) + { + return await GetWorkbooks().GetAsync(resourceName, canFetchContent, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a single workbook by its resourceName. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName} + /// + /// + /// Operation Id + /// Workbooks_Get + /// + /// + /// + /// The name of the resource. + /// Flag indicating whether or not to return the full content for each applicable workbook. If false, only return summary content for workbooks. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkbook(string resourceName, bool? canFetchContent = null, CancellationToken cancellationToken = default) + { + return GetWorkbooks().Get(resourceName, canFetchContent, cancellationToken); + } + } +} diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsSubscriptionMockingExtension.cs similarity index 91% rename from sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsSubscriptionMockingExtension.cs index ba6c2fd5c912..88688b252841 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ApplicationInsightsSubscriptionMockingExtension.cs @@ -12,12 +12,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ApplicationInsights; using Azure.ResourceManager.ApplicationInsights.Models; -namespace Azure.ResourceManager.ApplicationInsights +namespace Azure.ResourceManager.ApplicationInsights.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ApplicationInsightsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _applicationInsightsComponentComponentsClientDiagnostics; private ComponentsRestOperations _applicationInsightsComponentComponentsRestClient; @@ -28,15 +29,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _workbookClientDiagnostics; private WorkbooksRestOperations _workbookRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ApplicationInsightsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ApplicationInsightsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -74,7 +75,7 @@ public virtual AsyncPageable GetApplicatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationInsightsComponentComponentsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationInsightsComponentComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationInsightsComponentResource(Client, ApplicationInsightsComponentData.DeserializeApplicationInsightsComponentData(e)), ApplicationInsightsComponentComponentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationInsightsComponents", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationInsightsComponentResource(Client, ApplicationInsightsComponentData.DeserializeApplicationInsightsComponentData(e)), ApplicationInsightsComponentComponentsClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetApplicationInsightsComponents", "value", "nextLink", cancellationToken); } /// @@ -96,7 +97,7 @@ public virtual Pageable GetApplicationInsi { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationInsightsComponentComponentsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationInsightsComponentComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationInsightsComponentResource(Client, ApplicationInsightsComponentData.DeserializeApplicationInsightsComponentData(e)), ApplicationInsightsComponentComponentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationInsightsComponents", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationInsightsComponentResource(Client, ApplicationInsightsComponentData.DeserializeApplicationInsightsComponentData(e)), ApplicationInsightsComponentComponentsClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetApplicationInsightsComponents", "value", "nextLink", cancellationToken); } /// @@ -118,7 +119,7 @@ public virtual AsyncPageable GetWebTestsAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => WebTestRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebTestRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebTestResource(Client, WebTestData.DeserializeWebTestData(e)), WebTestClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebTests", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebTestResource(Client, WebTestData.DeserializeWebTestData(e)), WebTestClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetWebTests", "value", "nextLink", cancellationToken); } /// @@ -140,7 +141,7 @@ public virtual Pageable GetWebTests(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => WebTestRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebTestRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebTestResource(Client, WebTestData.DeserializeWebTestData(e)), WebTestClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebTests", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebTestResource(Client, WebTestData.DeserializeWebTestData(e)), WebTestClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetWebTests", "value", "nextLink", cancellationToken); } /// @@ -165,7 +166,7 @@ public virtual AsyncPageable GetMyWorkbooksAsync(CategoryTyp { HttpMessage FirstPageRequest(int? pageSizeHint) => MyWorkbookRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, category, tags, canFetchContent); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MyWorkbookRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, category, tags, canFetchContent); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MyWorkbookResource(Client, MyWorkbookData.DeserializeMyWorkbookData(e)), MyWorkbookClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMyWorkbooks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MyWorkbookResource(Client, MyWorkbookData.DeserializeMyWorkbookData(e)), MyWorkbookClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetMyWorkbooks", "value", "nextLink", cancellationToken); } /// @@ -190,7 +191,7 @@ public virtual Pageable GetMyWorkbooks(CategoryType category { HttpMessage FirstPageRequest(int? pageSizeHint) => MyWorkbookRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, category, tags, canFetchContent); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MyWorkbookRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, category, tags, canFetchContent); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MyWorkbookResource(Client, MyWorkbookData.DeserializeMyWorkbookData(e)), MyWorkbookClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMyWorkbooks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MyWorkbookResource(Client, MyWorkbookData.DeserializeMyWorkbookData(e)), MyWorkbookClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetMyWorkbooks", "value", "nextLink", cancellationToken); } /// @@ -215,7 +216,7 @@ public virtual AsyncPageable GetWorkbooksAsync(CategoryType ca { HttpMessage FirstPageRequest(int? pageSizeHint) => WorkbookRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, category, tags, canFetchContent); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WorkbookRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, category, tags, canFetchContent); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkbookResource(Client, WorkbookData.DeserializeWorkbookData(e)), WorkbookClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWorkbooks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkbookResource(Client, WorkbookData.DeserializeWorkbookData(e)), WorkbookClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetWorkbooks", "value", "nextLink", cancellationToken); } /// @@ -240,7 +241,7 @@ public virtual Pageable GetWorkbooks(CategoryType category, IE { HttpMessage FirstPageRequest(int? pageSizeHint) => WorkbookRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, category, tags, canFetchContent); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WorkbookRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, category, tags, canFetchContent); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkbookResource(Client, WorkbookData.DeserializeWorkbookData(e)), WorkbookClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWorkbooks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkbookResource(Client, WorkbookData.DeserializeWorkbookData(e)), WorkbookClientDiagnostics, Pipeline, "ApplicationInsightsSubscriptionMockingExtension.GetWorkbooks", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 89c956e7f076..000000000000 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.ApplicationInsights.Models; - -namespace Azure.ResourceManager.ApplicationInsights -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _liveTokenClientDiagnostics; - private LiveTokenRestOperations _liveTokenRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics LiveTokenClientDiagnostics => _liveTokenClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ApplicationInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private LiveTokenRestOperations LiveTokenRestClient => _liveTokenRestClient ??= new LiveTokenRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// **Gets an access token for live metrics stream data.** - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken - /// - /// - /// Operation Id - /// LiveToken_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetLiveTokenAsync(CancellationToken cancellationToken = default) - { - using var scope = LiveTokenClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetLiveToken"); - scope.Start(); - try - { - var response = await LiveTokenRestClient.GetAsync(Id, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// **Gets an access token for live metrics stream data.** - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/generatelivetoken - /// - /// - /// Operation Id - /// LiveToken_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetLiveToken(CancellationToken cancellationToken = default) - { - using var scope = LiveTokenClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetLiveToken"); - scope.Start(); - try - { - var response = LiveTokenRestClient.Get(Id, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 312f16219f00..000000000000 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ApplicationInsights -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ApplicationInsightsComponentResources in the ResourceGroupResource. - /// An object representing collection of ApplicationInsightsComponentResources and their operations over a ApplicationInsightsComponentResource. - public virtual ApplicationInsightsComponentCollection GetApplicationInsightsComponents() - { - return GetCachedClient(Client => new ApplicationInsightsComponentCollection(Client, Id)); - } - - /// Gets a collection of WebTestResources in the ResourceGroupResource. - /// An object representing collection of WebTestResources and their operations over a WebTestResource. - public virtual WebTestCollection GetWebTests() - { - return GetCachedClient(Client => new WebTestCollection(Client, Id)); - } - - /// Gets a collection of WorkbookTemplateResources in the ResourceGroupResource. - /// An object representing collection of WorkbookTemplateResources and their operations over a WorkbookTemplateResource. - public virtual WorkbookTemplateCollection GetWorkbookTemplates() - { - return GetCachedClient(Client => new WorkbookTemplateCollection(Client, Id)); - } - - /// Gets a collection of MyWorkbookResources in the ResourceGroupResource. - /// An object representing collection of MyWorkbookResources and their operations over a MyWorkbookResource. - public virtual MyWorkbookCollection GetMyWorkbooks() - { - return GetCachedClient(Client => new MyWorkbookCollection(Client, Id)); - } - - /// Gets a collection of WorkbookResources in the ResourceGroupResource. - /// An object representing collection of WorkbookResources and their operations over a WorkbookResource. - public virtual WorkbookCollection GetWorkbooks() - { - return GetCachedClient(Client => new WorkbookCollection(Client, Id)); - } - } -} diff --git a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/WorkbookResource.cs b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/WorkbookResource.cs index 250fe2f8ef9c..82ff6fdccf84 100644 --- a/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/WorkbookResource.cs +++ b/sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/src/Generated/WorkbookResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WorkbookRevisionResources and their operations over a WorkbookRevisionResource. public virtual WorkbookRevisionCollection GetWorkbookRevisions() { - return GetCachedClient(Client => new WorkbookRevisionCollection(Client, Id)); + return GetCachedClient(client => new WorkbookRevisionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual WorkbookRevisionCollection GetWorkbookRevisions() /// /// The id of the workbook's revision. /// The cancellation token to use. - /// 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> GetWorkbookRevisionAsync(string revisionId, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetWorkbookRevisio /// /// The id of the workbook's revision. /// The cancellation token to use. - /// 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 GetWorkbookRevision(string revisionId, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformApiPortalResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformApiPortalResource.cs index 27e5bfa4addc..3e0b1bd29640 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformApiPortalResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformApiPortalResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformApiPortalCustomDomainResources and their operations over a AppPlatformApiPortalCustomDomainResource. public virtual AppPlatformApiPortalCustomDomainCollection GetAppPlatformApiPortalCustomDomains() { - return GetCachedClient(Client => new AppPlatformApiPortalCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformApiPortalCustomDomainCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AppPlatformApiPortalCustomDomainCollection GetAppPlatformApiPorta /// /// The name of the API portal custom domain. /// The cancellation token to use. - /// 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> GetAppPlatformApiPortalCustomDomainAsync(string domainName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> Ge /// /// The name of the API portal custom domain. /// The cancellation token to use. - /// 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 GetAppPlatformApiPortalCustomDomain(string domainName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformAppResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformAppResource.cs index 7b5721c54a65..5eedbc00fab0 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformAppResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformAppResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformBindingResources and their operations over a AppPlatformBindingResource. public virtual AppPlatformBindingCollection GetAppPlatformBindings() { - return GetCachedClient(Client => new AppPlatformBindingCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBindingCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AppPlatformBindingCollection GetAppPlatformBindings() /// /// The name of the Binding resource. /// The cancellation token to use. - /// 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> GetAppPlatformBindingAsync(string bindingName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetAppPlatformBi /// /// The name of the Binding resource. /// The cancellation token to use. - /// 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 GetAppPlatformBinding(string bindingName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetAppPlatformBinding(string /// An object representing collection of AppPlatformCustomDomainResources and their operations over a AppPlatformCustomDomainResource. public virtual AppPlatformCustomDomainCollection GetAppPlatformCustomDomains() { - return GetCachedClient(Client => new AppPlatformCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformCustomDomainCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual AppPlatformCustomDomainCollection GetAppPlatformCustomDomains() /// /// The name of the custom domain resource. /// The cancellation token to use. - /// 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> GetAppPlatformCustomDomainAsync(string domainName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetAppPlatf /// /// The name of the custom domain resource. /// The cancellation token to use. - /// 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 GetAppPlatformCustomDomain(string domainName, CancellationToken cancellationToken = default) { @@ -197,7 +197,7 @@ public virtual Response GetAppPlatformCustomDom /// An object representing collection of AppPlatformDeploymentResources and their operations over a AppPlatformDeploymentResource. public virtual AppPlatformDeploymentCollection GetAppPlatformDeployments() { - return GetCachedClient(Client => new AppPlatformDeploymentCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformDeploymentCollection(client, Id)); } /// @@ -215,8 +215,8 @@ public virtual AppPlatformDeploymentCollection GetAppPlatformDeployments() /// /// The name of the Deployment resource. /// The cancellation token to use. - /// 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> GetAppPlatformDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { @@ -238,8 +238,8 @@ public virtual async Task> GetAppPlatfor /// /// The name of the Deployment resource. /// The cancellation token to use. - /// 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 GetAppPlatformDeployment(string deploymentName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildResource.cs index 3736a727acef..5eef91f42525 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformBuildResultResources and their operations over a AppPlatformBuildResultResource. public virtual AppPlatformBuildResultCollection GetAppPlatformBuildResults() { - return GetCachedClient(Client => new AppPlatformBuildResultCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuildResultCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AppPlatformBuildResultCollection GetAppPlatformBuildResults() /// /// The name of the build result resource. /// The cancellation token to use. - /// 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> GetAppPlatformBuildResultAsync(string buildResultName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetAppPlatfo /// /// The name of the build result resource. /// The cancellation token to use. - /// 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 GetAppPlatformBuildResult(string buildResultName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildServiceResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildServiceResource.cs index 03053830625d..647ab4445cdd 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildServiceResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuildServiceResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformBuildResources and their operations over a AppPlatformBuildResource. public virtual AppPlatformBuildCollection GetAppPlatformBuilds() { - return GetCachedClient(Client => new AppPlatformBuildCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuildCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AppPlatformBuildCollection GetAppPlatformBuilds() /// /// The name of the build resource. /// The cancellation token to use. - /// 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> GetAppPlatformBuildAsync(string buildName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetAppPlatformBuil /// /// The name of the build resource. /// The cancellation token to use. - /// 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 GetAppPlatformBuild(string buildName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetAppPlatformBuild(string bui /// An object representing collection of AppPlatformSupportedBuildpackResources and their operations over a AppPlatformSupportedBuildpackResource. public virtual AppPlatformSupportedBuildpackCollection GetAppPlatformSupportedBuildpacks() { - return GetCachedClient(Client => new AppPlatformSupportedBuildpackCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformSupportedBuildpackCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual AppPlatformSupportedBuildpackCollection GetAppPlatformSupportedBu /// /// The name of the buildpack resource. /// The cancellation token to use. - /// 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> GetAppPlatformSupportedBuildpackAsync(string buildpackName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetAp /// /// The name of the buildpack resource. /// The cancellation token to use. - /// 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 GetAppPlatformSupportedBuildpack(string buildpackName, CancellationToken cancellationToken = default) { @@ -197,7 +197,7 @@ public virtual Response GetAppPlatformSup /// An object representing collection of AppPlatformSupportedStackResources and their operations over a AppPlatformSupportedStackResource. public virtual AppPlatformSupportedStackCollection GetAppPlatformSupportedStacks() { - return GetCachedClient(Client => new AppPlatformSupportedStackCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformSupportedStackCollection(client, Id)); } /// @@ -215,8 +215,8 @@ public virtual AppPlatformSupportedStackCollection GetAppPlatformSupportedStacks /// /// The name of the stack resource. /// The cancellation token to use. - /// 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> GetAppPlatformSupportedStackAsync(string stackName, CancellationToken cancellationToken = default) { @@ -238,8 +238,8 @@ public virtual async Task> GetAppPla /// /// The name of the stack resource. /// The cancellation token to use. - /// 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 GetAppPlatformSupportedStack(string stackName, CancellationToken cancellationToken = default) { @@ -250,7 +250,7 @@ public virtual Response GetAppPlatformSupport /// An object representing collection of AppPlatformBuilderResources and their operations over a AppPlatformBuilderResource. public virtual AppPlatformBuilderCollection GetAppPlatformBuilders() { - return GetCachedClient(Client => new AppPlatformBuilderCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuilderCollection(client, Id)); } /// @@ -268,8 +268,8 @@ public virtual AppPlatformBuilderCollection GetAppPlatformBuilders() /// /// The name of the builder resource. /// The cancellation token to use. - /// 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> GetAppPlatformBuilderAsync(string builderName, CancellationToken cancellationToken = default) { @@ -291,8 +291,8 @@ public virtual async Task> GetAppPlatformBu /// /// The name of the builder resource. /// The cancellation token to use. - /// 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 GetAppPlatformBuilder(string builderName, CancellationToken cancellationToken = default) { @@ -303,7 +303,7 @@ public virtual Response GetAppPlatformBuilder(string /// An object representing collection of AppPlatformBuildServiceAgentPoolResources and their operations over a AppPlatformBuildServiceAgentPoolResource. public virtual AppPlatformBuildServiceAgentPoolCollection GetAppPlatformBuildServiceAgentPools() { - return GetCachedClient(Client => new AppPlatformBuildServiceAgentPoolCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuildServiceAgentPoolCollection(client, Id)); } /// @@ -321,8 +321,8 @@ public virtual AppPlatformBuildServiceAgentPoolCollection GetAppPlatformBuildSer /// /// The name of the build service agent pool resource. /// The cancellation token to use. - /// 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> GetAppPlatformBuildServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) { @@ -344,8 +344,8 @@ public virtual async Task> Ge /// /// The name of the build service agent pool resource. /// The cancellation token to use. - /// 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 GetAppPlatformBuildServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuilderResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuilderResource.cs index d99eb8506a86..d63a9174a1e9 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuilderResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformBuilderResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformBuildpackBindingResources and their operations over a AppPlatformBuildpackBindingResource. public virtual AppPlatformBuildpackBindingCollection GetAppPlatformBuildpackBindings() { - return GetCachedClient(Client => new AppPlatformBuildpackBindingCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuildpackBindingCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AppPlatformBuildpackBindingCollection GetAppPlatformBuildpackBind /// /// The name of the Buildpack Binding Name. /// The cancellation token to use. - /// 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> GetAppPlatformBuildpackBindingAsync(string buildpackBindingName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetAppP /// /// The name of the Buildpack Binding Name. /// The cancellation token to use. - /// 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 GetAppPlatformBuildpackBinding(string buildpackBindingName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformGatewayResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformGatewayResource.cs index 2a4a52e4a3b9..69696fe19e2e 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformGatewayResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformGatewayResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppPlatformGatewayRouteConfigResources and their operations over a AppPlatformGatewayRouteConfigResource. public virtual AppPlatformGatewayRouteConfigCollection GetAppPlatformGatewayRouteConfigs() { - return GetCachedClient(Client => new AppPlatformGatewayRouteConfigCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformGatewayRouteConfigCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AppPlatformGatewayRouteConfigCollection GetAppPlatformGatewayRout /// /// The name of the Spring Cloud Gateway route config. /// The cancellation token to use. - /// 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> GetAppPlatformGatewayRouteConfigAsync(string routeConfigName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetAp /// /// The name of the Spring Cloud Gateway route config. /// The cancellation token to use. - /// 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 GetAppPlatformGatewayRouteConfig(string routeConfigName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetAppPlatformGat /// An object representing collection of AppPlatformGatewayCustomDomainResources and their operations over a AppPlatformGatewayCustomDomainResource. public virtual AppPlatformGatewayCustomDomainCollection GetAppPlatformGatewayCustomDomains() { - return GetCachedClient(Client => new AppPlatformGatewayCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformGatewayCustomDomainCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual AppPlatformGatewayCustomDomainCollection GetAppPlatformGatewayCus /// /// The name of the Spring Cloud Gateway custom domain. /// The cancellation token to use. - /// 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> GetAppPlatformGatewayCustomDomainAsync(string domainName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetA /// /// The name of the Spring Cloud Gateway custom domain. /// The cancellation token to use. - /// 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 GetAppPlatformGatewayCustomDomain(string domainName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformServiceResource.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformServiceResource.cs index d9a3afe487d4..883b33e7a36a 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformServiceResource.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/AppPlatformServiceResource.cs @@ -111,7 +111,7 @@ public virtual AppPlatformConfigServerResource GetAppPlatformConfigServer() /// An object representing collection of AppPlatformConfigurationServiceResources and their operations over a AppPlatformConfigurationServiceResource. public virtual AppPlatformConfigurationServiceCollection GetAppPlatformConfigurationServices() { - return GetCachedClient(Client => new AppPlatformConfigurationServiceCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformConfigurationServiceCollection(client, Id)); } /// @@ -129,8 +129,8 @@ public virtual AppPlatformConfigurationServiceCollection GetAppPlatformConfigura /// /// The name of Application Configuration Service. /// The cancellation token to use. - /// 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> GetAppPlatformConfigurationServiceAsync(string configurationServiceName, CancellationToken cancellationToken = default) { @@ -152,8 +152,8 @@ public virtual async Task> Get /// /// The name of Application Configuration Service. /// The cancellation token to use. - /// 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 GetAppPlatformConfigurationService(string configurationServiceName, CancellationToken cancellationToken = default) { @@ -164,7 +164,7 @@ public virtual Response GetAppPlatformC /// An object representing collection of AppPlatformServiceRegistryResources and their operations over a AppPlatformServiceRegistryResource. public virtual AppPlatformServiceRegistryCollection GetAppPlatformServiceRegistries() { - return GetCachedClient(Client => new AppPlatformServiceRegistryCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformServiceRegistryCollection(client, Id)); } /// @@ -182,8 +182,8 @@ public virtual AppPlatformServiceRegistryCollection GetAppPlatformServiceRegistr /// /// The name of Service Registry. /// The cancellation token to use. - /// 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> GetAppPlatformServiceRegistryAsync(string serviceRegistryName, CancellationToken cancellationToken = default) { @@ -205,8 +205,8 @@ public virtual async Task> GetAppPl /// /// The name of Service Registry. /// The cancellation token to use. - /// 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 GetAppPlatformServiceRegistry(string serviceRegistryName, CancellationToken cancellationToken = default) { @@ -217,7 +217,7 @@ public virtual Response GetAppPlatformServic /// An object representing collection of AppPlatformBuildServiceResources and their operations over a AppPlatformBuildServiceResource. public virtual AppPlatformBuildServiceCollection GetAppPlatformBuildServices() { - return GetCachedClient(Client => new AppPlatformBuildServiceCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformBuildServiceCollection(client, Id)); } /// @@ -235,8 +235,8 @@ public virtual AppPlatformBuildServiceCollection GetAppPlatformBuildServices() /// /// The name of the build service resource. /// The cancellation token to use. - /// 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> GetAppPlatformBuildServiceAsync(string buildServiceName, CancellationToken cancellationToken = default) { @@ -258,8 +258,8 @@ public virtual async Task> GetAppPlatf /// /// The name of the build service resource. /// The cancellation token to use. - /// 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 GetAppPlatformBuildService(string buildServiceName, CancellationToken cancellationToken = default) { @@ -277,7 +277,7 @@ public virtual AppPlatformMonitoringSettingResource GetAppPlatformMonitoringSett /// An object representing collection of AppPlatformAppResources and their operations over a AppPlatformAppResource. public virtual AppPlatformAppCollection GetAppPlatformApps() { - return GetCachedClient(Client => new AppPlatformAppCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformAppCollection(client, Id)); } /// @@ -296,8 +296,8 @@ public virtual AppPlatformAppCollection GetAppPlatformApps() /// The name of the App resource. /// Indicates whether sync status. /// The cancellation token to use. - /// 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> GetAppPlatformAppAsync(string appName, string syncStatus = null, CancellationToken cancellationToken = default) { @@ -320,8 +320,8 @@ public virtual async Task> GetAppPlatformAppAsy /// The name of the App resource. /// Indicates whether sync status. /// The cancellation token to use. - /// 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 GetAppPlatformApp(string appName, string syncStatus = null, CancellationToken cancellationToken = default) { @@ -332,7 +332,7 @@ public virtual Response GetAppPlatformApp(string appName /// An object representing collection of AppPlatformStorageResources and their operations over a AppPlatformStorageResource. public virtual AppPlatformStorageCollection GetAppPlatformStorages() { - return GetCachedClient(Client => new AppPlatformStorageCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformStorageCollection(client, Id)); } /// @@ -350,8 +350,8 @@ public virtual AppPlatformStorageCollection GetAppPlatformStorages() /// /// The name of the storage resource. /// The cancellation token to use. - /// 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> GetAppPlatformStorageAsync(string storageName, CancellationToken cancellationToken = default) { @@ -373,8 +373,8 @@ public virtual async Task> GetAppPlatformSt /// /// The name of the storage resource. /// The cancellation token to use. - /// 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 GetAppPlatformStorage(string storageName, CancellationToken cancellationToken = default) { @@ -385,7 +385,7 @@ public virtual Response GetAppPlatformStorage(string /// An object representing collection of AppPlatformCertificateResources and their operations over a AppPlatformCertificateResource. public virtual AppPlatformCertificateCollection GetAppPlatformCertificates() { - return GetCachedClient(Client => new AppPlatformCertificateCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformCertificateCollection(client, Id)); } /// @@ -403,8 +403,8 @@ public virtual AppPlatformCertificateCollection GetAppPlatformCertificates() /// /// The name of the certificate resource. /// The cancellation token to use. - /// 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> GetAppPlatformCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -426,8 +426,8 @@ public virtual async Task> GetAppPlatfo /// /// The name of the certificate resource. /// The cancellation token to use. - /// 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 GetAppPlatformCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -438,7 +438,7 @@ public virtual Response GetAppPlatformCertificat /// An object representing collection of AppPlatformGatewayResources and their operations over a AppPlatformGatewayResource. public virtual AppPlatformGatewayCollection GetAppPlatformGateways() { - return GetCachedClient(Client => new AppPlatformGatewayCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformGatewayCollection(client, Id)); } /// @@ -456,8 +456,8 @@ public virtual AppPlatformGatewayCollection GetAppPlatformGateways() /// /// The name of Spring Cloud Gateway. /// The cancellation token to use. - /// 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> GetAppPlatformGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) { @@ -479,8 +479,8 @@ public virtual async Task> GetAppPlatformGa /// /// The name of Spring Cloud Gateway. /// The cancellation token to use. - /// 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 GetAppPlatformGateway(string gatewayName, CancellationToken cancellationToken = default) { @@ -491,7 +491,7 @@ public virtual Response GetAppPlatformGateway(string /// An object representing collection of AppPlatformApiPortalResources and their operations over a AppPlatformApiPortalResource. public virtual AppPlatformApiPortalCollection GetAppPlatformApiPortals() { - return GetCachedClient(Client => new AppPlatformApiPortalCollection(Client, Id)); + return GetCachedClient(client => new AppPlatformApiPortalCollection(client, Id)); } /// @@ -509,8 +509,8 @@ public virtual AppPlatformApiPortalCollection GetAppPlatformApiPortals() /// /// The name of API portal. /// The cancellation token to use. - /// 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> GetAppPlatformApiPortalAsync(string apiPortalName, CancellationToken cancellationToken = default) { @@ -532,8 +532,8 @@ public virtual async Task> GetAppPlatform /// /// The name of API portal. /// The cancellation token to use. - /// 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 GetAppPlatformApiPortal(string apiPortalName, CancellationToken cancellationToken = default) { diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformArmClientMockingExtension.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformArmClientMockingExtension.cs new file mode 100644 index 000000000000..d713d1aa64a8 --- /dev/null +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformArmClientMockingExtension.cs @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppPlatform; + +namespace Azure.ResourceManager.AppPlatform.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AppPlatformArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppPlatformArmClientMockingExtension() + { + } + + /// 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 AppPlatformArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AppPlatformArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformServiceResource GetAppPlatformServiceResource(ResourceIdentifier id) + { + AppPlatformServiceResource.ValidateResourceId(id); + return new AppPlatformServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformConfigServerResource GetAppPlatformConfigServerResource(ResourceIdentifier id) + { + AppPlatformConfigServerResource.ValidateResourceId(id); + return new AppPlatformConfigServerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformConfigurationServiceResource GetAppPlatformConfigurationServiceResource(ResourceIdentifier id) + { + AppPlatformConfigurationServiceResource.ValidateResourceId(id); + return new AppPlatformConfigurationServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformServiceRegistryResource GetAppPlatformServiceRegistryResource(ResourceIdentifier id) + { + AppPlatformServiceRegistryResource.ValidateResourceId(id); + return new AppPlatformServiceRegistryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuildServiceResource GetAppPlatformBuildServiceResource(ResourceIdentifier id) + { + AppPlatformBuildServiceResource.ValidateResourceId(id); + return new AppPlatformBuildServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuildResource GetAppPlatformBuildResource(ResourceIdentifier id) + { + AppPlatformBuildResource.ValidateResourceId(id); + return new AppPlatformBuildResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuildResultResource GetAppPlatformBuildResultResource(ResourceIdentifier id) + { + AppPlatformBuildResultResource.ValidateResourceId(id); + return new AppPlatformBuildResultResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformSupportedBuildpackResource GetAppPlatformSupportedBuildpackResource(ResourceIdentifier id) + { + AppPlatformSupportedBuildpackResource.ValidateResourceId(id); + return new AppPlatformSupportedBuildpackResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformSupportedStackResource GetAppPlatformSupportedStackResource(ResourceIdentifier id) + { + AppPlatformSupportedStackResource.ValidateResourceId(id); + return new AppPlatformSupportedStackResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuildpackBindingResource GetAppPlatformBuildpackBindingResource(ResourceIdentifier id) + { + AppPlatformBuildpackBindingResource.ValidateResourceId(id); + return new AppPlatformBuildpackBindingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuilderResource GetAppPlatformBuilderResource(ResourceIdentifier id) + { + AppPlatformBuilderResource.ValidateResourceId(id); + return new AppPlatformBuilderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBuildServiceAgentPoolResource GetAppPlatformBuildServiceAgentPoolResource(ResourceIdentifier id) + { + AppPlatformBuildServiceAgentPoolResource.ValidateResourceId(id); + return new AppPlatformBuildServiceAgentPoolResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformMonitoringSettingResource GetAppPlatformMonitoringSettingResource(ResourceIdentifier id) + { + AppPlatformMonitoringSettingResource.ValidateResourceId(id); + return new AppPlatformMonitoringSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformAppResource GetAppPlatformAppResource(ResourceIdentifier id) + { + AppPlatformAppResource.ValidateResourceId(id); + return new AppPlatformAppResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformBindingResource GetAppPlatformBindingResource(ResourceIdentifier id) + { + AppPlatformBindingResource.ValidateResourceId(id); + return new AppPlatformBindingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformStorageResource GetAppPlatformStorageResource(ResourceIdentifier id) + { + AppPlatformStorageResource.ValidateResourceId(id); + return new AppPlatformStorageResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformCertificateResource GetAppPlatformCertificateResource(ResourceIdentifier id) + { + AppPlatformCertificateResource.ValidateResourceId(id); + return new AppPlatformCertificateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformCustomDomainResource GetAppPlatformCustomDomainResource(ResourceIdentifier id) + { + AppPlatformCustomDomainResource.ValidateResourceId(id); + return new AppPlatformCustomDomainResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformDeploymentResource GetAppPlatformDeploymentResource(ResourceIdentifier id) + { + AppPlatformDeploymentResource.ValidateResourceId(id); + return new AppPlatformDeploymentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformGatewayResource GetAppPlatformGatewayResource(ResourceIdentifier id) + { + AppPlatformGatewayResource.ValidateResourceId(id); + return new AppPlatformGatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformGatewayRouteConfigResource GetAppPlatformGatewayRouteConfigResource(ResourceIdentifier id) + { + AppPlatformGatewayRouteConfigResource.ValidateResourceId(id); + return new AppPlatformGatewayRouteConfigResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformGatewayCustomDomainResource GetAppPlatformGatewayCustomDomainResource(ResourceIdentifier id) + { + AppPlatformGatewayCustomDomainResource.ValidateResourceId(id); + return new AppPlatformGatewayCustomDomainResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformApiPortalResource GetAppPlatformApiPortalResource(ResourceIdentifier id) + { + AppPlatformApiPortalResource.ValidateResourceId(id); + return new AppPlatformApiPortalResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppPlatformApiPortalCustomDomainResource GetAppPlatformApiPortalCustomDomainResource(ResourceIdentifier id) + { + AppPlatformApiPortalCustomDomainResource.ValidateResourceId(id); + return new AppPlatformApiPortalCustomDomainResource(Client, id); + } + } +} diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformExtensions.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformExtensions.cs index 1516512c796b..8535b032268e 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformExtensions.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AppPlatform.Mocking; using Azure.ResourceManager.AppPlatform.Models; using Azure.ResourceManager.Resources; @@ -19,515 +20,422 @@ namespace Azure.ResourceManager.AppPlatform /// A class to add extension methods to Azure.ResourceManager.AppPlatform. public static partial class AppPlatformExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AppPlatformArmClientMockingExtension GetAppPlatformArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AppPlatformArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppPlatformResourceGroupMockingExtension GetAppPlatformResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppPlatformResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AppPlatformSubscriptionMockingExtension GetAppPlatformSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AppPlatformSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppPlatformTenantMockingExtension GetAppPlatformTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppPlatformTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region AppPlatformServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformServiceResource GetAppPlatformServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformServiceResource.ValidateResourceId(id); - return new AppPlatformServiceResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformServiceResource(id); } - #endregion - #region AppPlatformConfigServerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformConfigServerResource GetAppPlatformConfigServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformConfigServerResource.ValidateResourceId(id); - return new AppPlatformConfigServerResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformConfigServerResource(id); } - #endregion - #region AppPlatformConfigurationServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformConfigurationServiceResource GetAppPlatformConfigurationServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformConfigurationServiceResource.ValidateResourceId(id); - return new AppPlatformConfigurationServiceResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformConfigurationServiceResource(id); } - #endregion - #region AppPlatformServiceRegistryResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformServiceRegistryResource GetAppPlatformServiceRegistryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformServiceRegistryResource.ValidateResourceId(id); - return new AppPlatformServiceRegistryResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformServiceRegistryResource(id); } - #endregion - #region AppPlatformBuildServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuildServiceResource GetAppPlatformBuildServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuildServiceResource.ValidateResourceId(id); - return new AppPlatformBuildServiceResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuildServiceResource(id); } - #endregion - #region AppPlatformBuildResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuildResource GetAppPlatformBuildResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuildResource.ValidateResourceId(id); - return new AppPlatformBuildResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuildResource(id); } - #endregion - #region AppPlatformBuildResultResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuildResultResource GetAppPlatformBuildResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuildResultResource.ValidateResourceId(id); - return new AppPlatformBuildResultResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuildResultResource(id); } - #endregion - #region AppPlatformSupportedBuildpackResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformSupportedBuildpackResource GetAppPlatformSupportedBuildpackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformSupportedBuildpackResource.ValidateResourceId(id); - return new AppPlatformSupportedBuildpackResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformSupportedBuildpackResource(id); } - #endregion - #region AppPlatformSupportedStackResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformSupportedStackResource GetAppPlatformSupportedStackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformSupportedStackResource.ValidateResourceId(id); - return new AppPlatformSupportedStackResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformSupportedStackResource(id); } - #endregion - #region AppPlatformBuildpackBindingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuildpackBindingResource GetAppPlatformBuildpackBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuildpackBindingResource.ValidateResourceId(id); - return new AppPlatformBuildpackBindingResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuildpackBindingResource(id); } - #endregion - #region AppPlatformBuilderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuilderResource GetAppPlatformBuilderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuilderResource.ValidateResourceId(id); - return new AppPlatformBuilderResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuilderResource(id); } - #endregion - #region AppPlatformBuildServiceAgentPoolResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBuildServiceAgentPoolResource GetAppPlatformBuildServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBuildServiceAgentPoolResource.ValidateResourceId(id); - return new AppPlatformBuildServiceAgentPoolResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBuildServiceAgentPoolResource(id); } - #endregion - #region AppPlatformMonitoringSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformMonitoringSettingResource GetAppPlatformMonitoringSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformMonitoringSettingResource.ValidateResourceId(id); - return new AppPlatformMonitoringSettingResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformMonitoringSettingResource(id); } - #endregion - #region AppPlatformAppResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformAppResource GetAppPlatformAppResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformAppResource.ValidateResourceId(id); - return new AppPlatformAppResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformAppResource(id); } - #endregion - #region AppPlatformBindingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformBindingResource GetAppPlatformBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformBindingResource.ValidateResourceId(id); - return new AppPlatformBindingResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformBindingResource(id); } - #endregion - #region AppPlatformStorageResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformStorageResource GetAppPlatformStorageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformStorageResource.ValidateResourceId(id); - return new AppPlatformStorageResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformStorageResource(id); } - #endregion - #region AppPlatformCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformCertificateResource GetAppPlatformCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformCertificateResource.ValidateResourceId(id); - return new AppPlatformCertificateResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformCertificateResource(id); } - #endregion - #region AppPlatformCustomDomainResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformCustomDomainResource GetAppPlatformCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformCustomDomainResource.ValidateResourceId(id); - return new AppPlatformCustomDomainResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformCustomDomainResource(id); } - #endregion - #region AppPlatformDeploymentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformDeploymentResource GetAppPlatformDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformDeploymentResource.ValidateResourceId(id); - return new AppPlatformDeploymentResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformDeploymentResource(id); } - #endregion - #region AppPlatformGatewayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformGatewayResource GetAppPlatformGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformGatewayResource.ValidateResourceId(id); - return new AppPlatformGatewayResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformGatewayResource(id); } - #endregion - #region AppPlatformGatewayRouteConfigResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformGatewayRouteConfigResource GetAppPlatformGatewayRouteConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformGatewayRouteConfigResource.ValidateResourceId(id); - return new AppPlatformGatewayRouteConfigResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformGatewayRouteConfigResource(id); } - #endregion - #region AppPlatformGatewayCustomDomainResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformGatewayCustomDomainResource GetAppPlatformGatewayCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformGatewayCustomDomainResource.ValidateResourceId(id); - return new AppPlatformGatewayCustomDomainResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformGatewayCustomDomainResource(id); } - #endregion - #region AppPlatformApiPortalResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformApiPortalResource GetAppPlatformApiPortalResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformApiPortalResource.ValidateResourceId(id); - return new AppPlatformApiPortalResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformApiPortalResource(id); } - #endregion - #region AppPlatformApiPortalCustomDomainResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppPlatformApiPortalCustomDomainResource GetAppPlatformApiPortalCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppPlatformApiPortalCustomDomainResource.ValidateResourceId(id); - return new AppPlatformApiPortalCustomDomainResource(client, id); - } - ); + return GetAppPlatformArmClientMockingExtension(client).GetAppPlatformApiPortalCustomDomainResource(id); } - #endregion - /// Gets a collection of AppPlatformServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of AppPlatformServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppPlatformServiceResources and their operations over a AppPlatformServiceResource. public static AppPlatformServiceCollection GetAppPlatformServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppPlatformServices(); + return GetAppPlatformResourceGroupMockingExtension(resourceGroupResource).GetAppPlatformServices(); } /// @@ -542,16 +450,20 @@ public static AppPlatformServiceCollection GetAppPlatformServices(this ResourceG /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Service resource. /// The cancellation token to use. - /// 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 static async Task> GetAppPlatformServiceAsync(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppPlatformServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetAppPlatformResourceGroupMockingExtension(resourceGroupResource).GetAppPlatformServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -566,16 +478,20 @@ public static async Task> GetAppPlatformSer /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Service resource. /// The cancellation token to use. - /// 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 static Response GetAppPlatformService(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppPlatformServices().Get(serviceName, cancellationToken); + return GetAppPlatformResourceGroupMockingExtension(resourceGroupResource).GetAppPlatformService(serviceName, cancellationToken); } /// @@ -590,6 +506,10 @@ public static Response GetAppPlatformService(this Re /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -598,9 +518,7 @@ public static Response GetAppPlatformService(this Re /// is null. public static async Task> CheckAppPlatformNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, AppPlatformNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppPlatformNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetAppPlatformSubscriptionMockingExtension(subscriptionResource).CheckAppPlatformNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -615,6 +533,10 @@ public static async Task> CheckAppPl /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -623,9 +545,7 @@ public static async Task> CheckAppPl /// is null. public static Response CheckAppPlatformNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, AppPlatformNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppPlatformNameAvailability(location, content, cancellationToken); + return GetAppPlatformSubscriptionMockingExtension(subscriptionResource).CheckAppPlatformNameAvailability(location, content, cancellationToken); } /// @@ -640,13 +560,17 @@ public static Response CheckAppPlatformNameAv /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppPlatformServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppPlatformServicesAsync(cancellationToken); + return GetAppPlatformSubscriptionMockingExtension(subscriptionResource).GetAppPlatformServicesAsync(cancellationToken); } /// @@ -661,13 +585,17 @@ public static AsyncPageable GetAppPlatformServicesAs /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppPlatformServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppPlatformServices(cancellationToken); + return GetAppPlatformSubscriptionMockingExtension(subscriptionResource).GetAppPlatformServices(cancellationToken); } /// @@ -682,13 +610,17 @@ public static Pageable GetAppPlatformServices(this S /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(cancellationToken); + return GetAppPlatformSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(cancellationToken); } /// @@ -703,13 +635,17 @@ public static AsyncPageable GetSkusAsync(this Subscript /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(cancellationToken); + return GetAppPlatformSubscriptionMockingExtension(subscriptionResource).GetSkus(cancellationToken); } /// @@ -724,13 +660,17 @@ public static Pageable GetSkus(this SubscriptionResourc /// RuntimeVersions_ListRuntimeVersions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRuntimeVersionsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetRuntimeVersionsAsync(cancellationToken); + return GetAppPlatformTenantMockingExtension(tenantResource).GetRuntimeVersionsAsync(cancellationToken); } /// @@ -745,13 +685,17 @@ public static AsyncPageable GetRuntimeVersio /// RuntimeVersions_ListRuntimeVersions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRuntimeVersions(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetRuntimeVersions(cancellationToken); + return GetAppPlatformTenantMockingExtension(tenantResource).GetRuntimeVersions(cancellationToken); } } } diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformResourceGroupMockingExtension.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..7cee1c236b0d --- /dev/null +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppPlatform; + +namespace Azure.ResourceManager.AppPlatform.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AppPlatformResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppPlatformResourceGroupMockingExtension() + { + } + + /// 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 AppPlatformResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AppPlatformServiceResources in the ResourceGroupResource. + /// An object representing collection of AppPlatformServiceResources and their operations over a AppPlatformServiceResource. + public virtual AppPlatformServiceCollection GetAppPlatformServices() + { + return GetCachedClient(client => new AppPlatformServiceCollection(client, Id)); + } + + /// + /// Get a Service and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the Service resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppPlatformServiceAsync(string serviceName, CancellationToken cancellationToken = default) + { + return await GetAppPlatformServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Service and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the Service resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppPlatformService(string serviceName, CancellationToken cancellationToken = default) + { + return GetAppPlatformServices().Get(serviceName, cancellationToken); + } + } +} diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformSubscriptionMockingExtension.cs similarity index 88% rename from sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformSubscriptionMockingExtension.cs index d08e81e73920..2ae1e3efab8c 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppPlatform; using Azure.ResourceManager.AppPlatform.Models; -namespace Azure.ResourceManager.AppPlatform +namespace Azure.ResourceManager.AppPlatform.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AppPlatformSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _appPlatformServiceServicesClientDiagnostics; private ServicesRestOperations _appPlatformServiceServicesRestClient; private ClientDiagnostics _skusClientDiagnostics; private SkusRestOperations _skusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppPlatformSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppPlatformSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,9 +65,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckAppPlatformNameAvailabilityAsync(AzureLocation location, AppPlatformNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = AppPlatformServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppPlatformNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = AppPlatformServiceServicesClientDiagnostics.CreateScope("AppPlatformSubscriptionMockingExtension.CheckAppPlatformNameAvailability"); scope.Start(); try { @@ -96,9 +100,12 @@ public virtual async Task> CheckAppP /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual Response CheckAppPlatformNameAvailability(AzureLocation location, AppPlatformNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = AppPlatformServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppPlatformNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = AppPlatformServiceServicesClientDiagnostics.CreateScope("AppPlatformSubscriptionMockingExtension.CheckAppPlatformNameAvailability"); scope.Start(); try { @@ -131,7 +138,7 @@ public virtual AsyncPageable GetAppPlatformServicesA { HttpMessage FirstPageRequest(int? pageSizeHint) => AppPlatformServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppPlatformServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppPlatformServiceResource(Client, AppPlatformServiceData.DeserializeAppPlatformServiceData(e)), AppPlatformServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppPlatformServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppPlatformServiceResource(Client, AppPlatformServiceData.DeserializeAppPlatformServiceData(e)), AppPlatformServiceServicesClientDiagnostics, Pipeline, "AppPlatformSubscriptionMockingExtension.GetAppPlatformServices", "value", "nextLink", cancellationToken); } /// @@ -153,7 +160,7 @@ public virtual Pageable GetAppPlatformServices(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => AppPlatformServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppPlatformServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppPlatformServiceResource(Client, AppPlatformServiceData.DeserializeAppPlatformServiceData(e)), AppPlatformServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppPlatformServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppPlatformServiceResource(Client, AppPlatformServiceData.DeserializeAppPlatformServiceData(e)), AppPlatformServiceServicesClientDiagnostics, Pipeline, "AppPlatformSubscriptionMockingExtension.GetAppPlatformServices", "value", "nextLink", cancellationToken); } /// @@ -175,7 +182,7 @@ public virtual AsyncPageable GetSkusAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableAppPlatformSku.DeserializeAvailableAppPlatformSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableAppPlatformSku.DeserializeAvailableAppPlatformSku, SkusClientDiagnostics, Pipeline, "AppPlatformSubscriptionMockingExtension.GetSkus", "value", "nextLink", cancellationToken); } /// @@ -197,7 +204,7 @@ public virtual Pageable GetSkus(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableAppPlatformSku.DeserializeAvailableAppPlatformSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableAppPlatformSku.DeserializeAvailableAppPlatformSku, SkusClientDiagnostics, Pipeline, "AppPlatformSubscriptionMockingExtension.GetSkus", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformTenantMockingExtension.cs similarity index 85% rename from sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformTenantMockingExtension.cs index 57a5c43f0530..6365497551af 100644 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/AppPlatformTenantMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppPlatform; using Azure.ResourceManager.AppPlatform.Models; -namespace Azure.ResourceManager.AppPlatform +namespace Azure.ResourceManager.AppPlatform.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class AppPlatformTenantMockingExtension : ArmResource { private ClientDiagnostics _runtimeVersionsClientDiagnostics; private RuntimeVersionsRestOperations _runtimeVersionsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppPlatformTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppPlatformTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetRuntimeVersionsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => RuntimeVersionsRestClient.CreateListRuntimeVersionsRequest(); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AppPlatformSupportedRuntimeVersion.DeserializeAppPlatformSupportedRuntimeVersion, RuntimeVersionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetRuntimeVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AppPlatformSupportedRuntimeVersion.DeserializeAppPlatformSupportedRuntimeVersion, RuntimeVersionsClientDiagnostics, Pipeline, "AppPlatformTenantMockingExtension.GetRuntimeVersions", "value", null, cancellationToken); } /// @@ -81,7 +82,7 @@ public virtual AsyncPageable GetRuntimeVersi public virtual Pageable GetRuntimeVersions(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => RuntimeVersionsRestClient.CreateListRuntimeVersionsRequest(); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AppPlatformSupportedRuntimeVersion.DeserializeAppPlatformSupportedRuntimeVersion, RuntimeVersionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetRuntimeVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AppPlatformSupportedRuntimeVersion.DeserializeAppPlatformSupportedRuntimeVersion, RuntimeVersionsClientDiagnostics, Pipeline, "AppPlatformTenantMockingExtension.GetRuntimeVersions", "value", null, cancellationToken); } } } diff --git a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 400370c8364b..000000000000 --- a/sdk/appplatform/Azure.ResourceManager.AppPlatform/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AppPlatform -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AppPlatformServiceResources in the ResourceGroupResource. - /// An object representing collection of AppPlatformServiceResources and their operations over a AppPlatformServiceResource. - public virtual AppPlatformServiceCollection GetAppPlatformServices() - { - return GetCachedClient(Client => new AppPlatformServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmArmClientMockingExtension.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmArmClientMockingExtension.cs new file mode 100644 index 000000000000..784f3c518701 --- /dev/null +++ b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ArcScVmm; + +namespace Azure.ResourceManager.ArcScVmm.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ArcScVmmArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ArcScVmmArmClientMockingExtension() + { + } + + /// 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 ArcScVmmArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ArcScVmmArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ScVmmServerResource GetScVmmServerResource(ResourceIdentifier id) + { + ScVmmServerResource.ValidateResourceId(id); + return new ScVmmServerResource(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 ScVmmCloudResource GetScVmmCloudResource(ResourceIdentifier id) + { + ScVmmCloudResource.ValidateResourceId(id); + return new ScVmmCloudResource(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 ScVmmVirtualNetworkResource GetScVmmVirtualNetworkResource(ResourceIdentifier id) + { + ScVmmVirtualNetworkResource.ValidateResourceId(id); + return new ScVmmVirtualNetworkResource(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 ScVmmVirtualMachineResource GetScVmmVirtualMachineResource(ResourceIdentifier id) + { + ScVmmVirtualMachineResource.ValidateResourceId(id); + return new ScVmmVirtualMachineResource(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 ScVmmVirtualMachineTemplateResource GetScVmmVirtualMachineTemplateResource(ResourceIdentifier id) + { + ScVmmVirtualMachineTemplateResource.ValidateResourceId(id); + return new ScVmmVirtualMachineTemplateResource(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 ScVmmAvailabilitySetResource GetScVmmAvailabilitySetResource(ResourceIdentifier id) + { + ScVmmAvailabilitySetResource.ValidateResourceId(id); + return new ScVmmAvailabilitySetResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InventoryItemResource GetInventoryItemResource(ResourceIdentifier id) + { + InventoryItemResource.ValidateResourceId(id); + return new InventoryItemResource(Client, id); + } + } +} diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmExtensions.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmExtensions.cs index 98a949481305..dc068e070cd1 100644 --- a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmExtensions.cs +++ b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ArcScVmm.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ArcScVmm @@ -18,176 +19,145 @@ namespace Azure.ResourceManager.ArcScVmm /// A class to add extension methods to Azure.ResourceManager.ArcScVmm. public static partial class ArcScVmmExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ArcScVmmArmClientMockingExtension GetArcScVmmArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ArcScVmmArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ArcScVmmResourceGroupMockingExtension GetArcScVmmResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ArcScVmmResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ArcScVmmSubscriptionMockingExtension GetArcScVmmSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ArcScVmmSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ScVmmServerResource /// /// 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. /// Returns a object. public static ScVmmServerResource GetScVmmServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmServerResource.ValidateResourceId(id); - return new ScVmmServerResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmServerResource(id); } - #endregion - #region ScVmmCloudResource /// /// 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. /// Returns a object. public static ScVmmCloudResource GetScVmmCloudResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmCloudResource.ValidateResourceId(id); - return new ScVmmCloudResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmCloudResource(id); } - #endregion - #region ScVmmVirtualNetworkResource /// /// 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. /// Returns a object. public static ScVmmVirtualNetworkResource GetScVmmVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmVirtualNetworkResource.ValidateResourceId(id); - return new ScVmmVirtualNetworkResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmVirtualNetworkResource(id); } - #endregion - #region ScVmmVirtualMachineResource /// /// 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. /// Returns a object. public static ScVmmVirtualMachineResource GetScVmmVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmVirtualMachineResource.ValidateResourceId(id); - return new ScVmmVirtualMachineResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmVirtualMachineResource(id); } - #endregion - #region ScVmmVirtualMachineTemplateResource /// /// 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. /// Returns a object. public static ScVmmVirtualMachineTemplateResource GetScVmmVirtualMachineTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmVirtualMachineTemplateResource.ValidateResourceId(id); - return new ScVmmVirtualMachineTemplateResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmVirtualMachineTemplateResource(id); } - #endregion - #region ScVmmAvailabilitySetResource /// /// 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. /// Returns a object. public static ScVmmAvailabilitySetResource GetScVmmAvailabilitySetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScVmmAvailabilitySetResource.ValidateResourceId(id); - return new ScVmmAvailabilitySetResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetScVmmAvailabilitySetResource(id); } - #endregion - #region InventoryItemResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InventoryItemResource GetInventoryItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InventoryItemResource.ValidateResourceId(id); - return new InventoryItemResource(client, id); - } - ); + return GetArcScVmmArmClientMockingExtension(client).GetInventoryItemResource(id); } - #endregion - /// Gets a collection of ScVmmServerResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmServerResources and their operations over a ScVmmServerResource. public static ScVmmServerCollection GetScVmmServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmServers(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmServers(); } /// @@ -202,16 +172,20 @@ public static ScVmmServerCollection GetScVmmServers(this ResourceGroupResource r /// VmmServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VMMServer. /// The cancellation token to use. - /// 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 static async Task> GetScVmmServerAsync(this ResourceGroupResource resourceGroupResource, string vmmServerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmServers().GetAsync(vmmServerName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmServerAsync(vmmServerName, cancellationToken).ConfigureAwait(false); } /// @@ -226,24 +200,34 @@ public static async Task> GetScVmmServerAsync(this /// VmmServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VMMServer. /// The cancellation token to use. - /// 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 static Response GetScVmmServer(this ResourceGroupResource resourceGroupResource, string vmmServerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmServers().Get(vmmServerName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmServer(vmmServerName, cancellationToken); } - /// Gets a collection of ScVmmCloudResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmCloudResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmCloudResources and their operations over a ScVmmCloudResource. public static ScVmmCloudCollection GetScVmmClouds(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmClouds(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmClouds(); } /// @@ -258,16 +242,20 @@ public static ScVmmCloudCollection GetScVmmClouds(this ResourceGroupResource res /// Clouds_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Cloud. /// The cancellation token to use. - /// 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 static async Task> GetScVmmCloudAsync(this ResourceGroupResource resourceGroupResource, string cloudName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmClouds().GetAsync(cloudName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmCloudAsync(cloudName, cancellationToken).ConfigureAwait(false); } /// @@ -282,24 +270,34 @@ public static async Task> GetScVmmCloudAsync(this R /// Clouds_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Cloud. /// The cancellation token to use. - /// 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 static Response GetScVmmCloud(this ResourceGroupResource resourceGroupResource, string cloudName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmClouds().Get(cloudName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmCloud(cloudName, cancellationToken); } - /// Gets a collection of ScVmmVirtualNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmVirtualNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmVirtualNetworkResources and their operations over a ScVmmVirtualNetworkResource. public static ScVmmVirtualNetworkCollection GetScVmmVirtualNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmVirtualNetworks(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualNetworks(); } /// @@ -314,16 +312,20 @@ public static ScVmmVirtualNetworkCollection GetScVmmVirtualNetworks(this Resourc /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualNetwork. /// The cancellation token to use. - /// 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 static async Task> GetScVmmVirtualNetworkAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmVirtualNetworks().GetAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualNetworkAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -338,24 +340,34 @@ public static async Task> GetScVmmVirtualN /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualNetwork. /// The cancellation token to use. - /// 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 static Response GetScVmmVirtualNetwork(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmVirtualNetworks().Get(virtualNetworkName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualNetwork(virtualNetworkName, cancellationToken); } - /// Gets a collection of ScVmmVirtualMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmVirtualMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmVirtualMachineResources and their operations over a ScVmmVirtualMachineResource. public static ScVmmVirtualMachineCollection GetScVmmVirtualMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmVirtualMachines(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachines(); } /// @@ -370,16 +382,20 @@ public static ScVmmVirtualMachineCollection GetScVmmVirtualMachines(this Resourc /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualMachine. /// The cancellation token to use. - /// 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 static async Task> GetScVmmVirtualMachineAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachineAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); } /// @@ -394,24 +410,34 @@ public static async Task> GetScVmmVirtualM /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualMachine. /// The cancellation token to use. - /// 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 static Response GetScVmmVirtualMachine(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmVirtualMachines().Get(virtualMachineName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachine(virtualMachineName, cancellationToken); } - /// Gets a collection of ScVmmVirtualMachineTemplateResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmVirtualMachineTemplateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmVirtualMachineTemplateResources and their operations over a ScVmmVirtualMachineTemplateResource. public static ScVmmVirtualMachineTemplateCollection GetScVmmVirtualMachineTemplates(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmVirtualMachineTemplates(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachineTemplates(); } /// @@ -426,16 +452,20 @@ public static ScVmmVirtualMachineTemplateCollection GetScVmmVirtualMachineTempla /// VirtualMachineTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualMachineTemplate. /// The cancellation token to use. - /// 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 static async Task> GetScVmmVirtualMachineTemplateAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineTemplateName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmVirtualMachineTemplates().GetAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachineTemplateAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); } /// @@ -450,24 +480,34 @@ public static async Task> GetScVmm /// VirtualMachineTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the VirtualMachineTemplate. /// The cancellation token to use. - /// 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 static Response GetScVmmVirtualMachineTemplate(this ResourceGroupResource resourceGroupResource, string virtualMachineTemplateName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmVirtualMachineTemplates().Get(virtualMachineTemplateName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmVirtualMachineTemplate(virtualMachineTemplateName, cancellationToken); } - /// Gets a collection of ScVmmAvailabilitySetResources in the ResourceGroupResource. + /// + /// Gets a collection of ScVmmAvailabilitySetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScVmmAvailabilitySetResources and their operations over a ScVmmAvailabilitySetResource. public static ScVmmAvailabilitySetCollection GetScVmmAvailabilitySets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScVmmAvailabilitySets(); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmAvailabilitySets(); } /// @@ -482,16 +522,20 @@ public static ScVmmAvailabilitySetCollection GetScVmmAvailabilitySets(this Resou /// AvailabilitySets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the AvailabilitySet. /// The cancellation token to use. - /// 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 static async Task> GetScVmmAvailabilitySetAsync(this ResourceGroupResource resourceGroupResource, string availabilitySetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScVmmAvailabilitySets().GetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); + return await GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmAvailabilitySetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); } /// @@ -506,16 +550,20 @@ public static async Task> GetScVmmAvailab /// AvailabilitySets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the AvailabilitySet. /// The cancellation token to use. - /// 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 static Response GetScVmmAvailabilitySet(this ResourceGroupResource resourceGroupResource, string availabilitySetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScVmmAvailabilitySets().Get(availabilitySetName, cancellationToken); + return GetArcScVmmResourceGroupMockingExtension(resourceGroupResource).GetScVmmAvailabilitySet(availabilitySetName, cancellationToken); } /// @@ -530,13 +578,17 @@ public static Response GetScVmmAvailabilitySet(thi /// VmmServers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmServersAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmServersAsync(cancellationToken); } /// @@ -551,13 +603,17 @@ public static AsyncPageable GetScVmmServersAsync(this Subsc /// VmmServers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmServers(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmServers(cancellationToken); } /// @@ -572,13 +628,17 @@ public static Pageable GetScVmmServers(this SubscriptionRes /// Clouds_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmCloudsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmCloudsAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmCloudsAsync(cancellationToken); } /// @@ -593,13 +653,17 @@ public static AsyncPageable GetScVmmCloudsAsync(this Subscri /// Clouds_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmClouds(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmClouds(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmClouds(cancellationToken); } /// @@ -614,13 +678,17 @@ public static Pageable GetScVmmClouds(this SubscriptionResou /// VirtualNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmVirtualNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualNetworksAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualNetworksAsync(cancellationToken); } /// @@ -635,13 +703,17 @@ public static AsyncPageable GetScVmmVirtualNetworks /// VirtualNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmVirtualNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualNetworks(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualNetworks(cancellationToken); } /// @@ -656,13 +728,17 @@ public static Pageable GetScVmmVirtualNetworks(this /// VirtualMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmVirtualMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualMachinesAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualMachinesAsync(cancellationToken); } /// @@ -677,13 +753,17 @@ public static AsyncPageable GetScVmmVirtualMachines /// VirtualMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmVirtualMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualMachines(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualMachines(cancellationToken); } /// @@ -698,13 +778,17 @@ public static Pageable GetScVmmVirtualMachines(this /// VirtualMachineTemplates_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmVirtualMachineTemplatesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualMachineTemplatesAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualMachineTemplatesAsync(cancellationToken); } /// @@ -719,13 +803,17 @@ public static AsyncPageable GetScVmmVirtual /// VirtualMachineTemplates_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmVirtualMachineTemplates(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmVirtualMachineTemplates(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmVirtualMachineTemplates(cancellationToken); } /// @@ -740,13 +828,17 @@ public static Pageable GetScVmmVirtualMachi /// AvailabilitySets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScVmmAvailabilitySetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmAvailabilitySetsAsync(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmAvailabilitySetsAsync(cancellationToken); } /// @@ -761,13 +853,17 @@ public static AsyncPageable GetScVmmAvailabilitySe /// AvailabilitySets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScVmmAvailabilitySets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScVmmAvailabilitySets(cancellationToken); + return GetArcScVmmSubscriptionMockingExtension(subscriptionResource).GetScVmmAvailabilitySets(cancellationToken); } } } diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmResourceGroupMockingExtension.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..67bd997c84ce --- /dev/null +++ b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmResourceGroupMockingExtension.cs @@ -0,0 +1,357 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ArcScVmm; + +namespace Azure.ResourceManager.ArcScVmm.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ArcScVmmResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ArcScVmmResourceGroupMockingExtension() + { + } + + /// 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 ArcScVmmResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ScVmmServerResources in the ResourceGroupResource. + /// An object representing collection of ScVmmServerResources and their operations over a ScVmmServerResource. + public virtual ScVmmServerCollection GetScVmmServers() + { + return GetCachedClient(client => new ScVmmServerCollection(client, Id)); + } + + /// + /// Implements VMMServer GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName} + /// + /// + /// Operation Id + /// VmmServers_Get + /// + /// + /// + /// Name of the VMMServer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmServerAsync(string vmmServerName, CancellationToken cancellationToken = default) + { + return await GetScVmmServers().GetAsync(vmmServerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements VMMServer GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName} + /// + /// + /// Operation Id + /// VmmServers_Get + /// + /// + /// + /// Name of the VMMServer. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmServer(string vmmServerName, CancellationToken cancellationToken = default) + { + return GetScVmmServers().Get(vmmServerName, cancellationToken); + } + + /// Gets a collection of ScVmmCloudResources in the ResourceGroupResource. + /// An object representing collection of ScVmmCloudResources and their operations over a ScVmmCloudResource. + public virtual ScVmmCloudCollection GetScVmmClouds() + { + return GetCachedClient(client => new ScVmmCloudCollection(client, Id)); + } + + /// + /// Implements Cloud GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudName} + /// + /// + /// Operation Id + /// Clouds_Get + /// + /// + /// + /// Name of the Cloud. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmCloudAsync(string cloudName, CancellationToken cancellationToken = default) + { + return await GetScVmmClouds().GetAsync(cloudName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements Cloud GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudName} + /// + /// + /// Operation Id + /// Clouds_Get + /// + /// + /// + /// Name of the Cloud. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmCloud(string cloudName, CancellationToken cancellationToken = default) + { + return GetScVmmClouds().Get(cloudName, cancellationToken); + } + + /// Gets a collection of ScVmmVirtualNetworkResources in the ResourceGroupResource. + /// An object representing collection of ScVmmVirtualNetworkResources and their operations over a ScVmmVirtualNetworkResource. + public virtual ScVmmVirtualNetworkCollection GetScVmmVirtualNetworks() + { + return GetCachedClient(client => new ScVmmVirtualNetworkCollection(client, Id)); + } + + /// + /// Implements VirtualNetwork GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// Name of the VirtualNetwork. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmVirtualNetworkAsync(string virtualNetworkName, CancellationToken cancellationToken = default) + { + return await GetScVmmVirtualNetworks().GetAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements VirtualNetwork GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// Name of the VirtualNetwork. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmVirtualNetwork(string virtualNetworkName, CancellationToken cancellationToken = default) + { + return GetScVmmVirtualNetworks().Get(virtualNetworkName, cancellationToken); + } + + /// Gets a collection of ScVmmVirtualMachineResources in the ResourceGroupResource. + /// An object representing collection of ScVmmVirtualMachineResources and their operations over a ScVmmVirtualMachineResource. + public virtual ScVmmVirtualMachineCollection GetScVmmVirtualMachines() + { + return GetCachedClient(client => new ScVmmVirtualMachineCollection(client, Id)); + } + + /// + /// Implements VirtualMachine GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// Name of the VirtualMachine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmVirtualMachineAsync(string virtualMachineName, CancellationToken cancellationToken = default) + { + return await GetScVmmVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements VirtualMachine GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// Name of the VirtualMachine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmVirtualMachine(string virtualMachineName, CancellationToken cancellationToken = default) + { + return GetScVmmVirtualMachines().Get(virtualMachineName, cancellationToken); + } + + /// Gets a collection of ScVmmVirtualMachineTemplateResources in the ResourceGroupResource. + /// An object representing collection of ScVmmVirtualMachineTemplateResources and their operations over a ScVmmVirtualMachineTemplateResource. + public virtual ScVmmVirtualMachineTemplateCollection GetScVmmVirtualMachineTemplates() + { + return GetCachedClient(client => new ScVmmVirtualMachineTemplateCollection(client, Id)); + } + + /// + /// Implements VirtualMachineTemplate GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName} + /// + /// + /// Operation Id + /// VirtualMachineTemplates_Get + /// + /// + /// + /// Name of the VirtualMachineTemplate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmVirtualMachineTemplateAsync(string virtualMachineTemplateName, CancellationToken cancellationToken = default) + { + return await GetScVmmVirtualMachineTemplates().GetAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements VirtualMachineTemplate GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName} + /// + /// + /// Operation Id + /// VirtualMachineTemplates_Get + /// + /// + /// + /// Name of the VirtualMachineTemplate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmVirtualMachineTemplate(string virtualMachineTemplateName, CancellationToken cancellationToken = default) + { + return GetScVmmVirtualMachineTemplates().Get(virtualMachineTemplateName, cancellationToken); + } + + /// Gets a collection of ScVmmAvailabilitySetResources in the ResourceGroupResource. + /// An object representing collection of ScVmmAvailabilitySetResources and their operations over a ScVmmAvailabilitySetResource. + public virtual ScVmmAvailabilitySetCollection GetScVmmAvailabilitySets() + { + return GetCachedClient(client => new ScVmmAvailabilitySetCollection(client, Id)); + } + + /// + /// Implements AvailabilitySet GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetName} + /// + /// + /// Operation Id + /// AvailabilitySets_Get + /// + /// + /// + /// Name of the AvailabilitySet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScVmmAvailabilitySetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + { + return await GetScVmmAvailabilitySets().GetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements AvailabilitySet GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetName} + /// + /// + /// Operation Id + /// AvailabilitySets_Get + /// + /// + /// + /// Name of the AvailabilitySet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScVmmAvailabilitySet(string availabilitySetName, CancellationToken cancellationToken = default) + { + return GetScVmmAvailabilitySets().Get(availabilitySetName, cancellationToken); + } + } +} diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmSubscriptionMockingExtension.cs similarity index 91% rename from sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmSubscriptionMockingExtension.cs index 3b8b499bc428..b7c307fa098d 100644 --- a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ArcScVmmSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ArcScVmm; -namespace Azure.ResourceManager.ArcScVmm +namespace Azure.ResourceManager.ArcScVmm.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ArcScVmmSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _scVmmServerVmmServersClientDiagnostics; private VmmServersRestOperations _scVmmServerVmmServersRestClient; @@ -30,15 +31,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _scVmmAvailabilitySetAvailabilitySetsClientDiagnostics; private AvailabilitySetsRestOperations _scVmmAvailabilitySetAvailabilitySetsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ArcScVmmSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ArcScVmmSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -80,7 +81,7 @@ public virtual AsyncPageable GetScVmmServersAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmServerVmmServersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmServerVmmServersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmServerResource(Client, ScVmmServerData.DeserializeScVmmServerData(e)), ScVmmServerVmmServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmServerResource(Client, ScVmmServerData.DeserializeScVmmServerData(e)), ScVmmServerVmmServersClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmServers", "value", "nextLink", cancellationToken); } /// @@ -102,7 +103,7 @@ public virtual Pageable GetScVmmServers(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmServerVmmServersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmServerVmmServersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmServerResource(Client, ScVmmServerData.DeserializeScVmmServerData(e)), ScVmmServerVmmServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmServerResource(Client, ScVmmServerData.DeserializeScVmmServerData(e)), ScVmmServerVmmServersClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmServers", "value", "nextLink", cancellationToken); } /// @@ -124,7 +125,7 @@ public virtual AsyncPageable GetScVmmCloudsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmCloudCloudsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmCloudCloudsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmCloudResource(Client, ScVmmCloudData.DeserializeScVmmCloudData(e)), ScVmmCloudCloudsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmClouds", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmCloudResource(Client, ScVmmCloudData.DeserializeScVmmCloudData(e)), ScVmmCloudCloudsClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmClouds", "value", "nextLink", cancellationToken); } /// @@ -146,7 +147,7 @@ public virtual Pageable GetScVmmClouds(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmCloudCloudsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmCloudCloudsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmCloudResource(Client, ScVmmCloudData.DeserializeScVmmCloudData(e)), ScVmmCloudCloudsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmClouds", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmCloudResource(Client, ScVmmCloudData.DeserializeScVmmCloudData(e)), ScVmmCloudCloudsClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmClouds", "value", "nextLink", cancellationToken); } /// @@ -168,7 +169,7 @@ public virtual AsyncPageable GetScVmmVirtualNetwork { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualNetworkVirtualNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualNetworkVirtualNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualNetworkResource(Client, ScVmmVirtualNetworkData.DeserializeScVmmVirtualNetworkData(e)), ScVmmVirtualNetworkVirtualNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualNetworkResource(Client, ScVmmVirtualNetworkData.DeserializeScVmmVirtualNetworkData(e)), ScVmmVirtualNetworkVirtualNetworksClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -190,7 +191,7 @@ public virtual Pageable GetScVmmVirtualNetworks(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualNetworkVirtualNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualNetworkVirtualNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualNetworkResource(Client, ScVmmVirtualNetworkData.DeserializeScVmmVirtualNetworkData(e)), ScVmmVirtualNetworkVirtualNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualNetworkResource(Client, ScVmmVirtualNetworkData.DeserializeScVmmVirtualNetworkData(e)), ScVmmVirtualNetworkVirtualNetworksClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -212,7 +213,7 @@ public virtual AsyncPageable GetScVmmVirtualMachine { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineResource(Client, ScVmmVirtualMachineData.DeserializeScVmmVirtualMachineData(e)), ScVmmVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineResource(Client, ScVmmVirtualMachineData.DeserializeScVmmVirtualMachineData(e)), ScVmmVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -234,7 +235,7 @@ public virtual Pageable GetScVmmVirtualMachines(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineResource(Client, ScVmmVirtualMachineData.DeserializeScVmmVirtualMachineData(e)), ScVmmVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineResource(Client, ScVmmVirtualMachineData.DeserializeScVmmVirtualMachineData(e)), ScVmmVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -256,7 +257,7 @@ public virtual AsyncPageable GetScVmmVirtua { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualMachineTemplateVirtualMachineTemplatesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualMachineTemplateVirtualMachineTemplatesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineTemplateResource(Client, ScVmmVirtualMachineTemplateData.DeserializeScVmmVirtualMachineTemplateData(e)), ScVmmVirtualMachineTemplateVirtualMachineTemplatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualMachineTemplates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineTemplateResource(Client, ScVmmVirtualMachineTemplateData.DeserializeScVmmVirtualMachineTemplateData(e)), ScVmmVirtualMachineTemplateVirtualMachineTemplatesClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualMachineTemplates", "value", "nextLink", cancellationToken); } /// @@ -278,7 +279,7 @@ public virtual Pageable GetScVmmVirtualMach { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmVirtualMachineTemplateVirtualMachineTemplatesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmVirtualMachineTemplateVirtualMachineTemplatesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineTemplateResource(Client, ScVmmVirtualMachineTemplateData.DeserializeScVmmVirtualMachineTemplateData(e)), ScVmmVirtualMachineTemplateVirtualMachineTemplatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmVirtualMachineTemplates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmVirtualMachineTemplateResource(Client, ScVmmVirtualMachineTemplateData.DeserializeScVmmVirtualMachineTemplateData(e)), ScVmmVirtualMachineTemplateVirtualMachineTemplatesClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmVirtualMachineTemplates", "value", "nextLink", cancellationToken); } /// @@ -300,7 +301,7 @@ public virtual AsyncPageable GetScVmmAvailabilityS { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmAvailabilitySetAvailabilitySetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmAvailabilitySetAvailabilitySetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmAvailabilitySetResource(Client, ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(e)), ScVmmAvailabilitySetAvailabilitySetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmAvailabilitySets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScVmmAvailabilitySetResource(Client, ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(e)), ScVmmAvailabilitySetAvailabilitySetsClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmAvailabilitySets", "value", "nextLink", cancellationToken); } /// @@ -322,7 +323,7 @@ public virtual Pageable GetScVmmAvailabilitySets(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ScVmmAvailabilitySetAvailabilitySetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScVmmAvailabilitySetAvailabilitySetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmAvailabilitySetResource(Client, ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(e)), ScVmmAvailabilitySetAvailabilitySetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScVmmAvailabilitySets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScVmmAvailabilitySetResource(Client, ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(e)), ScVmmAvailabilitySetAvailabilitySetsClientDiagnostics, Pipeline, "ArcScVmmSubscriptionMockingExtension.GetScVmmAvailabilitySets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4cdb2ba54f5d..000000000000 --- a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ArcScVmm -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ScVmmServerResources in the ResourceGroupResource. - /// An object representing collection of ScVmmServerResources and their operations over a ScVmmServerResource. - public virtual ScVmmServerCollection GetScVmmServers() - { - return GetCachedClient(Client => new ScVmmServerCollection(Client, Id)); - } - - /// Gets a collection of ScVmmCloudResources in the ResourceGroupResource. - /// An object representing collection of ScVmmCloudResources and their operations over a ScVmmCloudResource. - public virtual ScVmmCloudCollection GetScVmmClouds() - { - return GetCachedClient(Client => new ScVmmCloudCollection(Client, Id)); - } - - /// Gets a collection of ScVmmVirtualNetworkResources in the ResourceGroupResource. - /// An object representing collection of ScVmmVirtualNetworkResources and their operations over a ScVmmVirtualNetworkResource. - public virtual ScVmmVirtualNetworkCollection GetScVmmVirtualNetworks() - { - return GetCachedClient(Client => new ScVmmVirtualNetworkCollection(Client, Id)); - } - - /// Gets a collection of ScVmmVirtualMachineResources in the ResourceGroupResource. - /// An object representing collection of ScVmmVirtualMachineResources and their operations over a ScVmmVirtualMachineResource. - public virtual ScVmmVirtualMachineCollection GetScVmmVirtualMachines() - { - return GetCachedClient(Client => new ScVmmVirtualMachineCollection(Client, Id)); - } - - /// Gets a collection of ScVmmVirtualMachineTemplateResources in the ResourceGroupResource. - /// An object representing collection of ScVmmVirtualMachineTemplateResources and their operations over a ScVmmVirtualMachineTemplateResource. - public virtual ScVmmVirtualMachineTemplateCollection GetScVmmVirtualMachineTemplates() - { - return GetCachedClient(Client => new ScVmmVirtualMachineTemplateCollection(Client, Id)); - } - - /// Gets a collection of ScVmmAvailabilitySetResources in the ResourceGroupResource. - /// An object representing collection of ScVmmAvailabilitySetResources and their operations over a ScVmmAvailabilitySetResource. - public virtual ScVmmAvailabilitySetCollection GetScVmmAvailabilitySets() - { - return GetCachedClient(Client => new ScVmmAvailabilitySetCollection(Client, Id)); - } - } -} diff --git a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/ScVmmServerResource.cs b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/ScVmmServerResource.cs index b8d3ba732e58..2353fc8c5a31 100644 --- a/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/ScVmmServerResource.cs +++ b/sdk/arc-scvmm/Azure.ResourceManager.ArcScVmm/src/Generated/ScVmmServerResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of InventoryItemResources and their operations over a InventoryItemResource. public virtual InventoryItemCollection GetInventoryItems() { - return GetCachedClient(Client => new InventoryItemCollection(Client, Id)); + return GetCachedClient(client => new InventoryItemCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual InventoryItemCollection GetInventoryItems() /// /// Name of the inventoryItem. /// The cancellation token to use. - /// 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> GetInventoryItemAsync(string inventoryItemName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetInventoryItemAsync /// /// Name of the inventoryItem. /// The cancellation token to use. - /// 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 GetInventoryItem(string inventoryItemName, CancellationToken cancellationToken = default) { diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/AttestationProviderResource.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/AttestationProviderResource.cs index f29ea881582e..bb703a4b40ad 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/AttestationProviderResource.cs +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/AttestationProviderResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AttestationPrivateEndpointConnectionResources and their operations over a AttestationPrivateEndpointConnectionResource. public virtual AttestationPrivateEndpointConnectionCollection GetAttestationPrivateEndpointConnections() { - return GetCachedClient(Client => new AttestationPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new AttestationPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual AttestationPrivateEndpointConnectionCollection GetAttestationPriv /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetAttestationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetAttestationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationArmClientMockingExtension.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationArmClientMockingExtension.cs new file mode 100644 index 000000000000..ab86861a18ab --- /dev/null +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Attestation; + +namespace Azure.ResourceManager.Attestation.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AttestationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AttestationArmClientMockingExtension() + { + } + + /// 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 AttestationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AttestationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AttestationProviderResource GetAttestationProviderResource(ResourceIdentifier id) + { + AttestationProviderResource.ValidateResourceId(id); + return new AttestationProviderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AttestationPrivateEndpointConnectionResource GetAttestationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + AttestationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new AttestationPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationExtensions.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationExtensions.cs index 2eb6d2f9fa27..659a78da480e 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationExtensions.cs +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Attestation.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Attestation @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.Attestation /// A class to add extension methods to Azure.ResourceManager.Attestation. public static partial class AttestationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AttestationArmClientMockingExtension GetAttestationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AttestationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AttestationResourceGroupMockingExtension GetAttestationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AttestationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AttestationSubscriptionMockingExtension GetAttestationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AttestationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AttestationProviderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AttestationProviderResource GetAttestationProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AttestationProviderResource.ValidateResourceId(id); - return new AttestationProviderResource(client, id); - } - ); + return GetAttestationArmClientMockingExtension(client).GetAttestationProviderResource(id); } - #endregion - #region AttestationPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AttestationPrivateEndpointConnectionResource GetAttestationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AttestationPrivateEndpointConnectionResource.ValidateResourceId(id); - return new AttestationPrivateEndpointConnectionResource(client, id); - } - ); + return GetAttestationArmClientMockingExtension(client).GetAttestationPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of AttestationProviderResources in the ResourceGroupResource. + /// + /// Gets a collection of AttestationProviderResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AttestationProviderResources and their operations over a AttestationProviderResource. public static AttestationProviderCollection GetAttestationProviders(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAttestationProviders(); + return GetAttestationResourceGroupMockingExtension(resourceGroupResource).GetAttestationProviders(); } /// @@ -107,16 +92,20 @@ public static AttestationProviderCollection GetAttestationProviders(this Resourc /// AttestationProviders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the attestation provider. /// The cancellation token to use. - /// 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 static async Task> GetAttestationProviderAsync(this ResourceGroupResource resourceGroupResource, string providerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAttestationProviders().GetAsync(providerName, cancellationToken).ConfigureAwait(false); + return await GetAttestationResourceGroupMockingExtension(resourceGroupResource).GetAttestationProviderAsync(providerName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetAttestationPr /// AttestationProviders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the attestation provider. /// The cancellation token to use. - /// 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 static Response GetAttestationProvider(this ResourceGroupResource resourceGroupResource, string providerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAttestationProviders().Get(providerName, cancellationToken); + return GetAttestationResourceGroupMockingExtension(resourceGroupResource).GetAttestationProvider(providerName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetAttestationProvider(this /// AttestationProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAttestationProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAttestationProvidersAsync(cancellationToken); + return GetAttestationSubscriptionMockingExtension(subscriptionResource).GetAttestationProvidersAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetAttestationProviders /// AttestationProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAttestationProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAttestationProviders(cancellationToken); + return GetAttestationSubscriptionMockingExtension(subscriptionResource).GetAttestationProviders(cancellationToken); } /// @@ -197,13 +198,17 @@ public static Pageable GetAttestationProviders(this /// AttestationProviders_ListDefault /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAttestationProvidersByDefaultProviderAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAttestationProvidersByDefaultProviderAsync(cancellationToken); + return GetAttestationSubscriptionMockingExtension(subscriptionResource).GetAttestationProvidersByDefaultProviderAsync(cancellationToken); } /// @@ -218,13 +223,17 @@ public static AsyncPageable GetAttestationProviders /// AttestationProviders_ListDefault /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAttestationProvidersByDefaultProvider(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAttestationProvidersByDefaultProvider(cancellationToken); + return GetAttestationSubscriptionMockingExtension(subscriptionResource).GetAttestationProvidersByDefaultProvider(cancellationToken); } /// @@ -239,13 +248,17 @@ public static Pageable GetAttestationProvidersByDef /// AttestationProviders_GetDefaultByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the default provider. /// The cancellation token to use. public static async Task> GetDefaultByLocationAttestationProviderAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetDefaultByLocationAttestationProviderAsync(location, cancellationToken).ConfigureAwait(false); + return await GetAttestationSubscriptionMockingExtension(subscriptionResource).GetDefaultByLocationAttestationProviderAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -260,13 +273,17 @@ public static async Task> GetDefaultByLoca /// AttestationProviders_GetDefaultByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the default provider. /// The cancellation token to use. public static Response GetDefaultByLocationAttestationProvider(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDefaultByLocationAttestationProvider(location, cancellationToken); + return GetAttestationSubscriptionMockingExtension(subscriptionResource).GetDefaultByLocationAttestationProvider(location, cancellationToken); } } } diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationResourceGroupMockingExtension.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f49eafb6038f --- /dev/null +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Attestation; + +namespace Azure.ResourceManager.Attestation.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AttestationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AttestationResourceGroupMockingExtension() + { + } + + /// 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 AttestationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AttestationProviderResources in the ResourceGroupResource. + /// An object representing collection of AttestationProviderResources and their operations over a AttestationProviderResource. + public virtual AttestationProviderCollection GetAttestationProviders() + { + return GetCachedClient(client => new AttestationProviderCollection(client, Id)); + } + + /// + /// Get the status of Attestation Provider. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName} + /// + /// + /// Operation Id + /// AttestationProviders_Get + /// + /// + /// + /// Name of the attestation provider. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAttestationProviderAsync(string providerName, CancellationToken cancellationToken = default) + { + return await GetAttestationProviders().GetAsync(providerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the status of Attestation Provider. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName} + /// + /// + /// Operation Id + /// AttestationProviders_Get + /// + /// + /// + /// Name of the attestation provider. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAttestationProvider(string providerName, CancellationToken cancellationToken = default) + { + return GetAttestationProviders().Get(providerName, cancellationToken); + } + } +} diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationSubscriptionMockingExtension.cs similarity index 87% rename from sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationSubscriptionMockingExtension.cs index feff75ddea9d..2029686b4303 100644 --- a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/AttestationSubscriptionMockingExtension.cs @@ -13,24 +13,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Attestation; -namespace Azure.ResourceManager.Attestation +namespace Azure.ResourceManager.Attestation.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AttestationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _attestationProviderClientDiagnostics; private AttestationProvidersRestOperations _attestationProviderRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AttestationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AttestationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetAttestationProvidersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AttestationProviderRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAttestationProviders", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "AttestationSubscriptionMockingExtension.GetAttestationProviders", "value", null, cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual AsyncPageable GetAttestationProvider public virtual Pageable GetAttestationProviders(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AttestationProviderRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAttestationProviders", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "AttestationSubscriptionMockingExtension.GetAttestationProviders", "value", null, cancellationToken); } /// @@ -103,7 +104,7 @@ public virtual Pageable GetAttestationProviders(Can public virtual AsyncPageable GetAttestationProvidersByDefaultProviderAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AttestationProviderRestClient.CreateListDefaultRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAttestationProvidersByDefaultProvider", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "AttestationSubscriptionMockingExtension.GetAttestationProvidersByDefaultProvider", "value", null, cancellationToken); } /// @@ -124,7 +125,7 @@ public virtual AsyncPageable GetAttestationProvider public virtual Pageable GetAttestationProvidersByDefaultProvider(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AttestationProviderRestClient.CreateListDefaultRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAttestationProvidersByDefaultProvider", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AttestationProviderResource(Client, AttestationProviderData.DeserializeAttestationProviderData(e)), AttestationProviderClientDiagnostics, Pipeline, "AttestationSubscriptionMockingExtension.GetAttestationProvidersByDefaultProvider", "value", null, cancellationToken); } /// @@ -144,7 +145,7 @@ public virtual Pageable GetAttestationProvidersByDe /// The cancellation token to use. public virtual async Task> GetDefaultByLocationAttestationProviderAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = AttestationProviderClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDefaultByLocationAttestationProvider"); + using var scope = AttestationProviderClientDiagnostics.CreateScope("AttestationSubscriptionMockingExtension.GetDefaultByLocationAttestationProvider"); scope.Start(); try { @@ -175,7 +176,7 @@ public virtual async Task> GetDefaultByLoc /// The cancellation token to use. public virtual Response GetDefaultByLocationAttestationProvider(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = AttestationProviderClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDefaultByLocationAttestationProvider"); + using var scope = AttestationProviderClientDiagnostics.CreateScope("AttestationSubscriptionMockingExtension.GetDefaultByLocationAttestationProvider"); scope.Start(); try { diff --git a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d6350d52e2ff..000000000000 --- a/sdk/attestation/Azure.ResourceManager.Attestation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Attestation -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AttestationProviderResources in the ResourceGroupResource. - /// An object representing collection of AttestationProviderResources and their operations over a AttestationProviderResource. - public virtual AttestationProviderCollection GetAttestationProviders() - { - return GetCachedClient(Client => new AttestationProviderCollection(Client, Id)); - } - } -} diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs b/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs deleted file mode 100644 index cd8ab4c9bd34..000000000000 --- a/sdk/authorization/Azure.ResourceManager.Authorization/samples/Generated/Samples/Sample_ArmResourceExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.Authorization.Models; - -namespace Azure.ResourceManager.Authorization.Samples -{ - public partial class Sample_ArmResourceExtensions - { - // GetEligibleChildResourcesByScope - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetEligibleChildResources_GetEligibleChildResourcesByScope() - { - // Generated from example definition: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json - // this example is just showing the usage of "EligibleChildResources_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); - - // invoke the operation and iterate over the result - string scope = "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f"; - ResourceIdentifier scope0 = new ResourceIdentifier(string.Format("/{0}", scope)); - string filter = "resourceType+eq+'resourcegroup'"; - await foreach (EligibleChildResource item in client.GetEligibleChildResourcesAsync(scope0, filter: filter)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 3022e42d44c9..000000000000 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Authorization.Models; - -namespace Azure.ResourceManager.Authorization -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _eligibleChildResourcesClientDiagnostics; - private EligibleChildResourcesRestOperations _eligibleChildResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics EligibleChildResourcesClientDiagnostics => _eligibleChildResourcesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Authorization", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private EligibleChildResourcesRestOperations EligibleChildResourcesRestClient => _eligibleChildResourcesRestClient ??= new EligibleChildResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DenyAssignmentResources in the ArmResource. - /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. - public virtual DenyAssignmentCollection GetDenyAssignments() - { - return GetCachedClient(Client => new DenyAssignmentCollection(Client, Id)); - } - - /// Gets a collection of RoleAssignmentResources in the ArmResource. - /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. - public virtual RoleAssignmentCollection GetRoleAssignments() - { - return GetCachedClient(Client => new RoleAssignmentCollection(Client, Id)); - } - - /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmResource. - /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. - public virtual AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions() - { - return GetCachedClient(Client => new AuthorizationRoleDefinitionCollection(Client, Id)); - } - - /// Gets a collection of RoleAssignmentScheduleResources in the ArmResource. - /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. - public virtual RoleAssignmentScheduleCollection GetRoleAssignmentSchedules() - { - return GetCachedClient(Client => new RoleAssignmentScheduleCollection(Client, Id)); - } - - /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmResource. - /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. - public virtual RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances() - { - return GetCachedClient(Client => new RoleAssignmentScheduleInstanceCollection(Client, Id)); - } - - /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmResource. - /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. - public virtual RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests() - { - return GetCachedClient(Client => new RoleAssignmentScheduleRequestCollection(Client, Id)); - } - - /// Gets a collection of RoleEligibilityScheduleResources in the ArmResource. - /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. - public virtual RoleEligibilityScheduleCollection GetRoleEligibilitySchedules() - { - return GetCachedClient(Client => new RoleEligibilityScheduleCollection(Client, Id)); - } - - /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmResource. - /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. - public virtual RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances() - { - return GetCachedClient(Client => new RoleEligibilityScheduleInstanceCollection(Client, Id)); - } - - /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmResource. - /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. - public virtual RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests() - { - return GetCachedClient(Client => new RoleEligibilityScheduleRequestCollection(Client, Id)); - } - - /// Gets a collection of RoleManagementPolicyResources in the ArmResource. - /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. - public virtual RoleManagementPolicyCollection GetRoleManagementPolicies() - { - return GetCachedClient(Client => new RoleManagementPolicyCollection(Client, Id)); - } - - /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmResource. - /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. - public virtual RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments() - { - return GetCachedClient(Client => new RoleManagementPolicyAssignmentCollection(Client, Id)); - } - - /// - /// Get the child resources of a resource on which user has eligible access - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources - /// - /// - /// Operation Id - /// EligibleChildResources_Get - /// - /// - /// - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEligibleChildResourcesAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => EligibleChildResourcesRestClient.CreateGetRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EligibleChildResourcesRestClient.CreateGetNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EligibleChildResource.DeserializeEligibleChildResource, EligibleChildResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetEligibleChildResources", "value", "nextLink", cancellationToken); - } - - /// - /// Get the child resources of a resource on which user has eligible access - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources - /// - /// - /// Operation Id - /// EligibleChildResources_Get - /// - /// - /// - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEligibleChildResources(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => EligibleChildResourcesRestClient.CreateGetRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EligibleChildResourcesRestClient.CreateGetNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EligibleChildResource.DeserializeEligibleChildResource, EligibleChildResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetEligibleChildResources", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmClientMockingExtension.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmClientMockingExtension.cs new file mode 100644 index 000000000000..c48264504fb7 --- /dev/null +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmClientMockingExtension.cs @@ -0,0 +1,857 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Authorization; +using Azure.ResourceManager.Authorization.Models; + +namespace Azure.ResourceManager.Authorization.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AuthorizationArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _eligibleChildResourcesClientDiagnostics; + private EligibleChildResourcesRestOperations _eligibleChildResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected AuthorizationArmClientMockingExtension() + { + } + + /// 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 AuthorizationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AuthorizationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics EligibleChildResourcesClientDiagnostics => _eligibleChildResourcesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Authorization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private EligibleChildResourcesRestOperations EligibleChildResourcesRestClient => _eligibleChildResourcesRestClient ??= new EligibleChildResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DenyAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. + public virtual DenyAssignmentCollection GetDenyAssignments(ResourceIdentifier scope) + { + return new DenyAssignmentCollection(Client, scope); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDenyAssignmentAsync(ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) + { + return await GetDenyAssignments(scope).GetAsync(denyAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDenyAssignment(ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) + { + return GetDenyAssignments(scope).Get(denyAssignmentId, cancellationToken); + } + + /// Gets a collection of RoleAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. + public virtual RoleAssignmentCollection GetRoleAssignments(ResourceIdentifier scope) + { + return new RoleAssignmentCollection(Client, scope); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentAsync(ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return await GetRoleAssignments(scope).GetAsync(roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRoleAssignment(ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return GetRoleAssignments(scope).Get(roleAssignmentName, tenantId, cancellationToken); + } + + /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. + public virtual AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions(ResourceIdentifier scope) + { + return new AuthorizationRoleDefinitionCollection(Client, scope); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAuthorizationRoleDefinitionAsync(ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetAuthorizationRoleDefinitions(scope).GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAuthorizationRoleDefinition(ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetAuthorizationRoleDefinitions(scope).Get(roleDefinitionId, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. + public virtual RoleAssignmentScheduleCollection GetRoleAssignmentSchedules(ResourceIdentifier scope) + { + return new RoleAssignmentScheduleCollection(Client, scope); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleAsync(ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentSchedules(scope).GetAsync(roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentSchedule(ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentSchedules(scope).Get(roleAssignmentScheduleName, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. + public virtual RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances(ResourceIdentifier scope) + { + return new RoleAssignmentScheduleInstanceCollection(Client, scope); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleInstanceAsync(ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentScheduleInstances(scope).GetAsync(roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentScheduleInstance(ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentScheduleInstances(scope).Get(roleAssignmentScheduleInstanceName, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. + public virtual RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests(ResourceIdentifier scope) + { + return new RoleAssignmentScheduleRequestCollection(Client, scope); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleRequestAsync(ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentScheduleRequests(scope).GetAsync(roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentScheduleRequest(ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentScheduleRequests(scope).Get(roleAssignmentScheduleRequestName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. + public virtual RoleEligibilityScheduleCollection GetRoleEligibilitySchedules(ResourceIdentifier scope) + { + return new RoleEligibilityScheduleCollection(Client, scope); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleAsync(ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilitySchedules(scope).GetAsync(roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilitySchedule(ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilitySchedules(scope).Get(roleEligibilityScheduleName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. + public virtual RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances(ResourceIdentifier scope) + { + return new RoleEligibilityScheduleInstanceCollection(Client, scope); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleInstanceAsync(ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilityScheduleInstances(scope).GetAsync(roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilityScheduleInstance(ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilityScheduleInstances(scope).Get(roleEligibilityScheduleInstanceName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. + public virtual RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests(ResourceIdentifier scope) + { + return new RoleEligibilityScheduleRequestCollection(Client, scope); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleRequestAsync(ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilityScheduleRequests(scope).GetAsync(roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilityScheduleRequest(ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilityScheduleRequests(scope).Get(roleEligibilityScheduleRequestName, cancellationToken); + } + + /// Gets a collection of RoleManagementPolicyResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. + public virtual RoleManagementPolicyCollection GetRoleManagementPolicies(ResourceIdentifier scope) + { + return new RoleManagementPolicyCollection(Client, scope); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleManagementPolicyAsync(ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return await GetRoleManagementPolicies(scope).GetAsync(roleManagementPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleManagementPolicy(ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return GetRoleManagementPolicies(scope).Get(roleManagementPolicyName, cancellationToken); + } + + /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. + public virtual RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments(ResourceIdentifier scope) + { + return new RoleManagementPolicyAssignmentCollection(Client, scope); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleManagementPolicyAssignmentAsync(ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return await GetRoleManagementPolicyAssignments(scope).GetAsync(roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleManagementPolicyAssignment(ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return GetRoleManagementPolicyAssignments(scope).Get(roleManagementPolicyAssignmentName, cancellationToken); + } + + /// + /// Get the child resources of a resource on which user has eligible access + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources + /// + /// + /// Operation Id + /// EligibleChildResources_Get + /// + /// + /// + /// The scope to use. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEligibleChildResourcesAsync(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EligibleChildResourcesRestClient.CreateGetRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EligibleChildResourcesRestClient.CreateGetNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EligibleChildResource.DeserializeEligibleChildResource, EligibleChildResourcesClientDiagnostics, Pipeline, "AuthorizationArmClientMockingExtension.GetEligibleChildResources", "value", "nextLink", cancellationToken); + } + + /// + /// Get the child resources of a resource on which user has eligible access + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources + /// + /// + /// Operation Id + /// EligibleChildResources_Get + /// + /// + /// + /// The scope to use. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEligibleChildResources(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EligibleChildResourcesRestClient.CreateGetRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EligibleChildResourcesRestClient.CreateGetNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EligibleChildResource.DeserializeEligibleChildResource, EligibleChildResourcesClientDiagnostics, Pipeline, "AuthorizationArmClientMockingExtension.GetEligibleChildResources", "value", "nextLink", 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 DenyAssignmentResource GetDenyAssignmentResource(ResourceIdentifier id) + { + DenyAssignmentResource.ValidateResourceId(id); + return new DenyAssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AuthorizationProviderOperationsMetadataResource GetAuthorizationProviderOperationsMetadataResource(ResourceIdentifier id) + { + AuthorizationProviderOperationsMetadataResource.ValidateResourceId(id); + return new AuthorizationProviderOperationsMetadataResource(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 RoleAssignmentResource GetRoleAssignmentResource(ResourceIdentifier id) + { + RoleAssignmentResource.ValidateResourceId(id); + return new RoleAssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AuthorizationRoleDefinitionResource GetAuthorizationRoleDefinitionResource(ResourceIdentifier id) + { + AuthorizationRoleDefinitionResource.ValidateResourceId(id); + return new AuthorizationRoleDefinitionResource(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 RoleAssignmentScheduleResource GetRoleAssignmentScheduleResource(ResourceIdentifier id) + { + RoleAssignmentScheduleResource.ValidateResourceId(id); + return new RoleAssignmentScheduleResource(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 RoleAssignmentScheduleInstanceResource GetRoleAssignmentScheduleInstanceResource(ResourceIdentifier id) + { + RoleAssignmentScheduleInstanceResource.ValidateResourceId(id); + return new RoleAssignmentScheduleInstanceResource(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 RoleAssignmentScheduleRequestResource GetRoleAssignmentScheduleRequestResource(ResourceIdentifier id) + { + RoleAssignmentScheduleRequestResource.ValidateResourceId(id); + return new RoleAssignmentScheduleRequestResource(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 RoleEligibilityScheduleResource GetRoleEligibilityScheduleResource(ResourceIdentifier id) + { + RoleEligibilityScheduleResource.ValidateResourceId(id); + return new RoleEligibilityScheduleResource(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 RoleEligibilityScheduleInstanceResource GetRoleEligibilityScheduleInstanceResource(ResourceIdentifier id) + { + RoleEligibilityScheduleInstanceResource.ValidateResourceId(id); + return new RoleEligibilityScheduleInstanceResource(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 RoleEligibilityScheduleRequestResource GetRoleEligibilityScheduleRequestResource(ResourceIdentifier id) + { + RoleEligibilityScheduleRequestResource.ValidateResourceId(id); + return new RoleEligibilityScheduleRequestResource(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 RoleManagementPolicyResource GetRoleManagementPolicyResource(ResourceIdentifier id) + { + RoleManagementPolicyResource.ValidateResourceId(id); + return new RoleManagementPolicyResource(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 RoleManagementPolicyAssignmentResource GetRoleManagementPolicyAssignmentResource(ResourceIdentifier id) + { + RoleManagementPolicyAssignmentResource.ValidateResourceId(id); + return new RoleManagementPolicyAssignmentResource(Client, id); + } + } +} diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmMockingExtension.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmMockingExtension.cs new file mode 100644 index 000000000000..b68e7f190308 --- /dev/null +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationArmMockingExtension.cs @@ -0,0 +1,620 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Authorization; + +namespace Azure.ResourceManager.Authorization.Mocking +{ + /// A class to add extension methods to ArmResource. + public partial class AuthorizationArmMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AuthorizationArmMockingExtension() + { + } + + /// 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 AuthorizationArmMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DenyAssignmentResources in the ArmResource. + /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. + public virtual DenyAssignmentCollection GetDenyAssignments() + { + return GetCachedClient(client => new DenyAssignmentCollection(client, Id)); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDenyAssignmentAsync(string denyAssignmentId, CancellationToken cancellationToken = default) + { + return await GetDenyAssignments().GetAsync(denyAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDenyAssignment(string denyAssignmentId, CancellationToken cancellationToken = default) + { + return GetDenyAssignments().Get(denyAssignmentId, cancellationToken); + } + + /// Gets a collection of RoleAssignmentResources in the ArmResource. + /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. + public virtual RoleAssignmentCollection GetRoleAssignments() + { + return GetCachedClient(client => new RoleAssignmentCollection(client, Id)); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// The name of the role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentAsync(string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return await GetRoleAssignments().GetAsync(roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// The name of the role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRoleAssignment(string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return GetRoleAssignments().Get(roleAssignmentName, tenantId, cancellationToken); + } + + /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmResource. + /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. + public virtual AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions() + { + return GetCachedClient(client => new AuthorizationRoleDefinitionCollection(client, Id)); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAuthorizationRoleDefinitionAsync(ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetAuthorizationRoleDefinitions().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAuthorizationRoleDefinition(ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetAuthorizationRoleDefinitions().Get(roleDefinitionId, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleResources in the ArmResource. + /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. + public virtual RoleAssignmentScheduleCollection GetRoleAssignmentSchedules() + { + return GetCachedClient(client => new RoleAssignmentScheduleCollection(client, Id)); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// The name (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleAsync(string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentSchedules().GetAsync(roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// The name (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentSchedule(string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentSchedules().Get(roleAssignmentScheduleName, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmResource. + /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. + public virtual RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances() + { + return GetCachedClient(client => new RoleAssignmentScheduleInstanceCollection(client, Id)); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// The name (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleInstanceAsync(string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentScheduleInstances().GetAsync(roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// The name (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentScheduleInstance(string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentScheduleInstances().Get(roleAssignmentScheduleInstanceName, cancellationToken); + } + + /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmResource. + /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. + public virtual RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests() + { + return GetCachedClient(client => new RoleAssignmentScheduleRequestCollection(client, Id)); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// The name (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleAssignmentScheduleRequestAsync(string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetRoleAssignmentScheduleRequests().GetAsync(roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// The name (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleAssignmentScheduleRequest(string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetRoleAssignmentScheduleRequests().Get(roleAssignmentScheduleRequestName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleResources in the ArmResource. + /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. + public virtual RoleEligibilityScheduleCollection GetRoleEligibilitySchedules() + { + return GetCachedClient(client => new RoleEligibilityScheduleCollection(client, Id)); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// The name (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleAsync(string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilitySchedules().GetAsync(roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// The name (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilitySchedule(string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilitySchedules().Get(roleEligibilityScheduleName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmResource. + /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. + public virtual RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances() + { + return GetCachedClient(client => new RoleEligibilityScheduleInstanceCollection(client, Id)); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// The name (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleInstanceAsync(string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilityScheduleInstances().GetAsync(roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// The name (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilityScheduleInstance(string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilityScheduleInstances().Get(roleEligibilityScheduleInstanceName, cancellationToken); + } + + /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmResource. + /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. + public virtual RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests() + { + return GetCachedClient(client => new RoleEligibilityScheduleRequestCollection(client, Id)); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// The name (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleEligibilityScheduleRequestAsync(string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetRoleEligibilityScheduleRequests().GetAsync(roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// The name (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleEligibilityScheduleRequest(string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetRoleEligibilityScheduleRequests().Get(roleEligibilityScheduleRequestName, cancellationToken); + } + + /// Gets a collection of RoleManagementPolicyResources in the ArmResource. + /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. + public virtual RoleManagementPolicyCollection GetRoleManagementPolicies() + { + return GetCachedClient(client => new RoleManagementPolicyCollection(client, Id)); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// The name (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleManagementPolicyAsync(string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return await GetRoleManagementPolicies().GetAsync(roleManagementPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// The name (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleManagementPolicy(string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return GetRoleManagementPolicies().Get(roleManagementPolicyName, cancellationToken); + } + + /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmResource. + /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. + public virtual RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments() + { + return GetCachedClient(client => new RoleManagementPolicyAssignmentCollection(client, Id)); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// The name of format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRoleManagementPolicyAssignmentAsync(string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return await GetRoleManagementPolicyAssignments().GetAsync(roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// The name of format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRoleManagementPolicyAssignment(string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return GetRoleManagementPolicyAssignments().Get(roleManagementPolicyAssignmentName, cancellationToken); + } + } +} diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationExtensions.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationExtensions.cs index 04f0656d20a8..ff65662f10e2 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationExtensions.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Authorization.Mocking; using Azure.ResourceManager.Authorization.Models; using Azure.ResourceManager.Resources; @@ -19,312 +20,1088 @@ namespace Azure.ResourceManager.Authorization /// A class to add extension methods to Azure.ResourceManager.Authorization. public static partial class AuthorizationExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static AuthorizationArmClientMockingExtension GetAuthorizationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AuthorizationArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AuthorizationArmMockingExtension GetAuthorizationArmMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AuthorizationArmMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AuthorizationResourceGroupMockingExtension GetAuthorizationResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AuthorizationResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AuthorizationSubscriptionMockingExtension GetAuthorizationSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AuthorizationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AuthorizationTenantMockingExtension GetAuthorizationTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AuthorizationTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// Gets a collection of DenyAssignmentResources 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. + /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. + public static DenyAssignmentCollection GetDenyAssignments(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetDenyAssignments(scope); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDenyAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetDenyAssignmentAsync(scope, denyAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified deny assignment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} + /// + /// + /// Operation Id + /// DenyAssignments_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ID of the deny assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDenyAssignment(this ArmClient client, ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetDenyAssignment(scope, denyAssignmentId, cancellationToken); + } + + /// + /// Gets a collection of RoleAssignmentResources 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. + /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. + public static RoleAssignmentCollection GetRoleAssignments(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignments(scope); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// 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 role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static async Task> GetRoleAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentAsync(scope, roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a role assignment by scope and name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} + /// + /// + /// Operation Id + /// RoleAssignments_Get + /// + /// + /// + /// 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 role assignment. It can be any valid GUID. + /// Tenant ID for cross-tenant request. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static Response GetRoleAssignment(this ArmClient client, ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignment(scope, roleAssignmentName, tenantId, cancellationToken); + } + + /// + /// Gets a collection of AuthorizationRoleDefinitionResources 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. + /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. + public static AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetAuthorizationRoleDefinitions(scope); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static async Task> GetAuthorizationRoleDefinitionAsync(this ArmClient client, ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetAuthorizationRoleDefinitionAsync(scope, roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get role definition by name (GUID). + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// RoleDefinitions_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ID of the role definition. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public static Response GetAuthorizationRoleDefinition(this ArmClient client, ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetAuthorizationRoleDefinition(scope, roleDefinitionId, cancellationToken); + } + + /// + /// Gets a collection of RoleAssignmentScheduleResources 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. + /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. + public static RoleAssignmentScheduleCollection GetRoleAssignmentSchedules(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentSchedules(scope); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// 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 (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleAssignmentScheduleAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleAsync(scope, roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} + /// + /// + /// Operation Id + /// RoleAssignmentSchedules_Get + /// + /// + /// + /// 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 (guid) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleAssignmentSchedule(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentSchedule(scope, roleAssignmentScheduleName, cancellationToken); + } + + /// + /// Gets a collection of RoleAssignmentScheduleInstanceResources 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. + /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. + public static RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleInstances(scope); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// 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 (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleAssignmentScheduleInstanceAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleInstanceAsync(scope, roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role assignment schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleInstances_Get + /// + /// + /// + /// 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 (hash of schedule name + time) of the role assignment schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleAssignmentScheduleInstance(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleInstance(scope, roleAssignmentScheduleInstanceName, cancellationToken); + } + + /// + /// Gets a collection of RoleAssignmentScheduleRequestResources 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. + /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. + public static RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleRequests(scope); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// 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 (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleAssignmentScheduleRequestAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleRequestAsync(scope, roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role assignment schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} + /// + /// + /// Operation Id + /// RoleAssignmentScheduleRequests_Get + /// + /// + /// + /// 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 (guid) of the role assignment schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleAssignmentScheduleRequest(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleRequest(scope, roleAssignmentScheduleRequestName, cancellationToken); + } + + /// + /// Gets a collection of RoleEligibilityScheduleResources 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. + /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. + public static RoleEligibilityScheduleCollection GetRoleEligibilitySchedules(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilitySchedules(scope); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// 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 (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleEligibilityScheduleAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleAsync(scope, roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} + /// + /// + /// Operation Id + /// RoleEligibilitySchedules_Get + /// + /// + /// + /// 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 (guid) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleEligibilitySchedule(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilitySchedule(scope, roleEligibilityScheduleName, cancellationToken); + } + + /// + /// Gets a collection of RoleEligibilityScheduleInstanceResources 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. + /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. + public static RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleInstances(scope); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// 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 (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleEligibilityScheduleInstanceAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleInstanceAsync(scope, roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified role eligibility schedule instance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleInstances_Get + /// + /// + /// + /// 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 (hash of schedule name + time) of the role eligibility schedule to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleEligibilityScheduleInstance(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleInstance(scope, roleEligibilityScheduleInstanceName, cancellationToken); + } + + /// + /// Gets a collection of RoleEligibilityScheduleRequestResources 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. + /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. + public static RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleRequests(scope); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// 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 (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleEligibilityScheduleRequestAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleRequestAsync(scope, roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role eligibility schedule request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} + /// + /// + /// Operation Id + /// RoleEligibilityScheduleRequests_Get + /// + /// + /// + /// 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 (guid) of the role eligibility schedule request to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleEligibilityScheduleRequest(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleRequest(scope, roleEligibilityScheduleRequestName, cancellationToken); + } + + /// + /// Gets a collection of RoleManagementPolicyResources 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. + /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. + public static RoleManagementPolicyCollection GetRoleManagementPolicies(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicies(scope); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// 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 (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleManagementPolicyAsync(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyAsync(scope, roleManagementPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} + /// + /// + /// Operation Id + /// RoleManagementPolicies_Get + /// + /// + /// + /// 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 (guid) of the role management policy to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleManagementPolicy(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicy(scope, roleManagementPolicyName, cancellationToken); + } + + /// + /// Gets a collection of RoleManagementPolicyAssignmentResources 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. + /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. + public static RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments(this ArmClient client, ResourceIdentifier scope) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyAssignments(scope); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// 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 format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetRoleManagementPolicyAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return await GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyAssignmentAsync(scope, roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified role management policy assignment for a resource scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} + /// + /// + /// Operation Id + /// RoleManagementPolicyAssignments_Get + /// + /// + /// + /// 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 format {guid_guid} the role management policy assignment to get. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetRoleManagementPolicyAssignment(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) + { + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyAssignment(scope, roleManagementPolicyAssignmentName, cancellationToken); + } + + /// + /// Get the child resources of a resource on which user has eligible access + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources + /// + /// + /// Operation Id + /// EligibleChildResources_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. + /// The cancellation token to use. + public static AsyncPageable GetEligibleChildResourcesAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return GetAuthorizationArmClientMockingExtension(client).GetEligibleChildResourcesAsync(scope, filter, cancellationToken); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + /// + /// Get the child resources of a resource on which user has eligible access + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources + /// + /// + /// Operation Id + /// EligibleChildResources_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. + /// The cancellation token to use. + public static Pageable GetEligibleChildResources(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return GetAuthorizationArmClientMockingExtension(client).GetEligibleChildResources(scope, filter, cancellationToken); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region DenyAssignmentResource /// /// 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. /// Returns a object. public static DenyAssignmentResource GetDenyAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DenyAssignmentResource.ValidateResourceId(id); - return new DenyAssignmentResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetDenyAssignmentResource(id); } - #endregion - #region AuthorizationProviderOperationsMetadataResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AuthorizationProviderOperationsMetadataResource GetAuthorizationProviderOperationsMetadataResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AuthorizationProviderOperationsMetadataResource.ValidateResourceId(id); - return new AuthorizationProviderOperationsMetadataResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetAuthorizationProviderOperationsMetadataResource(id); } - #endregion - #region RoleAssignmentResource /// /// 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. /// Returns a object. public static RoleAssignmentResource GetRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleAssignmentResource.ValidateResourceId(id); - return new RoleAssignmentResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentResource(id); } - #endregion - #region AuthorizationRoleDefinitionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AuthorizationRoleDefinitionResource GetAuthorizationRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AuthorizationRoleDefinitionResource.ValidateResourceId(id); - return new AuthorizationRoleDefinitionResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetAuthorizationRoleDefinitionResource(id); } - #endregion - #region RoleAssignmentScheduleResource /// /// 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. /// Returns a object. public static RoleAssignmentScheduleResource GetRoleAssignmentScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleAssignmentScheduleResource.ValidateResourceId(id); - return new RoleAssignmentScheduleResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleResource(id); } - #endregion - #region RoleAssignmentScheduleInstanceResource /// /// 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. /// Returns a object. public static RoleAssignmentScheduleInstanceResource GetRoleAssignmentScheduleInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleAssignmentScheduleInstanceResource.ValidateResourceId(id); - return new RoleAssignmentScheduleInstanceResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleInstanceResource(id); } - #endregion - #region RoleAssignmentScheduleRequestResource /// /// 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. /// Returns a object. public static RoleAssignmentScheduleRequestResource GetRoleAssignmentScheduleRequestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleAssignmentScheduleRequestResource.ValidateResourceId(id); - return new RoleAssignmentScheduleRequestResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleAssignmentScheduleRequestResource(id); } - #endregion - #region RoleEligibilityScheduleResource /// /// 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. /// Returns a object. public static RoleEligibilityScheduleResource GetRoleEligibilityScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleEligibilityScheduleResource.ValidateResourceId(id); - return new RoleEligibilityScheduleResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleResource(id); } - #endregion - #region RoleEligibilityScheduleInstanceResource /// /// 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. /// Returns a object. public static RoleEligibilityScheduleInstanceResource GetRoleEligibilityScheduleInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleEligibilityScheduleInstanceResource.ValidateResourceId(id); - return new RoleEligibilityScheduleInstanceResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleInstanceResource(id); } - #endregion - #region RoleEligibilityScheduleRequestResource /// /// 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. /// Returns a object. public static RoleEligibilityScheduleRequestResource GetRoleEligibilityScheduleRequestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleEligibilityScheduleRequestResource.ValidateResourceId(id); - return new RoleEligibilityScheduleRequestResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleEligibilityScheduleRequestResource(id); } - #endregion - #region RoleManagementPolicyResource /// /// 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. /// Returns a object. public static RoleManagementPolicyResource GetRoleManagementPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleManagementPolicyResource.ValidateResourceId(id); - return new RoleManagementPolicyResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyResource(id); } - #endregion - #region RoleManagementPolicyAssignmentResource /// /// 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. /// Returns a object. public static RoleManagementPolicyAssignmentResource GetRoleManagementPolicyAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleManagementPolicyAssignmentResource.ValidateResourceId(id); - return new RoleManagementPolicyAssignmentResource(client, id); - } - ); + return GetAuthorizationArmClientMockingExtension(client).GetRoleManagementPolicyAssignmentResource(id); } - #endregion - /// Gets a collection of DenyAssignmentResources in the ArmResource. + /// + /// Gets a collection of DenyAssignmentResources in the ArmResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. public static DenyAssignmentCollection GetDenyAssignments(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetDenyAssignments(); - } - - /// Gets a collection of DenyAssignmentResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of DenyAssignmentResources and their operations over a DenyAssignmentResource. - public static DenyAssignmentCollection GetDenyAssignments(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetDenyAssignments(); + return GetAuthorizationArmMockingExtension(armResource).GetDenyAssignments(); } /// @@ -339,16 +1116,20 @@ public static DenyAssignmentCollection GetDenyAssignments(this ArmClient client, /// DenyAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID of the deny assignment to get. /// The cancellation token to use. - /// 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 static async Task> GetDenyAssignmentAsync(this ArmResource armResource, string denyAssignmentId, CancellationToken cancellationToken = default) { - return await armResource.GetDenyAssignments().GetAsync(denyAssignmentId, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetDenyAssignmentAsync(denyAssignmentId, cancellationToken).ConfigureAwait(false); } /// @@ -363,83 +1144,34 @@ public static async Task> GetDenyAssignmentAsyn /// DenyAssignments_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ID of the deny assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetDenyAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) - { - return await client.GetDenyAssignments(scope).GetAsync(denyAssignmentId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified deny assignment. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} - /// /// - /// Operation Id - /// DenyAssignments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The ID of the deny assignment to get. /// The cancellation token to use. - /// 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 static Response GetDenyAssignment(this ArmResource armResource, string denyAssignmentId, CancellationToken cancellationToken = default) { - return armResource.GetDenyAssignments().Get(denyAssignmentId, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetDenyAssignment(denyAssignmentId, cancellationToken); } /// - /// Get the specified deny assignment. - /// + /// Gets a collection of RoleAssignmentResources in the ArmResource. /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} - /// - /// - /// Operation Id - /// DenyAssignments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ID of the deny assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetDenyAssignment(this ArmClient client, ResourceIdentifier scope, string denyAssignmentId, CancellationToken cancellationToken = default) - { - return client.GetDenyAssignments(scope).Get(denyAssignmentId, cancellationToken); - } - - /// Gets a collection of RoleAssignmentResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. public static RoleAssignmentCollection GetRoleAssignments(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleAssignments(); - } - - /// Gets a collection of RoleAssignmentResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleAssignmentResources and their operations over a RoleAssignmentResource. - public static RoleAssignmentCollection GetRoleAssignments(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleAssignments(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignments(); } /// @@ -454,6 +1186,10 @@ public static RoleAssignmentCollection GetRoleAssignments(this ArmClient client, /// RoleAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the role assignment. It can be any valid GUID. @@ -463,7 +1199,7 @@ public static RoleAssignmentCollection GetRoleAssignments(this ArmClient client, [ForwardsClientCalls] public static async Task> GetRoleAssignmentAsync(this ArmResource armResource, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) { - return await armResource.GetRoleAssignments().GetAsync(roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentAsync(roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); } /// @@ -478,31 +1214,10 @@ public static async Task> GetRoleAssignmentAsyn /// RoleAssignments_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of the role assignment. It can be any valid GUID. - /// Tenant ID for cross-tenant request. - /// The cancellation token to use. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) - { - return await client.GetRoleAssignments(scope).GetAsync(roleAssignmentName, tenantId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a role assignment by scope and name. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} - /// /// - /// Operation Id - /// RoleAssignments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name of the role assignment. It can be any valid GUID. @@ -512,49 +1227,21 @@ public static async Task> GetRoleAssignmentAsyn [ForwardsClientCalls] public static Response GetRoleAssignment(this ArmResource armResource, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) { - return armResource.GetRoleAssignments().Get(roleAssignmentName, tenantId, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignment(roleAssignmentName, tenantId, cancellationToken); } /// - /// Get a role assignment by scope and name. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName} - /// + /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmResource. /// - /// Operation Id - /// RoleAssignments_Get + /// 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 role assignment. It can be any valid GUID. - /// Tenant ID for cross-tenant request. - /// The cancellation token to use. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleAssignment(this ArmClient client, ResourceIdentifier scope, string roleAssignmentName, string tenantId = null, CancellationToken cancellationToken = default) - { - return client.GetRoleAssignments(scope).Get(roleAssignmentName, tenantId, cancellationToken); - } - - /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. public static AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetAuthorizationRoleDefinitions(); - } - - /// Gets a collection of AuthorizationRoleDefinitionResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of AuthorizationRoleDefinitionResources and their operations over a AuthorizationRoleDefinitionResource. - public static AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefinitions(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetAuthorizationRoleDefinitions(); + return GetAuthorizationArmMockingExtension(armResource).GetAuthorizationRoleDefinitions(); } /// @@ -569,6 +1256,10 @@ public static AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefiniti /// RoleDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID of the role definition. @@ -577,7 +1268,7 @@ public static AuthorizationRoleDefinitionCollection GetAuthorizationRoleDefiniti [ForwardsClientCalls] public static async Task> GetAuthorizationRoleDefinitionAsync(this ArmResource armResource, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) { - return await armResource.GetAuthorizationRoleDefinitions().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetAuthorizationRoleDefinitionAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); } /// @@ -592,30 +1283,10 @@ public static async Task> GetAutho /// RoleDefinitions_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ID of the role definition. - /// The cancellation token to use. - /// is null. - [ForwardsClientCalls] - public static async Task> GetAuthorizationRoleDefinitionAsync(this ArmClient client, ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) - { - return await client.GetAuthorizationRoleDefinitions(scope).GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get role definition by name (GUID). - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - /// /// - /// Operation Id - /// RoleDefinitions_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The ID of the role definition. @@ -624,72 +1295,21 @@ public static async Task> GetAutho [ForwardsClientCalls] public static Response GetAuthorizationRoleDefinition(this ArmResource armResource, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) { - return armResource.GetAuthorizationRoleDefinitions().Get(roleDefinitionId, cancellationToken); - } - - /// - /// Get role definition by name (GUID). - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// RoleDefinitions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ID of the role definition. - /// The cancellation token to use. - /// is null. - [ForwardsClientCalls] - public static Response GetAuthorizationRoleDefinition(this ArmClient client, ResourceIdentifier scope, ResourceIdentifier roleDefinitionId, CancellationToken cancellationToken = default) - { - return client.GetAuthorizationRoleDefinitions(scope).Get(roleDefinitionId, cancellationToken); - } - - /// Gets a collection of RoleAssignmentScheduleResources in the ArmResource. - /// The instance the method will execute against. - /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. - public static RoleAssignmentScheduleCollection GetRoleAssignmentSchedules(this ArmResource armResource) - { - return GetArmResourceExtensionClient(armResource).GetRoleAssignmentSchedules(); - } - - /// Gets a collection of RoleAssignmentScheduleResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. - public static RoleAssignmentScheduleCollection GetRoleAssignmentSchedules(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleAssignmentSchedules(); + return GetAuthorizationArmMockingExtension(armResource).GetAuthorizationRoleDefinition(roleDefinitionId, cancellationToken); } /// - /// Get the specified role assignment schedule for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} - /// + /// Gets a collection of RoleAssignmentScheduleResources in the ArmResource. /// - /// Operation Id - /// RoleAssignmentSchedules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// - /// - /// The instance the method will execute against. - /// The name (guid) of the role assignment schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleAssignmentScheduleAsync(this ArmResource armResource, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + /// + /// The instance the method will execute against. + /// An object representing collection of RoleAssignmentScheduleResources and their operations over a RoleAssignmentScheduleResource. + public static RoleAssignmentScheduleCollection GetRoleAssignmentSchedules(this ArmResource armResource) { - return await armResource.GetRoleAssignmentSchedules().GetAsync(roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentSchedules(); } /// @@ -704,17 +1324,20 @@ public static async Task> GetRoleAssign /// RoleAssignmentSchedules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. + /// The instance the method will execute against. /// The name (guid) of the role assignment schedule to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleAssignmentScheduleAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) + public static async Task> GetRoleAssignmentScheduleAsync(this ArmResource armResource, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) { - return await client.GetRoleAssignmentSchedules(scope).GetAsync(roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleAsync(roleAssignmentScheduleName, cancellationToken).ConfigureAwait(false); } /// @@ -729,58 +1352,34 @@ public static async Task> GetRoleAssign /// RoleAssignmentSchedules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (guid) of the role assignment schedule to get. /// The cancellation token to use. - /// 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 static Response GetRoleAssignmentSchedule(this ArmResource armResource, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) { - return armResource.GetRoleAssignmentSchedules().Get(roleAssignmentScheduleName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentSchedule(roleAssignmentScheduleName, cancellationToken); } /// - /// Get the specified role assignment schedule for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName} - /// + /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmResource. /// - /// Operation Id - /// RoleAssignmentSchedules_Get + /// 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 (guid) of the role assignment schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleAssignmentSchedule(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleName, CancellationToken cancellationToken = default) - { - return client.GetRoleAssignmentSchedules(scope).Get(roleAssignmentScheduleName, cancellationToken); - } - - /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. public static RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleAssignmentScheduleInstances(); - } - - /// Gets a collection of RoleAssignmentScheduleInstanceResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleAssignmentScheduleInstanceResources and their operations over a RoleAssignmentScheduleInstanceResource. - public static RoleAssignmentScheduleInstanceCollection GetRoleAssignmentScheduleInstances(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleAssignmentScheduleInstances(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleInstances(); } /// @@ -795,16 +1394,20 @@ public static RoleAssignmentScheduleInstanceCollection GetRoleAssignmentSchedule /// RoleAssignmentScheduleInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (hash of schedule name + time) of the role assignment schedule to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleAssignmentScheduleInstanceAsync(this ArmResource armResource, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleAssignmentScheduleInstances().GetAsync(roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleInstanceAsync(roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); } /// @@ -819,83 +1422,34 @@ public static async Task> GetRo /// RoleAssignmentScheduleInstances_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (hash of schedule name + time) of the role assignment schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleAssignmentScheduleInstanceAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) - { - return await client.GetRoleAssignmentScheduleInstances(scope).GetAsync(roleAssignmentScheduleInstanceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified role assignment schedule instance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} - /// /// - /// Operation Id - /// RoleAssignmentScheduleInstances_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name (hash of schedule name + time) of the role assignment schedule to get. /// The cancellation token to use. - /// 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 static Response GetRoleAssignmentScheduleInstance(this ArmResource armResource, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) { - return armResource.GetRoleAssignmentScheduleInstances().Get(roleAssignmentScheduleInstanceName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleInstance(roleAssignmentScheduleInstanceName, cancellationToken); } /// - /// Gets the specified role assignment schedule instance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName} - /// + /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmResource. /// - /// Operation Id - /// RoleAssignmentScheduleInstances_Get + /// 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 (hash of schedule name + time) of the role assignment schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleAssignmentScheduleInstance(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleInstanceName, CancellationToken cancellationToken = default) - { - return client.GetRoleAssignmentScheduleInstances(scope).Get(roleAssignmentScheduleInstanceName, cancellationToken); - } - - /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. public static RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleAssignmentScheduleRequests(); - } - - /// Gets a collection of RoleAssignmentScheduleRequestResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleAssignmentScheduleRequestResources and their operations over a RoleAssignmentScheduleRequestResource. - public static RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleRequests(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleAssignmentScheduleRequests(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleRequests(); } /// @@ -910,16 +1464,20 @@ public static RoleAssignmentScheduleRequestCollection GetRoleAssignmentScheduleR /// RoleAssignmentScheduleRequests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (guid) of the role assignment schedule request to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleAssignmentScheduleRequestAsync(this ArmResource armResource, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleAssignmentScheduleRequests().GetAsync(roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleRequestAsync(roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); } /// @@ -934,83 +1492,34 @@ public static async Task> GetRol /// RoleAssignmentScheduleRequests_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (guid) of the role assignment schedule request to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleAssignmentScheduleRequestAsync(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) - { - return await client.GetRoleAssignmentScheduleRequests(scope).GetAsync(roleAssignmentScheduleRequestName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified role assignment schedule request. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} - /// /// - /// Operation Id - /// RoleAssignmentScheduleRequests_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name (guid) of the role assignment schedule request to get. /// The cancellation token to use. - /// 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 static Response GetRoleAssignmentScheduleRequest(this ArmResource armResource, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) { - return armResource.GetRoleAssignmentScheduleRequests().Get(roleAssignmentScheduleRequestName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleAssignmentScheduleRequest(roleAssignmentScheduleRequestName, cancellationToken); } /// - /// Get the specified role assignment schedule request. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName} - /// + /// Gets a collection of RoleEligibilityScheduleResources in the ArmResource. /// - /// Operation Id - /// RoleAssignmentScheduleRequests_Get + /// 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 (guid) of the role assignment schedule request to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleAssignmentScheduleRequest(this ArmClient client, ResourceIdentifier scope, string roleAssignmentScheduleRequestName, CancellationToken cancellationToken = default) - { - return client.GetRoleAssignmentScheduleRequests(scope).Get(roleAssignmentScheduleRequestName, cancellationToken); - } - - /// Gets a collection of RoleEligibilityScheduleResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. public static RoleEligibilityScheduleCollection GetRoleEligibilitySchedules(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleEligibilitySchedules(); - } - - /// Gets a collection of RoleEligibilityScheduleResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleEligibilityScheduleResources and their operations over a RoleEligibilityScheduleResource. - public static RoleEligibilityScheduleCollection GetRoleEligibilitySchedules(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleEligibilitySchedules(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilitySchedules(); } /// @@ -1025,16 +1534,20 @@ public static RoleEligibilityScheduleCollection GetRoleEligibilitySchedules(this /// RoleEligibilitySchedules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (guid) of the role eligibility schedule to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleEligibilityScheduleAsync(this ArmResource armResource, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleEligibilitySchedules().GetAsync(roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleAsync(roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); } /// @@ -1049,132 +1562,34 @@ public static async Task> GetRoleEligi /// RoleEligibilitySchedules_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (guid) of the role eligibility schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleEligibilityScheduleAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) - { - return await client.GetRoleEligibilitySchedules(scope).GetAsync(roleEligibilityScheduleName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified role eligibility schedule for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} - /// /// - /// Operation Id - /// RoleEligibilitySchedules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name (guid) of the role eligibility schedule to get. /// The cancellation token to use. - /// 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 static Response GetRoleEligibilitySchedule(this ArmResource armResource, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) { - return armResource.GetRoleEligibilitySchedules().Get(roleEligibilityScheduleName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilitySchedule(roleEligibilityScheduleName, cancellationToken); } /// - /// Get the specified role eligibility schedule for a resource scope - /// + /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmResource. /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName} - /// - /// - /// Operation Id - /// RoleEligibilitySchedules_Get + /// 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 (guid) of the role eligibility schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleEligibilitySchedule(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleName, CancellationToken cancellationToken = default) - { - return client.GetRoleEligibilitySchedules(scope).Get(roleEligibilityScheduleName, cancellationToken); - } - - /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. public static RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleEligibilityScheduleInstances(); - } - - /// Gets a collection of RoleEligibilityScheduleInstanceResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleEligibilityScheduleInstanceResources and their operations over a RoleEligibilityScheduleInstanceResource. - public static RoleEligibilityScheduleInstanceCollection GetRoleEligibilityScheduleInstances(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleEligibilityScheduleInstances(); - } - - /// - /// Gets the specified role eligibility schedule instance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} - /// - /// - /// Operation Id - /// RoleEligibilityScheduleInstances_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name (hash of schedule name + time) of the role eligibility schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleEligibilityScheduleInstanceAsync(this ArmResource armResource, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) - { - return await armResource.GetRoleEligibilityScheduleInstances().GetAsync(roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the specified role eligibility schedule instance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName} - /// - /// - /// Operation Id - /// RoleEligibilityScheduleInstances_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (hash of schedule name + time) of the role eligibility schedule to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleEligibilityScheduleInstanceAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) - { - return await client.GetRoleEligibilityScheduleInstances(scope).GetAsync(roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleInstances(); } /// @@ -1189,16 +1604,20 @@ public static async Task> GetR /// RoleEligibilityScheduleInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (hash of schedule name + time) of the role eligibility schedule to get. /// The cancellation token to use. - /// 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 static Response GetRoleEligibilityScheduleInstance(this ArmResource armResource, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + public static async Task> GetRoleEligibilityScheduleInstanceAsync(this ArmResource armResource, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) { - return armResource.GetRoleEligibilityScheduleInstances().Get(roleEligibilityScheduleInstanceName, cancellationToken); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleInstanceAsync(roleEligibilityScheduleInstanceName, cancellationToken).ConfigureAwait(false); } /// @@ -1213,34 +1632,34 @@ public static Response GetRoleEligibili /// RoleEligibilityScheduleInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. + /// The instance the method will execute against. /// The name (hash of schedule name + time) of the role eligibility schedule to get. /// The cancellation token to use. - /// 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 static Response GetRoleEligibilityScheduleInstance(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) + public static Response GetRoleEligibilityScheduleInstance(this ArmResource armResource, string roleEligibilityScheduleInstanceName, CancellationToken cancellationToken = default) { - return client.GetRoleEligibilityScheduleInstances(scope).Get(roleEligibilityScheduleInstanceName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleInstance(roleEligibilityScheduleInstanceName, cancellationToken); } - /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmResource. + /// + /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. public static RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleEligibilityScheduleRequests(); - } - - /// Gets a collection of RoleEligibilityScheduleRequestResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleEligibilityScheduleRequestResources and their operations over a RoleEligibilityScheduleRequestResource. - public static RoleEligibilityScheduleRequestCollection GetRoleEligibilityScheduleRequests(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleEligibilityScheduleRequests(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleRequests(); } /// @@ -1255,16 +1674,20 @@ public static RoleEligibilityScheduleRequestCollection GetRoleEligibilitySchedul /// RoleEligibilityScheduleRequests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (guid) of the role eligibility schedule request to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleEligibilityScheduleRequestAsync(this ArmResource armResource, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleEligibilityScheduleRequests().GetAsync(roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleRequestAsync(roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); } /// @@ -1279,83 +1702,34 @@ public static async Task> GetRo /// RoleEligibilityScheduleRequests_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (guid) of the role eligibility schedule request to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleEligibilityScheduleRequestAsync(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) - { - return await client.GetRoleEligibilityScheduleRequests(scope).GetAsync(roleEligibilityScheduleRequestName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified role eligibility schedule request. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} - /// /// - /// Operation Id - /// RoleEligibilityScheduleRequests_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name (guid) of the role eligibility schedule request to get. /// The cancellation token to use. - /// 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 static Response GetRoleEligibilityScheduleRequest(this ArmResource armResource, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) { - return armResource.GetRoleEligibilityScheduleRequests().Get(roleEligibilityScheduleRequestName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleEligibilityScheduleRequest(roleEligibilityScheduleRequestName, cancellationToken); } /// - /// Get the specified role eligibility schedule request. - /// + /// Gets a collection of RoleManagementPolicyResources in the ArmResource. /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName} - /// - /// - /// Operation Id - /// RoleEligibilityScheduleRequests_Get + /// 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 (guid) of the role eligibility schedule request to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleEligibilityScheduleRequest(this ArmClient client, ResourceIdentifier scope, string roleEligibilityScheduleRequestName, CancellationToken cancellationToken = default) - { - return client.GetRoleEligibilityScheduleRequests(scope).Get(roleEligibilityScheduleRequestName, cancellationToken); - } - - /// Gets a collection of RoleManagementPolicyResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. public static RoleManagementPolicyCollection GetRoleManagementPolicies(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleManagementPolicies(); - } - - /// Gets a collection of RoleManagementPolicyResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleManagementPolicyResources and their operations over a RoleManagementPolicyResource. - public static RoleManagementPolicyCollection GetRoleManagementPolicies(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleManagementPolicies(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicies(); } /// @@ -1370,16 +1744,20 @@ public static RoleManagementPolicyCollection GetRoleManagementPolicies(this ArmC /// RoleManagementPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name (guid) of the role management policy to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleManagementPolicyAsync(this ArmResource armResource, string roleManagementPolicyName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleManagementPolicies().GetAsync(roleManagementPolicyName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicyAsync(roleManagementPolicyName, cancellationToken).ConfigureAwait(false); } /// @@ -1394,83 +1772,34 @@ public static async Task> GetRoleManageme /// RoleManagementPolicies_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name (guid) of the role management policy to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleManagementPolicyAsync(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) - { - return await client.GetRoleManagementPolicies(scope).GetAsync(roleManagementPolicyName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified role management policy for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} - /// /// - /// Operation Id - /// RoleManagementPolicies_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name (guid) of the role management policy to get. /// The cancellation token to use. - /// 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 static Response GetRoleManagementPolicy(this ArmResource armResource, string roleManagementPolicyName, CancellationToken cancellationToken = default) { - return armResource.GetRoleManagementPolicies().Get(roleManagementPolicyName, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicy(roleManagementPolicyName, cancellationToken); } /// - /// Get the specified role management policy for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName} - /// + /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmResource. /// - /// Operation Id - /// RoleManagementPolicies_Get + /// 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 (guid) of the role management policy to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRoleManagementPolicy(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyName, CancellationToken cancellationToken = default) - { - return client.GetRoleManagementPolicies(scope).Get(roleManagementPolicyName, cancellationToken); - } - - /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmResource. /// The instance the method will execute against. /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. public static RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments(this ArmResource armResource) { - return GetArmResourceExtensionClient(armResource).GetRoleManagementPolicyAssignments(); - } - - /// Gets a collection of RoleManagementPolicyAssignmentResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of RoleManagementPolicyAssignmentResources and their operations over a RoleManagementPolicyAssignmentResource. - public static RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAssignments(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetRoleManagementPolicyAssignments(); + return GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicyAssignments(); } /// @@ -1485,16 +1814,20 @@ public static RoleManagementPolicyAssignmentCollection GetRoleManagementPolicyAs /// RoleManagementPolicyAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of format {guid_guid} the role management policy assignment to get. /// The cancellation token to use. - /// 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 static async Task> GetRoleManagementPolicyAssignmentAsync(this ArmResource armResource, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) { - return await armResource.GetRoleManagementPolicyAssignments().GetAsync(roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicyAssignmentAsync(roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -1509,110 +1842,20 @@ public static async Task> GetRo /// RoleManagementPolicyAssignments_Get /// /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of format {guid_guid} the role management policy assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRoleManagementPolicyAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) - { - return await client.GetRoleManagementPolicyAssignments(scope).GetAsync(roleManagementPolicyAssignmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified role management policy assignment for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} - /// /// - /// Operation Id - /// RoleManagementPolicyAssignments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. /// The name of format {guid_guid} the role management policy assignment to get. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. - [ForwardsClientCalls] - public static Response GetRoleManagementPolicyAssignment(this ArmResource armResource, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) - { - return armResource.GetRoleManagementPolicyAssignments().Get(roleManagementPolicyAssignmentName, cancellationToken); - } - - /// - /// Get the specified role management policy assignment for a resource scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName} - /// - /// - /// Operation Id - /// RoleManagementPolicyAssignments_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of format {guid_guid} the role management policy assignment to get. - /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. - /// is null. [ForwardsClientCalls] - public static Response GetRoleManagementPolicyAssignment(this ArmClient client, ResourceIdentifier scope, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) - { - return client.GetRoleManagementPolicyAssignments(scope).Get(roleManagementPolicyAssignmentName, cancellationToken); - } - - /// - /// Get the child resources of a resource on which user has eligible access - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources - /// - /// - /// Operation Id - /// EligibleChildResources_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. - /// The cancellation token to use. - public static AsyncPageable GetEligibleChildResourcesAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) - { - return GetArmResourceExtensionClient(client, scope).GetEligibleChildResourcesAsync(filter, cancellationToken); - } - - /// - /// Get the child resources of a resource on which user has eligible access - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/eligibleChildResources - /// - /// - /// Operation Id - /// EligibleChildResources_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'. - /// The cancellation token to use. - public static Pageable GetEligibleChildResources(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) + public static Response GetRoleManagementPolicyAssignment(this ArmResource armResource, string roleManagementPolicyAssignmentName, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetEligibleChildResources(filter, cancellationToken); + return GetAuthorizationArmMockingExtension(armResource).GetRoleManagementPolicyAssignment(roleManagementPolicyAssignmentName, cancellationToken); } /// @@ -1627,13 +1870,17 @@ public static Pageable GetEligibleChildResources(this Arm /// AzurePermissionsForResourceGroup_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzurePermissionsForResourceGroupsAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzurePermissionsForResourceGroupsAsync(cancellationToken); + return GetAuthorizationResourceGroupMockingExtension(resourceGroupResource).GetAzurePermissionsForResourceGroupsAsync(cancellationToken); } /// @@ -1648,13 +1895,17 @@ public static AsyncPageable GetAzurePermissionsForReso /// AzurePermissionsForResourceGroup_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzurePermissionsForResourceGroups(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzurePermissionsForResourceGroups(cancellationToken); + return GetAuthorizationResourceGroupMockingExtension(resourceGroupResource).GetAzurePermissionsForResourceGroups(cancellationToken); } /// @@ -1669,6 +1920,10 @@ public static Pageable GetAzurePermissionsForResourceG /// AzurePermissionsForResource_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource provider. @@ -1681,12 +1936,7 @@ public static Pageable GetAzurePermissionsForResourceG /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzurePermissionsForResourcesAsync(this ResourceGroupResource resourceGroupResource, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(resourceProviderNamespace, nameof(resourceProviderNamespace)); - Argument.AssertNotNull(parentResourcePath, nameof(parentResourcePath)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzurePermissionsForResourcesAsync(resourceProviderNamespace, parentResourcePath, resourceType, resourceName, cancellationToken); + return GetAuthorizationResourceGroupMockingExtension(resourceGroupResource).GetAzurePermissionsForResourcesAsync(resourceProviderNamespace, parentResourcePath, resourceType, resourceName, cancellationToken); } /// @@ -1701,6 +1951,10 @@ public static AsyncPageable GetAzurePermissionsForReso /// AzurePermissionsForResource_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource provider. @@ -1713,12 +1967,7 @@ public static AsyncPageable GetAzurePermissionsForReso /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzurePermissionsForResources(this ResourceGroupResource resourceGroupResource, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(resourceProviderNamespace, nameof(resourceProviderNamespace)); - Argument.AssertNotNull(parentResourcePath, nameof(parentResourcePath)); - Argument.AssertNotNull(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzurePermissionsForResources(resourceProviderNamespace, parentResourcePath, resourceType, resourceName, cancellationToken); + return GetAuthorizationResourceGroupMockingExtension(resourceGroupResource).GetAzurePermissionsForResources(resourceProviderNamespace, parentResourcePath, resourceType, resourceName, cancellationToken); } /// @@ -1733,13 +1982,17 @@ public static Pageable GetAzurePermissionsForResources /// ClassicAdministrators_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetClassicAdministratorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClassicAdministratorsAsync(cancellationToken); + return GetAuthorizationSubscriptionMockingExtension(subscriptionResource).GetClassicAdministratorsAsync(cancellationToken); } /// @@ -1754,21 +2007,31 @@ public static AsyncPageable GetClassicAdminis /// ClassicAdministrators_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetClassicAdministrators(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClassicAdministrators(cancellationToken); + return GetAuthorizationSubscriptionMockingExtension(subscriptionResource).GetClassicAdministrators(cancellationToken); } - /// Gets a collection of AuthorizationProviderOperationsMetadataResources in the TenantResource. + /// + /// Gets a collection of AuthorizationProviderOperationsMetadataResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AuthorizationProviderOperationsMetadataResources and their operations over a AuthorizationProviderOperationsMetadataResource. public static AuthorizationProviderOperationsMetadataCollection GetAllAuthorizationProviderOperationsMetadata(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAllAuthorizationProviderOperationsMetadata(); + return GetAuthorizationTenantMockingExtension(tenantResource).GetAllAuthorizationProviderOperationsMetadata(); } /// @@ -1783,6 +2046,10 @@ public static AuthorizationProviderOperationsMetadataCollection GetAllAuthorizat /// ProviderOperationsMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource provider. @@ -1792,7 +2059,7 @@ public static AuthorizationProviderOperationsMetadataCollection GetAllAuthorizat [ForwardsClientCalls] public static async Task> GetAuthorizationProviderOperationsMetadataAsync(this TenantResource tenantResource, string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { - return await tenantResource.GetAllAuthorizationProviderOperationsMetadata().GetAsync(resourceProviderNamespace, expand, cancellationToken).ConfigureAwait(false); + return await GetAuthorizationTenantMockingExtension(tenantResource).GetAuthorizationProviderOperationsMetadataAsync(resourceProviderNamespace, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1807,6 +2074,10 @@ public static async TaskProviderOperationsMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource provider. @@ -1816,7 +2087,7 @@ public static async Task GetAuthorizationProviderOperationsMetadata(this TenantResource tenantResource, string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { - return tenantResource.GetAllAuthorizationProviderOperationsMetadata().Get(resourceProviderNamespace, expand, cancellationToken); + return GetAuthorizationTenantMockingExtension(tenantResource).GetAuthorizationProviderOperationsMetadata(resourceProviderNamespace, expand, cancellationToken); } /// @@ -1831,12 +2102,16 @@ public static Response GetAutho /// GlobalAdministrator_ElevateAccess /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task ElevateAccessGlobalAdministratorAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).ElevateAccessGlobalAdministratorAsync(cancellationToken).ConfigureAwait(false); + return await GetAuthorizationTenantMockingExtension(tenantResource).ElevateAccessGlobalAdministratorAsync(cancellationToken).ConfigureAwait(false); } /// @@ -1851,12 +2126,16 @@ public static async Task ElevateAccessGlobalAdministratorAsync(this Te /// GlobalAdministrator_ElevateAccess /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response ElevateAccessGlobalAdministrator(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).ElevateAccessGlobalAdministrator(cancellationToken); + return GetAuthorizationTenantMockingExtension(tenantResource).ElevateAccessGlobalAdministrator(cancellationToken); } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationResourceGroupMockingExtension.cs similarity index 79% rename from sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationResourceGroupMockingExtension.cs index ccda8fa0f68e..81249cc00ef3 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationResourceGroupMockingExtension.cs @@ -5,33 +5,35 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Authorization; using Azure.ResourceManager.Authorization.Models; -namespace Azure.ResourceManager.Authorization +namespace Azure.ResourceManager.Authorization.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class AuthorizationResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _azurePermissionsForResourceGroupClientDiagnostics; private AzurePermissionsForResourceGroupRestOperations _azurePermissionsForResourceGroupRestClient; private ClientDiagnostics _azurePermissionsForResourceClientDiagnostics; private AzurePermissionsForResourceRestOperations _azurePermissionsForResourceRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AuthorizationResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AuthorizationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +67,7 @@ public virtual AsyncPageable GetAzurePermissionsForRes { HttpMessage FirstPageRequest(int? pageSizeHint) => AzurePermissionsForResourceGroupRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzurePermissionsForResourceGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceGroupClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAzurePermissionsForResourceGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceGroupClientDiagnostics, Pipeline, "AuthorizationResourceGroupMockingExtension.GetAzurePermissionsForResourceGroups", "value", "nextLink", cancellationToken); } /// @@ -87,7 +89,7 @@ public virtual Pageable GetAzurePermissionsForResource { HttpMessage FirstPageRequest(int? pageSizeHint) => AzurePermissionsForResourceGroupRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzurePermissionsForResourceGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceGroupClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAzurePermissionsForResourceGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceGroupClientDiagnostics, Pipeline, "AuthorizationResourceGroupMockingExtension.GetAzurePermissionsForResourceGroups", "value", "nextLink", cancellationToken); } /// @@ -108,12 +110,19 @@ public virtual Pageable GetAzurePermissionsForResource /// The resource type of the resource. /// The name of the resource to get the permissions for. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAzurePermissionsForResourcesAsync(string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(resourceProviderNamespace, nameof(resourceProviderNamespace)); + Argument.AssertNotNull(parentResourcePath, nameof(parentResourcePath)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => AzurePermissionsForResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzurePermissionsForResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAzurePermissionsForResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceClientDiagnostics, Pipeline, "AuthorizationResourceGroupMockingExtension.GetAzurePermissionsForResources", "value", "nextLink", cancellationToken); } /// @@ -134,12 +143,19 @@ public virtual AsyncPageable GetAzurePermissionsForRes /// The resource type of the resource. /// The name of the resource to get the permissions for. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAzurePermissionsForResources(string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(resourceProviderNamespace, nameof(resourceProviderNamespace)); + Argument.AssertNotNull(parentResourcePath, nameof(parentResourcePath)); + Argument.AssertNotNull(resourceType, nameof(resourceType)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => AzurePermissionsForResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzurePermissionsForResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAzurePermissionsForResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RoleDefinitionPermission.DeserializeRoleDefinitionPermission, AzurePermissionsForResourceClientDiagnostics, Pipeline, "AuthorizationResourceGroupMockingExtension.GetAzurePermissionsForResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationSubscriptionMockingExtension.cs similarity index 85% rename from sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationSubscriptionMockingExtension.cs index e92eb289b53a..3a40c0abc862 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationSubscriptionMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Authorization; using Azure.ResourceManager.Authorization.Models; -namespace Azure.ResourceManager.Authorization +namespace Azure.ResourceManager.Authorization.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AuthorizationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _classicAdministratorsClientDiagnostics; private ClassicAdministratorsRestOperations _classicAdministratorsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AuthorizationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AuthorizationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ public virtual AsyncPageable GetClassicAdmini { HttpMessage FirstPageRequest(int? pageSizeHint) => ClassicAdministratorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ClassicAdministratorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AuthorizationClassicAdministrator.DeserializeAuthorizationClassicAdministrator, ClassicAdministratorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClassicAdministrators", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AuthorizationClassicAdministrator.DeserializeAuthorizationClassicAdministrator, ClassicAdministratorsClientDiagnostics, Pipeline, "AuthorizationSubscriptionMockingExtension.GetClassicAdministrators", "value", "nextLink", cancellationToken); } /// @@ -83,7 +84,7 @@ public virtual Pageable GetClassicAdministrat { HttpMessage FirstPageRequest(int? pageSizeHint) => ClassicAdministratorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ClassicAdministratorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AuthorizationClassicAdministrator.DeserializeAuthorizationClassicAdministrator, ClassicAdministratorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClassicAdministrators", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AuthorizationClassicAdministrator.DeserializeAuthorizationClassicAdministrator, ClassicAdministratorsClientDiagnostics, Pipeline, "AuthorizationSubscriptionMockingExtension.GetClassicAdministrators", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationTenantMockingExtension.cs similarity index 54% rename from sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationTenantMockingExtension.cs index 0a3ef7b8099e..e27a3abcda21 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/Extensions/AuthorizationTenantMockingExtension.cs @@ -12,24 +12,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Authorization; -namespace Azure.ResourceManager.Authorization +namespace Azure.ResourceManager.Authorization.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class AuthorizationTenantMockingExtension : ArmResource { private ClientDiagnostics _globalAdministratorClientDiagnostics; private GlobalAdministratorRestOperations _globalAdministratorRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AuthorizationTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AuthorizationTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +47,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of AuthorizationProviderOperationsMetadataResources and their operations over a AuthorizationProviderOperationsMetadataResource. public virtual AuthorizationProviderOperationsMetadataCollection GetAllAuthorizationProviderOperationsMetadata() { - return GetCachedClient(Client => new AuthorizationProviderOperationsMetadataCollection(Client, Id)); + return GetCachedClient(client => new AuthorizationProviderOperationsMetadataCollection(client, Id)); + } + + /// + /// Gets provider operations metadata for the specified resource provider. + /// + /// + /// Request Path + /// /providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace} + /// + /// + /// Operation Id + /// ProviderOperationsMetadata_Get + /// + /// + /// + /// The namespace of the resource provider. + /// Specifies whether to expand the values. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetAuthorizationProviderOperationsMetadataAsync(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) + { + return await GetAllAuthorizationProviderOperationsMetadata().GetAsync(resourceProviderNamespace, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets provider operations metadata for the specified resource provider. + /// + /// + /// Request Path + /// /providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace} + /// + /// + /// Operation Id + /// ProviderOperationsMetadata_Get + /// + /// + /// + /// The namespace of the resource provider. + /// Specifies whether to expand the values. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetAuthorizationProviderOperationsMetadata(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) + { + return GetAllAuthorizationProviderOperationsMetadata().Get(resourceProviderNamespace, expand, cancellationToken); } /// @@ -65,7 +112,7 @@ public virtual AuthorizationProviderOperationsMetadataCollection GetAllAuthoriza /// The cancellation token to use. public virtual async Task ElevateAccessGlobalAdministratorAsync(CancellationToken cancellationToken = default) { - using var scope = GlobalAdministratorClientDiagnostics.CreateScope("TenantResourceExtensionClient.ElevateAccessGlobalAdministrator"); + using var scope = GlobalAdministratorClientDiagnostics.CreateScope("AuthorizationTenantMockingExtension.ElevateAccessGlobalAdministrator"); scope.Start(); try { @@ -95,7 +142,7 @@ public virtual async Task ElevateAccessGlobalAdministratorAsync(Cancel /// The cancellation token to use. public virtual Response ElevateAccessGlobalAdministrator(CancellationToken cancellationToken = default) { - using var scope = GlobalAdministratorClientDiagnostics.CreateScope("TenantResourceExtensionClient.ElevateAccessGlobalAdministrator"); + using var scope = GlobalAdministratorClientDiagnostics.CreateScope("AuthorizationTenantMockingExtension.ElevateAccessGlobalAdministrator"); scope.Start(); try { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageConfigurationProfileResource.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageConfigurationProfileResource.cs index 9066d58d1d95..9e1428feac2f 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageConfigurationProfileResource.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageConfigurationProfileResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AutomanageConfigurationProfileVersionResources and their operations over a AutomanageConfigurationProfileVersionResource. public virtual AutomanageConfigurationProfileVersionCollection GetAutomanageConfigurationProfileVersions() { - return GetCachedClient(Client => new AutomanageConfigurationProfileVersionCollection(Client, Id)); + return GetCachedClient(client => new AutomanageConfigurationProfileVersionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual AutomanageConfigurationProfileVersionCollection GetAutomanageConf /// /// The configuration profile version name. /// The cancellation token to use. - /// 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> GetAutomanageConfigurationProfileVersionAsync(string versionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task /// The configuration profile version name. /// The cancellation token to use. - /// 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 GetAutomanageConfigurationProfileVersion(string versionName, CancellationToken cancellationToken = default) { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHciClusterConfigurationProfileAssignmentResource.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHciClusterConfigurationProfileAssignmentResource.cs index 12dbc7410397..741f48449c5c 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHciClusterConfigurationProfileAssignmentResource.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHciClusterConfigurationProfileAssignmentResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AutomanageHciClusterConfigurationProfileAssignmentReportResources and their operations over a AutomanageHciClusterConfigurationProfileAssignmentReportResource. public virtual AutomanageHciClusterConfigurationProfileAssignmentReportCollection GetAutomanageHciClusterConfigurationProfileAssignmentReports() { - return GetCachedClient(Client => new AutomanageHciClusterConfigurationProfileAssignmentReportCollection(Client, Id)); + return GetCachedClient(client => new AutomanageHciClusterConfigurationProfileAssignmentReportCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AutomanageHciClusterConfigurationProfileAssignmentReportCollectio /// /// The report name. /// The cancellation token to use. - /// 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> GetAutomanageHciClusterConfigurationProfileAssignmentReportAsync(string reportName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// The report name. /// The cancellation token to use. - /// 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 GetAutomanageHciClusterConfigurationProfileAssignmentReport(string reportName, CancellationToken cancellationToken = default) { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHcrpConfigurationProfileAssignmentResource.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHcrpConfigurationProfileAssignmentResource.cs index 8ab0eb8e6227..1283ac5eafea 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHcrpConfigurationProfileAssignmentResource.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageHcrpConfigurationProfileAssignmentResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AutomanageHcrpConfigurationProfileAssignmentReportResources and their operations over a AutomanageHcrpConfigurationProfileAssignmentReportResource. public virtual AutomanageHcrpConfigurationProfileAssignmentReportCollection GetAutomanageHcrpConfigurationProfileAssignmentReports() { - return GetCachedClient(Client => new AutomanageHcrpConfigurationProfileAssignmentReportCollection(Client, Id)); + return GetCachedClient(client => new AutomanageHcrpConfigurationProfileAssignmentReportCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AutomanageHcrpConfigurationProfileAssignmentReportCollection GetA /// /// The report name. /// The cancellation token to use. - /// 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> GetAutomanageHcrpConfigurationProfileAssignmentReportAsync(string reportName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// The report name. /// The cancellation token to use. - /// 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 GetAutomanageHcrpConfigurationProfileAssignmentReport(string reportName, CancellationToken cancellationToken = default) { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageVmConfigurationProfileAssignmentResource.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageVmConfigurationProfileAssignmentResource.cs index 2e19d658f010..9047035bc6ad 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageVmConfigurationProfileAssignmentResource.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/AutomanageVmConfigurationProfileAssignmentResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AutomanageVmConfigurationProfileAssignmentReportResources and their operations over a AutomanageVmConfigurationProfileAssignmentReportResource. public virtual AutomanageVmConfigurationProfileAssignmentReportCollection GetAutomanageVmConfigurationProfileAssignmentReports() { - return GetCachedClient(Client => new AutomanageVmConfigurationProfileAssignmentReportCollection(Client, Id)); + return GetCachedClient(client => new AutomanageVmConfigurationProfileAssignmentReportCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AutomanageVmConfigurationProfileAssignmentReportCollection GetAut /// /// The report name. /// The cancellation token to use. - /// 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> GetAutomanageVmConfigurationProfileAssignmentReportAsync(string reportName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// The report name. /// The cancellation token to use. - /// 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 GetAutomanageVmConfigurationProfileAssignmentReport(string reportName, CancellationToken cancellationToken = default) { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 1f83f1bd36a8..000000000000 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Automanage -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AutomanageVmConfigurationProfileAssignmentResources in the ArmResource. - /// An object representing collection of AutomanageVmConfigurationProfileAssignmentResources and their operations over a AutomanageVmConfigurationProfileAssignmentResource. - public virtual AutomanageVmConfigurationProfileAssignmentCollection GetAutomanageVmConfigurationProfileAssignments() - { - return GetCachedClient(Client => new AutomanageVmConfigurationProfileAssignmentCollection(Client, Id)); - } - - /// Gets a collection of AutomanageHcrpConfigurationProfileAssignmentResources in the ArmResource. - /// An object representing collection of AutomanageHcrpConfigurationProfileAssignmentResources and their operations over a AutomanageHcrpConfigurationProfileAssignmentResource. - public virtual AutomanageHcrpConfigurationProfileAssignmentCollection GetAutomanageHcrpConfigurationProfileAssignments() - { - return GetCachedClient(Client => new AutomanageHcrpConfigurationProfileAssignmentCollection(Client, Id)); - } - - /// Gets a collection of AutomanageHciClusterConfigurationProfileAssignmentResources in the ArmResource. - /// An object representing collection of AutomanageHciClusterConfigurationProfileAssignmentResources and their operations over a AutomanageHciClusterConfigurationProfileAssignmentResource. - public virtual AutomanageHciClusterConfigurationProfileAssignmentCollection GetAutomanageHciClusterConfigurationProfileAssignments() - { - return GetCachedClient(Client => new AutomanageHciClusterConfigurationProfileAssignmentCollection(Client, Id)); - } - } -} diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageArmClientMockingExtension.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageArmClientMockingExtension.cs new file mode 100644 index 000000000000..bd8d91f8bcca --- /dev/null +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageArmClientMockingExtension.cs @@ -0,0 +1,331 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Automanage; + +namespace Azure.ResourceManager.Automanage.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AutomanageArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AutomanageArmClientMockingExtension() + { + } + + /// 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 AutomanageArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AutomanageArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AutomanageVmConfigurationProfileAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of AutomanageVmConfigurationProfileAssignmentResources and their operations over a AutomanageVmConfigurationProfileAssignmentResource. + public virtual AutomanageVmConfigurationProfileAssignmentCollection GetAutomanageVmConfigurationProfileAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.Compute/virtualMachines", scope.ResourceType)); + } + return new AutomanageVmConfigurationProfileAssignmentCollection(Client, scope); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomanageVmConfigurationProfileAssignmentAsync(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return await GetAutomanageVmConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomanageVmConfigurationProfileAssignment(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return GetAutomanageVmConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + } + + /// Gets a collection of AutomanageHcrpConfigurationProfileAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of AutomanageHcrpConfigurationProfileAssignmentResources and their operations over a AutomanageHcrpConfigurationProfileAssignmentResource. + public virtual AutomanageHcrpConfigurationProfileAssignmentCollection GetAutomanageHcrpConfigurationProfileAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.HybridCompute/machines", scope.ResourceType)); + } + return new AutomanageHcrpConfigurationProfileAssignmentCollection(Client, scope); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileHCRPAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomanageHcrpConfigurationProfileAssignmentAsync(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return await GetAutomanageHcrpConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileHCRPAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomanageHcrpConfigurationProfileAssignment(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return GetAutomanageHcrpConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + } + + /// Gets a collection of AutomanageHciClusterConfigurationProfileAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of AutomanageHciClusterConfigurationProfileAssignmentResources and their operations over a AutomanageHciClusterConfigurationProfileAssignmentResource. + public virtual AutomanageHciClusterConfigurationProfileAssignmentCollection GetAutomanageHciClusterConfigurationProfileAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.AzureStackHci/clusters")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.AzureStackHci/clusters", scope.ResourceType)); + } + return new AutomanageHciClusterConfigurationProfileAssignmentCollection(Client, scope); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileHCIAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomanageHciClusterConfigurationProfileAssignmentAsync(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return await GetAutomanageHciClusterConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a configuration profile assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHci/clusters/{clusterName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName} + /// + /// + /// Operation Id + /// ConfigurationProfileHCIAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The configuration profile assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomanageHciClusterConfigurationProfileAssignment(ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) + { + return GetAutomanageHciClusterConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageBestPracticeResource GetAutomanageBestPracticeResource(ResourceIdentifier id) + { + AutomanageBestPracticeResource.ValidateResourceId(id); + return new AutomanageBestPracticeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageConfigurationProfileResource GetAutomanageConfigurationProfileResource(ResourceIdentifier id) + { + AutomanageConfigurationProfileResource.ValidateResourceId(id); + return new AutomanageConfigurationProfileResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageConfigurationProfileVersionResource GetAutomanageConfigurationProfileVersionResource(ResourceIdentifier id) + { + AutomanageConfigurationProfileVersionResource.ValidateResourceId(id); + return new AutomanageConfigurationProfileVersionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageVmConfigurationProfileAssignmentResource GetAutomanageVmConfigurationProfileAssignmentResource(ResourceIdentifier id) + { + AutomanageVmConfigurationProfileAssignmentResource.ValidateResourceId(id); + return new AutomanageVmConfigurationProfileAssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageHcrpConfigurationProfileAssignmentResource GetAutomanageHcrpConfigurationProfileAssignmentResource(ResourceIdentifier id) + { + AutomanageHcrpConfigurationProfileAssignmentResource.ValidateResourceId(id); + return new AutomanageHcrpConfigurationProfileAssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageHciClusterConfigurationProfileAssignmentResource GetAutomanageHciClusterConfigurationProfileAssignmentResource(ResourceIdentifier id) + { + AutomanageHciClusterConfigurationProfileAssignmentResource.ValidateResourceId(id); + return new AutomanageHciClusterConfigurationProfileAssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageVmConfigurationProfileAssignmentReportResource GetAutomanageVmConfigurationProfileAssignmentReportResource(ResourceIdentifier id) + { + AutomanageVmConfigurationProfileAssignmentReportResource.ValidateResourceId(id); + return new AutomanageVmConfigurationProfileAssignmentReportResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageHcrpConfigurationProfileAssignmentReportResource GetAutomanageHcrpConfigurationProfileAssignmentReportResource(ResourceIdentifier id) + { + AutomanageHcrpConfigurationProfileAssignmentReportResource.ValidateResourceId(id); + return new AutomanageHcrpConfigurationProfileAssignmentReportResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomanageHciClusterConfigurationProfileAssignmentReportResource GetAutomanageHciClusterConfigurationProfileAssignmentReportResource(ResourceIdentifier id) + { + AutomanageHciClusterConfigurationProfileAssignmentReportResource.ValidateResourceId(id); + return new AutomanageHciClusterConfigurationProfileAssignmentReportResource(Client, id); + } + } +} diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageExtensions.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageExtensions.cs index 2e9f223dfa6d..bb6b74153b0b 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageExtensions.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Automanage.Mocking; using Azure.ResourceManager.Automanage.Models; using Azure.ResourceManager.Resources; @@ -19,251 +20,39 @@ namespace Azure.ResourceManager.Automanage /// A class to add extension methods to Azure.ResourceManager.Automanage. public static partial class AutomanageExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static AutomanageArmClientMockingExtension GetAutomanageArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AutomanageArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AutomanageResourceGroupMockingExtension GetAutomanageResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AutomanageResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AutomanageSubscriptionMockingExtension GetAutomanageSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AutomanageSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AutomanageTenantMockingExtension GetAutomanageTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AutomanageTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region AutomanageBestPracticeResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageBestPracticeResource GetAutomanageBestPracticeResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageBestPracticeResource.ValidateResourceId(id); - return new AutomanageBestPracticeResource(client, id); - } - ); - } - #endregion - - #region AutomanageConfigurationProfileResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageConfigurationProfileResource GetAutomanageConfigurationProfileResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageConfigurationProfileResource.ValidateResourceId(id); - return new AutomanageConfigurationProfileResource(client, id); - } - ); - } - #endregion - - #region AutomanageConfigurationProfileVersionResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageConfigurationProfileVersionResource GetAutomanageConfigurationProfileVersionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageConfigurationProfileVersionResource.ValidateResourceId(id); - return new AutomanageConfigurationProfileVersionResource(client, id); - } - ); - } - #endregion - - #region AutomanageVmConfigurationProfileAssignmentResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageVmConfigurationProfileAssignmentResource GetAutomanageVmConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageVmConfigurationProfileAssignmentResource.ValidateResourceId(id); - return new AutomanageVmConfigurationProfileAssignmentResource(client, id); - } - ); - } - #endregion - - #region AutomanageHcrpConfigurationProfileAssignmentResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageHcrpConfigurationProfileAssignmentResource GetAutomanageHcrpConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageHcrpConfigurationProfileAssignmentResource.ValidateResourceId(id); - return new AutomanageHcrpConfigurationProfileAssignmentResource(client, id); - } - ); - } - #endregion - - #region AutomanageHciClusterConfigurationProfileAssignmentResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageHciClusterConfigurationProfileAssignmentResource GetAutomanageHciClusterConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageHciClusterConfigurationProfileAssignmentResource.ValidateResourceId(id); - return new AutomanageHciClusterConfigurationProfileAssignmentResource(client, id); - } - ); - } - #endregion - - #region AutomanageVmConfigurationProfileAssignmentReportResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageVmConfigurationProfileAssignmentReportResource GetAutomanageVmConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageVmConfigurationProfileAssignmentReportResource.ValidateResourceId(id); - return new AutomanageVmConfigurationProfileAssignmentReportResource(client, id); - } - ); - } - #endregion - - #region AutomanageHcrpConfigurationProfileAssignmentReportResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageHcrpConfigurationProfileAssignmentReportResource GetAutomanageHcrpConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageHcrpConfigurationProfileAssignmentReportResource.ValidateResourceId(id); - return new AutomanageHcrpConfigurationProfileAssignmentReportResource(client, id); - } - ); - } - #endregion - - #region AutomanageHciClusterConfigurationProfileAssignmentReportResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets a collection of AutomanageVmConfigurationProfileAssignmentResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutomanageHciClusterConfigurationProfileAssignmentReportResource GetAutomanageHciClusterConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutomanageHciClusterConfigurationProfileAssignmentReportResource.ValidateResourceId(id); - return new AutomanageHciClusterConfigurationProfileAssignmentReportResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of AutomanageVmConfigurationProfileAssignmentResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// An object representing collection of AutomanageVmConfigurationProfileAssignmentResources and their operations over a AutomanageVmConfigurationProfileAssignmentResource. public static AutomanageVmConfigurationProfileAssignmentCollection GetAutomanageVmConfigurationProfileAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetAutomanageVmConfigurationProfileAssignments(); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageVmConfigurationProfileAssignments(scope); } /// @@ -278,21 +67,21 @@ public static AutomanageVmConfigurationProfileAssignmentCollection GetAutomanage /// ConfigurationProfileAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static async Task> GetAutomanageVmConfigurationProfileAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return await client.GetAutomanageVmConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetAutomanageArmClientMockingExtension(client).GetAutomanageVmConfigurationProfileAssignmentAsync(scope, configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -307,34 +96,36 @@ public static async TaskConfigurationProfileAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static Response GetAutomanageVmConfigurationProfileAssignment(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return client.GetAutomanageVmConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageVmConfigurationProfileAssignment(scope, configurationProfileAssignmentName, cancellationToken); } - /// Gets a collection of AutomanageHcrpConfigurationProfileAssignmentResources in the ArmResource. + /// + /// Gets a collection of AutomanageHcrpConfigurationProfileAssignmentResources 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. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// An object representing collection of AutomanageHcrpConfigurationProfileAssignmentResources and their operations over a AutomanageHcrpConfigurationProfileAssignmentResource. public static AutomanageHcrpConfigurationProfileAssignmentCollection GetAutomanageHcrpConfigurationProfileAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetAutomanageHcrpConfigurationProfileAssignments(); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHcrpConfigurationProfileAssignments(scope); } /// @@ -349,21 +140,21 @@ public static AutomanageHcrpConfigurationProfileAssignmentCollection GetAutomana /// ConfigurationProfileHCRPAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static async Task> GetAutomanageHcrpConfigurationProfileAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return await client.GetAutomanageHcrpConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetAutomanageArmClientMockingExtension(client).GetAutomanageHcrpConfigurationProfileAssignmentAsync(scope, configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -378,34 +169,36 @@ public static async TaskConfigurationProfileHCRPAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static Response GetAutomanageHcrpConfigurationProfileAssignment(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return client.GetAutomanageHcrpConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHcrpConfigurationProfileAssignment(scope, configurationProfileAssignmentName, cancellationToken); } - /// Gets a collection of AutomanageHciClusterConfigurationProfileAssignmentResources in the ArmResource. + /// + /// Gets a collection of AutomanageHciClusterConfigurationProfileAssignmentResources 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. Expected resource type includes the following: Microsoft.AzureStackHci/clusters. /// An object representing collection of AutomanageHciClusterConfigurationProfileAssignmentResources and their operations over a AutomanageHciClusterConfigurationProfileAssignmentResource. public static AutomanageHciClusterConfigurationProfileAssignmentCollection GetAutomanageHciClusterConfigurationProfileAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.AzureStackHci/clusters")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.AzureStackHci/clusters", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetAutomanageHciClusterConfigurationProfileAssignments(); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHciClusterConfigurationProfileAssignments(scope); } /// @@ -420,21 +213,21 @@ public static AutomanageHciClusterConfigurationProfileAssignmentCollection GetAu /// ConfigurationProfileHCIAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.AzureStackHci/clusters. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static async Task> GetAutomanageHciClusterConfigurationProfileAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.AzureStackHci/clusters")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.AzureStackHci/clusters", scope.ResourceType)); - } - return await client.GetAutomanageHciClusterConfigurationProfileAssignments(scope).GetAsync(configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetAutomanageArmClientMockingExtension(client).GetAutomanageHciClusterConfigurationProfileAssignmentAsync(scope, configurationProfileAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -449,29 +242,179 @@ public static async TaskConfigurationProfileHCIAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.AzureStackHci/clusters. /// The configuration profile assignment name. /// The cancellation token to use. - /// 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 static Response GetAutomanageHciClusterConfigurationProfileAssignment(this ArmClient client, ResourceIdentifier scope, string configurationProfileAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.AzureStackHci/clusters")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.AzureStackHci/clusters", scope.ResourceType)); - } - return client.GetAutomanageHciClusterConfigurationProfileAssignments(scope).Get(configurationProfileAssignmentName, cancellationToken); + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHciClusterConfigurationProfileAssignment(scope, configurationProfileAssignmentName, cancellationToken); } - /// Gets a collection of AutomanageConfigurationProfileResources in the ResourceGroupResource. + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageBestPracticeResource GetAutomanageBestPracticeResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageBestPracticeResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageConfigurationProfileResource GetAutomanageConfigurationProfileResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageConfigurationProfileResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageConfigurationProfileVersionResource GetAutomanageConfigurationProfileVersionResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageConfigurationProfileVersionResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageVmConfigurationProfileAssignmentResource GetAutomanageVmConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageVmConfigurationProfileAssignmentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageHcrpConfigurationProfileAssignmentResource GetAutomanageHcrpConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHcrpConfigurationProfileAssignmentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageHciClusterConfigurationProfileAssignmentResource GetAutomanageHciClusterConfigurationProfileAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHciClusterConfigurationProfileAssignmentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageVmConfigurationProfileAssignmentReportResource GetAutomanageVmConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageVmConfigurationProfileAssignmentReportResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageHcrpConfigurationProfileAssignmentReportResource GetAutomanageHcrpConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHcrpConfigurationProfileAssignmentReportResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutomanageHciClusterConfigurationProfileAssignmentReportResource GetAutomanageHciClusterConfigurationProfileAssignmentReportResource(this ArmClient client, ResourceIdentifier id) + { + return GetAutomanageArmClientMockingExtension(client).GetAutomanageHciClusterConfigurationProfileAssignmentReportResource(id); + } + + /// + /// Gets a collection of AutomanageConfigurationProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutomanageConfigurationProfileResources and their operations over a AutomanageConfigurationProfileResource. public static AutomanageConfigurationProfileCollection GetAutomanageConfigurationProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutomanageConfigurationProfiles(); + return GetAutomanageResourceGroupMockingExtension(resourceGroupResource).GetAutomanageConfigurationProfiles(); } /// @@ -486,16 +429,20 @@ public static AutomanageConfigurationProfileCollection GetAutomanageConfiguratio /// ConfigurationProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The configuration profile name. /// The cancellation token to use. - /// 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 static async Task> GetAutomanageConfigurationProfileAsync(this ResourceGroupResource resourceGroupResource, string configurationProfileName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAutomanageConfigurationProfiles().GetAsync(configurationProfileName, cancellationToken).ConfigureAwait(false); + return await GetAutomanageResourceGroupMockingExtension(resourceGroupResource).GetAutomanageConfigurationProfileAsync(configurationProfileName, cancellationToken).ConfigureAwait(false); } /// @@ -510,16 +457,20 @@ public static async Task> GetAu /// ConfigurationProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The configuration profile name. /// The cancellation token to use. - /// 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 static Response GetAutomanageConfigurationProfile(this ResourceGroupResource resourceGroupResource, string configurationProfileName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAutomanageConfigurationProfiles().Get(configurationProfileName, cancellationToken); + return GetAutomanageResourceGroupMockingExtension(resourceGroupResource).GetAutomanageConfigurationProfile(configurationProfileName, cancellationToken); } /// @@ -534,13 +485,17 @@ public static Response GetAutomanageConf /// ConfigurationProfiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutomanageConfigurationProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutomanageConfigurationProfilesAsync(cancellationToken); + return GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetAutomanageConfigurationProfilesAsync(cancellationToken); } /// @@ -555,13 +510,17 @@ public static AsyncPageable GetAutomanag /// ConfigurationProfiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutomanageConfigurationProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutomanageConfigurationProfiles(cancellationToken); + return GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetAutomanageConfigurationProfiles(cancellationToken); } /// @@ -576,13 +535,17 @@ public static Pageable GetAutomanageConf /// ServicePrincipals_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetServicePrincipalsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServicePrincipalsAsync(cancellationToken); + return GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetServicePrincipalsAsync(cancellationToken); } /// @@ -597,13 +560,17 @@ public static AsyncPageable GetServicePrincipals /// ServicePrincipals_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetServicePrincipals(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServicePrincipals(cancellationToken); + return GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetServicePrincipals(cancellationToken); } /// @@ -618,12 +585,16 @@ public static Pageable GetServicePrincipals(this /// ServicePrincipals_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetServicePrincipalAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetServicePrincipalAsync(cancellationToken).ConfigureAwait(false); + return await GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetServicePrincipalAsync(cancellationToken).ConfigureAwait(false); } /// @@ -638,20 +609,30 @@ public static async Task> GetServicePri /// ServicePrincipals_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetServicePrincipal(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServicePrincipal(cancellationToken); + return GetAutomanageSubscriptionMockingExtension(subscriptionResource).GetServicePrincipal(cancellationToken); } - /// Gets a collection of AutomanageBestPracticeResources in the TenantResource. + /// + /// Gets a collection of AutomanageBestPracticeResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutomanageBestPracticeResources and their operations over a AutomanageBestPracticeResource. public static AutomanageBestPracticeCollection GetAutomanageBestPractices(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAutomanageBestPractices(); + return GetAutomanageTenantMockingExtension(tenantResource).GetAutomanageBestPractices(); } /// @@ -666,16 +647,20 @@ public static AutomanageBestPracticeCollection GetAutomanageBestPractices(this T /// BestPractices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Automanage best practice name. /// The cancellation token to use. - /// 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 static async Task> GetAutomanageBestPracticeAsync(this TenantResource tenantResource, string bestPracticeName, CancellationToken cancellationToken = default) { - return await tenantResource.GetAutomanageBestPractices().GetAsync(bestPracticeName, cancellationToken).ConfigureAwait(false); + return await GetAutomanageTenantMockingExtension(tenantResource).GetAutomanageBestPracticeAsync(bestPracticeName, cancellationToken).ConfigureAwait(false); } /// @@ -690,16 +675,20 @@ public static async Task> GetAutomanage /// BestPractices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Automanage best practice name. /// The cancellation token to use. - /// 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 static Response GetAutomanageBestPractice(this TenantResource tenantResource, string bestPracticeName, CancellationToken cancellationToken = default) { - return tenantResource.GetAutomanageBestPractices().Get(bestPracticeName, cancellationToken); + return GetAutomanageTenantMockingExtension(tenantResource).GetAutomanageBestPractice(bestPracticeName, cancellationToken); } } } diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageResourceGroupMockingExtension.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..20626e83a42b --- /dev/null +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Automanage; + +namespace Azure.ResourceManager.Automanage.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AutomanageResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AutomanageResourceGroupMockingExtension() + { + } + + /// 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 AutomanageResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AutomanageConfigurationProfileResources in the ResourceGroupResource. + /// An object representing collection of AutomanageConfigurationProfileResources and their operations over a AutomanageConfigurationProfileResource. + public virtual AutomanageConfigurationProfileCollection GetAutomanageConfigurationProfiles() + { + return GetCachedClient(client => new AutomanageConfigurationProfileCollection(client, Id)); + } + + /// + /// Get information about a configuration profile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName} + /// + /// + /// Operation Id + /// ConfigurationProfiles_Get + /// + /// + /// + /// The configuration profile name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomanageConfigurationProfileAsync(string configurationProfileName, CancellationToken cancellationToken = default) + { + return await GetAutomanageConfigurationProfiles().GetAsync(configurationProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a configuration profile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName} + /// + /// + /// Operation Id + /// ConfigurationProfiles_Get + /// + /// + /// + /// The configuration profile name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomanageConfigurationProfile(string configurationProfileName, CancellationToken cancellationToken = default) + { + return GetAutomanageConfigurationProfiles().Get(configurationProfileName, cancellationToken); + } + } +} diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageSubscriptionMockingExtension.cs similarity index 89% rename from sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageSubscriptionMockingExtension.cs index e028579e77a9..35edd8904184 100644 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Automanage; using Azure.ResourceManager.Automanage.Models; -namespace Azure.ResourceManager.Automanage +namespace Azure.ResourceManager.Automanage.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AutomanageSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _automanageConfigurationProfileConfigurationProfilesClientDiagnostics; private ConfigurationProfilesRestOperations _automanageConfigurationProfileConfigurationProfilesRestClient; private ClientDiagnostics _servicePrincipalsClientDiagnostics; private ServicePrincipalsRestOperations _servicePrincipalsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AutomanageSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AutomanageSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetAutomanageConfigurationProfilesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AutomanageConfigurationProfileConfigurationProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AutomanageConfigurationProfileResource(Client, AutomanageConfigurationProfileData.DeserializeAutomanageConfigurationProfileData(e)), AutomanageConfigurationProfileConfigurationProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutomanageConfigurationProfiles", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AutomanageConfigurationProfileResource(Client, AutomanageConfigurationProfileData.DeserializeAutomanageConfigurationProfileData(e)), AutomanageConfigurationProfileConfigurationProfilesClientDiagnostics, Pipeline, "AutomanageSubscriptionMockingExtension.GetAutomanageConfigurationProfiles", "value", null, cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual AsyncPageable GetAutomana public virtual Pageable GetAutomanageConfigurationProfiles(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AutomanageConfigurationProfileConfigurationProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AutomanageConfigurationProfileResource(Client, AutomanageConfigurationProfileData.DeserializeAutomanageConfigurationProfileData(e)), AutomanageConfigurationProfileConfigurationProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutomanageConfigurationProfiles", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AutomanageConfigurationProfileResource(Client, AutomanageConfigurationProfileData.DeserializeAutomanageConfigurationProfileData(e)), AutomanageConfigurationProfileConfigurationProfilesClientDiagnostics, Pipeline, "AutomanageSubscriptionMockingExtension.GetAutomanageConfigurationProfiles", "value", null, cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual Pageable GetAutomanageCon public virtual AsyncPageable GetServicePrincipalsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ServicePrincipalsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AutomanageServicePrincipalData.DeserializeAutomanageServicePrincipalData, ServicePrincipalsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServicePrincipals", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AutomanageServicePrincipalData.DeserializeAutomanageServicePrincipalData, ServicePrincipalsClientDiagnostics, Pipeline, "AutomanageSubscriptionMockingExtension.GetServicePrincipals", "value", null, cancellationToken); } /// @@ -129,7 +130,7 @@ public virtual AsyncPageable GetServicePrincipal public virtual Pageable GetServicePrincipals(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ServicePrincipalsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AutomanageServicePrincipalData.DeserializeAutomanageServicePrincipalData, ServicePrincipalsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServicePrincipals", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AutomanageServicePrincipalData.DeserializeAutomanageServicePrincipalData, ServicePrincipalsClientDiagnostics, Pipeline, "AutomanageSubscriptionMockingExtension.GetServicePrincipals", "value", null, cancellationToken); } /// @@ -148,7 +149,7 @@ public virtual Pageable GetServicePrincipals(Can /// The cancellation token to use. public virtual async Task> GetServicePrincipalAsync(CancellationToken cancellationToken = default) { - using var scope = ServicePrincipalsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServicePrincipal"); + using var scope = ServicePrincipalsClientDiagnostics.CreateScope("AutomanageSubscriptionMockingExtension.GetServicePrincipal"); scope.Start(); try { @@ -178,7 +179,7 @@ public virtual async Task> GetServicePr /// The cancellation token to use. public virtual Response GetServicePrincipal(CancellationToken cancellationToken = default) { - using var scope = ServicePrincipalsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServicePrincipal"); + using var scope = ServicePrincipalsClientDiagnostics.CreateScope("AutomanageSubscriptionMockingExtension.GetServicePrincipal"); scope.Start(); try { diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageTenantMockingExtension.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageTenantMockingExtension.cs new file mode 100644 index 000000000000..459e20297072 --- /dev/null +++ b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/AutomanageTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Automanage; + +namespace Azure.ResourceManager.Automanage.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class AutomanageTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AutomanageTenantMockingExtension() + { + } + + /// 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 AutomanageTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AutomanageBestPracticeResources in the TenantResource. + /// An object representing collection of AutomanageBestPracticeResources and their operations over a AutomanageBestPracticeResource. + public virtual AutomanageBestPracticeCollection GetAutomanageBestPractices() + { + return GetCachedClient(client => new AutomanageBestPracticeCollection(client, Id)); + } + + /// + /// Get information about a Automanage best practice + /// + /// + /// Request Path + /// /providers/Microsoft.Automanage/bestPractices/{bestPracticeName} + /// + /// + /// Operation Id + /// BestPractices_Get + /// + /// + /// + /// The Automanage best practice name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomanageBestPracticeAsync(string bestPracticeName, CancellationToken cancellationToken = default) + { + return await GetAutomanageBestPractices().GetAsync(bestPracticeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a Automanage best practice + /// + /// + /// Request Path + /// /providers/Microsoft.Automanage/bestPractices/{bestPracticeName} + /// + /// + /// Operation Id + /// BestPractices_Get + /// + /// + /// + /// The Automanage best practice name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomanageBestPractice(string bestPracticeName, CancellationToken cancellationToken = default) + { + return GetAutomanageBestPractices().Get(bestPracticeName, cancellationToken); + } + } +} diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 80056435c502..000000000000 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Automanage -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AutomanageConfigurationProfileResources in the ResourceGroupResource. - /// An object representing collection of AutomanageConfigurationProfileResources and their operations over a AutomanageConfigurationProfileResource. - public virtual AutomanageConfigurationProfileCollection GetAutomanageConfigurationProfiles() - { - return GetCachedClient(Client => new AutomanageConfigurationProfileCollection(Client, Id)); - } - } -} diff --git a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index a7a4d95ff048..000000000000 --- a/sdk/automanage/Azure.ResourceManager.Automanage/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Automanage -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AutomanageBestPracticeResources in the TenantResource. - /// An object representing collection of AutomanageBestPracticeResources and their operations over a AutomanageBestPracticeResource. - public virtual AutomanageBestPracticeCollection GetAutomanageBestPractices() - { - return GetCachedClient(Client => new AutomanageBestPracticeCollection(Client, Id)); - } - } -} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs index 3813c0b5295d..4a3b92a16d87 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/AutomationAccountResource.cs @@ -152,7 +152,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AutomationPrivateEndpointConnectionResources and their operations over a AutomationPrivateEndpointConnectionResource. public virtual AutomationPrivateEndpointConnectionCollection GetAutomationPrivateEndpointConnections() { - return GetCachedClient(Client => new AutomationPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new AutomationPrivateEndpointConnectionCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual AutomationPrivateEndpointConnectionCollection GetAutomationPrivat /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetAutomationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetAutomationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetAutomati /// An object representing collection of AutomationAccountPython2PackageResources and their operations over a AutomationAccountPython2PackageResource. public virtual AutomationAccountPython2PackageCollection GetAutomationAccountPython2Packages() { - return GetCachedClient(Client => new AutomationAccountPython2PackageCollection(Client, Id)); + return GetCachedClient(client => new AutomationAccountPython2PackageCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual AutomationAccountPython2PackageCollection GetAutomationAccountPyt /// /// The python package name. /// The cancellation token to use. - /// 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> GetAutomationAccountPython2PackageAsync(string packageName, CancellationToken cancellationToken = default) { @@ -246,8 +246,8 @@ public virtual async Task> Get /// /// The python package name. /// The cancellation token to use. - /// 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 GetAutomationAccountPython2Package(string packageName, CancellationToken cancellationToken = default) { @@ -258,7 +258,7 @@ public virtual Response GetAutomationAc /// An object representing collection of AutomationAccountModuleResources and their operations over a AutomationAccountModuleResource. public virtual AutomationAccountModuleCollection GetAutomationAccountModules() { - return GetCachedClient(Client => new AutomationAccountModuleCollection(Client, Id)); + return GetCachedClient(client => new AutomationAccountModuleCollection(client, Id)); } /// @@ -276,8 +276,8 @@ public virtual AutomationAccountModuleCollection GetAutomationAccountModules() /// /// The module name. /// The cancellation token to use. - /// 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> GetAutomationAccountModuleAsync(string moduleName, CancellationToken cancellationToken = default) { @@ -299,8 +299,8 @@ public virtual async Task> GetAutomati /// /// The module name. /// The cancellation token to use. - /// 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 GetAutomationAccountModule(string moduleName, CancellationToken cancellationToken = default) { @@ -311,7 +311,7 @@ public virtual Response GetAutomationAccountMod /// An object representing collection of DscNodeResources and their operations over a DscNodeResource. public virtual DscNodeCollection GetDscNodes() { - return GetCachedClient(Client => new DscNodeCollection(Client, Id)); + return GetCachedClient(client => new DscNodeCollection(client, Id)); } /// @@ -329,8 +329,8 @@ public virtual DscNodeCollection GetDscNodes() /// /// The node id. /// The cancellation token to use. - /// 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> GetDscNodeAsync(string nodeId, CancellationToken cancellationToken = default) { @@ -352,8 +352,8 @@ public virtual async Task> GetDscNodeAsync(string node /// /// The node id. /// The cancellation token to use. - /// 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 GetDscNode(string nodeId, CancellationToken cancellationToken = default) { @@ -364,7 +364,7 @@ public virtual Response GetDscNode(string nodeId, CancellationT /// An object representing collection of DscNodeConfigurationResources and their operations over a DscNodeConfigurationResource. public virtual DscNodeConfigurationCollection GetDscNodeConfigurations() { - return GetCachedClient(Client => new DscNodeConfigurationCollection(Client, Id)); + return GetCachedClient(client => new DscNodeConfigurationCollection(client, Id)); } /// @@ -382,8 +382,8 @@ public virtual DscNodeConfigurationCollection GetDscNodeConfigurations() /// /// The Dsc node configuration name. /// The cancellation token to use. - /// 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> GetDscNodeConfigurationAsync(string nodeConfigurationName, CancellationToken cancellationToken = default) { @@ -405,8 +405,8 @@ public virtual async Task> GetDscNodeConf /// /// The Dsc node configuration name. /// The cancellation token to use. - /// 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 GetDscNodeConfiguration(string nodeConfigurationName, CancellationToken cancellationToken = default) { @@ -417,7 +417,7 @@ public virtual Response GetDscNodeConfiguration(st /// An object representing collection of DscCompilationJobResources and their operations over a DscCompilationJobResource. public virtual DscCompilationJobCollection GetDscCompilationJobs() { - return GetCachedClient(Client => new DscCompilationJobCollection(Client, Id)); + return GetCachedClient(client => new DscCompilationJobCollection(client, Id)); } /// @@ -435,8 +435,8 @@ public virtual DscCompilationJobCollection GetDscCompilationJobs() /// /// The DSC configuration Id. /// The cancellation token to use. - /// 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> GetDscCompilationJobAsync(string compilationJobName, CancellationToken cancellationToken = default) { @@ -458,8 +458,8 @@ public virtual async Task> GetDscCompilation /// /// The DSC configuration Id. /// The cancellation token to use. - /// 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 GetDscCompilationJob(string compilationJobName, CancellationToken cancellationToken = default) { @@ -470,7 +470,7 @@ public virtual Response GetDscCompilationJob(string c /// An object representing collection of AutomationSourceControlResources and their operations over a AutomationSourceControlResource. public virtual AutomationSourceControlCollection GetAutomationSourceControls() { - return GetCachedClient(Client => new AutomationSourceControlCollection(Client, Id)); + return GetCachedClient(client => new AutomationSourceControlCollection(client, Id)); } /// @@ -488,8 +488,8 @@ public virtual AutomationSourceControlCollection GetAutomationSourceControls() /// /// The name of source control. /// The cancellation token to use. - /// 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> GetAutomationSourceControlAsync(string sourceControlName, CancellationToken cancellationToken = default) { @@ -511,8 +511,8 @@ public virtual async Task> GetAutomati /// /// The name of source control. /// The cancellation token to use. - /// 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 GetAutomationSourceControl(string sourceControlName, CancellationToken cancellationToken = default) { @@ -523,7 +523,7 @@ public virtual Response GetAutomationSourceCont /// An object representing collection of AutomationCertificateResources and their operations over a AutomationCertificateResource. public virtual AutomationCertificateCollection GetAutomationCertificates() { - return GetCachedClient(Client => new AutomationCertificateCollection(Client, Id)); + return GetCachedClient(client => new AutomationCertificateCollection(client, Id)); } /// @@ -541,8 +541,8 @@ public virtual AutomationCertificateCollection GetAutomationCertificates() /// /// The name of certificate. /// The cancellation token to use. - /// 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> GetAutomationCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -564,8 +564,8 @@ public virtual async Task> GetAutomation /// /// The name of certificate. /// The cancellation token to use. - /// 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 GetAutomationCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -576,7 +576,7 @@ public virtual Response GetAutomationCertificate( /// An object representing collection of AutomationConnectionResources and their operations over a AutomationConnectionResource. public virtual AutomationConnectionCollection GetAutomationConnections() { - return GetCachedClient(Client => new AutomationConnectionCollection(Client, Id)); + return GetCachedClient(client => new AutomationConnectionCollection(client, Id)); } /// @@ -594,8 +594,8 @@ public virtual AutomationConnectionCollection GetAutomationConnections() /// /// The name of connection. /// The cancellation token to use. - /// 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> GetAutomationConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -617,8 +617,8 @@ public virtual async Task> GetAutomationC /// /// The name of connection. /// The cancellation token to use. - /// 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 GetAutomationConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -629,7 +629,7 @@ public virtual Response GetAutomationConnection(st /// An object representing collection of AutomationConnectionTypeResources and their operations over a AutomationConnectionTypeResource. public virtual AutomationConnectionTypeCollection GetAutomationConnectionTypes() { - return GetCachedClient(Client => new AutomationConnectionTypeCollection(Client, Id)); + return GetCachedClient(client => new AutomationConnectionTypeCollection(client, Id)); } /// @@ -647,8 +647,8 @@ public virtual AutomationConnectionTypeCollection GetAutomationConnectionTypes() /// /// The name of connection type. /// The cancellation token to use. - /// 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> GetAutomationConnectionTypeAsync(string connectionTypeName, CancellationToken cancellationToken = default) { @@ -670,8 +670,8 @@ public virtual async Task> GetAutomat /// /// The name of connection type. /// The cancellation token to use. - /// 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 GetAutomationConnectionType(string connectionTypeName, CancellationToken cancellationToken = default) { @@ -682,7 +682,7 @@ public virtual Response GetAutomationConnectio /// An object representing collection of AutomationCredentialResources and their operations over a AutomationCredentialResource. public virtual AutomationCredentialCollection GetAutomationCredentials() { - return GetCachedClient(Client => new AutomationCredentialCollection(Client, Id)); + return GetCachedClient(client => new AutomationCredentialCollection(client, Id)); } /// @@ -700,8 +700,8 @@ public virtual AutomationCredentialCollection GetAutomationCredentials() /// /// The name of credential. /// The cancellation token to use. - /// 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> GetAutomationCredentialAsync(string credentialName, CancellationToken cancellationToken = default) { @@ -723,8 +723,8 @@ public virtual async Task> GetAutomationC /// /// The name of credential. /// The cancellation token to use. - /// 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 GetAutomationCredential(string credentialName, CancellationToken cancellationToken = default) { @@ -735,7 +735,7 @@ public virtual Response GetAutomationCredential(st /// An object representing collection of AutomationJobScheduleResources and their operations over a AutomationJobScheduleResource. public virtual AutomationJobScheduleCollection GetAutomationJobSchedules() { - return GetCachedClient(Client => new AutomationJobScheduleCollection(Client, Id)); + return GetCachedClient(client => new AutomationJobScheduleCollection(client, Id)); } /// @@ -784,7 +784,7 @@ public virtual Response GetAutomationJobSchedule( /// An object representing collection of AutomationScheduleResources and their operations over a AutomationScheduleResource. public virtual AutomationScheduleCollection GetAutomationSchedules() { - return GetCachedClient(Client => new AutomationScheduleCollection(Client, Id)); + return GetCachedClient(client => new AutomationScheduleCollection(client, Id)); } /// @@ -802,8 +802,8 @@ public virtual AutomationScheduleCollection GetAutomationSchedules() /// /// The schedule name. /// The cancellation token to use. - /// 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> GetAutomationScheduleAsync(string scheduleName, CancellationToken cancellationToken = default) { @@ -825,8 +825,8 @@ public virtual async Task> GetAutomationSch /// /// The schedule name. /// The cancellation token to use. - /// 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 GetAutomationSchedule(string scheduleName, CancellationToken cancellationToken = default) { @@ -837,7 +837,7 @@ public virtual Response GetAutomationSchedule(string /// An object representing collection of AutomationVariableResources and their operations over a AutomationVariableResource. public virtual AutomationVariableCollection GetAutomationVariables() { - return GetCachedClient(Client => new AutomationVariableCollection(Client, Id)); + return GetCachedClient(client => new AutomationVariableCollection(client, Id)); } /// @@ -855,8 +855,8 @@ public virtual AutomationVariableCollection GetAutomationVariables() /// /// The name of variable. /// The cancellation token to use. - /// 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> GetAutomationVariableAsync(string variableName, CancellationToken cancellationToken = default) { @@ -878,8 +878,8 @@ public virtual async Task> GetAutomationVar /// /// The name of variable. /// The cancellation token to use. - /// 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 GetAutomationVariable(string variableName, CancellationToken cancellationToken = default) { @@ -890,7 +890,7 @@ public virtual Response GetAutomationVariable(string /// An object representing collection of AutomationWatcherResources and their operations over a AutomationWatcherResource. public virtual AutomationWatcherCollection GetAutomationWatchers() { - return GetCachedClient(Client => new AutomationWatcherCollection(Client, Id)); + return GetCachedClient(client => new AutomationWatcherCollection(client, Id)); } /// @@ -908,8 +908,8 @@ public virtual AutomationWatcherCollection GetAutomationWatchers() /// /// The watcher name. /// The cancellation token to use. - /// 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> GetAutomationWatcherAsync(string watcherName, CancellationToken cancellationToken = default) { @@ -931,8 +931,8 @@ public virtual async Task> GetAutomationWatc /// /// The watcher name. /// The cancellation token to use. - /// 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 GetAutomationWatcher(string watcherName, CancellationToken cancellationToken = default) { @@ -943,7 +943,7 @@ public virtual Response GetAutomationWatcher(string w /// An object representing collection of DscConfigurationResources and their operations over a DscConfigurationResource. public virtual DscConfigurationCollection GetDscConfigurations() { - return GetCachedClient(Client => new DscConfigurationCollection(Client, Id)); + return GetCachedClient(client => new DscConfigurationCollection(client, Id)); } /// @@ -961,8 +961,8 @@ public virtual DscConfigurationCollection GetDscConfigurations() /// /// The configuration name. /// The cancellation token to use. - /// 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> GetDscConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -984,8 +984,8 @@ public virtual async Task> GetDscConfiguratio /// /// The configuration name. /// The cancellation token to use. - /// 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 GetDscConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -996,7 +996,7 @@ public virtual Response GetDscConfiguration(string con /// An object representing collection of AutomationJobResources and their operations over a AutomationJobResource. public virtual AutomationJobCollection GetAutomationJobs() { - return GetCachedClient(Client => new AutomationJobCollection(Client, Id)); + return GetCachedClient(client => new AutomationJobCollection(client, Id)); } /// @@ -1015,8 +1015,8 @@ public virtual AutomationJobCollection GetAutomationJobs() /// The job name. /// Identifies this specific client request. /// The cancellation token to use. - /// 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> GetAutomationJobAsync(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) { @@ -1039,8 +1039,8 @@ public virtual async Task> GetAutomationJobAsync /// The job name. /// Identifies this specific client request. /// The cancellation token to use. - /// 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 GetAutomationJob(string jobName, string clientRequestId = null, CancellationToken cancellationToken = default) { @@ -1051,7 +1051,7 @@ public virtual Response GetAutomationJob(string jobName, /// An object representing collection of SoftwareUpdateConfigurationResources and their operations over a SoftwareUpdateConfigurationResource. public virtual SoftwareUpdateConfigurationCollection GetSoftwareUpdateConfigurations() { - return GetCachedClient(Client => new SoftwareUpdateConfigurationCollection(Client, Id)); + return GetCachedClient(client => new SoftwareUpdateConfigurationCollection(client, Id)); } /// @@ -1070,8 +1070,8 @@ public virtual SoftwareUpdateConfigurationCollection GetSoftwareUpdateConfigurat /// The name of the software update configuration to be created. /// Identifies this specific client request. /// The cancellation token to use. - /// 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> GetSoftwareUpdateConfigurationAsync(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) { @@ -1094,8 +1094,8 @@ public virtual async Task> GetSoft /// The name of the software update configuration to be created. /// Identifies this specific client request. /// The cancellation token to use. - /// 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 GetSoftwareUpdateConfiguration(string softwareUpdateConfigurationName, string clientRequestId = null, CancellationToken cancellationToken = default) { @@ -1106,7 +1106,7 @@ public virtual Response GetSoftwareUpdateCo /// An object representing collection of AutomationRunbookResources and their operations over a AutomationRunbookResource. public virtual AutomationRunbookCollection GetAutomationRunbooks() { - return GetCachedClient(Client => new AutomationRunbookCollection(Client, Id)); + return GetCachedClient(client => new AutomationRunbookCollection(client, Id)); } /// @@ -1124,8 +1124,8 @@ public virtual AutomationRunbookCollection GetAutomationRunbooks() /// /// The runbook name. /// The cancellation token to use. - /// 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> GetAutomationRunbookAsync(string runbookName, CancellationToken cancellationToken = default) { @@ -1147,8 +1147,8 @@ public virtual async Task> GetAutomationRunb /// /// The runbook name. /// The cancellation token to use. - /// 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 GetAutomationRunbook(string runbookName, CancellationToken cancellationToken = default) { @@ -1159,7 +1159,7 @@ public virtual Response GetAutomationRunbook(string r /// An object representing collection of AutomationWebhookResources and their operations over a AutomationWebhookResource. public virtual AutomationWebhookCollection GetAutomationWebhooks() { - return GetCachedClient(Client => new AutomationWebhookCollection(Client, Id)); + return GetCachedClient(client => new AutomationWebhookCollection(client, Id)); } /// @@ -1177,8 +1177,8 @@ public virtual AutomationWebhookCollection GetAutomationWebhooks() /// /// The webhook name. /// The cancellation token to use. - /// 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> GetAutomationWebhookAsync(string webhookName, CancellationToken cancellationToken = default) { @@ -1200,8 +1200,8 @@ public virtual async Task> GetAutomationWebh /// /// The webhook name. /// The cancellation token to use. - /// 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 GetAutomationWebhook(string webhookName, CancellationToken cancellationToken = default) { @@ -1212,7 +1212,7 @@ public virtual Response GetAutomationWebhook(string w /// An object representing collection of HybridRunbookWorkerGroupResources and their operations over a HybridRunbookWorkerGroupResource. public virtual HybridRunbookWorkerGroupCollection GetHybridRunbookWorkerGroups() { - return GetCachedClient(Client => new HybridRunbookWorkerGroupCollection(Client, Id)); + return GetCachedClient(client => new HybridRunbookWorkerGroupCollection(client, Id)); } /// @@ -1230,8 +1230,8 @@ public virtual HybridRunbookWorkerGroupCollection GetHybridRunbookWorkerGroups() /// /// The hybrid runbook worker group name. /// The cancellation token to use. - /// 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> GetHybridRunbookWorkerGroupAsync(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) { @@ -1253,8 +1253,8 @@ public virtual async Task> GetHybridR /// /// The hybrid runbook worker group name. /// The cancellation token to use. - /// 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 GetHybridRunbookWorkerGroup(string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationArmClientMockingExtension.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationArmClientMockingExtension.cs new file mode 100644 index 000000000000..5edc97989291 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationArmClientMockingExtension.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Automation; + +namespace Azure.ResourceManager.Automation.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AutomationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AutomationArmClientMockingExtension() + { + } + + /// 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 AutomationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AutomationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationPrivateEndpointConnectionResource GetAutomationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + AutomationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new AutomationPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationAccountPython2PackageResource GetAutomationAccountPython2PackageResource(ResourceIdentifier id) + { + AutomationAccountPython2PackageResource.ValidateResourceId(id); + return new AutomationAccountPython2PackageResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationAccountModuleResource GetAutomationAccountModuleResource(ResourceIdentifier id) + { + AutomationAccountModuleResource.ValidateResourceId(id); + return new AutomationAccountModuleResource(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 DscNodeResource GetDscNodeResource(ResourceIdentifier id) + { + DscNodeResource.ValidateResourceId(id); + return new DscNodeResource(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 DscNodeConfigurationResource GetDscNodeConfigurationResource(ResourceIdentifier id) + { + DscNodeConfigurationResource.ValidateResourceId(id); + return new DscNodeConfigurationResource(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 DscCompilationJobResource GetDscCompilationJobResource(ResourceIdentifier id) + { + DscCompilationJobResource.ValidateResourceId(id); + return new DscCompilationJobResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationSourceControlResource GetAutomationSourceControlResource(ResourceIdentifier id) + { + AutomationSourceControlResource.ValidateResourceId(id); + return new AutomationSourceControlResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationAccountResource GetAutomationAccountResource(ResourceIdentifier id) + { + AutomationAccountResource.ValidateResourceId(id); + return new AutomationAccountResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationCertificateResource GetAutomationCertificateResource(ResourceIdentifier id) + { + AutomationCertificateResource.ValidateResourceId(id); + return new AutomationCertificateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationConnectionResource GetAutomationConnectionResource(ResourceIdentifier id) + { + AutomationConnectionResource.ValidateResourceId(id); + return new AutomationConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationConnectionTypeResource GetAutomationConnectionTypeResource(ResourceIdentifier id) + { + AutomationConnectionTypeResource.ValidateResourceId(id); + return new AutomationConnectionTypeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationCredentialResource GetAutomationCredentialResource(ResourceIdentifier id) + { + AutomationCredentialResource.ValidateResourceId(id); + return new AutomationCredentialResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationJobScheduleResource GetAutomationJobScheduleResource(ResourceIdentifier id) + { + AutomationJobScheduleResource.ValidateResourceId(id); + return new AutomationJobScheduleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationScheduleResource GetAutomationScheduleResource(ResourceIdentifier id) + { + AutomationScheduleResource.ValidateResourceId(id); + return new AutomationScheduleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationVariableResource GetAutomationVariableResource(ResourceIdentifier id) + { + AutomationVariableResource.ValidateResourceId(id); + return new AutomationVariableResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationWatcherResource GetAutomationWatcherResource(ResourceIdentifier id) + { + AutomationWatcherResource.ValidateResourceId(id); + return new AutomationWatcherResource(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 DscConfigurationResource GetDscConfigurationResource(ResourceIdentifier id) + { + DscConfigurationResource.ValidateResourceId(id); + return new DscConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationJobResource GetAutomationJobResource(ResourceIdentifier id) + { + AutomationJobResource.ValidateResourceId(id); + return new AutomationJobResource(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 SoftwareUpdateConfigurationResource GetSoftwareUpdateConfigurationResource(ResourceIdentifier id) + { + SoftwareUpdateConfigurationResource.ValidateResourceId(id); + return new SoftwareUpdateConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationRunbookResource GetAutomationRunbookResource(ResourceIdentifier id) + { + AutomationRunbookResource.ValidateResourceId(id); + return new AutomationRunbookResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutomationWebhookResource GetAutomationWebhookResource(ResourceIdentifier id) + { + AutomationWebhookResource.ValidateResourceId(id); + return new AutomationWebhookResource(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 HybridRunbookWorkerResource GetHybridRunbookWorkerResource(ResourceIdentifier id) + { + HybridRunbookWorkerResource.ValidateResourceId(id); + return new HybridRunbookWorkerResource(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 HybridRunbookWorkerGroupResource GetHybridRunbookWorkerGroupResource(ResourceIdentifier id) + { + HybridRunbookWorkerGroupResource.ValidateResourceId(id); + return new HybridRunbookWorkerGroupResource(Client, id); + } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs index fb4adce2a7e8..af8afb7d87b6 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Automation.Mocking; using Azure.ResourceManager.Automation.Models; using Azure.ResourceManager.Resources; @@ -19,480 +20,401 @@ namespace Azure.ResourceManager.Automation /// A class to add extension methods to Azure.ResourceManager.Automation. public static partial class AutomationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AutomationArmClientMockingExtension GetAutomationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AutomationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AutomationResourceGroupMockingExtension GetAutomationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AutomationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AutomationSubscriptionMockingExtension GetAutomationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AutomationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AutomationPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationPrivateEndpointConnectionResource GetAutomationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationPrivateEndpointConnectionResource.ValidateResourceId(id); - return new AutomationPrivateEndpointConnectionResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationPrivateEndpointConnectionResource(id); } - #endregion - #region AutomationAccountPython2PackageResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationAccountPython2PackageResource GetAutomationAccountPython2PackageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationAccountPython2PackageResource.ValidateResourceId(id); - return new AutomationAccountPython2PackageResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationAccountPython2PackageResource(id); } - #endregion - #region AutomationAccountModuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationAccountModuleResource GetAutomationAccountModuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationAccountModuleResource.ValidateResourceId(id); - return new AutomationAccountModuleResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationAccountModuleResource(id); } - #endregion - #region DscNodeResource /// /// 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. /// Returns a object. public static DscNodeResource GetDscNodeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DscNodeResource.ValidateResourceId(id); - return new DscNodeResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetDscNodeResource(id); } - #endregion - #region DscNodeConfigurationResource /// /// 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. /// Returns a object. public static DscNodeConfigurationResource GetDscNodeConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DscNodeConfigurationResource.ValidateResourceId(id); - return new DscNodeConfigurationResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetDscNodeConfigurationResource(id); } - #endregion - #region DscCompilationJobResource /// /// 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. /// Returns a object. public static DscCompilationJobResource GetDscCompilationJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DscCompilationJobResource.ValidateResourceId(id); - return new DscCompilationJobResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetDscCompilationJobResource(id); } - #endregion - #region AutomationSourceControlResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationSourceControlResource GetAutomationSourceControlResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationSourceControlResource.ValidateResourceId(id); - return new AutomationSourceControlResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationSourceControlResource(id); } - #endregion - #region AutomationAccountResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationAccountResource GetAutomationAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationAccountResource.ValidateResourceId(id); - return new AutomationAccountResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationAccountResource(id); } - #endregion - #region AutomationCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationCertificateResource GetAutomationCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationCertificateResource.ValidateResourceId(id); - return new AutomationCertificateResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationCertificateResource(id); } - #endregion - #region AutomationConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationConnectionResource GetAutomationConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationConnectionResource.ValidateResourceId(id); - return new AutomationConnectionResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationConnectionResource(id); } - #endregion - #region AutomationConnectionTypeResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationConnectionTypeResource GetAutomationConnectionTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationConnectionTypeResource.ValidateResourceId(id); - return new AutomationConnectionTypeResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationConnectionTypeResource(id); } - #endregion - #region AutomationCredentialResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationCredentialResource GetAutomationCredentialResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationCredentialResource.ValidateResourceId(id); - return new AutomationCredentialResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationCredentialResource(id); } - #endregion - #region AutomationJobScheduleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationJobScheduleResource GetAutomationJobScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationJobScheduleResource.ValidateResourceId(id); - return new AutomationJobScheduleResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationJobScheduleResource(id); } - #endregion - #region AutomationScheduleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationScheduleResource GetAutomationScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationScheduleResource.ValidateResourceId(id); - return new AutomationScheduleResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationScheduleResource(id); } - #endregion - #region AutomationVariableResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationVariableResource GetAutomationVariableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationVariableResource.ValidateResourceId(id); - return new AutomationVariableResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationVariableResource(id); } - #endregion - #region AutomationWatcherResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationWatcherResource GetAutomationWatcherResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationWatcherResource.ValidateResourceId(id); - return new AutomationWatcherResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationWatcherResource(id); } - #endregion - #region DscConfigurationResource /// /// 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. /// Returns a object. public static DscConfigurationResource GetDscConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DscConfigurationResource.ValidateResourceId(id); - return new DscConfigurationResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetDscConfigurationResource(id); } - #endregion - #region AutomationJobResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationJobResource GetAutomationJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationJobResource.ValidateResourceId(id); - return new AutomationJobResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationJobResource(id); } - #endregion - #region SoftwareUpdateConfigurationResource /// /// 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. /// Returns a object. public static SoftwareUpdateConfigurationResource GetSoftwareUpdateConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SoftwareUpdateConfigurationResource.ValidateResourceId(id); - return new SoftwareUpdateConfigurationResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetSoftwareUpdateConfigurationResource(id); } - #endregion - #region AutomationRunbookResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationRunbookResource GetAutomationRunbookResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationRunbookResource.ValidateResourceId(id); - return new AutomationRunbookResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationRunbookResource(id); } - #endregion - #region AutomationWebhookResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutomationWebhookResource GetAutomationWebhookResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutomationWebhookResource.ValidateResourceId(id); - return new AutomationWebhookResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetAutomationWebhookResource(id); } - #endregion - #region HybridRunbookWorkerResource /// /// 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. /// Returns a object. public static HybridRunbookWorkerResource GetHybridRunbookWorkerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridRunbookWorkerResource.ValidateResourceId(id); - return new HybridRunbookWorkerResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetHybridRunbookWorkerResource(id); } - #endregion - #region HybridRunbookWorkerGroupResource /// /// 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. /// Returns a object. public static HybridRunbookWorkerGroupResource GetHybridRunbookWorkerGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridRunbookWorkerGroupResource.ValidateResourceId(id); - return new HybridRunbookWorkerGroupResource(client, id); - } - ); + return GetAutomationArmClientMockingExtension(client).GetHybridRunbookWorkerGroupResource(id); } - #endregion - /// Gets a collection of AutomationAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of AutomationAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutomationAccountResources and their operations over a AutomationAccountResource. public static AutomationAccountCollection GetAutomationAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutomationAccounts(); + return GetAutomationResourceGroupMockingExtension(resourceGroupResource).GetAutomationAccounts(); } /// @@ -507,16 +429,20 @@ public static AutomationAccountCollection GetAutomationAccounts(this ResourceGro /// AutomationAccount_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the automation account. /// The cancellation token to use. - /// 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 static async Task> GetAutomationAccountAsync(this ResourceGroupResource resourceGroupResource, string automationAccountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAutomationAccounts().GetAsync(automationAccountName, cancellationToken).ConfigureAwait(false); + return await GetAutomationResourceGroupMockingExtension(resourceGroupResource).GetAutomationAccountAsync(automationAccountName, cancellationToken).ConfigureAwait(false); } /// @@ -531,16 +457,20 @@ public static async Task> GetAutomationAccou /// AutomationAccount_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the automation account. /// The cancellation token to use. - /// 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 static Response GetAutomationAccount(this ResourceGroupResource resourceGroupResource, string automationAccountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAutomationAccounts().Get(automationAccountName, cancellationToken); + return GetAutomationResourceGroupMockingExtension(resourceGroupResource).GetAutomationAccount(automationAccountName, cancellationToken); } /// @@ -555,13 +485,17 @@ public static Response GetAutomationAccount(this Reso /// AutomationAccount_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutomationAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutomationAccountsAsync(cancellationToken); + return GetAutomationSubscriptionMockingExtension(subscriptionResource).GetAutomationAccountsAsync(cancellationToken); } /// @@ -576,13 +510,17 @@ public static AsyncPageable GetAutomationAccountsAsyn /// AutomationAccount_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutomationAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutomationAccounts(cancellationToken); + return GetAutomationSubscriptionMockingExtension(subscriptionResource).GetAutomationAccounts(cancellationToken); } /// @@ -597,13 +535,17 @@ public static Pageable GetAutomationAccounts(this Sub /// deletedAutomationAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscriptionAsync(cancellationToken); + return GetAutomationSubscriptionMockingExtension(subscriptionResource).GetDeletedAutomationAccountsBySubscriptionAsync(cancellationToken); } /// @@ -618,13 +560,17 @@ public static AsyncPageable GetDeletedAutomationAccoun /// deletedAutomationAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedAutomationAccountsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAutomationAccountsBySubscription(cancellationToken); + return GetAutomationSubscriptionMockingExtension(subscriptionResource).GetDeletedAutomationAccountsBySubscription(cancellationToken); } } } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationResourceGroupMockingExtension.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..02098fa291b7 --- /dev/null +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Automation; + +namespace Azure.ResourceManager.Automation.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AutomationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AutomationResourceGroupMockingExtension() + { + } + + /// 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 AutomationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AutomationAccountResources in the ResourceGroupResource. + /// An object representing collection of AutomationAccountResources and their operations over a AutomationAccountResource. + public virtual AutomationAccountCollection GetAutomationAccounts() + { + return GetCachedClient(client => new AutomationAccountCollection(client, Id)); + } + + /// + /// Get information about an Automation Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName} + /// + /// + /// Operation Id + /// AutomationAccount_Get + /// + /// + /// + /// The name of the automation account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutomationAccountAsync(string automationAccountName, CancellationToken cancellationToken = default) + { + return await GetAutomationAccounts().GetAsync(automationAccountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about an Automation Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName} + /// + /// + /// Operation Id + /// AutomationAccount_Get + /// + /// + /// + /// The name of the automation account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutomationAccount(string automationAccountName, CancellationToken cancellationToken = default) + { + return GetAutomationAccounts().Get(automationAccountName, cancellationToken); + } + } +} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationSubscriptionMockingExtension.cs similarity index 87% rename from sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationSubscriptionMockingExtension.cs index 31a4ee41b117..0c187ba66982 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/AutomationSubscriptionMockingExtension.cs @@ -11,27 +11,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Automation; using Azure.ResourceManager.Automation.Models; -namespace Azure.ResourceManager.Automation +namespace Azure.ResourceManager.Automation.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AutomationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _automationAccountClientDiagnostics; private AutomationAccountRestOperations _automationAccountRestClient; private ClientDiagnostics _deletedAutomationAccountsClientDiagnostics; private DeletedAutomationAccountsRestOperations _deletedAutomationAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AutomationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AutomationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetAutomationAccountsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => AutomationAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutomationAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutomationAccountResource(Client, AutomationAccountData.DeserializeAutomationAccountData(e)), AutomationAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutomationAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutomationAccountResource(Client, AutomationAccountData.DeserializeAutomationAccountData(e)), AutomationAccountClientDiagnostics, Pipeline, "AutomationSubscriptionMockingExtension.GetAutomationAccounts", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetAutomationAccounts(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => AutomationAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutomationAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutomationAccountResource(Client, AutomationAccountData.DeserializeAutomationAccountData(e)), AutomationAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutomationAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutomationAccountResource(Client, AutomationAccountData.DeserializeAutomationAccountData(e)), AutomationAccountClientDiagnostics, Pipeline, "AutomationSubscriptionMockingExtension.GetAutomationAccounts", "value", "nextLink", cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual Pageable GetAutomationAccounts(Cancell public virtual AsyncPageable GetDeletedAutomationAccountsBySubscriptionAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => deletedAutomationAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, DeletedAutomationAccount.DeserializeDeletedAutomationAccount, deletedAutomationAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, DeletedAutomationAccount.DeserializeDeletedAutomationAccount, deletedAutomationAccountsClientDiagnostics, Pipeline, "AutomationSubscriptionMockingExtension.GetDeletedAutomationAccountsBySubscription", "value", null, cancellationToken); } /// @@ -129,7 +130,7 @@ public virtual AsyncPageable GetDeletedAutomationAccou public virtual Pageable GetDeletedAutomationAccountsBySubscription(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => deletedAutomationAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, DeletedAutomationAccount.DeserializeDeletedAutomationAccount, deletedAutomationAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAutomationAccountsBySubscription", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, DeletedAutomationAccount.DeserializeDeletedAutomationAccount, deletedAutomationAccountsClientDiagnostics, Pipeline, "AutomationSubscriptionMockingExtension.GetDeletedAutomationAccountsBySubscription", "value", null, cancellationToken); } } } diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 7151b395f5d4..000000000000 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Automation -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AutomationAccountResources in the ResourceGroupResource. - /// An object representing collection of AutomationAccountResources and their operations over a AutomationAccountResource. - public virtual AutomationAccountCollection GetAutomationAccounts() - { - return GetCachedClient(Client => new AutomationAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/HybridRunbookWorkerGroupResource.cs b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/HybridRunbookWorkerGroupResource.cs index de7b28d5bc9c..bae104b4419a 100644 --- a/sdk/automation/Azure.ResourceManager.Automation/src/Generated/HybridRunbookWorkerGroupResource.cs +++ b/sdk/automation/Azure.ResourceManager.Automation/src/Generated/HybridRunbookWorkerGroupResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HybridRunbookWorkerResources and their operations over a HybridRunbookWorkerResource. public virtual HybridRunbookWorkerCollection GetHybridRunbookWorkers() { - return GetCachedClient(Client => new HybridRunbookWorkerCollection(Client, Id)); + return GetCachedClient(client => new HybridRunbookWorkerCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual HybridRunbookWorkerCollection GetHybridRunbookWorkers() /// /// The hybrid runbook worker id. /// The cancellation token to use. - /// 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> GetHybridRunbookWorkerAsync(string hybridRunbookWorkerId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetHybridRunboo /// /// The hybrid runbook worker id. /// The cancellation token to use. - /// 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 GetHybridRunbookWorker(string hybridRunbookWorkerId, CancellationToken cancellationToken = default) { diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudClusterResource.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudClusterResource.cs index 6a18d92c8a41..99eef752a8ae 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudClusterResource.cs +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudClusterResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AvsPrivateCloudDatastoreResources and their operations over a AvsPrivateCloudDatastoreResource. public virtual AvsPrivateCloudDatastoreCollection GetAvsPrivateCloudDatastores() { - return GetCachedClient(Client => new AvsPrivateCloudDatastoreCollection(Client, Id)); + return GetCachedClient(client => new AvsPrivateCloudDatastoreCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual AvsPrivateCloudDatastoreCollection GetAvsPrivateCloudDatastores() /// /// Name of the datastore in the private cloud cluster. /// The cancellation token to use. - /// 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> GetAvsPrivateCloudDatastoreAsync(string datastoreName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetAvsPriv /// /// Name of the datastore in the private cloud cluster. /// The cancellation token to use. - /// 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 GetAvsPrivateCloudDatastore(string datastoreName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetAvsPrivateCloudData /// An object representing collection of AvsPrivateCloudClusterVirtualMachineResources and their operations over a AvsPrivateCloudClusterVirtualMachineResource. public virtual AvsPrivateCloudClusterVirtualMachineCollection GetAvsPrivateCloudClusterVirtualMachines() { - return GetCachedClient(Client => new AvsPrivateCloudClusterVirtualMachineCollection(Client, Id)); + return GetCachedClient(client => new AvsPrivateCloudClusterVirtualMachineCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual AvsPrivateCloudClusterVirtualMachineCollection GetAvsPrivateCloud /// /// Virtual Machine identifier. /// The cancellation token to use. - /// 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> GetAvsPrivateCloudClusterVirtualMachineAsync(string virtualMachineId, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task /// /// Virtual Machine identifier. /// The cancellation token to use. - /// 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 GetAvsPrivateCloudClusterVirtualMachine(string virtualMachineId, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetAvsPriv /// An object representing collection of PlacementPolicyResources and their operations over a PlacementPolicyResource. public virtual PlacementPolicyCollection GetPlacementPolicies() { - return GetCachedClient(Client => new PlacementPolicyCollection(Client, Id)); + return GetCachedClient(client => new PlacementPolicyCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual PlacementPolicyCollection GetPlacementPolicies() /// /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy. /// The cancellation token to use. - /// 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> GetPlacementPolicyAsync(string placementPolicyName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> GetPlacementPolicyA /// /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy. /// The cancellation token to use. - /// 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 GetPlacementPolicy(string placementPolicyName, CancellationToken cancellationToken = default) { diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudResource.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudResource.cs index 1150efd67013..163d49f32050 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudResource.cs +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/AvsPrivateCloudResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AvsPrivateCloudClusterResources and their operations over a AvsPrivateCloudClusterResource. public virtual AvsPrivateCloudClusterCollection GetAvsPrivateCloudClusters() { - return GetCachedClient(Client => new AvsPrivateCloudClusterCollection(Client, Id)); + return GetCachedClient(client => new AvsPrivateCloudClusterCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual AvsPrivateCloudClusterCollection GetAvsPrivateCloudClusters() /// /// Name of the cluster in the private cloud. /// The cancellation token to use. - /// 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> GetAvsPrivateCloudClusterAsync(string clusterName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetAvsPrivat /// /// Name of the cluster in the private cloud. /// The cancellation token to use. - /// 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 GetAvsPrivateCloudCluster(string clusterName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetAvsPrivateCloudCluste /// An object representing collection of HcxEnterpriseSiteResources and their operations over a HcxEnterpriseSiteResource. public virtual HcxEnterpriseSiteCollection GetHcxEnterpriseSites() { - return GetCachedClient(Client => new HcxEnterpriseSiteCollection(Client, Id)); + return GetCachedClient(client => new HcxEnterpriseSiteCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual HcxEnterpriseSiteCollection GetHcxEnterpriseSites() /// /// Name of the HCX Enterprise Site in the private cloud. /// The cancellation token to use. - /// 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> GetHcxEnterpriseSiteAsync(string hcxEnterpriseSiteName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetHcxEnterpriseS /// /// Name of the HCX Enterprise Site in the private cloud. /// The cancellation token to use. - /// 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 GetHcxEnterpriseSite(string hcxEnterpriseSiteName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetHcxEnterpriseSite(string h /// An object representing collection of ExpressRouteAuthorizationResources and their operations over a ExpressRouteAuthorizationResource. public virtual ExpressRouteAuthorizationCollection GetExpressRouteAuthorizations() { - return GetCachedClient(Client => new ExpressRouteAuthorizationCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteAuthorizationCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual ExpressRouteAuthorizationCollection GetExpressRouteAuthorizations /// /// Name of the ExpressRoute Circuit Authorization in the private cloud. /// The cancellation token to use. - /// 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> GetExpressRouteAuthorizationAsync(string authorizationName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetExpres /// /// Name of the ExpressRoute Circuit Authorization in the private cloud. /// The cancellation token to use. - /// 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 GetExpressRouteAuthorization(string authorizationName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetExpressRouteAuthor /// An object representing collection of GlobalReachConnectionResources and their operations over a GlobalReachConnectionResource. public virtual GlobalReachConnectionCollection GetGlobalReachConnections() { - return GetCachedClient(Client => new GlobalReachConnectionCollection(Client, Id)); + return GetCachedClient(client => new GlobalReachConnectionCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual GlobalReachConnectionCollection GetGlobalReachConnections() /// /// Name of the global reach connection in the private cloud. /// The cancellation token to use. - /// 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> GetGlobalReachConnectionAsync(string globalReachConnectionName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetGlobalReac /// /// Name of the global reach connection in the private cloud. /// The cancellation token to use. - /// 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 GetGlobalReachConnection(string globalReachConnectionName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetGlobalReachConnection( /// An object representing collection of WorkloadNetworkResources and their operations over a WorkloadNetworkResource. public virtual WorkloadNetworkCollection GetWorkloadNetworks() { - return GetCachedClient(Client => new WorkloadNetworkCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkCollection(client, Id)); } /// @@ -354,7 +354,7 @@ public virtual Response GetWorkloadNetwork(WorkloadNetw /// An object representing collection of WorkloadNetworkSegmentResources and their operations over a WorkloadNetworkSegmentResource. public virtual WorkloadNetworkSegmentCollection GetWorkloadNetworkSegments() { - return GetCachedClient(Client => new WorkloadNetworkSegmentCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkSegmentCollection(client, Id)); } /// @@ -372,8 +372,8 @@ public virtual WorkloadNetworkSegmentCollection GetWorkloadNetworkSegments() /// /// NSX Segment identifier. Generally the same as the Segment's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkSegmentAsync(string segmentId, CancellationToken cancellationToken = default) { @@ -395,8 +395,8 @@ public virtual async Task> GetWorkloadN /// /// NSX Segment identifier. Generally the same as the Segment's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkSegment(string segmentId, CancellationToken cancellationToken = default) { @@ -407,7 +407,7 @@ public virtual Response GetWorkloadNetworkSegmen /// An object representing collection of WorkloadNetworkDhcpResources and their operations over a WorkloadNetworkDhcpResource. public virtual WorkloadNetworkDhcpCollection GetWorkloadNetworkDhcps() { - return GetCachedClient(Client => new WorkloadNetworkDhcpCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkDhcpCollection(client, Id)); } /// @@ -425,8 +425,8 @@ public virtual WorkloadNetworkDhcpCollection GetWorkloadNetworkDhcps() /// /// NSX DHCP identifier. Generally the same as the DHCP display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkDhcpAsync(string dhcpId, CancellationToken cancellationToken = default) { @@ -448,8 +448,8 @@ public virtual async Task> GetWorkloadNetw /// /// NSX DHCP identifier. Generally the same as the DHCP display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkDhcp(string dhcpId, CancellationToken cancellationToken = default) { @@ -460,7 +460,7 @@ public virtual Response GetWorkloadNetworkDhcp(stri /// An object representing collection of WorkloadNetworkGatewayResources and their operations over a WorkloadNetworkGatewayResource. public virtual WorkloadNetworkGatewayCollection GetWorkloadNetworkGateways() { - return GetCachedClient(Client => new WorkloadNetworkGatewayCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkGatewayCollection(client, Id)); } /// @@ -478,8 +478,8 @@ public virtual WorkloadNetworkGatewayCollection GetWorkloadNetworkGateways() /// /// NSX Gateway identifier. Generally the same as the Gateway's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkGatewayAsync(string gatewayId, CancellationToken cancellationToken = default) { @@ -501,8 +501,8 @@ public virtual async Task> GetWorkloadN /// /// NSX Gateway identifier. Generally the same as the Gateway's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkGateway(string gatewayId, CancellationToken cancellationToken = default) { @@ -513,7 +513,7 @@ public virtual Response GetWorkloadNetworkGatewa /// An object representing collection of WorkloadNetworkPortMirroringProfileResources and their operations over a WorkloadNetworkPortMirroringProfileResource. public virtual WorkloadNetworkPortMirroringProfileCollection GetWorkloadNetworkPortMirroringProfiles() { - return GetCachedClient(Client => new WorkloadNetworkPortMirroringProfileCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkPortMirroringProfileCollection(client, Id)); } /// @@ -531,8 +531,8 @@ public virtual WorkloadNetworkPortMirroringProfileCollection GetWorkloadNetworkP /// /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkPortMirroringProfileAsync(string portMirroringId, CancellationToken cancellationToken = default) { @@ -554,8 +554,8 @@ public virtual async Task> /// /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkPortMirroringProfile(string portMirroringId, CancellationToken cancellationToken = default) { @@ -566,7 +566,7 @@ public virtual Response GetWorkload /// An object representing collection of WorkloadNetworkVmGroupResources and their operations over a WorkloadNetworkVmGroupResource. public virtual WorkloadNetworkVmGroupCollection GetWorkloadNetworkVmGroups() { - return GetCachedClient(Client => new WorkloadNetworkVmGroupCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkVmGroupCollection(client, Id)); } /// @@ -584,8 +584,8 @@ public virtual WorkloadNetworkVmGroupCollection GetWorkloadNetworkVmGroups() /// /// NSX VM Group identifier. Generally the same as the VM Group's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkVmGroupAsync(string vmGroupId, CancellationToken cancellationToken = default) { @@ -607,8 +607,8 @@ public virtual async Task> GetWorkloadN /// /// NSX VM Group identifier. Generally the same as the VM Group's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkVmGroup(string vmGroupId, CancellationToken cancellationToken = default) { @@ -619,7 +619,7 @@ public virtual Response GetWorkloadNetworkVmGrou /// An object representing collection of WorkloadNetworkVirtualMachineResources and their operations over a WorkloadNetworkVirtualMachineResource. public virtual WorkloadNetworkVirtualMachineCollection GetWorkloadNetworkVirtualMachines() { - return GetCachedClient(Client => new WorkloadNetworkVirtualMachineCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkVirtualMachineCollection(client, Id)); } /// @@ -637,8 +637,8 @@ public virtual WorkloadNetworkVirtualMachineCollection GetWorkloadNetworkVirtual /// /// Virtual Machine identifier. /// The cancellation token to use. - /// 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> GetWorkloadNetworkVirtualMachineAsync(string virtualMachineId, CancellationToken cancellationToken = default) { @@ -660,8 +660,8 @@ public virtual async Task> GetWo /// /// Virtual Machine identifier. /// The cancellation token to use. - /// 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 GetWorkloadNetworkVirtualMachine(string virtualMachineId, CancellationToken cancellationToken = default) { @@ -672,7 +672,7 @@ public virtual Response GetWorkloadNetwor /// An object representing collection of WorkloadNetworkDnsServiceResources and their operations over a WorkloadNetworkDnsServiceResource. public virtual WorkloadNetworkDnsServiceCollection GetWorkloadNetworkDnsServices() { - return GetCachedClient(Client => new WorkloadNetworkDnsServiceCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkDnsServiceCollection(client, Id)); } /// @@ -690,8 +690,8 @@ public virtual WorkloadNetworkDnsServiceCollection GetWorkloadNetworkDnsServices /// /// NSX DNS Service identifier. Generally the same as the DNS Service's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkDnsServiceAsync(string dnsServiceId, CancellationToken cancellationToken = default) { @@ -713,8 +713,8 @@ public virtual async Task> GetWorklo /// /// NSX DNS Service identifier. Generally the same as the DNS Service's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkDnsService(string dnsServiceId, CancellationToken cancellationToken = default) { @@ -725,7 +725,7 @@ public virtual Response GetWorkloadNetworkDns /// An object representing collection of WorkloadNetworkDnsZoneResources and their operations over a WorkloadNetworkDnsZoneResource. public virtual WorkloadNetworkDnsZoneCollection GetWorkloadNetworkDnsZones() { - return GetCachedClient(Client => new WorkloadNetworkDnsZoneCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkDnsZoneCollection(client, Id)); } /// @@ -743,8 +743,8 @@ public virtual WorkloadNetworkDnsZoneCollection GetWorkloadNetworkDnsZones() /// /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkDnsZoneAsync(string dnsZoneId, CancellationToken cancellationToken = default) { @@ -766,8 +766,8 @@ public virtual async Task> GetWorkloadN /// /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkDnsZone(string dnsZoneId, CancellationToken cancellationToken = default) { @@ -778,7 +778,7 @@ public virtual Response GetWorkloadNetworkDnsZon /// An object representing collection of WorkloadNetworkPublicIPResources and their operations over a WorkloadNetworkPublicIPResource. public virtual WorkloadNetworkPublicIPCollection GetWorkloadNetworkPublicIPs() { - return GetCachedClient(Client => new WorkloadNetworkPublicIPCollection(Client, Id)); + return GetCachedClient(client => new WorkloadNetworkPublicIPCollection(client, Id)); } /// @@ -796,8 +796,8 @@ public virtual WorkloadNetworkPublicIPCollection GetWorkloadNetworkPublicIPs() /// /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. /// The cancellation token to use. - /// 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> GetWorkloadNetworkPublicIPAsync(string publicIPId, CancellationToken cancellationToken = default) { @@ -819,8 +819,8 @@ public virtual async Task> GetWorkload /// /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. /// The cancellation token to use. - /// 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 GetWorkloadNetworkPublicIP(string publicIPId, CancellationToken cancellationToken = default) { @@ -831,7 +831,7 @@ public virtual Response GetWorkloadNetworkPubli /// An object representing collection of AvsCloudLinkResources and their operations over a AvsCloudLinkResource. public virtual AvsCloudLinkCollection GetAvsCloudLinks() { - return GetCachedClient(Client => new AvsCloudLinkCollection(Client, Id)); + return GetCachedClient(client => new AvsCloudLinkCollection(client, Id)); } /// @@ -849,8 +849,8 @@ public virtual AvsCloudLinkCollection GetAvsCloudLinks() /// /// Name of the cloud link resource. /// The cancellation token to use. - /// 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> GetAvsCloudLinkAsync(string cloudLinkName, CancellationToken cancellationToken = default) { @@ -872,8 +872,8 @@ public virtual async Task> GetAvsCloudLinkAsync(s /// /// Name of the cloud link resource. /// The cancellation token to use. - /// 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 GetAvsCloudLink(string cloudLinkName, CancellationToken cancellationToken = default) { @@ -884,7 +884,7 @@ public virtual Response GetAvsCloudLink(string cloudLinkNa /// An object representing collection of AvsPrivateCloudAddonResources and their operations over a AvsPrivateCloudAddonResource. public virtual AvsPrivateCloudAddonCollection GetAvsPrivateCloudAddons() { - return GetCachedClient(Client => new AvsPrivateCloudAddonCollection(Client, Id)); + return GetCachedClient(client => new AvsPrivateCloudAddonCollection(client, Id)); } /// @@ -902,8 +902,8 @@ public virtual AvsPrivateCloudAddonCollection GetAvsPrivateCloudAddons() /// /// Name of the addon for the private cloud. /// The cancellation token to use. - /// 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> GetAvsPrivateCloudAddonAsync(string addonName, CancellationToken cancellationToken = default) { @@ -925,8 +925,8 @@ public virtual async Task> GetAvsPrivateC /// /// Name of the addon for the private cloud. /// The cancellation token to use. - /// 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 GetAvsPrivateCloudAddon(string addonName, CancellationToken cancellationToken = default) { @@ -937,7 +937,7 @@ public virtual Response GetAvsPrivateCloudAddon(st /// An object representing collection of ScriptPackageResources and their operations over a ScriptPackageResource. public virtual ScriptPackageCollection GetScriptPackages() { - return GetCachedClient(Client => new ScriptPackageCollection(Client, Id)); + return GetCachedClient(client => new ScriptPackageCollection(client, Id)); } /// @@ -955,8 +955,8 @@ public virtual ScriptPackageCollection GetScriptPackages() /// /// Name of the script package in the private cloud. /// The cancellation token to use. - /// 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> GetScriptPackageAsync(string scriptPackageName, CancellationToken cancellationToken = default) { @@ -978,8 +978,8 @@ public virtual async Task> GetScriptPackageAsync /// /// Name of the script package in the private cloud. /// The cancellation token to use. - /// 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 GetScriptPackage(string scriptPackageName, CancellationToken cancellationToken = default) { @@ -990,7 +990,7 @@ public virtual Response GetScriptPackage(string scriptPac /// An object representing collection of ScriptExecutionResources and their operations over a ScriptExecutionResource. public virtual ScriptExecutionCollection GetScriptExecutions() { - return GetCachedClient(Client => new ScriptExecutionCollection(Client, Id)); + return GetCachedClient(client => new ScriptExecutionCollection(client, Id)); } /// @@ -1008,8 +1008,8 @@ public virtual ScriptExecutionCollection GetScriptExecutions() /// /// Name of the user-invoked script execution resource. /// The cancellation token to use. - /// 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> GetScriptExecutionAsync(string scriptExecutionName, CancellationToken cancellationToken = default) { @@ -1031,8 +1031,8 @@ public virtual async Task> GetScriptExecutionA /// /// Name of the user-invoked script execution resource. /// The cancellation token to use. - /// 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 GetScriptExecution(string scriptExecutionName, CancellationToken cancellationToken = default) { diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsArmClientMockingExtension.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsArmClientMockingExtension.cs new file mode 100644 index 000000000000..daa3874ec1ae --- /dev/null +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsArmClientMockingExtension.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Avs; + +namespace Azure.ResourceManager.Avs.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AvsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AvsArmClientMockingExtension() + { + } + + /// 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 AvsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AvsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsPrivateCloudResource GetAvsPrivateCloudResource(ResourceIdentifier id) + { + AvsPrivateCloudResource.ValidateResourceId(id); + return new AvsPrivateCloudResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsPrivateCloudClusterResource GetAvsPrivateCloudClusterResource(ResourceIdentifier id) + { + AvsPrivateCloudClusterResource.ValidateResourceId(id); + return new AvsPrivateCloudClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsPrivateCloudDatastoreResource GetAvsPrivateCloudDatastoreResource(ResourceIdentifier id) + { + AvsPrivateCloudDatastoreResource.ValidateResourceId(id); + return new AvsPrivateCloudDatastoreResource(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 HcxEnterpriseSiteResource GetHcxEnterpriseSiteResource(ResourceIdentifier id) + { + HcxEnterpriseSiteResource.ValidateResourceId(id); + return new HcxEnterpriseSiteResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteAuthorizationResource GetExpressRouteAuthorizationResource(ResourceIdentifier id) + { + ExpressRouteAuthorizationResource.ValidateResourceId(id); + return new ExpressRouteAuthorizationResource(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 GlobalReachConnectionResource GetGlobalReachConnectionResource(ResourceIdentifier id) + { + GlobalReachConnectionResource.ValidateResourceId(id); + return new GlobalReachConnectionResource(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 WorkloadNetworkResource GetWorkloadNetworkResource(ResourceIdentifier id) + { + WorkloadNetworkResource.ValidateResourceId(id); + return new WorkloadNetworkResource(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 WorkloadNetworkSegmentResource GetWorkloadNetworkSegmentResource(ResourceIdentifier id) + { + WorkloadNetworkSegmentResource.ValidateResourceId(id); + return new WorkloadNetworkSegmentResource(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 WorkloadNetworkDhcpResource GetWorkloadNetworkDhcpResource(ResourceIdentifier id) + { + WorkloadNetworkDhcpResource.ValidateResourceId(id); + return new WorkloadNetworkDhcpResource(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 WorkloadNetworkGatewayResource GetWorkloadNetworkGatewayResource(ResourceIdentifier id) + { + WorkloadNetworkGatewayResource.ValidateResourceId(id); + return new WorkloadNetworkGatewayResource(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 WorkloadNetworkPortMirroringProfileResource GetWorkloadNetworkPortMirroringProfileResource(ResourceIdentifier id) + { + WorkloadNetworkPortMirroringProfileResource.ValidateResourceId(id); + return new WorkloadNetworkPortMirroringProfileResource(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 WorkloadNetworkVmGroupResource GetWorkloadNetworkVmGroupResource(ResourceIdentifier id) + { + WorkloadNetworkVmGroupResource.ValidateResourceId(id); + return new WorkloadNetworkVmGroupResource(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 WorkloadNetworkVirtualMachineResource GetWorkloadNetworkVirtualMachineResource(ResourceIdentifier id) + { + WorkloadNetworkVirtualMachineResource.ValidateResourceId(id); + return new WorkloadNetworkVirtualMachineResource(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 WorkloadNetworkDnsServiceResource GetWorkloadNetworkDnsServiceResource(ResourceIdentifier id) + { + WorkloadNetworkDnsServiceResource.ValidateResourceId(id); + return new WorkloadNetworkDnsServiceResource(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 WorkloadNetworkDnsZoneResource GetWorkloadNetworkDnsZoneResource(ResourceIdentifier id) + { + WorkloadNetworkDnsZoneResource.ValidateResourceId(id); + return new WorkloadNetworkDnsZoneResource(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 WorkloadNetworkPublicIPResource GetWorkloadNetworkPublicIPResource(ResourceIdentifier id) + { + WorkloadNetworkPublicIPResource.ValidateResourceId(id); + return new WorkloadNetworkPublicIPResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsCloudLinkResource GetAvsCloudLinkResource(ResourceIdentifier id) + { + AvsCloudLinkResource.ValidateResourceId(id); + return new AvsCloudLinkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsPrivateCloudAddonResource GetAvsPrivateCloudAddonResource(ResourceIdentifier id) + { + AvsPrivateCloudAddonResource.ValidateResourceId(id); + return new AvsPrivateCloudAddonResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvsPrivateCloudClusterVirtualMachineResource GetAvsPrivateCloudClusterVirtualMachineResource(ResourceIdentifier id) + { + AvsPrivateCloudClusterVirtualMachineResource.ValidateResourceId(id); + return new AvsPrivateCloudClusterVirtualMachineResource(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 PlacementPolicyResource GetPlacementPolicyResource(ResourceIdentifier id) + { + PlacementPolicyResource.ValidateResourceId(id); + return new PlacementPolicyResource(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 ScriptPackageResource GetScriptPackageResource(ResourceIdentifier id) + { + ScriptPackageResource.ValidateResourceId(id); + return new ScriptPackageResource(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 ScriptCmdletResource GetScriptCmdletResource(ResourceIdentifier id) + { + ScriptCmdletResource.ValidateResourceId(id); + return new ScriptCmdletResource(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 ScriptExecutionResource GetScriptExecutionResource(ResourceIdentifier id) + { + ScriptExecutionResource.ValidateResourceId(id); + return new ScriptExecutionResource(Client, id); + } + } +} diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsExtensions.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsExtensions.cs index d9641c4abe2c..c9b4a027f792 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsExtensions.cs +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Avs.Mocking; using Azure.ResourceManager.Avs.Models; using Azure.ResourceManager.Resources; @@ -19,480 +20,401 @@ namespace Azure.ResourceManager.Avs /// A class to add extension methods to Azure.ResourceManager.Avs. public static partial class AvsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AvsArmClientMockingExtension GetAvsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AvsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AvsResourceGroupMockingExtension GetAvsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AvsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AvsSubscriptionMockingExtension GetAvsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AvsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AvsPrivateCloudResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsPrivateCloudResource GetAvsPrivateCloudResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsPrivateCloudResource.ValidateResourceId(id); - return new AvsPrivateCloudResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsPrivateCloudResource(id); } - #endregion - #region AvsPrivateCloudClusterResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsPrivateCloudClusterResource GetAvsPrivateCloudClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsPrivateCloudClusterResource.ValidateResourceId(id); - return new AvsPrivateCloudClusterResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsPrivateCloudClusterResource(id); } - #endregion - #region AvsPrivateCloudDatastoreResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsPrivateCloudDatastoreResource GetAvsPrivateCloudDatastoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsPrivateCloudDatastoreResource.ValidateResourceId(id); - return new AvsPrivateCloudDatastoreResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsPrivateCloudDatastoreResource(id); } - #endregion - #region HcxEnterpriseSiteResource /// /// 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. /// Returns a object. public static HcxEnterpriseSiteResource GetHcxEnterpriseSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HcxEnterpriseSiteResource.ValidateResourceId(id); - return new HcxEnterpriseSiteResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetHcxEnterpriseSiteResource(id); } - #endregion - #region ExpressRouteAuthorizationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteAuthorizationResource GetExpressRouteAuthorizationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteAuthorizationResource.ValidateResourceId(id); - return new ExpressRouteAuthorizationResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetExpressRouteAuthorizationResource(id); } - #endregion - #region GlobalReachConnectionResource /// /// 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. /// Returns a object. public static GlobalReachConnectionResource GetGlobalReachConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GlobalReachConnectionResource.ValidateResourceId(id); - return new GlobalReachConnectionResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetGlobalReachConnectionResource(id); } - #endregion - #region WorkloadNetworkResource /// /// 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. /// Returns a object. public static WorkloadNetworkResource GetWorkloadNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkResource.ValidateResourceId(id); - return new WorkloadNetworkResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkResource(id); } - #endregion - #region WorkloadNetworkSegmentResource /// /// 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. /// Returns a object. public static WorkloadNetworkSegmentResource GetWorkloadNetworkSegmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkSegmentResource.ValidateResourceId(id); - return new WorkloadNetworkSegmentResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkSegmentResource(id); } - #endregion - #region WorkloadNetworkDhcpResource /// /// 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. /// Returns a object. public static WorkloadNetworkDhcpResource GetWorkloadNetworkDhcpResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkDhcpResource.ValidateResourceId(id); - return new WorkloadNetworkDhcpResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkDhcpResource(id); } - #endregion - #region WorkloadNetworkGatewayResource /// /// 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. /// Returns a object. public static WorkloadNetworkGatewayResource GetWorkloadNetworkGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkGatewayResource.ValidateResourceId(id); - return new WorkloadNetworkGatewayResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkGatewayResource(id); } - #endregion - #region WorkloadNetworkPortMirroringProfileResource /// /// 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. /// Returns a object. public static WorkloadNetworkPortMirroringProfileResource GetWorkloadNetworkPortMirroringProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkPortMirroringProfileResource.ValidateResourceId(id); - return new WorkloadNetworkPortMirroringProfileResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkPortMirroringProfileResource(id); } - #endregion - #region WorkloadNetworkVmGroupResource /// /// 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. /// Returns a object. public static WorkloadNetworkVmGroupResource GetWorkloadNetworkVmGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkVmGroupResource.ValidateResourceId(id); - return new WorkloadNetworkVmGroupResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkVmGroupResource(id); } - #endregion - #region WorkloadNetworkVirtualMachineResource /// /// 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. /// Returns a object. public static WorkloadNetworkVirtualMachineResource GetWorkloadNetworkVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkVirtualMachineResource.ValidateResourceId(id); - return new WorkloadNetworkVirtualMachineResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkVirtualMachineResource(id); } - #endregion - #region WorkloadNetworkDnsServiceResource /// /// 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. /// Returns a object. public static WorkloadNetworkDnsServiceResource GetWorkloadNetworkDnsServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkDnsServiceResource.ValidateResourceId(id); - return new WorkloadNetworkDnsServiceResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkDnsServiceResource(id); } - #endregion - #region WorkloadNetworkDnsZoneResource /// /// 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. /// Returns a object. public static WorkloadNetworkDnsZoneResource GetWorkloadNetworkDnsZoneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkDnsZoneResource.ValidateResourceId(id); - return new WorkloadNetworkDnsZoneResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkDnsZoneResource(id); } - #endregion - #region WorkloadNetworkPublicIPResource /// /// 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. /// Returns a object. public static WorkloadNetworkPublicIPResource GetWorkloadNetworkPublicIPResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadNetworkPublicIPResource.ValidateResourceId(id); - return new WorkloadNetworkPublicIPResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetWorkloadNetworkPublicIPResource(id); } - #endregion - #region AvsCloudLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsCloudLinkResource GetAvsCloudLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsCloudLinkResource.ValidateResourceId(id); - return new AvsCloudLinkResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsCloudLinkResource(id); } - #endregion - #region AvsPrivateCloudAddonResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsPrivateCloudAddonResource GetAvsPrivateCloudAddonResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsPrivateCloudAddonResource.ValidateResourceId(id); - return new AvsPrivateCloudAddonResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsPrivateCloudAddonResource(id); } - #endregion - #region AvsPrivateCloudClusterVirtualMachineResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvsPrivateCloudClusterVirtualMachineResource GetAvsPrivateCloudClusterVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvsPrivateCloudClusterVirtualMachineResource.ValidateResourceId(id); - return new AvsPrivateCloudClusterVirtualMachineResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetAvsPrivateCloudClusterVirtualMachineResource(id); } - #endregion - #region PlacementPolicyResource /// /// 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. /// Returns a object. public static PlacementPolicyResource GetPlacementPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PlacementPolicyResource.ValidateResourceId(id); - return new PlacementPolicyResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetPlacementPolicyResource(id); } - #endregion - #region ScriptPackageResource /// /// 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. /// Returns a object. public static ScriptPackageResource GetScriptPackageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScriptPackageResource.ValidateResourceId(id); - return new ScriptPackageResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetScriptPackageResource(id); } - #endregion - #region ScriptCmdletResource /// /// 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. /// Returns a object. public static ScriptCmdletResource GetScriptCmdletResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScriptCmdletResource.ValidateResourceId(id); - return new ScriptCmdletResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetScriptCmdletResource(id); } - #endregion - #region ScriptExecutionResource /// /// 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. /// Returns a object. public static ScriptExecutionResource GetScriptExecutionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScriptExecutionResource.ValidateResourceId(id); - return new ScriptExecutionResource(client, id); - } - ); + return GetAvsArmClientMockingExtension(client).GetScriptExecutionResource(id); } - #endregion - /// Gets a collection of AvsPrivateCloudResources in the ResourceGroupResource. + /// + /// Gets a collection of AvsPrivateCloudResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AvsPrivateCloudResources and their operations over a AvsPrivateCloudResource. public static AvsPrivateCloudCollection GetAvsPrivateClouds(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvsPrivateClouds(); + return GetAvsResourceGroupMockingExtension(resourceGroupResource).GetAvsPrivateClouds(); } /// @@ -507,16 +429,20 @@ public static AvsPrivateCloudCollection GetAvsPrivateClouds(this ResourceGroupRe /// PrivateClouds_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the private cloud. /// The cancellation token to use. - /// 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 static async Task> GetAvsPrivateCloudAsync(this ResourceGroupResource resourceGroupResource, string privateCloudName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAvsPrivateClouds().GetAsync(privateCloudName, cancellationToken).ConfigureAwait(false); + return await GetAvsResourceGroupMockingExtension(resourceGroupResource).GetAvsPrivateCloudAsync(privateCloudName, cancellationToken).ConfigureAwait(false); } /// @@ -531,16 +457,20 @@ public static async Task> GetAvsPrivateCloudAs /// PrivateClouds_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the private cloud. /// The cancellation token to use. - /// 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 static Response GetAvsPrivateCloud(this ResourceGroupResource resourceGroupResource, string privateCloudName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAvsPrivateClouds().Get(privateCloudName, cancellationToken); + return GetAvsResourceGroupMockingExtension(resourceGroupResource).GetAvsPrivateCloud(privateCloudName, cancellationToken); } /// @@ -555,6 +485,10 @@ public static Response GetAvsPrivateCloud(this Resource /// Locations_CheckTrialAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region. @@ -562,7 +496,7 @@ public static Response GetAvsPrivateCloud(this Resource /// The cancellation token to use. public static async Task> CheckAvsTrialAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, AvsSku sku = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAvsTrialAvailabilityAsync(location, sku, cancellationToken).ConfigureAwait(false); + return await GetAvsSubscriptionMockingExtension(subscriptionResource).CheckAvsTrialAvailabilityAsync(location, sku, cancellationToken).ConfigureAwait(false); } /// @@ -577,6 +511,10 @@ public static async Task> Check /// Locations_CheckTrialAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region. @@ -584,7 +522,7 @@ public static async Task> Check /// The cancellation token to use. public static Response CheckAvsTrialAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, AvsSku sku = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAvsTrialAvailability(location, sku, cancellationToken); + return GetAvsSubscriptionMockingExtension(subscriptionResource).CheckAvsTrialAvailability(location, sku, cancellationToken); } /// @@ -599,13 +537,17 @@ public static Response CheckAvsTrialAvai /// Locations_CheckQuotaAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region. /// The cancellation token to use. public static async Task> CheckAvsQuotaAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAvsQuotaAvailabilityAsync(location, cancellationToken).ConfigureAwait(false); + return await GetAvsSubscriptionMockingExtension(subscriptionResource).CheckAvsQuotaAvailabilityAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -620,13 +562,17 @@ public static async Task> Check /// Locations_CheckQuotaAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region. /// The cancellation token to use. public static Response CheckAvsQuotaAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAvsQuotaAvailability(location, cancellationToken); + return GetAvsSubscriptionMockingExtension(subscriptionResource).CheckAvsQuotaAvailability(location, cancellationToken); } /// @@ -641,13 +587,17 @@ public static Response CheckAvsQuotaAvai /// PrivateClouds_ListInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvsPrivateCloudsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvsPrivateCloudsAsync(cancellationToken); + return GetAvsSubscriptionMockingExtension(subscriptionResource).GetAvsPrivateCloudsAsync(cancellationToken); } /// @@ -662,13 +612,17 @@ public static AsyncPageable GetAvsPrivateCloudsAsync(th /// PrivateClouds_ListInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvsPrivateClouds(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvsPrivateClouds(cancellationToken); + return GetAvsSubscriptionMockingExtension(subscriptionResource).GetAvsPrivateClouds(cancellationToken); } } } diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsResourceGroupMockingExtension.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..97ae9b23bbee --- /dev/null +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Avs; + +namespace Azure.ResourceManager.Avs.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AvsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AvsResourceGroupMockingExtension() + { + } + + /// 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 AvsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AvsPrivateCloudResources in the ResourceGroupResource. + /// An object representing collection of AvsPrivateCloudResources and their operations over a AvsPrivateCloudResource. + public virtual AvsPrivateCloudCollection GetAvsPrivateClouds() + { + return GetCachedClient(client => new AvsPrivateCloudCollection(client, Id)); + } + + /// + /// Get a private cloud + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName} + /// + /// + /// Operation Id + /// PrivateClouds_Get + /// + /// + /// + /// Name of the private cloud. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvsPrivateCloudAsync(string privateCloudName, CancellationToken cancellationToken = default) + { + return await GetAvsPrivateClouds().GetAsync(privateCloudName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a private cloud + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName} + /// + /// + /// Operation Id + /// PrivateClouds_Get + /// + /// + /// + /// Name of the private cloud. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvsPrivateCloud(string privateCloudName, CancellationToken cancellationToken = default) + { + return GetAvsPrivateClouds().Get(privateCloudName, cancellationToken); + } + } +} diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsSubscriptionMockingExtension.cs similarity index 91% rename from sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsSubscriptionMockingExtension.cs index 44ae45f53536..d8b0b5bd5af9 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/AvsSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Avs; using Azure.ResourceManager.Avs.Models; -namespace Azure.ResourceManager.Avs +namespace Azure.ResourceManager.Avs.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AvsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; private ClientDiagnostics _avsPrivateCloudPrivateCloudsClientDiagnostics; private PrivateCloudsRestOperations _avsPrivateCloudPrivateCloudsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AvsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AvsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> CheckAvsTrialAvailabilityAsync(AzureLocation location, AvsSku sku = null, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAvsTrialAvailability"); + using var scope = LocationsClientDiagnostics.CreateScope("AvsSubscriptionMockingExtension.CheckAvsTrialAvailability"); scope.Start(); try { @@ -98,7 +99,7 @@ public virtual async Task> Chec /// The cancellation token to use. public virtual Response CheckAvsTrialAvailability(AzureLocation location, AvsSku sku = null, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAvsTrialAvailability"); + using var scope = LocationsClientDiagnostics.CreateScope("AvsSubscriptionMockingExtension.CheckAvsTrialAvailability"); scope.Start(); try { @@ -129,7 +130,7 @@ public virtual Response CheckAvsTrialAva /// The cancellation token to use. public virtual async Task> CheckAvsQuotaAvailabilityAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAvsQuotaAvailability"); + using var scope = LocationsClientDiagnostics.CreateScope("AvsSubscriptionMockingExtension.CheckAvsQuotaAvailability"); scope.Start(); try { @@ -160,7 +161,7 @@ public virtual async Task> Chec /// The cancellation token to use. public virtual Response CheckAvsQuotaAvailability(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAvsQuotaAvailability"); + using var scope = LocationsClientDiagnostics.CreateScope("AvsSubscriptionMockingExtension.CheckAvsQuotaAvailability"); scope.Start(); try { @@ -193,7 +194,7 @@ public virtual AsyncPageable GetAvsPrivateCloudsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => AvsPrivateCloudPrivateCloudsRestClient.CreateListInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvsPrivateCloudPrivateCloudsRestClient.CreateListInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsPrivateCloudResource(Client, AvsPrivateCloudData.DeserializeAvsPrivateCloudData(e)), AvsPrivateCloudPrivateCloudsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvsPrivateClouds", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvsPrivateCloudResource(Client, AvsPrivateCloudData.DeserializeAvsPrivateCloudData(e)), AvsPrivateCloudPrivateCloudsClientDiagnostics, Pipeline, "AvsSubscriptionMockingExtension.GetAvsPrivateClouds", "value", "nextLink", cancellationToken); } /// @@ -215,7 +216,7 @@ public virtual Pageable GetAvsPrivateClouds(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => AvsPrivateCloudPrivateCloudsRestClient.CreateListInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvsPrivateCloudPrivateCloudsRestClient.CreateListInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsPrivateCloudResource(Client, AvsPrivateCloudData.DeserializeAvsPrivateCloudData(e)), AvsPrivateCloudPrivateCloudsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvsPrivateClouds", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvsPrivateCloudResource(Client, AvsPrivateCloudData.DeserializeAvsPrivateCloudData(e)), AvsPrivateCloudPrivateCloudsClientDiagnostics, Pipeline, "AvsSubscriptionMockingExtension.GetAvsPrivateClouds", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f27d9ee87b0d..000000000000 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Avs -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AvsPrivateCloudResources in the ResourceGroupResource. - /// An object representing collection of AvsPrivateCloudResources and their operations over a AvsPrivateCloudResource. - public virtual AvsPrivateCloudCollection GetAvsPrivateClouds() - { - return GetCachedClient(Client => new AvsPrivateCloudCollection(Client, Id)); - } - } -} diff --git a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/ScriptPackageResource.cs b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/ScriptPackageResource.cs index f00d9bde6426..176476d3e635 100644 --- a/sdk/avs/Azure.ResourceManager.Avs/src/Generated/ScriptPackageResource.cs +++ b/sdk/avs/Azure.ResourceManager.Avs/src/Generated/ScriptPackageResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ScriptCmdletResources and their operations over a ScriptCmdletResource. public virtual ScriptCmdletCollection GetScriptCmdlets() { - return GetCachedClient(Client => new ScriptCmdletCollection(Client, Id)); + return GetCachedClient(client => new ScriptCmdletCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ScriptCmdletCollection GetScriptCmdlets() /// /// Name of the script cmdlet resource in the script package in the private cloud. /// The cancellation token to use. - /// 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> GetScriptCmdletAsync(string scriptCmdletName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetScriptCmdletAsync(s /// /// Name of the script cmdlet resource in the script package in the private cloud. /// The cancellation token to use. - /// 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 GetScriptCmdlet(string scriptCmdletName, CancellationToken cancellationToken = default) { diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/ArcSettingResource.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/ArcSettingResource.cs index 32ed6a53a206..79a00a629c5c 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/ArcSettingResource.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/ArcSettingResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ArcExtensionResources and their operations over a ArcExtensionResource. public virtual ArcExtensionCollection GetArcExtensions() { - return GetCachedClient(Client => new ArcExtensionCollection(Client, Id)); + return GetCachedClient(client => new ArcExtensionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ArcExtensionCollection GetArcExtensions() /// /// The name of the machine extension. /// The cancellation token to use. - /// 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> GetArcExtensionAsync(string extensionName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetArcExtensionAsync(s /// /// The name of the machine extension. /// The cancellation token to use. - /// 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 GetArcExtension(string extensionName, CancellationToken cancellationToken = default) { diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciArmClientMockingExtension.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciArmClientMockingExtension.cs new file mode 100644 index 000000000000..efe0b18f2d6b --- /dev/null +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Hci; + +namespace Azure.ResourceManager.Hci.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HciArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HciArmClientMockingExtension() + { + } + + /// 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 HciArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HciArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArcSettingResource GetArcSettingResource(ResourceIdentifier id) + { + ArcSettingResource.ValidateResourceId(id); + return new ArcSettingResource(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 HciClusterResource GetHciClusterResource(ResourceIdentifier id) + { + HciClusterResource.ValidateResourceId(id); + return new HciClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArcExtensionResource GetArcExtensionResource(ResourceIdentifier id) + { + ArcExtensionResource.ValidateResourceId(id); + return new ArcExtensionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OfferResource GetOfferResource(ResourceIdentifier id) + { + OfferResource.ValidateResourceId(id); + return new OfferResource(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 PublisherResource GetPublisherResource(ResourceIdentifier id) + { + PublisherResource.ValidateResourceId(id); + return new PublisherResource(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 HciSkuResource GetHciSkuResource(ResourceIdentifier id) + { + HciSkuResource.ValidateResourceId(id); + return new HciSkuResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UpdateRunResource GetUpdateRunResource(ResourceIdentifier id) + { + UpdateRunResource.ValidateResourceId(id); + return new UpdateRunResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UpdateSummaryResource GetUpdateSummaryResource(ResourceIdentifier id) + { + UpdateSummaryResource.ValidateResourceId(id); + return new UpdateSummaryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UpdateResource GetUpdateResource(ResourceIdentifier id) + { + UpdateResource.ValidateResourceId(id); + return new UpdateResource(Client, id); + } + } +} diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciExtensions.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciExtensions.cs index 25e60f41d1d1..c0c98f17483c 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciExtensions.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Hci.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Hci @@ -18,214 +19,177 @@ namespace Azure.ResourceManager.Hci /// A class to add extension methods to Azure.ResourceManager.Hci. public static partial class HciExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HciArmClientMockingExtension GetHciArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HciArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HciResourceGroupMockingExtension GetHciResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HciResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HciSubscriptionMockingExtension GetHciSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HciSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ArcSettingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArcSettingResource GetArcSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArcSettingResource.ValidateResourceId(id); - return new ArcSettingResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetArcSettingResource(id); } - #endregion - #region HciClusterResource /// /// 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. /// Returns a object. public static HciClusterResource GetHciClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HciClusterResource.ValidateResourceId(id); - return new HciClusterResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetHciClusterResource(id); } - #endregion - #region ArcExtensionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArcExtensionResource GetArcExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArcExtensionResource.ValidateResourceId(id); - return new ArcExtensionResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetArcExtensionResource(id); } - #endregion - #region OfferResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OfferResource GetOfferResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OfferResource.ValidateResourceId(id); - return new OfferResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetOfferResource(id); } - #endregion - #region PublisherResource /// /// 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. /// Returns a object. public static PublisherResource GetPublisherResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PublisherResource.ValidateResourceId(id); - return new PublisherResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetPublisherResource(id); } - #endregion - #region HciSkuResource /// /// 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. /// Returns a object. public static HciSkuResource GetHciSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HciSkuResource.ValidateResourceId(id); - return new HciSkuResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetHciSkuResource(id); } - #endregion - #region UpdateRunResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static UpdateRunResource GetUpdateRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - UpdateRunResource.ValidateResourceId(id); - return new UpdateRunResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetUpdateRunResource(id); } - #endregion - #region UpdateSummaryResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static UpdateSummaryResource GetUpdateSummaryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - UpdateSummaryResource.ValidateResourceId(id); - return new UpdateSummaryResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetUpdateSummaryResource(id); } - #endregion - #region UpdateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static UpdateResource GetUpdateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - UpdateResource.ValidateResourceId(id); - return new UpdateResource(client, id); - } - ); + return GetHciArmClientMockingExtension(client).GetUpdateResource(id); } - #endregion - /// Gets a collection of HciClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of HciClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HciClusterResources and their operations over a HciClusterResource. public static HciClusterCollection GetHciClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHciClusters(); + return GetHciResourceGroupMockingExtension(resourceGroupResource).GetHciClusters(); } /// @@ -240,16 +204,20 @@ public static HciClusterCollection GetHciClusters(this ResourceGroupResource res /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetHciClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHciClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetHciResourceGroupMockingExtension(resourceGroupResource).GetHciClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -264,16 +232,20 @@ public static async Task> GetHciClusterAsync(this R /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetHciCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHciClusters().Get(clusterName, cancellationToken); + return GetHciResourceGroupMockingExtension(resourceGroupResource).GetHciCluster(clusterName, cancellationToken); } /// @@ -288,13 +260,17 @@ public static Response GetHciCluster(this ResourceGroupResou /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHciClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHciClustersAsync(cancellationToken); + return GetHciSubscriptionMockingExtension(subscriptionResource).GetHciClustersAsync(cancellationToken); } /// @@ -309,13 +285,17 @@ public static AsyncPageable GetHciClustersAsync(this Subscri /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHciClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHciClusters(cancellationToken); + return GetHciSubscriptionMockingExtension(subscriptionResource).GetHciClusters(cancellationToken); } } } diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciResourceGroupMockingExtension.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..2ea803de8e49 --- /dev/null +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Hci; + +namespace Azure.ResourceManager.Hci.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HciResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HciResourceGroupMockingExtension() + { + } + + /// 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 HciResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HciClusterResources in the ResourceGroupResource. + /// An object representing collection of HciClusterResources and their operations over a HciClusterResource. + public virtual HciClusterCollection GetHciClusters() + { + return GetCachedClient(client => new HciClusterCollection(client, Id)); + } + + /// + /// Get HCI cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHciClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetHciClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get HCI cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHciCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetHciClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciSubscriptionMockingExtension.cs similarity index 86% rename from sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciSubscriptionMockingExtension.cs index 9b937d2dced4..717b97c43b71 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/HciSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Hci; -namespace Azure.ResourceManager.Hci +namespace Azure.ResourceManager.Hci.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HciSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _hciClusterClustersClientDiagnostics; private ClustersRestOperations _hciClusterClustersRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HciSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HciSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetHciClustersAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => HciClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HciClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HciClusterResource(Client, HciClusterData.DeserializeHciClusterData(e)), HciClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHciClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HciClusterResource(Client, HciClusterData.DeserializeHciClusterData(e)), HciClusterClustersClientDiagnostics, Pipeline, "HciSubscriptionMockingExtension.GetHciClusters", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetHciClusters(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => HciClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HciClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HciClusterResource(Client, HciClusterData.DeserializeHciClusterData(e)), HciClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHciClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HciClusterResource(Client, HciClusterData.DeserializeHciClusterData(e)), HciClusterClustersClientDiagnostics, Pipeline, "HciSubscriptionMockingExtension.GetHciClusters", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index a89e10777a6f..000000000000 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Hci -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HciClusterResources in the ResourceGroupResource. - /// An object representing collection of HciClusterResources and their operations over a HciClusterResource. - public virtual HciClusterCollection GetHciClusters() - { - return GetCachedClient(Client => new HciClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/HciClusterResource.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/HciClusterResource.cs index 209a217201a5..a7e80c7d6de4 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/HciClusterResource.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/HciClusterResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ArcSettingResources and their operations over a ArcSettingResource. public virtual ArcSettingCollection GetArcSettings() { - return GetCachedClient(Client => new ArcSettingCollection(Client, Id)); + return GetCachedClient(client => new ArcSettingCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual ArcSettingCollection GetArcSettings() /// /// The name of the proxy resource holding details of HCI ArcSetting information. /// The cancellation token to use. - /// 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> GetArcSettingAsync(string arcSettingName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetArcSettingAsync(strin /// /// The name of the proxy resource holding details of HCI ArcSetting information. /// The cancellation token to use. - /// 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 GetArcSetting(string arcSettingName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetArcSetting(string arcSettingName, /// An object representing collection of PublisherResources and their operations over a PublisherResource. public virtual PublisherCollection GetPublishers() { - return GetCachedClient(Client => new PublisherCollection(Client, Id)); + return GetCachedClient(client => new PublisherCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual PublisherCollection GetPublishers() /// /// The name of the publisher available within HCI cluster. /// The cancellation token to use. - /// 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> GetPublisherAsync(string publisherName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetPublisherAsync(string /// /// The name of the publisher available within HCI cluster. /// The cancellation token to use. - /// 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 GetPublisher(string publisherName, CancellationToken cancellationToken = default) { @@ -212,7 +212,7 @@ public virtual UpdateSummaryResource GetUpdateSummary() /// An object representing collection of UpdateResources and their operations over a UpdateResource. public virtual UpdateCollection GetUpdates() { - return GetCachedClient(Client => new UpdateCollection(Client, Id)); + return GetCachedClient(client => new UpdateCollection(client, Id)); } /// @@ -230,8 +230,8 @@ public virtual UpdateCollection GetUpdates() /// /// The name of the Update. /// The cancellation token to use. - /// 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> GetUpdateAsync(string updateName, CancellationToken cancellationToken = default) { @@ -253,8 +253,8 @@ public virtual async Task> GetUpdateAsync(string update /// /// The name of the Update. /// The cancellation token to use. - /// 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 GetUpdate(string updateName, CancellationToken cancellationToken = default) { diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/OfferResource.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/OfferResource.cs index 5584fe0251bb..01f6a6819a3d 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/OfferResource.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/OfferResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HciSkuResources and their operations over a HciSkuResource. public virtual HciSkuCollection GetHciSkus() { - return GetCachedClient(Client => new HciSkuCollection(Client, Id)); + return GetCachedClient(client => new HciSkuCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual HciSkuCollection GetHciSkus() /// The name of the SKU available within HCI cluster. /// Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. /// The cancellation token to use. - /// 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> GetHciSkuAsync(string skuName, string expand = null, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetHciSkuAsync(string skuNam /// The name of the SKU available within HCI cluster. /// Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. /// The cancellation token to use. - /// 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 GetHciSku(string skuName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/PublisherResource.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/PublisherResource.cs index dfbe6758b34f..915c49a925b6 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/PublisherResource.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/PublisherResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of OfferResources and their operations over a OfferResource. public virtual OfferCollection GetOffers() { - return GetCachedClient(Client => new OfferCollection(Client, Id)); + return GetCachedClient(client => new OfferCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual OfferCollection GetOffers() /// The name of the offer available within HCI cluster. /// Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. /// The cancellation token to use. - /// 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> GetOfferAsync(string offerName, string expand = null, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetOfferAsync(string offerNam /// The name of the offer available within HCI cluster. /// Specify $expand=content,contentVersion to populate additional fields related to the marketplace offer. /// The cancellation token to use. - /// 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 GetOffer(string offerName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/UpdateResource.cs b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/UpdateResource.cs index fa00365e06fa..bbead0408d55 100644 --- a/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/UpdateResource.cs +++ b/sdk/azurestackhci/Azure.ResourceManager.Hci/src/Generated/UpdateResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of UpdateRunResources and their operations over a UpdateRunResource. public virtual UpdateRunCollection GetUpdateRuns() { - return GetCachedClient(Client => new UpdateRunCollection(Client, Id)); + return GetCachedClient(client => new UpdateRunCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual UpdateRunCollection GetUpdateRuns() /// /// The name of the Update Run. /// The cancellation token to use. - /// 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> GetUpdateRunAsync(string updateRunName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetUpdateRunAsync(string /// /// The name of the Update Run. /// The cancellation token to use. - /// 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 GetUpdateRun(string updateRunName, CancellationToken cancellationToken = default) { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs index e636a97d9a6e..a9af55e60aa0 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BatchAccountDetectorResources and their operations over a BatchAccountDetectorResource. public virtual BatchAccountDetectorCollection GetBatchAccountDetectors() { - return GetCachedClient(Client => new BatchAccountDetectorCollection(Client, Id)); + return GetCachedClient(client => new BatchAccountDetectorCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual BatchAccountDetectorCollection GetBatchAccountDetectors() /// /// The name of the detector. /// The cancellation token to use. - /// 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> GetBatchAccountDetectorAsync(string detectorId, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetBatchAccoun /// /// The name of the detector. /// The cancellation token to use. - /// 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 GetBatchAccountDetector(string detectorId, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetBatchAccountDetector(st /// An object representing collection of BatchApplicationResources and their operations over a BatchApplicationResource. public virtual BatchApplicationCollection GetBatchApplications() { - return GetCachedClient(Client => new BatchApplicationCollection(Client, Id)); + return GetCachedClient(client => new BatchApplicationCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual BatchApplicationCollection GetBatchApplications() /// /// The name of the application. This must be unique within the account. /// The cancellation token to use. - /// 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> GetBatchApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetBatchApplicatio /// /// The name of the application. This must be unique within the account. /// The cancellation token to use. - /// 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 GetBatchApplication(string applicationName, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetBatchApplication(string app /// An object representing collection of BatchAccountCertificateResources and their operations over a BatchAccountCertificateResource. public virtual BatchAccountCertificateCollection GetBatchAccountCertificates() { - return GetCachedClient(Client => new BatchAccountCertificateCollection(Client, Id)); + return GetCachedClient(client => new BatchAccountCertificateCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual BatchAccountCertificateCollection GetBatchAccountCertificates() /// /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. /// The cancellation token to use. - /// 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> GetBatchAccountCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetBatchAcc /// /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. /// The cancellation token to use. - /// 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 GetBatchAccountCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -253,7 +253,7 @@ public virtual Response GetBatchAccountCertific /// An object representing collection of BatchPrivateLinkResources and their operations over a BatchPrivateLinkResource. public virtual BatchPrivateLinkResourceCollection GetBatchPrivateLinkResources() { - return GetCachedClient(Client => new BatchPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new BatchPrivateLinkResourceCollection(client, Id)); } /// @@ -271,8 +271,8 @@ public virtual BatchPrivateLinkResourceCollection GetBatchPrivateLinkResources() /// /// The private link resource name. This must be unique within the account. /// The cancellation token to use. - /// 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> GetBatchPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -294,8 +294,8 @@ public virtual async Task> GetBatchPrivateLin /// /// The private link resource name. This must be unique within the account. /// The cancellation token to use. - /// 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 GetBatchPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -306,7 +306,7 @@ public virtual Response GetBatchPrivateLinkResource(st /// An object representing collection of BatchPrivateEndpointConnectionResources and their operations over a BatchPrivateEndpointConnectionResource. public virtual BatchPrivateEndpointConnectionCollection GetBatchPrivateEndpointConnections() { - return GetCachedClient(Client => new BatchPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new BatchPrivateEndpointConnectionCollection(client, Id)); } /// @@ -324,8 +324,8 @@ public virtual BatchPrivateEndpointConnectionCollection GetBatchPrivateEndpointC /// /// The private endpoint connection name. This must be unique within the account. /// The cancellation token to use. - /// 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> GetBatchPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -347,8 +347,8 @@ public virtual async Task> GetB /// /// The private endpoint connection name. This must be unique within the account. /// The cancellation token to use. - /// 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 GetBatchPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -359,7 +359,7 @@ public virtual Response GetBatchPrivateE /// An object representing collection of BatchAccountPoolResources and their operations over a BatchAccountPoolResource. public virtual BatchAccountPoolCollection GetBatchAccountPools() { - return GetCachedClient(Client => new BatchAccountPoolCollection(Client, Id)); + return GetCachedClient(client => new BatchAccountPoolCollection(client, Id)); } /// @@ -377,8 +377,8 @@ public virtual BatchAccountPoolCollection GetBatchAccountPools() /// /// The pool name. This must be unique within the account. /// The cancellation token to use. - /// 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> GetBatchAccountPoolAsync(string poolName, CancellationToken cancellationToken = default) { @@ -400,8 +400,8 @@ public virtual async Task> GetBatchAccountPoo /// /// The pool name. This must be unique within the account. /// The cancellation token to use. - /// 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 GetBatchAccountPool(string poolName, CancellationToken cancellationToken = default) { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs index 76bd53762a23..d2fceee91f7f 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BatchApplicationPackageResources and their operations over a BatchApplicationPackageResource. public virtual BatchApplicationPackageCollection GetBatchApplicationPackages() { - return GetCachedClient(Client => new BatchApplicationPackageCollection(Client, Id)); + return GetCachedClient(client => new BatchApplicationPackageCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual BatchApplicationPackageCollection GetBatchApplicationPackages() /// /// The version of the application. /// The cancellation token to use. - /// 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> GetBatchApplicationPackageAsync(string versionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetBatchApp /// /// The version of the application. /// The cancellation token to use. - /// 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 GetBatchApplicationPackage(string versionName, CancellationToken cancellationToken = default) { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchArmClientMockingExtension.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchArmClientMockingExtension.cs new file mode 100644 index 000000000000..32e2d9d7b32c --- /dev/null +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchArmClientMockingExtension.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Batch; + +namespace Azure.ResourceManager.Batch.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class BatchArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BatchArmClientMockingExtension() + { + } + + /// 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 BatchArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal BatchArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BatchAccountResource GetBatchAccountResource(ResourceIdentifier id) + { + BatchAccountResource.ValidateResourceId(id); + return new BatchAccountResource(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 BatchAccountDetectorResource GetBatchAccountDetectorResource(ResourceIdentifier id) + { + BatchAccountDetectorResource.ValidateResourceId(id); + return new BatchAccountDetectorResource(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 BatchApplicationPackageResource GetBatchApplicationPackageResource(ResourceIdentifier id) + { + BatchApplicationPackageResource.ValidateResourceId(id); + return new BatchApplicationPackageResource(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 BatchApplicationResource GetBatchApplicationResource(ResourceIdentifier id) + { + BatchApplicationResource.ValidateResourceId(id); + return new BatchApplicationResource(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 BatchAccountCertificateResource GetBatchAccountCertificateResource(ResourceIdentifier id) + { + BatchAccountCertificateResource.ValidateResourceId(id); + return new BatchAccountCertificateResource(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 BatchPrivateLinkResource GetBatchPrivateLinkResource(ResourceIdentifier id) + { + BatchPrivateLinkResource.ValidateResourceId(id); + return new BatchPrivateLinkResource(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 BatchPrivateEndpointConnectionResource GetBatchPrivateEndpointConnectionResource(ResourceIdentifier id) + { + BatchPrivateEndpointConnectionResource.ValidateResourceId(id); + return new BatchPrivateEndpointConnectionResource(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 BatchAccountPoolResource GetBatchAccountPoolResource(ResourceIdentifier id) + { + BatchAccountPoolResource.ValidateResourceId(id); + return new BatchAccountPoolResource(Client, id); + } + } +} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs index 964d5f613f4b..7ab856c2633b 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Batch.Mocking; using Azure.ResourceManager.Batch.Models; using Azure.ResourceManager.Resources; @@ -19,195 +20,161 @@ namespace Azure.ResourceManager.Batch /// A class to add extension methods to Azure.ResourceManager.Batch. public static partial class BatchExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static BatchArmClientMockingExtension GetBatchArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new BatchArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static BatchResourceGroupMockingExtension GetBatchResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new BatchResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static BatchSubscriptionMockingExtension GetBatchSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new BatchSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region BatchAccountResource /// /// 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. /// Returns a object. public static BatchAccountResource GetBatchAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchAccountResource.ValidateResourceId(id); - return new BatchAccountResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchAccountResource(id); } - #endregion - #region BatchAccountDetectorResource /// /// 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. /// Returns a object. public static BatchAccountDetectorResource GetBatchAccountDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchAccountDetectorResource.ValidateResourceId(id); - return new BatchAccountDetectorResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchAccountDetectorResource(id); } - #endregion - #region BatchApplicationPackageResource /// /// 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. /// Returns a object. public static BatchApplicationPackageResource GetBatchApplicationPackageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchApplicationPackageResource.ValidateResourceId(id); - return new BatchApplicationPackageResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchApplicationPackageResource(id); } - #endregion - #region BatchApplicationResource /// /// 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. /// Returns a object. public static BatchApplicationResource GetBatchApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchApplicationResource.ValidateResourceId(id); - return new BatchApplicationResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchApplicationResource(id); } - #endregion - #region BatchAccountCertificateResource /// /// 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. /// Returns a object. public static BatchAccountCertificateResource GetBatchAccountCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchAccountCertificateResource.ValidateResourceId(id); - return new BatchAccountCertificateResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchAccountCertificateResource(id); } - #endregion - #region BatchPrivateLinkResource /// /// 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. /// Returns a object. public static BatchPrivateLinkResource GetBatchPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchPrivateLinkResource.ValidateResourceId(id); - return new BatchPrivateLinkResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchPrivateLinkResource(id); } - #endregion - #region BatchPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static BatchPrivateEndpointConnectionResource GetBatchPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchPrivateEndpointConnectionResource.ValidateResourceId(id); - return new BatchPrivateEndpointConnectionResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchPrivateEndpointConnectionResource(id); } - #endregion - #region BatchAccountPoolResource /// /// 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. /// Returns a object. public static BatchAccountPoolResource GetBatchAccountPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BatchAccountPoolResource.ValidateResourceId(id); - return new BatchAccountPoolResource(client, id); - } - ); + return GetBatchArmClientMockingExtension(client).GetBatchAccountPoolResource(id); } - #endregion - /// Gets a collection of BatchAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of BatchAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BatchAccountResources and their operations over a BatchAccountResource. public static BatchAccountCollection GetBatchAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBatchAccounts(); + return GetBatchResourceGroupMockingExtension(resourceGroupResource).GetBatchAccounts(); } /// @@ -222,16 +189,20 @@ public static BatchAccountCollection GetBatchAccounts(this ResourceGroupResource /// BatchAccount_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Batch account. /// The cancellation token to use. - /// 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 static async Task> GetBatchAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBatchAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetBatchResourceGroupMockingExtension(resourceGroupResource).GetBatchAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -246,16 +217,20 @@ public static async Task> GetBatchAccountAsync(th /// BatchAccount_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Batch account. /// The cancellation token to use. - /// 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 static Response GetBatchAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBatchAccounts().Get(accountName, cancellationToken); + return GetBatchResourceGroupMockingExtension(resourceGroupResource).GetBatchAccount(accountName, cancellationToken); } /// @@ -270,13 +245,17 @@ public static Response GetBatchAccount(this ResourceGroupR /// BatchAccount_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBatchAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchAccountsAsync(cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchAccountsAsync(cancellationToken); } /// @@ -291,13 +270,17 @@ public static AsyncPageable GetBatchAccountsAsync(this Sub /// BatchAccount_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBatchAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchAccounts(cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchAccounts(cancellationToken); } /// @@ -312,13 +295,17 @@ public static Pageable GetBatchAccounts(this SubscriptionR /// Location_GetQuotas /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service quotas. /// The cancellation token to use. public static async Task> GetBatchQuotasAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchQuotasAsync(locationName, cancellationToken).ConfigureAwait(false); + return await GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchQuotasAsync(locationName, cancellationToken).ConfigureAwait(false); } /// @@ -333,13 +320,17 @@ public static async Task> GetBatchQuotasAsync(this /// Location_GetQuotas /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service quotas. /// The cancellation token to use. public static Response GetBatchQuotas(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchQuotas(locationName, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchQuotas(locationName, cancellationToken); } /// @@ -354,6 +345,10 @@ public static Response GetBatchQuotas(this SubscriptionResou /// Location_ListSupportedVirtualMachineSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service supported SKUs. @@ -363,7 +358,7 @@ public static Response GetBatchQuotas(this SubscriptionResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBatchSupportedVirtualMachineSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, int? maxresults = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchSupportedVirtualMachineSkusAsync(locationName, maxresults, filter, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchSupportedVirtualMachineSkusAsync(locationName, maxresults, filter, cancellationToken); } /// @@ -378,6 +373,10 @@ public static AsyncPageable GetBatchSupportedVirtualMachineSk /// Location_ListSupportedVirtualMachineSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service supported SKUs. @@ -387,7 +386,7 @@ public static AsyncPageable GetBatchSupportedVirtualMachineSk /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBatchSupportedVirtualMachineSkus(this SubscriptionResource subscriptionResource, AzureLocation locationName, int? maxresults = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchSupportedVirtualMachineSkus(locationName, maxresults, filter, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchSupportedVirtualMachineSkus(locationName, maxresults, filter, cancellationToken); } /// @@ -402,6 +401,10 @@ public static Pageable GetBatchSupportedVirtualMachineSkus(th /// Location_ListSupportedCloudServiceSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service supported SKUs. @@ -411,7 +414,7 @@ public static Pageable GetBatchSupportedVirtualMachineSkus(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBatchSupportedCloudServiceSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, int? maxresults = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchSupportedCloudServiceSkusAsync(locationName, maxresults, filter, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchSupportedCloudServiceSkusAsync(locationName, maxresults, filter, cancellationToken); } /// @@ -426,6 +429,10 @@ public static AsyncPageable GetBatchSupportedCloudServiceSkus /// Location_ListSupportedCloudServiceSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region for which to retrieve Batch service supported SKUs. @@ -435,7 +442,7 @@ public static AsyncPageable GetBatchSupportedCloudServiceSkus /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBatchSupportedCloudServiceSkus(this SubscriptionResource subscriptionResource, AzureLocation locationName, int? maxresults = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBatchSupportedCloudServiceSkus(locationName, maxresults, filter, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).GetBatchSupportedCloudServiceSkus(locationName, maxresults, filter, cancellationToken); } /// @@ -450,6 +457,10 @@ public static Pageable GetBatchSupportedCloudServiceSkus(this /// Location_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The desired region for the name check. @@ -458,9 +469,7 @@ public static Pageable GetBatchSupportedCloudServiceSkus(this /// is null. public static async Task> CheckBatchNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, BatchNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckBatchNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetBatchSubscriptionMockingExtension(subscriptionResource).CheckBatchNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -475,6 +484,10 @@ public static async Task> CheckBatchNameAv /// Location_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The desired region for the name check. @@ -483,9 +496,7 @@ public static async Task> CheckBatchNameAv /// is null. public static Response CheckBatchNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation locationName, BatchNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckBatchNameAvailability(locationName, content, cancellationToken); + return GetBatchSubscriptionMockingExtension(subscriptionResource).CheckBatchNameAvailability(locationName, content, cancellationToken); } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchResourceGroupMockingExtension.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..cb42a182bb38 --- /dev/null +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Batch; + +namespace Azure.ResourceManager.Batch.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class BatchResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BatchResourceGroupMockingExtension() + { + } + + /// 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 BatchResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of BatchAccountResources in the ResourceGroupResource. + /// An object representing collection of BatchAccountResources and their operations over a BatchAccountResource. + public virtual BatchAccountCollection GetBatchAccounts() + { + return GetCachedClient(client => new BatchAccountCollection(client, Id)); + } + + /// + /// Gets information about the specified Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// + /// + /// Operation Id + /// BatchAccount_Get + /// + /// + /// + /// The name of the Batch account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBatchAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetBatchAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// + /// + /// Operation Id + /// BatchAccount_Get + /// + /// + /// + /// The name of the Batch account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetBatchAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchSubscriptionMockingExtension.cs similarity index 90% rename from sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchSubscriptionMockingExtension.cs index 90cea14bd93e..cf360753ba47 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Batch; using Azure.ResourceManager.Batch.Models; -namespace Azure.ResourceManager.Batch +namespace Azure.ResourceManager.Batch.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class BatchSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _batchAccountClientDiagnostics; private BatchAccountRestOperations _batchAccountRestClient; private ClientDiagnostics _locationClientDiagnostics; private LocationRestOperations _locationRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected BatchSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal BatchSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetBatchAccountsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchAccounts", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetBatchAccounts(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchAccounts", "value", "nextLink", cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual Pageable GetBatchAccounts(CancellationToken /// The cancellation token to use. public virtual async Task> GetBatchQuotasAsync(AzureLocation locationName, CancellationToken cancellationToken = default) { - using var scope = LocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBatchQuotas"); + using var scope = LocationClientDiagnostics.CreateScope("BatchSubscriptionMockingExtension.GetBatchQuotas"); scope.Start(); try { @@ -140,7 +141,7 @@ public virtual async Task> GetBatchQuotasAsync(Azur /// The cancellation token to use. public virtual Response GetBatchQuotas(AzureLocation locationName, CancellationToken cancellationToken = default) { - using var scope = LocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBatchQuotas"); + using var scope = LocationClientDiagnostics.CreateScope("BatchSubscriptionMockingExtension.GetBatchQuotas"); scope.Start(); try { @@ -176,7 +177,7 @@ public virtual AsyncPageable GetBatchSupportedVirtualMachineS { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListSupportedVirtualMachineSkusRequest(Id.SubscriptionId, locationName, maxresults, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListSupportedVirtualMachineSkusNextPageRequest(nextLink, Id.SubscriptionId, locationName, maxresults, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchSupportedVirtualMachineSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchSupportedVirtualMachineSkus", "value", "nextLink", cancellationToken); } /// @@ -201,7 +202,7 @@ public virtual Pageable GetBatchSupportedVirtualMachineSkus(A { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListSupportedVirtualMachineSkusRequest(Id.SubscriptionId, locationName, maxresults, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListSupportedVirtualMachineSkusNextPageRequest(nextLink, Id.SubscriptionId, locationName, maxresults, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchSupportedVirtualMachineSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchSupportedVirtualMachineSkus", "value", "nextLink", cancellationToken); } /// @@ -226,7 +227,7 @@ public virtual AsyncPageable GetBatchSupportedCloudServiceSku { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListSupportedCloudServiceSkusRequest(Id.SubscriptionId, locationName, maxresults, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListSupportedCloudServiceSkusNextPageRequest(nextLink, Id.SubscriptionId, locationName, maxresults, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchSupportedCloudServiceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchSupportedCloudServiceSkus", "value", "nextLink", cancellationToken); } /// @@ -251,7 +252,7 @@ public virtual Pageable GetBatchSupportedCloudServiceSkus(Azu { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListSupportedCloudServiceSkusRequest(Id.SubscriptionId, locationName, maxresults, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListSupportedCloudServiceSkusNextPageRequest(nextLink, Id.SubscriptionId, locationName, maxresults, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBatchSupportedCloudServiceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BatchSupportedSku.DeserializeBatchSupportedSku, LocationClientDiagnostics, Pipeline, "BatchSubscriptionMockingExtension.GetBatchSupportedCloudServiceSkus", "value", "nextLink", cancellationToken); } /// @@ -270,9 +271,12 @@ public virtual Pageable GetBatchSupportedCloudServiceSkus(Azu /// The desired region for the name check. /// Properties needed to check the availability of a name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckBatchNameAvailabilityAsync(AzureLocation locationName, BatchNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckBatchNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationClientDiagnostics.CreateScope("BatchSubscriptionMockingExtension.CheckBatchNameAvailability"); scope.Start(); try { @@ -302,9 +306,12 @@ public virtual async Task> CheckBatchNameA /// The desired region for the name check. /// Properties needed to check the availability of a name. /// The cancellation token to use. + /// is null. public virtual Response CheckBatchNameAvailability(AzureLocation locationName, BatchNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckBatchNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationClientDiagnostics.CreateScope("BatchSubscriptionMockingExtension.CheckBatchNameAvailability"); scope.Start(); try { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 95dbff85384c..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Batch -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of BatchAccountResources in the ResourceGroupResource. - /// An object representing collection of BatchAccountResources and their operations over a BatchAccountResource. - public virtual BatchAccountCollection GetBatchAccounts() - { - return GetCachedClient(Client => new BatchAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingArmClientMockingExtension.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingArmClientMockingExtension.cs new file mode 100644 index 000000000000..bf3d92faa460 --- /dev/null +++ b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Billing; + +namespace Azure.ResourceManager.Billing.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class BillingArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BillingArmClientMockingExtension() + { + } + + /// 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 BillingArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal BillingArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BillingSubscriptionResource GetBillingSubscriptionResource(ResourceIdentifier id) + { + BillingSubscriptionResource.ValidateResourceId(id); + return new BillingSubscriptionResource(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 BillingSubscriptionAliasResource GetBillingSubscriptionAliasResource(ResourceIdentifier id) + { + BillingSubscriptionAliasResource.ValidateResourceId(id); + return new BillingSubscriptionAliasResource(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 BillingPaymentMethodResource GetBillingPaymentMethodResource(ResourceIdentifier id) + { + BillingPaymentMethodResource.ValidateResourceId(id); + return new BillingPaymentMethodResource(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 BillingAccountPaymentMethodResource GetBillingAccountPaymentMethodResource(ResourceIdentifier id) + { + BillingAccountPaymentMethodResource.ValidateResourceId(id); + return new BillingAccountPaymentMethodResource(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 BillingPaymentMethodLinkResource GetBillingPaymentMethodLinkResource(ResourceIdentifier id) + { + BillingPaymentMethodLinkResource.ValidateResourceId(id); + return new BillingPaymentMethodLinkResource(Client, id); + } + } +} diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingExtensions.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingExtensions.cs index 3d964d62bf37..4590a4b88d65 100644 --- a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingExtensions.cs +++ b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Billing.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Billing @@ -18,127 +19,111 @@ namespace Azure.ResourceManager.Billing /// A class to add extension methods to Azure.ResourceManager.Billing. public static partial class BillingExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static BillingArmClientMockingExtension GetBillingArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new BillingArmClientMockingExtension(client0)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static BillingTenantMockingExtension GetBillingTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new BillingTenantMockingExtension(client, resource.Id)); } - #region BillingSubscriptionResource + /// /// 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. /// Returns a object. public static BillingSubscriptionResource GetBillingSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingSubscriptionResource.ValidateResourceId(id); - return new BillingSubscriptionResource(client, id); - } - ); + return GetBillingArmClientMockingExtension(client).GetBillingSubscriptionResource(id); } - #endregion - #region BillingSubscriptionAliasResource /// /// 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. /// Returns a object. public static BillingSubscriptionAliasResource GetBillingSubscriptionAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingSubscriptionAliasResource.ValidateResourceId(id); - return new BillingSubscriptionAliasResource(client, id); - } - ); + return GetBillingArmClientMockingExtension(client).GetBillingSubscriptionAliasResource(id); } - #endregion - #region BillingPaymentMethodResource /// /// 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. /// Returns a object. public static BillingPaymentMethodResource GetBillingPaymentMethodResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingPaymentMethodResource.ValidateResourceId(id); - return new BillingPaymentMethodResource(client, id); - } - ); + return GetBillingArmClientMockingExtension(client).GetBillingPaymentMethodResource(id); } - #endregion - #region BillingAccountPaymentMethodResource /// /// 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. /// Returns a object. public static BillingAccountPaymentMethodResource GetBillingAccountPaymentMethodResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingAccountPaymentMethodResource.ValidateResourceId(id); - return new BillingAccountPaymentMethodResource(client, id); - } - ); + return GetBillingArmClientMockingExtension(client).GetBillingAccountPaymentMethodResource(id); } - #endregion - #region BillingPaymentMethodLinkResource /// /// 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. /// Returns a object. public static BillingPaymentMethodLinkResource GetBillingPaymentMethodLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingPaymentMethodLinkResource.ValidateResourceId(id); - return new BillingPaymentMethodLinkResource(client, id); - } - ); + return GetBillingArmClientMockingExtension(client).GetBillingPaymentMethodLinkResource(id); } - #endregion - /// Gets a collection of BillingSubscriptionResources in the TenantResource. + /// + /// Gets a collection of BillingSubscriptionResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BillingSubscriptionResources and their operations over a BillingSubscriptionResource. public static BillingSubscriptionCollection GetBillingSubscriptions(this TenantResource tenantResource, string billingAccountName) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingSubscriptions(billingAccountName); + return GetBillingTenantMockingExtension(tenantResource).GetBillingSubscriptions(billingAccountName); } /// @@ -153,17 +138,21 @@ public static BillingSubscriptionCollection GetBillingSubscriptions(this TenantR /// BillingSubscriptions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a subscription. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBillingSubscriptionAsync(this TenantResource tenantResource, string billingAccountName, string billingSubscriptionName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingSubscriptions(billingAccountName).GetAsync(billingSubscriptionName, cancellationToken).ConfigureAwait(false); + return await GetBillingTenantMockingExtension(tenantResource).GetBillingSubscriptionAsync(billingAccountName, billingSubscriptionName, cancellationToken).ConfigureAwait(false); } /// @@ -178,30 +167,38 @@ public static async Task> GetBillingSubscr /// BillingSubscriptions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a subscription. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBillingSubscription(this TenantResource tenantResource, string billingAccountName, string billingSubscriptionName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingSubscriptions(billingAccountName).Get(billingSubscriptionName, cancellationToken); + return GetBillingTenantMockingExtension(tenantResource).GetBillingSubscription(billingAccountName, billingSubscriptionName, cancellationToken); } - /// Gets a collection of BillingSubscriptionAliasResources in the TenantResource. + /// + /// Gets a collection of BillingSubscriptionAliasResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BillingSubscriptionAliasResources and their operations over a BillingSubscriptionAliasResource. public static BillingSubscriptionAliasCollection GetBillingSubscriptionAliases(this TenantResource tenantResource, string billingAccountName) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingSubscriptionAliases(billingAccountName); + return GetBillingTenantMockingExtension(tenantResource).GetBillingSubscriptionAliases(billingAccountName); } /// @@ -216,17 +213,21 @@ public static BillingSubscriptionAliasCollection GetBillingSubscriptionAliases(t /// BillingSubscriptionsAliases_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a subscription alias. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBillingSubscriptionAliasAsync(this TenantResource tenantResource, string billingAccountName, string aliasName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingSubscriptionAliases(billingAccountName).GetAsync(aliasName, cancellationToken).ConfigureAwait(false); + return await GetBillingTenantMockingExtension(tenantResource).GetBillingSubscriptionAliasAsync(billingAccountName, aliasName, cancellationToken).ConfigureAwait(false); } /// @@ -241,25 +242,35 @@ public static async Task> GetBillingS /// BillingSubscriptionsAliases_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a subscription alias. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBillingSubscriptionAlias(this TenantResource tenantResource, string billingAccountName, string aliasName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingSubscriptionAliases(billingAccountName).Get(aliasName, cancellationToken); + return GetBillingTenantMockingExtension(tenantResource).GetBillingSubscriptionAlias(billingAccountName, aliasName, cancellationToken); } - /// Gets a collection of BillingPaymentMethodResources in the TenantResource. + /// + /// Gets a collection of BillingPaymentMethodResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BillingPaymentMethodResources and their operations over a BillingPaymentMethodResource. public static BillingPaymentMethodCollection GetBillingPaymentMethods(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetBillingPaymentMethods(); + return GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethods(); } /// @@ -274,16 +285,20 @@ public static BillingPaymentMethodCollection GetBillingPaymentMethods(this Tenan /// PaymentMethods_GetByUser /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// 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 static async Task> GetBillingPaymentMethodAsync(this TenantResource tenantResource, string paymentMethodName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingPaymentMethods().GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + return await GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethodAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); } /// @@ -298,29 +313,37 @@ public static async Task> GetBillingPayme /// PaymentMethods_GetByUser /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// 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 static Response GetBillingPaymentMethod(this TenantResource tenantResource, string paymentMethodName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingPaymentMethods().Get(paymentMethodName, cancellationToken); + return GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethod(paymentMethodName, cancellationToken); } - /// Gets a collection of BillingAccountPaymentMethodResources in the TenantResource. + /// + /// Gets a collection of BillingAccountPaymentMethodResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BillingAccountPaymentMethodResources and their operations over a BillingAccountPaymentMethodResource. public static BillingAccountPaymentMethodCollection GetBillingAccountPaymentMethods(this TenantResource tenantResource, string billingAccountName) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingAccountPaymentMethods(billingAccountName); + return GetBillingTenantMockingExtension(tenantResource).GetBillingAccountPaymentMethods(billingAccountName); } /// @@ -335,17 +358,21 @@ public static BillingAccountPaymentMethodCollection GetBillingAccountPaymentMeth /// PaymentMethods_GetByBillingAccount /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBillingAccountPaymentMethodAsync(this TenantResource tenantResource, string billingAccountName, string paymentMethodName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingAccountPaymentMethods(billingAccountName).GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + return await GetBillingTenantMockingExtension(tenantResource).GetBillingAccountPaymentMethodAsync(billingAccountName, paymentMethodName, cancellationToken).ConfigureAwait(false); } /// @@ -360,32 +387,39 @@ public static async Task> GetBilli /// PaymentMethods_GetByBillingAccount /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBillingAccountPaymentMethod(this TenantResource tenantResource, string billingAccountName, string paymentMethodName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingAccountPaymentMethods(billingAccountName).Get(paymentMethodName, cancellationToken); + return GetBillingTenantMockingExtension(tenantResource).GetBillingAccountPaymentMethod(billingAccountName, paymentMethodName, cancellationToken); } - /// Gets a collection of BillingPaymentMethodLinkResources in the TenantResource. + /// + /// Gets a collection of BillingPaymentMethodLinkResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a billing profile. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of BillingPaymentMethodLinkResources and their operations over a BillingPaymentMethodLinkResource. public static BillingPaymentMethodLinkCollection GetBillingPaymentMethodLinks(this TenantResource tenantResource, string billingAccountName, string billingProfileName) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingPaymentMethodLinks(billingAccountName, billingProfileName); + return GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethodLinks(billingAccountName, billingProfileName); } /// @@ -400,18 +434,22 @@ public static BillingPaymentMethodLinkCollection GetBillingPaymentMethodLinks(th /// PaymentMethods_GetByBillingProfile /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a billing profile. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBillingPaymentMethodLinkAsync(this TenantResource tenantResource, string billingAccountName, string billingProfileName, string paymentMethodName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingPaymentMethodLinks(billingAccountName, billingProfileName).GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + return await GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethodLinkAsync(billingAccountName, billingProfileName, paymentMethodName, cancellationToken).ConfigureAwait(false); } /// @@ -426,18 +464,22 @@ public static async Task> GetBillingP /// PaymentMethods_GetByBillingProfile /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a billing profile. /// The ID that uniquely identifies a payment method. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBillingPaymentMethodLink(this TenantResource tenantResource, string billingAccountName, string billingProfileName, string paymentMethodName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingPaymentMethodLinks(billingAccountName, billingProfileName).Get(paymentMethodName, cancellationToken); + return GetBillingTenantMockingExtension(tenantResource).GetBillingPaymentMethodLink(billingAccountName, billingProfileName, paymentMethodName, cancellationToken); } } } diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingTenantMockingExtension.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingTenantMockingExtension.cs new file mode 100644 index 000000000000..854b79a48c09 --- /dev/null +++ b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/BillingTenantMockingExtension.cs @@ -0,0 +1,327 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Billing; + +namespace Azure.ResourceManager.Billing.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class BillingTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BillingTenantMockingExtension() + { + } + + /// 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 BillingTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of BillingSubscriptionResources in the TenantResource. + /// The ID that uniquely identifies a billing account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BillingSubscriptionResources and their operations over a BillingSubscriptionResource. + public virtual BillingSubscriptionCollection GetBillingSubscriptions(string billingAccountName) + { + return new BillingSubscriptionCollection(Client, Id, billingAccountName); + } + + /// + /// Gets a subscription by its ID. The operation is currently supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement and Microsoft Online Services Program. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName} + /// + /// + /// Operation Id + /// BillingSubscriptions_Get + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a subscription. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingSubscriptionAsync(string billingAccountName, string billingSubscriptionName, CancellationToken cancellationToken = default) + { + return await GetBillingSubscriptions(billingAccountName).GetAsync(billingSubscriptionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a subscription by its ID. The operation is currently supported for billing accounts with agreement type Microsoft Customer Agreement, Microsoft Partner Agreement and Microsoft Online Services Program. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName} + /// + /// + /// Operation Id + /// BillingSubscriptions_Get + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a subscription. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingSubscription(string billingAccountName, string billingSubscriptionName, CancellationToken cancellationToken = default) + { + return GetBillingSubscriptions(billingAccountName).Get(billingSubscriptionName, cancellationToken); + } + + /// Gets a collection of BillingSubscriptionAliasResources in the TenantResource. + /// The ID that uniquely identifies a billing account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BillingSubscriptionAliasResources and their operations over a BillingSubscriptionAliasResource. + public virtual BillingSubscriptionAliasCollection GetBillingSubscriptionAliases(string billingAccountName) + { + return new BillingSubscriptionAliasCollection(Client, Id, billingAccountName); + } + + /// + /// Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptionAliases/{aliasName} + /// + /// + /// Operation Id + /// BillingSubscriptionsAliases_Get + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a subscription alias. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingSubscriptionAliasAsync(string billingAccountName, string aliasName, CancellationToken cancellationToken = default) + { + return await GetBillingSubscriptionAliases(billingAccountName).GetAsync(aliasName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a subscription by its alias ID. The operation is supported for seat based billing subscriptions. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptionAliases/{aliasName} + /// + /// + /// Operation Id + /// BillingSubscriptionsAliases_Get + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a subscription alias. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingSubscriptionAlias(string billingAccountName, string aliasName, CancellationToken cancellationToken = default) + { + return GetBillingSubscriptionAliases(billingAccountName).Get(aliasName, cancellationToken); + } + + /// Gets a collection of BillingPaymentMethodResources in the TenantResource. + /// An object representing collection of BillingPaymentMethodResources and their operations over a BillingPaymentMethodResource. + public virtual BillingPaymentMethodCollection GetBillingPaymentMethods() + { + return GetCachedClient(client => new BillingPaymentMethodCollection(client, Id)); + } + + /// + /// Gets a payment method owned by the caller. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/paymentMethods/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByUser + /// + /// + /// + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingPaymentMethodAsync(string paymentMethodName, CancellationToken cancellationToken = default) + { + return await GetBillingPaymentMethods().GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a payment method owned by the caller. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/paymentMethods/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByUser + /// + /// + /// + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingPaymentMethod(string paymentMethodName, CancellationToken cancellationToken = default) + { + return GetBillingPaymentMethods().Get(paymentMethodName, cancellationToken); + } + + /// Gets a collection of BillingAccountPaymentMethodResources in the TenantResource. + /// The ID that uniquely identifies a billing account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BillingAccountPaymentMethodResources and their operations over a BillingAccountPaymentMethodResource. + public virtual BillingAccountPaymentMethodCollection GetBillingAccountPaymentMethods(string billingAccountName) + { + return new BillingAccountPaymentMethodCollection(Client, Id, billingAccountName); + } + + /// + /// Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByBillingAccount + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingAccountPaymentMethodAsync(string billingAccountName, string paymentMethodName, CancellationToken cancellationToken = default) + { + return await GetBillingAccountPaymentMethods(billingAccountName).GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a payment method available for a billing account. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/paymentMethods/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByBillingAccount + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingAccountPaymentMethod(string billingAccountName, string paymentMethodName, CancellationToken cancellationToken = default) + { + return GetBillingAccountPaymentMethods(billingAccountName).Get(paymentMethodName, cancellationToken); + } + + /// Gets a collection of BillingPaymentMethodLinkResources in the TenantResource. + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a billing profile. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// An object representing collection of BillingPaymentMethodLinkResources and their operations over a BillingPaymentMethodLinkResource. + public virtual BillingPaymentMethodLinkCollection GetBillingPaymentMethodLinks(string billingAccountName, string billingProfileName) + { + return new BillingPaymentMethodLinkCollection(Client, Id, billingAccountName, billingProfileName); + } + + /// + /// Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByBillingProfile + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a billing profile. + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingPaymentMethodLinkAsync(string billingAccountName, string billingProfileName, string paymentMethodName, CancellationToken cancellationToken = default) + { + return await GetBillingPaymentMethodLinks(billingAccountName, billingProfileName).GetAsync(paymentMethodName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a payment method linked with a billing profile. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/paymentMethodLinks/{paymentMethodName} + /// + /// + /// Operation Id + /// PaymentMethods_GetByBillingProfile + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// The ID that uniquely identifies a billing profile. + /// The ID that uniquely identifies a payment method. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingPaymentMethodLink(string billingAccountName, string billingProfileName, string paymentMethodName, CancellationToken cancellationToken = default) + { + return GetBillingPaymentMethodLinks(billingAccountName, billingProfileName).Get(paymentMethodName, cancellationToken); + } + } +} diff --git a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 24b3e3b5fd9f..000000000000 --- a/sdk/billing/Azure.ResourceManager.Billing/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Billing -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of BillingSubscriptionResources in the TenantResource. - /// The ID that uniquely identifies a billing account. - /// An object representing collection of BillingSubscriptionResources and their operations over a BillingSubscriptionResource. - public virtual BillingSubscriptionCollection GetBillingSubscriptions(string billingAccountName) - { - return new BillingSubscriptionCollection(Client, Id, billingAccountName); - } - - /// Gets a collection of BillingSubscriptionAliasResources in the TenantResource. - /// The ID that uniquely identifies a billing account. - /// An object representing collection of BillingSubscriptionAliasResources and their operations over a BillingSubscriptionAliasResource. - public virtual BillingSubscriptionAliasCollection GetBillingSubscriptionAliases(string billingAccountName) - { - return new BillingSubscriptionAliasCollection(Client, Id, billingAccountName); - } - - /// Gets a collection of BillingPaymentMethodResources in the TenantResource. - /// An object representing collection of BillingPaymentMethodResources and their operations over a BillingPaymentMethodResource. - public virtual BillingPaymentMethodCollection GetBillingPaymentMethods() - { - return GetCachedClient(Client => new BillingPaymentMethodCollection(Client, Id)); - } - - /// Gets a collection of BillingAccountPaymentMethodResources in the TenantResource. - /// The ID that uniquely identifies a billing account. - /// An object representing collection of BillingAccountPaymentMethodResources and their operations over a BillingAccountPaymentMethodResource. - public virtual BillingAccountPaymentMethodCollection GetBillingAccountPaymentMethods(string billingAccountName) - { - return new BillingAccountPaymentMethodCollection(Client, Id, billingAccountName); - } - - /// Gets a collection of BillingPaymentMethodLinkResources in the TenantResource. - /// The ID that uniquely identifies a billing account. - /// The ID that uniquely identifies a billing profile. - /// An object representing collection of BillingPaymentMethodLinkResources and their operations over a BillingPaymentMethodLinkResource. - public virtual BillingPaymentMethodLinkCollection GetBillingPaymentMethodLinks(string billingAccountName, string billingProfileName) - { - return new BillingPaymentMethodLinkCollection(Client, Id, billingAccountName, billingProfileName); - } - } -} diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/BillingBenefitsSavingsPlanOrderResource.cs b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/BillingBenefitsSavingsPlanOrderResource.cs index b3ffbdd53ace..68a7c213ad1a 100644 --- a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/BillingBenefitsSavingsPlanOrderResource.cs +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/BillingBenefitsSavingsPlanOrderResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BillingBenefitsSavingsPlanResources and their operations over a BillingBenefitsSavingsPlanResource. public virtual BillingBenefitsSavingsPlanCollection GetBillingBenefitsSavingsPlans() { - return GetCachedClient(Client => new BillingBenefitsSavingsPlanCollection(Client, Id)); + return GetCachedClient(client => new BillingBenefitsSavingsPlanCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual BillingBenefitsSavingsPlanCollection GetBillingBenefitsSavingsPla /// ID of the savings plan. /// May be used to expand the detail information of some properties. /// The cancellation token to use. - /// 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> GetBillingBenefitsSavingsPlanAsync(string savingsPlanId, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetBilli /// ID of the savings plan. /// May be used to expand the detail information of some properties. /// The cancellation token to use. - /// 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 GetBillingBenefitsSavingsPlan(string savingsPlanId, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsArmClientMockingExtension.cs b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsArmClientMockingExtension.cs new file mode 100644 index 000000000000..6bed36310066 --- /dev/null +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.BillingBenefits; + +namespace Azure.ResourceManager.BillingBenefits.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class BillingBenefitsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BillingBenefitsArmClientMockingExtension() + { + } + + /// 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 BillingBenefitsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal BillingBenefitsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BillingBenefitsSavingsPlanOrderAliasResource GetBillingBenefitsSavingsPlanOrderAliasResource(ResourceIdentifier id) + { + BillingBenefitsSavingsPlanOrderAliasResource.ValidateResourceId(id); + return new BillingBenefitsSavingsPlanOrderAliasResource(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 BillingBenefitsSavingsPlanOrderResource GetBillingBenefitsSavingsPlanOrderResource(ResourceIdentifier id) + { + BillingBenefitsSavingsPlanOrderResource.ValidateResourceId(id); + return new BillingBenefitsSavingsPlanOrderResource(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 BillingBenefitsSavingsPlanResource GetBillingBenefitsSavingsPlanResource(ResourceIdentifier id) + { + BillingBenefitsSavingsPlanResource.ValidateResourceId(id); + return new BillingBenefitsSavingsPlanResource(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 BillingBenefitsReservationOrderAliasResource GetBillingBenefitsReservationOrderAliasResource(ResourceIdentifier id) + { + BillingBenefitsReservationOrderAliasResource.ValidateResourceId(id); + return new BillingBenefitsReservationOrderAliasResource(Client, id); + } + } +} diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsExtensions.cs b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsExtensions.cs index af6709fdd4e8..0dbe84d66fbb 100644 --- a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsExtensions.cs +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.BillingBenefits.Mocking; using Azure.ResourceManager.BillingBenefits.Models; using Azure.ResourceManager.Resources; @@ -19,103 +20,92 @@ namespace Azure.ResourceManager.BillingBenefits /// A class to add extension methods to Azure.ResourceManager.BillingBenefits. public static partial class BillingBenefitsExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static BillingBenefitsArmClientMockingExtension GetBillingBenefitsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new BillingBenefitsArmClientMockingExtension(client0)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static BillingBenefitsTenantMockingExtension GetBillingBenefitsTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new BillingBenefitsTenantMockingExtension(client, resource.Id)); } - #region BillingBenefitsSavingsPlanOrderAliasResource + /// /// 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. /// Returns a object. public static BillingBenefitsSavingsPlanOrderAliasResource GetBillingBenefitsSavingsPlanOrderAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingBenefitsSavingsPlanOrderAliasResource.ValidateResourceId(id); - return new BillingBenefitsSavingsPlanOrderAliasResource(client, id); - } - ); + return GetBillingBenefitsArmClientMockingExtension(client).GetBillingBenefitsSavingsPlanOrderAliasResource(id); } - #endregion - #region BillingBenefitsSavingsPlanOrderResource /// /// 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. /// Returns a object. public static BillingBenefitsSavingsPlanOrderResource GetBillingBenefitsSavingsPlanOrderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingBenefitsSavingsPlanOrderResource.ValidateResourceId(id); - return new BillingBenefitsSavingsPlanOrderResource(client, id); - } - ); + return GetBillingBenefitsArmClientMockingExtension(client).GetBillingBenefitsSavingsPlanOrderResource(id); } - #endregion - #region BillingBenefitsSavingsPlanResource /// /// 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. /// Returns a object. public static BillingBenefitsSavingsPlanResource GetBillingBenefitsSavingsPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingBenefitsSavingsPlanResource.ValidateResourceId(id); - return new BillingBenefitsSavingsPlanResource(client, id); - } - ); + return GetBillingBenefitsArmClientMockingExtension(client).GetBillingBenefitsSavingsPlanResource(id); } - #endregion - #region BillingBenefitsReservationOrderAliasResource /// /// 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. /// Returns a object. public static BillingBenefitsReservationOrderAliasResource GetBillingBenefitsReservationOrderAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingBenefitsReservationOrderAliasResource.ValidateResourceId(id); - return new BillingBenefitsReservationOrderAliasResource(client, id); - } - ); + return GetBillingBenefitsArmClientMockingExtension(client).GetBillingBenefitsReservationOrderAliasResource(id); } - #endregion - /// Gets a collection of BillingBenefitsSavingsPlanOrderAliasResources in the TenantResource. + /// + /// Gets a collection of BillingBenefitsSavingsPlanOrderAliasResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BillingBenefitsSavingsPlanOrderAliasResources and their operations over a BillingBenefitsSavingsPlanOrderAliasResource. public static BillingBenefitsSavingsPlanOrderAliasCollection GetBillingBenefitsSavingsPlanOrderAliases(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetBillingBenefitsSavingsPlanOrderAliases(); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrderAliases(); } /// @@ -130,16 +120,20 @@ public static BillingBenefitsSavingsPlanOrderAliasCollection GetBillingBenefitsS /// SavingsPlanOrderAlias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the savings plan order alias. /// The cancellation token to use. - /// 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 static async Task> GetBillingBenefitsSavingsPlanOrderAliasAsync(this TenantResource tenantResource, string savingsPlanOrderAliasName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingBenefitsSavingsPlanOrderAliases().GetAsync(savingsPlanOrderAliasName, cancellationToken).ConfigureAwait(false); + return await GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrderAliasAsync(savingsPlanOrderAliasName, cancellationToken).ConfigureAwait(false); } /// @@ -154,24 +148,34 @@ public static async Task> /// SavingsPlanOrderAlias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the savings plan order alias. /// The cancellation token to use. - /// 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 static Response GetBillingBenefitsSavingsPlanOrderAlias(this TenantResource tenantResource, string savingsPlanOrderAliasName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingBenefitsSavingsPlanOrderAliases().Get(savingsPlanOrderAliasName, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrderAlias(savingsPlanOrderAliasName, cancellationToken); } - /// Gets a collection of BillingBenefitsSavingsPlanOrderResources in the TenantResource. + /// + /// Gets a collection of BillingBenefitsSavingsPlanOrderResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BillingBenefitsSavingsPlanOrderResources and their operations over a BillingBenefitsSavingsPlanOrderResource. public static BillingBenefitsSavingsPlanOrderCollection GetBillingBenefitsSavingsPlanOrders(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetBillingBenefitsSavingsPlanOrders(); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrders(); } /// @@ -186,17 +190,21 @@ public static BillingBenefitsSavingsPlanOrderCollection GetBillingBenefitsSaving /// SavingsPlanOrder_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Order ID of the savings plan. /// May be used to expand the detail information of some properties. /// The cancellation token to use. - /// 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 static async Task> GetBillingBenefitsSavingsPlanOrderAsync(this TenantResource tenantResource, string savingsPlanOrderId, string expand = null, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingBenefitsSavingsPlanOrders().GetAsync(savingsPlanOrderId, expand, cancellationToken).ConfigureAwait(false); + return await GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrderAsync(savingsPlanOrderId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -211,25 +219,35 @@ public static async Task> GetB /// SavingsPlanOrder_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Order ID of the savings plan. /// May be used to expand the detail information of some properties. /// The cancellation token to use. - /// 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 static Response GetBillingBenefitsSavingsPlanOrder(this TenantResource tenantResource, string savingsPlanOrderId, string expand = null, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingBenefitsSavingsPlanOrders().Get(savingsPlanOrderId, expand, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlanOrder(savingsPlanOrderId, expand, cancellationToken); } - /// Gets a collection of BillingBenefitsReservationOrderAliasResources in the TenantResource. + /// + /// Gets a collection of BillingBenefitsReservationOrderAliasResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BillingBenefitsReservationOrderAliasResources and their operations over a BillingBenefitsReservationOrderAliasResource. public static BillingBenefitsReservationOrderAliasCollection GetBillingBenefitsReservationOrderAliases(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetBillingBenefitsReservationOrderAliases(); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsReservationOrderAliases(); } /// @@ -244,16 +262,20 @@ public static BillingBenefitsReservationOrderAliasCollection GetBillingBenefitsR /// ReservationOrderAlias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the reservation order alias. /// The cancellation token to use. - /// 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 static async Task> GetBillingBenefitsReservationOrderAliasAsync(this TenantResource tenantResource, string reservationOrderAliasName, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingBenefitsReservationOrderAliases().GetAsync(reservationOrderAliasName, cancellationToken).ConfigureAwait(false); + return await GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsReservationOrderAliasAsync(reservationOrderAliasName, cancellationToken).ConfigureAwait(false); } /// @@ -268,16 +290,20 @@ public static async Task> /// ReservationOrderAlias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the reservation order alias. /// The cancellation token to use. - /// 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 static Response GetBillingBenefitsReservationOrderAlias(this TenantResource tenantResource, string reservationOrderAliasName, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingBenefitsReservationOrderAliases().Get(reservationOrderAliasName, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsReservationOrderAlias(reservationOrderAliasName, cancellationToken); } /// @@ -292,6 +318,10 @@ public static Response GetBillingB /// SavingsPlan_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -299,9 +329,7 @@ public static Response GetBillingB /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBillingBenefitsSavingsPlansAsync(this TenantResource tenantResource, TenantResourceGetBillingBenefitsSavingsPlansOptions options, CancellationToken cancellationToken = default) { - options ??= new TenantResourceGetBillingBenefitsSavingsPlansOptions(); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingBenefitsSavingsPlansAsync(options, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlansAsync(options, cancellationToken); } /// @@ -316,6 +344,10 @@ public static AsyncPageable GetBillingBenefi /// SavingsPlan_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -323,9 +355,7 @@ public static AsyncPageable GetBillingBenefi /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBillingBenefitsSavingsPlans(this TenantResource tenantResource, TenantResourceGetBillingBenefitsSavingsPlansOptions options, CancellationToken cancellationToken = default) { - options ??= new TenantResourceGetBillingBenefitsSavingsPlansOptions(); - - return GetTenantResourceExtensionClient(tenantResource).GetBillingBenefitsSavingsPlans(options, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).GetBillingBenefitsSavingsPlans(options, cancellationToken); } /// @@ -340,6 +370,10 @@ public static Pageable GetBillingBenefitsSav /// ValidatePurchase /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request body for validating the purchase of a savings plan. @@ -348,9 +382,7 @@ public static Pageable GetBillingBenefitsSav /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable ValidatePurchaseAsync(this TenantResource tenantResource, SavingsPlanPurchaseValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).ValidatePurchaseAsync(content, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).ValidatePurchaseAsync(content, cancellationToken); } /// @@ -365,6 +397,10 @@ public static AsyncPageable ValidatePurchaseAsync(thi /// ValidatePurchase /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request body for validating the purchase of a savings plan. @@ -373,9 +409,7 @@ public static AsyncPageable ValidatePurchaseAsync(thi /// A collection of that may take multiple service requests to iterate over. public static Pageable ValidatePurchase(this TenantResource tenantResource, SavingsPlanPurchaseValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).ValidatePurchase(content, cancellationToken); + return GetBillingBenefitsTenantMockingExtension(tenantResource).ValidatePurchase(content, cancellationToken); } } } diff --git a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsTenantMockingExtension.cs similarity index 50% rename from sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsTenantMockingExtension.cs index 1508ec66d244..46827c78c605 100644 --- a/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/src/Generated/Extensions/BillingBenefitsTenantMockingExtension.cs @@ -5,33 +5,36 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.BillingBenefits; using Azure.ResourceManager.BillingBenefits.Models; -namespace Azure.ResourceManager.BillingBenefits +namespace Azure.ResourceManager.BillingBenefits.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class BillingBenefitsTenantMockingExtension : ArmResource { private ClientDiagnostics _billingBenefitsSavingsPlanSavingsPlanClientDiagnostics; private SavingsPlanRestOperations _billingBenefitsSavingsPlanSavingsPlanRestClient; private ClientDiagnostics _defaultClientDiagnostics; private BillingBenefitsRPRestOperations _defaultRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected BillingBenefitsTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal BillingBenefitsTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -50,21 +53,161 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of BillingBenefitsSavingsPlanOrderAliasResources and their operations over a BillingBenefitsSavingsPlanOrderAliasResource. public virtual BillingBenefitsSavingsPlanOrderAliasCollection GetBillingBenefitsSavingsPlanOrderAliases() { - return GetCachedClient(Client => new BillingBenefitsSavingsPlanOrderAliasCollection(Client, Id)); + return GetCachedClient(client => new BillingBenefitsSavingsPlanOrderAliasCollection(client, Id)); + } + + /// + /// Get a savings plan. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/{savingsPlanOrderAliasName} + /// + /// + /// Operation Id + /// SavingsPlanOrderAlias_Get + /// + /// + /// + /// Name of the savings plan order alias. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingBenefitsSavingsPlanOrderAliasAsync(string savingsPlanOrderAliasName, CancellationToken cancellationToken = default) + { + return await GetBillingBenefitsSavingsPlanOrderAliases().GetAsync(savingsPlanOrderAliasName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a savings plan. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/{savingsPlanOrderAliasName} + /// + /// + /// Operation Id + /// SavingsPlanOrderAlias_Get + /// + /// + /// + /// Name of the savings plan order alias. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingBenefitsSavingsPlanOrderAlias(string savingsPlanOrderAliasName, CancellationToken cancellationToken = default) + { + return GetBillingBenefitsSavingsPlanOrderAliases().Get(savingsPlanOrderAliasName, cancellationToken); } /// Gets a collection of BillingBenefitsSavingsPlanOrderResources in the TenantResource. /// An object representing collection of BillingBenefitsSavingsPlanOrderResources and their operations over a BillingBenefitsSavingsPlanOrderResource. public virtual BillingBenefitsSavingsPlanOrderCollection GetBillingBenefitsSavingsPlanOrders() { - return GetCachedClient(Client => new BillingBenefitsSavingsPlanOrderCollection(Client, Id)); + return GetCachedClient(client => new BillingBenefitsSavingsPlanOrderCollection(client, Id)); + } + + /// + /// Get a savings plan order. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId} + /// + /// + /// Operation Id + /// SavingsPlanOrder_Get + /// + /// + /// + /// Order ID of the savings plan. + /// May be used to expand the detail information of some properties. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingBenefitsSavingsPlanOrderAsync(string savingsPlanOrderId, string expand = null, CancellationToken cancellationToken = default) + { + return await GetBillingBenefitsSavingsPlanOrders().GetAsync(savingsPlanOrderId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a savings plan order. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId} + /// + /// + /// Operation Id + /// SavingsPlanOrder_Get + /// + /// + /// + /// Order ID of the savings plan. + /// May be used to expand the detail information of some properties. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingBenefitsSavingsPlanOrder(string savingsPlanOrderId, string expand = null, CancellationToken cancellationToken = default) + { + return GetBillingBenefitsSavingsPlanOrders().Get(savingsPlanOrderId, expand, cancellationToken); } /// Gets a collection of BillingBenefitsReservationOrderAliasResources in the TenantResource. /// An object representing collection of BillingBenefitsReservationOrderAliasResources and their operations over a BillingBenefitsReservationOrderAliasResource. public virtual BillingBenefitsReservationOrderAliasCollection GetBillingBenefitsReservationOrderAliases() { - return GetCachedClient(Client => new BillingBenefitsReservationOrderAliasCollection(Client, Id)); + return GetCachedClient(client => new BillingBenefitsReservationOrderAliasCollection(client, Id)); + } + + /// + /// Get a reservation order alias. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/reservationOrderAliases/{reservationOrderAliasName} + /// + /// + /// Operation Id + /// ReservationOrderAlias_Get + /// + /// + /// + /// Name of the reservation order alias. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingBenefitsReservationOrderAliasAsync(string reservationOrderAliasName, CancellationToken cancellationToken = default) + { + return await GetBillingBenefitsReservationOrderAliases().GetAsync(reservationOrderAliasName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a reservation order alias. + /// + /// + /// Request Path + /// /providers/Microsoft.BillingBenefits/reservationOrderAliases/{reservationOrderAliasName} + /// + /// + /// Operation Id + /// ReservationOrderAlias_Get + /// + /// + /// + /// Name of the reservation order alias. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingBenefitsReservationOrderAlias(string reservationOrderAliasName, CancellationToken cancellationToken = default) + { + return GetBillingBenefitsReservationOrderAliases().Get(reservationOrderAliasName, cancellationToken); } /// @@ -85,9 +228,11 @@ public virtual BillingBenefitsReservationOrderAliasCollection GetBillingBenefits /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBillingBenefitsSavingsPlansAsync(TenantResourceGetBillingBenefitsSavingsPlansOptions options, CancellationToken cancellationToken = default) { + options ??= new TenantResourceGetBillingBenefitsSavingsPlansOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => BillingBenefitsSavingsPlanSavingsPlanRestClient.CreateListAllRequest(options.Filter, options.OrderBy, options.RefreshSummary, options.SkipToken, options.SelectedState, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BillingBenefitsSavingsPlanSavingsPlanRestClient.CreateListAllNextPageRequest(nextLink, options.Filter, options.OrderBy, options.RefreshSummary, options.SkipToken, options.SelectedState, options.Take); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BillingBenefitsSavingsPlanResource(Client, BillingBenefitsSavingsPlanData.DeserializeBillingBenefitsSavingsPlanData(e)), BillingBenefitsSavingsPlanSavingsPlanClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBillingBenefitsSavingsPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BillingBenefitsSavingsPlanResource(Client, BillingBenefitsSavingsPlanData.DeserializeBillingBenefitsSavingsPlanData(e)), BillingBenefitsSavingsPlanSavingsPlanClientDiagnostics, Pipeline, "BillingBenefitsTenantMockingExtension.GetBillingBenefitsSavingsPlans", "value", "nextLink", cancellationToken); } /// @@ -108,9 +253,11 @@ public virtual AsyncPageable GetBillingBenef /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBillingBenefitsSavingsPlans(TenantResourceGetBillingBenefitsSavingsPlansOptions options, CancellationToken cancellationToken = default) { + options ??= new TenantResourceGetBillingBenefitsSavingsPlansOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => BillingBenefitsSavingsPlanSavingsPlanRestClient.CreateListAllRequest(options.Filter, options.OrderBy, options.RefreshSummary, options.SkipToken, options.SelectedState, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BillingBenefitsSavingsPlanSavingsPlanRestClient.CreateListAllNextPageRequest(nextLink, options.Filter, options.OrderBy, options.RefreshSummary, options.SkipToken, options.SelectedState, options.Take); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BillingBenefitsSavingsPlanResource(Client, BillingBenefitsSavingsPlanData.DeserializeBillingBenefitsSavingsPlanData(e)), BillingBenefitsSavingsPlanSavingsPlanClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBillingBenefitsSavingsPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BillingBenefitsSavingsPlanResource(Client, BillingBenefitsSavingsPlanData.DeserializeBillingBenefitsSavingsPlanData(e)), BillingBenefitsSavingsPlanSavingsPlanClientDiagnostics, Pipeline, "BillingBenefitsTenantMockingExtension.GetBillingBenefitsSavingsPlans", "value", "nextLink", cancellationToken); } /// @@ -128,12 +275,15 @@ public virtual Pageable GetBillingBenefitsSa /// /// Request body for validating the purchase of a savings plan. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable ValidatePurchaseAsync(SavingsPlanPurchaseValidateContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateValidatePurchaseRequest(content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateValidatePurchaseNextPageRequest(nextLink, content); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SavingsPlanValidateResult.DeserializeSavingsPlanValidateResult, DefaultClientDiagnostics, Pipeline, "TenantResourceExtensionClient.ValidatePurchase", "benefits", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SavingsPlanValidateResult.DeserializeSavingsPlanValidateResult, DefaultClientDiagnostics, Pipeline, "BillingBenefitsTenantMockingExtension.ValidatePurchase", "benefits", "nextLink", cancellationToken); } /// @@ -151,12 +301,15 @@ public virtual AsyncPageable ValidatePurchaseAsync(Sa /// /// Request body for validating the purchase of a savings plan. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable ValidatePurchase(SavingsPlanPurchaseValidateContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateValidatePurchaseRequest(content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateValidatePurchaseNextPageRequest(nextLink, content); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SavingsPlanValidateResult.DeserializeSavingsPlanValidateResult, DefaultClientDiagnostics, Pipeline, "TenantResourceExtensionClient.ValidatePurchase", "benefits", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SavingsPlanValidateResult.DeserializeSavingsPlanValidateResult, DefaultClientDiagnostics, Pipeline, "BillingBenefitsTenantMockingExtension.ValidatePurchase", "benefits", "nextLink", cancellationToken); } } } diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/AssignmentResource.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/AssignmentResource.cs index 78f2d75289fe..e60016304c0e 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/AssignmentResource.cs +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/AssignmentResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AssignmentOperationResources and their operations over a AssignmentOperationResource. public virtual AssignmentOperationCollection GetAssignmentOperations() { - return GetCachedClient(Client => new AssignmentOperationCollection(Client, Id)); + return GetCachedClient(client => new AssignmentOperationCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual AssignmentOperationCollection GetAssignmentOperations() /// /// Name of the blueprint assignment operation. /// The cancellation token to use. - /// 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> GetAssignmentOperationAsync(string assignmentOperationName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetAssignmentOp /// /// Name of the blueprint assignment operation. /// The cancellation token to use. - /// 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 GetAssignmentOperation(string assignmentOperationName, CancellationToken cancellationToken = default) { diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/BlueprintResource.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/BlueprintResource.cs index d64496c84ecb..8eb0928ababb 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/BlueprintResource.cs +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/BlueprintResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BlueprintArtifactResources and their operations over a BlueprintArtifactResource. public virtual BlueprintArtifactCollection GetBlueprintArtifacts() { - return GetCachedClient(Client => new BlueprintArtifactCollection(Client, Id)); + return GetCachedClient(client => new BlueprintArtifactCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual BlueprintArtifactCollection GetBlueprintArtifacts() /// /// Name of the blueprint artifact. /// The cancellation token to use. - /// 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> GetBlueprintArtifactAsync(string artifactName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetBlueprintArtif /// /// Name of the blueprint artifact. /// The cancellation token to use. - /// 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 GetBlueprintArtifact(string artifactName, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetBlueprintArtifact(string a /// An object representing collection of PublishedBlueprintResources and their operations over a PublishedBlueprintResource. public virtual PublishedBlueprintCollection GetPublishedBlueprints() { - return GetCachedClient(Client => new PublishedBlueprintCollection(Client, Id)); + return GetCachedClient(client => new PublishedBlueprintCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual PublishedBlueprintCollection GetPublishedBlueprints() /// /// Version of the published blueprint definition. /// The cancellation token to use. - /// 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> GetPublishedBlueprintAsync(string versionId, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetPublishedBlue /// /// Version of the published blueprint definition. /// The cancellation token to use. - /// 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 GetPublishedBlueprint(string versionId, CancellationToken cancellationToken = default) { diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index e5e798f947ba..000000000000 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Blueprint -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of BlueprintResources in the ArmResource. - /// An object representing collection of BlueprintResources and their operations over a BlueprintResource. - public virtual BlueprintCollection GetBlueprints() - { - return GetCachedClient(Client => new BlueprintCollection(Client, Id)); - } - - /// Gets a collection of AssignmentResources in the ArmResource. - /// An object representing collection of AssignmentResources and their operations over a AssignmentResource. - public virtual AssignmentCollection GetAssignments() - { - return GetCachedClient(Client => new AssignmentCollection(Client, Id)); - } - } -} diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintArmClientMockingExtension.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintArmClientMockingExtension.cs new file mode 100644 index 000000000000..a24d4e3ab2f5 --- /dev/null +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintArmClientMockingExtension.cs @@ -0,0 +1,227 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Blueprint; + +namespace Azure.ResourceManager.Blueprint.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class BlueprintArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BlueprintArmClientMockingExtension() + { + } + + /// 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 BlueprintArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal BlueprintArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of BlueprintResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of BlueprintResources and their operations over a BlueprintResource. + public virtual BlueprintCollection GetBlueprints(ResourceIdentifier scope) + { + return new BlueprintCollection(Client, scope); + } + + /// + /// Get a blueprint definition. + /// + /// + /// Request Path + /// /{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName} + /// + /// + /// Operation Id + /// Blueprints_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the blueprint definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBlueprintAsync(ResourceIdentifier scope, string blueprintName, CancellationToken cancellationToken = default) + { + return await GetBlueprints(scope).GetAsync(blueprintName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a blueprint definition. + /// + /// + /// Request Path + /// /{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName} + /// + /// + /// Operation Id + /// Blueprints_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the blueprint definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBlueprint(ResourceIdentifier scope, string blueprintName, CancellationToken cancellationToken = default) + { + return GetBlueprints(scope).Get(blueprintName, cancellationToken); + } + + /// Gets a collection of AssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of AssignmentResources and their operations over a AssignmentResource. + public virtual AssignmentCollection GetAssignments(ResourceIdentifier scope) + { + return new AssignmentCollection(Client, scope); + } + + /// + /// Get a blueprint assignment. + /// + /// + /// Request Path + /// /{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the blueprint assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAssignmentAsync(ResourceIdentifier scope, string assignmentName, CancellationToken cancellationToken = default) + { + return await GetAssignments(scope).GetAsync(assignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a blueprint assignment. + /// + /// + /// Request Path + /// /{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the blueprint assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAssignment(ResourceIdentifier scope, string assignmentName, CancellationToken cancellationToken = default) + { + return GetAssignments(scope).Get(assignmentName, 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 BlueprintResource GetBlueprintResource(ResourceIdentifier id) + { + BlueprintResource.ValidateResourceId(id); + return new BlueprintResource(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 BlueprintArtifactResource GetBlueprintArtifactResource(ResourceIdentifier id) + { + BlueprintArtifactResource.ValidateResourceId(id); + return new BlueprintArtifactResource(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 BlueprintVersionArtifactResource GetBlueprintVersionArtifactResource(ResourceIdentifier id) + { + BlueprintVersionArtifactResource.ValidateResourceId(id); + return new BlueprintVersionArtifactResource(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 PublishedBlueprintResource GetPublishedBlueprintResource(ResourceIdentifier id) + { + PublishedBlueprintResource.ValidateResourceId(id); + return new PublishedBlueprintResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssignmentResource GetAssignmentResource(ResourceIdentifier id) + { + AssignmentResource.ValidateResourceId(id); + return new AssignmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssignmentOperationResource GetAssignmentOperationResource(ResourceIdentifier id) + { + AssignmentOperationResource.ValidateResourceId(id); + return new AssignmentOperationResource(Client, id); + } + } +} diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintExtensions.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintExtensions.cs index d4773d4dffd3..ea3fc23bceec 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintExtensions.cs +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/Extensions/BlueprintExtensions.cs @@ -11,148 +11,31 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Blueprint.Mocking; namespace Azure.ResourceManager.Blueprint { /// A class to add extension methods to Azure.ResourceManager.Blueprint. public static partial class BlueprintExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static BlueprintArmClientMockingExtension GetBlueprintArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new BlueprintArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); - } - #region BlueprintResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BlueprintResource GetBlueprintResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BlueprintResource.ValidateResourceId(id); - return new BlueprintResource(client, id); - } - ); - } - #endregion - - #region BlueprintArtifactResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BlueprintArtifactResource GetBlueprintArtifactResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BlueprintArtifactResource.ValidateResourceId(id); - return new BlueprintArtifactResource(client, id); - } - ); - } - #endregion - - #region BlueprintVersionArtifactResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BlueprintVersionArtifactResource GetBlueprintVersionArtifactResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BlueprintVersionArtifactResource.ValidateResourceId(id); - return new BlueprintVersionArtifactResource(client, id); - } - ); - } - #endregion - - #region PublishedBlueprintResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static PublishedBlueprintResource GetPublishedBlueprintResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - PublishedBlueprintResource.ValidateResourceId(id); - return new PublishedBlueprintResource(client, id); - } - ); - } - #endregion - - #region AssignmentResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AssignmentResource GetAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AssignmentResource.ValidateResourceId(id); - return new AssignmentResource(client, id); - } - ); - } - #endregion - - #region AssignmentOperationResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets a collection of BlueprintResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AssignmentOperationResource GetAssignmentOperationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AssignmentOperationResource.ValidateResourceId(id); - return new AssignmentOperationResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of BlueprintResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of BlueprintResources and their operations over a BlueprintResource. public static BlueprintCollection GetBlueprints(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetBlueprints(); + return GetBlueprintArmClientMockingExtension(client).GetBlueprints(scope); } /// @@ -167,17 +50,21 @@ public static BlueprintCollection GetBlueprints(this ArmClient client, ResourceI /// Blueprints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Name of the blueprint definition. /// The cancellation token to use. - /// 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 static async Task> GetBlueprintAsync(this ArmClient client, ResourceIdentifier scope, string blueprintName, CancellationToken cancellationToken = default) { - return await client.GetBlueprints(scope).GetAsync(blueprintName, cancellationToken).ConfigureAwait(false); + return await GetBlueprintArmClientMockingExtension(client).GetBlueprintAsync(scope, blueprintName, cancellationToken).ConfigureAwait(false); } /// @@ -192,26 +79,36 @@ public static async Task> GetBlueprintAsync(this Arm /// Blueprints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Name of the blueprint definition. /// The cancellation token to use. - /// 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 static Response GetBlueprint(this ArmClient client, ResourceIdentifier scope, string blueprintName, CancellationToken cancellationToken = default) { - return client.GetBlueprints(scope).Get(blueprintName, cancellationToken); + return GetBlueprintArmClientMockingExtension(client).GetBlueprint(scope, blueprintName, cancellationToken); } - /// Gets a collection of AssignmentResources in the ArmResource. + /// + /// Gets a collection of AssignmentResources 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. /// An object representing collection of AssignmentResources and their operations over a AssignmentResource. public static AssignmentCollection GetAssignments(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetAssignments(); + return GetBlueprintArmClientMockingExtension(client).GetAssignments(scope); } /// @@ -226,17 +123,21 @@ public static AssignmentCollection GetAssignments(this ArmClient client, Resourc /// Assignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Name of the blueprint assignment. /// The cancellation token to use. - /// 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 static async Task> GetAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string assignmentName, CancellationToken cancellationToken = default) { - return await client.GetAssignments(scope).GetAsync(assignmentName, cancellationToken).ConfigureAwait(false); + return await GetBlueprintArmClientMockingExtension(client).GetAssignmentAsync(scope, assignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -251,17 +152,117 @@ public static async Task> GetAssignmentAsync(this A /// Assignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Name of the blueprint assignment. /// The cancellation token to use. - /// 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 static Response GetAssignment(this ArmClient client, ResourceIdentifier scope, string assignmentName, CancellationToken cancellationToken = default) { - return client.GetAssignments(scope).Get(assignmentName, cancellationToken); + return GetBlueprintArmClientMockingExtension(client).GetAssignment(scope, assignmentName, 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. + /// Returns a object. + public static BlueprintResource GetBlueprintResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetBlueprintResource(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. + /// Returns a object. + public static BlueprintArtifactResource GetBlueprintArtifactResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetBlueprintArtifactResource(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. + /// Returns a object. + public static BlueprintVersionArtifactResource GetBlueprintVersionArtifactResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetBlueprintVersionArtifactResource(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. + /// Returns a object. + public static PublishedBlueprintResource GetPublishedBlueprintResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetPublishedBlueprintResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AssignmentResource GetAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetAssignmentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AssignmentOperationResource GetAssignmentOperationResource(this ArmClient client, ResourceIdentifier id) + { + return GetBlueprintArmClientMockingExtension(client).GetAssignmentOperationResource(id); } } } diff --git a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/PublishedBlueprintResource.cs b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/PublishedBlueprintResource.cs index 27e61c7bc1c0..60b22a708333 100644 --- a/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/PublishedBlueprintResource.cs +++ b/sdk/blueprint/Azure.ResourceManager.Blueprint/src/Generated/PublishedBlueprintResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BlueprintVersionArtifactResources and their operations over a BlueprintVersionArtifactResource. public virtual BlueprintVersionArtifactCollection GetBlueprintVersionArtifacts() { - return GetCachedClient(Client => new BlueprintVersionArtifactCollection(Client, Id)); + return GetCachedClient(client => new BlueprintVersionArtifactCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual BlueprintVersionArtifactCollection GetBlueprintVersionArtifacts() /// /// Name of the blueprint artifact. /// The cancellation token to use. - /// 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> GetBlueprintVersionArtifactAsync(string artifactName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetBluepri /// /// Name of the blueprint artifact. /// The cancellation token to use. - /// 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 GetBlueprintVersionArtifact(string artifactName, CancellationToken cancellationToken = default) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs index db81696f3b2b..f9cc24e0df29 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BotChannelResources and their operations over a BotChannelResource. public virtual BotChannelCollection GetBotChannels() { - return GetCachedClient(Client => new BotChannelCollection(Client, Id)); + return GetCachedClient(client => new BotChannelCollection(client, Id)); } /// @@ -155,7 +155,7 @@ public virtual Response GetBotChannel(BotChannelName channel /// An object representing collection of BotConnectionSettingResources and their operations over a BotConnectionSettingResource. public virtual BotConnectionSettingCollection GetBotConnectionSettings() { - return GetCachedClient(Client => new BotConnectionSettingCollection(Client, Id)); + return GetCachedClient(client => new BotConnectionSettingCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual BotConnectionSettingCollection GetBotConnectionSettings() /// /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// 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> GetBotConnectionSettingAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task> GetBotConnecti /// /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// 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 GetBotConnectionSetting(string connectionName, CancellationToken cancellationToken = default) { @@ -208,7 +208,7 @@ public virtual Response GetBotConnectionSetting(st /// An object representing collection of BotServicePrivateEndpointConnectionResources and their operations over a BotServicePrivateEndpointConnectionResource. public virtual BotServicePrivateEndpointConnectionCollection GetBotServicePrivateEndpointConnections() { - return GetCachedClient(Client => new BotServicePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new BotServicePrivateEndpointConnectionCollection(client, Id)); } /// @@ -226,8 +226,8 @@ public virtual BotServicePrivateEndpointConnectionCollection GetBotServicePrivat /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetBotServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -249,8 +249,8 @@ public virtual async Task> /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetBotServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceArmClientMockingExtension.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceArmClientMockingExtension.cs new file mode 100644 index 000000000000..374c43f93033 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.BotService; + +namespace Azure.ResourceManager.BotService.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class BotServiceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BotServiceArmClientMockingExtension() + { + } + + /// 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 BotServiceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal BotServiceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BotResource GetBotResource(ResourceIdentifier id) + { + BotResource.ValidateResourceId(id); + return new BotResource(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 BotChannelResource GetBotChannelResource(ResourceIdentifier id) + { + BotChannelResource.ValidateResourceId(id); + return new BotChannelResource(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 BotConnectionSettingResource GetBotConnectionSettingResource(ResourceIdentifier id) + { + BotConnectionSettingResource.ValidateResourceId(id); + return new BotConnectionSettingResource(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 BotServicePrivateEndpointConnectionResource GetBotServicePrivateEndpointConnectionResource(ResourceIdentifier id) + { + BotServicePrivateEndpointConnectionResource.ValidateResourceId(id); + return new BotServicePrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs index 4eb4e44ed9cc..9630a4fb393f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.BotService.Mocking; using Azure.ResourceManager.BotService.Models; using Azure.ResourceManager.Resources; @@ -19,135 +20,102 @@ namespace Azure.ResourceManager.BotService /// A class to add extension methods to Azure.ResourceManager.BotService. public static partial class BotServiceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static BotServiceArmClientMockingExtension GetBotServiceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new BotServiceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static BotServiceResourceGroupMockingExtension GetBotServiceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new BotServiceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static BotServiceSubscriptionMockingExtension GetBotServiceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new BotServiceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static BotServiceTenantMockingExtension GetBotServiceTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new BotServiceTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region BotResource /// /// 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. /// Returns a object. public static BotResource GetBotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BotResource.ValidateResourceId(id); - return new BotResource(client, id); - } - ); + return GetBotServiceArmClientMockingExtension(client).GetBotResource(id); } - #endregion - #region BotChannelResource /// /// 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. /// Returns a object. public static BotChannelResource GetBotChannelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BotChannelResource.ValidateResourceId(id); - return new BotChannelResource(client, id); - } - ); + return GetBotServiceArmClientMockingExtension(client).GetBotChannelResource(id); } - #endregion - #region BotConnectionSettingResource /// /// 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. /// Returns a object. public static BotConnectionSettingResource GetBotConnectionSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BotConnectionSettingResource.ValidateResourceId(id); - return new BotConnectionSettingResource(client, id); - } - ); + return GetBotServiceArmClientMockingExtension(client).GetBotConnectionSettingResource(id); } - #endregion - #region BotServicePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static BotServicePrivateEndpointConnectionResource GetBotServicePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BotServicePrivateEndpointConnectionResource.ValidateResourceId(id); - return new BotServicePrivateEndpointConnectionResource(client, id); - } - ); + return GetBotServiceArmClientMockingExtension(client).GetBotServicePrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of BotResources in the ResourceGroupResource. + /// + /// Gets a collection of BotResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BotResources and their operations over a BotResource. public static BotCollection GetBots(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBots(); + return GetBotServiceResourceGroupMockingExtension(resourceGroupResource).GetBots(); } /// @@ -162,16 +130,20 @@ public static BotCollection GetBots(this ResourceGroupResource resourceGroupReso /// Bots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bot resource. /// The cancellation token to use. - /// 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 static async Task> GetBotAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetBotServiceResourceGroupMockingExtension(resourceGroupResource).GetBotAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -186,16 +158,20 @@ public static async Task> GetBotAsync(this ResourceGroupRe /// Bots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bot resource. /// The cancellation token to use. - /// 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 static Response GetBot(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBots().Get(resourceName, cancellationToken); + return GetBotServiceResourceGroupMockingExtension(resourceGroupResource).GetBot(resourceName, cancellationToken); } /// @@ -210,13 +186,17 @@ public static Response GetBot(this ResourceGroupResource resourceGr /// Bots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotsAsync(cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotsAsync(cancellationToken); } /// @@ -231,13 +211,17 @@ public static AsyncPageable GetBotsAsync(this SubscriptionResource /// Bots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBots(cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBots(cancellationToken); } /// @@ -252,13 +236,17 @@ public static Pageable GetBots(this SubscriptionResource subscripti /// BotConnection_ListServiceProviders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBotConnectionServiceProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotConnectionServiceProvidersAsync(cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotConnectionServiceProvidersAsync(cancellationToken); } /// @@ -273,13 +261,17 @@ public static AsyncPageable GetBotConnectionServiceProviders /// BotConnection_ListServiceProviders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBotConnectionServiceProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotConnectionServiceProviders(cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotConnectionServiceProviders(cancellationToken); } /// @@ -294,6 +286,10 @@ public static Pageable GetBotConnectionServiceProviders(this /// QnAMakerEndpointKeys_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The request body parameters to provide for the check name availability request. @@ -301,9 +297,7 @@ public static Pageable GetBotConnectionServiceProviders(this /// is null. public static async Task> GetBotServiceQnAMakerEndpointKeyAsync(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotServiceQnAMakerEndpointKeyAsync(content, cancellationToken).ConfigureAwait(false); + return await GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotServiceQnAMakerEndpointKeyAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -318,6 +312,10 @@ public static async Task> GetBo /// QnAMakerEndpointKeys_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The request body parameters to provide for the check name availability request. @@ -325,9 +323,7 @@ public static async Task> GetBo /// is null. public static Response GetBotServiceQnAMakerEndpointKey(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotServiceQnAMakerEndpointKey(content, cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotServiceQnAMakerEndpointKey(content, cancellationToken); } /// @@ -342,12 +338,16 @@ public static Response GetBotServiceQnAM /// HostSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetBotServiceHostSettingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotServiceHostSettingsAsync(cancellationToken).ConfigureAwait(false); + return await GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotServiceHostSettingsAsync(cancellationToken).ConfigureAwait(false); } /// @@ -362,12 +362,16 @@ public static async Task> GetBotServiceHo /// HostSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetBotServiceHostSettings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBotServiceHostSettings(cancellationToken); + return GetBotServiceSubscriptionMockingExtension(subscriptionResource).GetBotServiceHostSettings(cancellationToken); } /// @@ -382,6 +386,10 @@ public static Response GetBotServiceHostSettings(t /// Bots_GetCheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The request body parameters to provide for the check name availability request. @@ -389,9 +397,7 @@ public static Response GetBotServiceHostSettings(t /// is null. public static async Task> CheckBotServiceNameAvailabilityAsync(this TenantResource tenantResource, BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckBotServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetBotServiceTenantMockingExtension(tenantResource).CheckBotServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -406,6 +412,10 @@ public static async Task> CheckBotSer /// Bots_GetCheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The request body parameters to provide for the check name availability request. @@ -413,9 +423,7 @@ public static async Task> CheckBotSer /// is null. public static Response CheckBotServiceNameAvailability(this TenantResource tenantResource, BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CheckBotServiceNameAvailability(content, cancellationToken); + return GetBotServiceTenantMockingExtension(tenantResource).CheckBotServiceNameAvailability(content, cancellationToken); } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceResourceGroupMockingExtension.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..004e6cda2530 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.BotService; + +namespace Azure.ResourceManager.BotService.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class BotServiceResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected BotServiceResourceGroupMockingExtension() + { + } + + /// 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 BotServiceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of BotResources in the ResourceGroupResource. + /// An object representing collection of BotResources and their operations over a BotResource. + public virtual BotCollection GetBots() + { + return GetCachedClient(client => new BotCollection(client, Id)); + } + + /// + /// Returns a BotService specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName} + /// + /// + /// Operation Id + /// Bots_Get + /// + /// + /// + /// The name of the Bot resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBotAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetBots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a BotService specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName} + /// + /// + /// Operation Id + /// Bots_Get + /// + /// + /// + /// The name of the Bot resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBot(string resourceName, CancellationToken cancellationToken = default) + { + return GetBots().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceSubscriptionMockingExtension.cs similarity index 89% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceSubscriptionMockingExtension.cs index 1ee03e510f37..a5a72f0f8b23 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.BotService; using Azure.ResourceManager.BotService.Models; -namespace Azure.ResourceManager.BotService +namespace Azure.ResourceManager.BotService.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class BotServiceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _botClientDiagnostics; private BotsRestOperations _botRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _hostSettingsClientDiagnostics; private HostSettingsRestOperations _hostSettingsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected BotServiceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal BotServiceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -75,7 +76,7 @@ public virtual AsyncPageable GetBotsAsync(CancellationToken cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => BotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotResource(Client, BotData.DeserializeBotData(e)), BotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotResource(Client, BotData.DeserializeBotData(e)), BotClientDiagnostics, Pipeline, "BotServiceSubscriptionMockingExtension.GetBots", "value", "nextLink", cancellationToken); } /// @@ -97,7 +98,7 @@ public virtual Pageable GetBots(CancellationToken cancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => BotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotResource(Client, BotData.DeserializeBotData(e)), BotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotResource(Client, BotData.DeserializeBotData(e)), BotClientDiagnostics, Pipeline, "BotServiceSubscriptionMockingExtension.GetBots", "value", "nextLink", cancellationToken); } /// @@ -118,7 +119,7 @@ public virtual Pageable GetBots(CancellationToken cancellationToken public virtual AsyncPageable GetBotConnectionServiceProvidersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionSettingBotConnectionRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, BotServiceProvider.DeserializeBotServiceProvider, BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBotConnectionServiceProviders", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, BotServiceProvider.DeserializeBotServiceProvider, BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "BotServiceSubscriptionMockingExtension.GetBotConnectionServiceProviders", "value", null, cancellationToken); } /// @@ -139,7 +140,7 @@ public virtual AsyncPageable GetBotConnectionServiceProvider public virtual Pageable GetBotConnectionServiceProviders(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionSettingBotConnectionRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, BotServiceProvider.DeserializeBotServiceProvider, BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBotConnectionServiceProviders", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, BotServiceProvider.DeserializeBotServiceProvider, BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "BotServiceSubscriptionMockingExtension.GetBotConnectionServiceProviders", "value", null, cancellationToken); } /// @@ -157,9 +158,12 @@ public virtual Pageable GetBotConnectionServiceProviders(Can /// /// The request body parameters to provide for the check name availability request. /// The cancellation token to use. + /// is null. public virtual async Task> GetBotServiceQnAMakerEndpointKeyAsync(GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { - using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBotServiceQnAMakerEndpointKey"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("BotServiceSubscriptionMockingExtension.GetBotServiceQnAMakerEndpointKey"); scope.Start(); try { @@ -188,9 +192,12 @@ public virtual async Task> GetB /// /// The request body parameters to provide for the check name availability request. /// The cancellation token to use. + /// is null. public virtual Response GetBotServiceQnAMakerEndpointKey(GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { - using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBotServiceQnAMakerEndpointKey"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("BotServiceSubscriptionMockingExtension.GetBotServiceQnAMakerEndpointKey"); scope.Start(); try { @@ -220,7 +227,7 @@ public virtual Response GetBotServiceQnA /// The cancellation token to use. public virtual async Task> GetBotServiceHostSettingsAsync(CancellationToken cancellationToken = default) { - using var scope = HostSettingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBotServiceHostSettings"); + using var scope = HostSettingsClientDiagnostics.CreateScope("BotServiceSubscriptionMockingExtension.GetBotServiceHostSettings"); scope.Start(); try { @@ -250,7 +257,7 @@ public virtual async Task> GetBotServiceH /// The cancellation token to use. public virtual Response GetBotServiceHostSettings(CancellationToken cancellationToken = default) { - using var scope = HostSettingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBotServiceHostSettings"); + using var scope = HostSettingsClientDiagnostics.CreateScope("BotServiceSubscriptionMockingExtension.GetBotServiceHostSettings"); scope.Start(); try { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceTenantMockingExtension.cs similarity index 81% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceTenantMockingExtension.cs index d932c20a1a6e..7bda63f010dc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.BotService; using Azure.ResourceManager.BotService.Models; -namespace Azure.ResourceManager.BotService +namespace Azure.ResourceManager.BotService.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class BotServiceTenantMockingExtension : ArmResource { private ClientDiagnostics _botClientDiagnostics; private BotsRestOperations _botRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected BotServiceTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal BotServiceTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,9 +59,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// The request body parameters to provide for the check name availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckBotServiceNameAvailabilityAsync(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = BotClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckBotServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BotClientDiagnostics.CreateScope("BotServiceTenantMockingExtension.CheckBotServiceNameAvailability"); scope.Start(); try { @@ -89,9 +93,12 @@ public virtual async Task> CheckBotSe /// /// The request body parameters to provide for the check name availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckBotServiceNameAvailability(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = BotClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckBotServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BotClientDiagnostics.CreateScope("BotServiceTenantMockingExtension.CheckBotServiceNameAvailability"); scope.Start(); try { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ed082aca1174..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.BotService -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of BotResources in the ResourceGroupResource. - /// An object representing collection of BotResources and their operations over a BotResource. - public virtual BotCollection GetBots() - { - return GetCachedClient(Client => new BotCollection(Client, Id)); - } - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointResource.cs index 75b5be037f9b..2cdf0b804239 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/CdnEndpointResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CdnOriginResources and their operations over a CdnOriginResource. public virtual CdnOriginCollection GetCdnOrigins() { - return GetCachedClient(Client => new CdnOriginCollection(Client, Id)); + return GetCachedClient(client => new CdnOriginCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CdnOriginCollection GetCdnOrigins() /// /// Name of the origin which is unique within the endpoint. /// The cancellation token to use. - /// 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> GetCdnOriginAsync(string originName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCdnOriginAsync(string /// /// Name of the origin which is unique within the endpoint. /// The cancellation token to use. - /// 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 GetCdnOrigin(string originName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetCdnOrigin(string originName, Cance /// An object representing collection of CdnOriginGroupResources and their operations over a CdnOriginGroupResource. public virtual CdnOriginGroupCollection GetCdnOriginGroups() { - return GetCachedClient(Client => new CdnOriginGroupCollection(Client, Id)); + return GetCachedClient(client => new CdnOriginGroupCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual CdnOriginGroupCollection GetCdnOriginGroups() /// /// Name of the origin group which is unique within the endpoint. /// The cancellation token to use. - /// 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> GetCdnOriginGroupAsync(string originGroupName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetCdnOriginGroupAsy /// /// Name of the origin group which is unique within the endpoint. /// The cancellation token to use. - /// 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 GetCdnOriginGroup(string originGroupName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetCdnOriginGroup(string originG /// An object representing collection of CdnCustomDomainResources and their operations over a CdnCustomDomainResource. public virtual CdnCustomDomainCollection GetCdnCustomDomains() { - return GetCachedClient(Client => new CdnCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new CdnCustomDomainCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual CdnCustomDomainCollection GetCdnCustomDomains() /// /// Name of the custom domain within an endpoint. /// The cancellation token to use. - /// 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> GetCdnCustomDomainAsync(string customDomainName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetCdnCustomDomainA /// /// Name of the custom domain within an endpoint. /// The cancellation token to use. - /// 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 GetCdnCustomDomain(string customDomainName, CancellationToken cancellationToken = default) { diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnArmClientMockingExtension.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnArmClientMockingExtension.cs new file mode 100644 index 000000000000..881eafd304f7 --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnArmClientMockingExtension.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Cdn; + +namespace Azure.ResourceManager.Cdn.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CdnArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CdnArmClientMockingExtension() + { + } + + /// 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 CdnArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CdnArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FrontDoorCustomDomainResource GetFrontDoorCustomDomainResource(ResourceIdentifier id) + { + FrontDoorCustomDomainResource.ValidateResourceId(id); + return new FrontDoorCustomDomainResource(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 FrontDoorEndpointResource GetFrontDoorEndpointResource(ResourceIdentifier id) + { + FrontDoorEndpointResource.ValidateResourceId(id); + return new FrontDoorEndpointResource(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 FrontDoorOriginGroupResource GetFrontDoorOriginGroupResource(ResourceIdentifier id) + { + FrontDoorOriginGroupResource.ValidateResourceId(id); + return new FrontDoorOriginGroupResource(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 FrontDoorOriginResource GetFrontDoorOriginResource(ResourceIdentifier id) + { + FrontDoorOriginResource.ValidateResourceId(id); + return new FrontDoorOriginResource(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 FrontDoorRouteResource GetFrontDoorRouteResource(ResourceIdentifier id) + { + FrontDoorRouteResource.ValidateResourceId(id); + return new FrontDoorRouteResource(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 FrontDoorRuleSetResource GetFrontDoorRuleSetResource(ResourceIdentifier id) + { + FrontDoorRuleSetResource.ValidateResourceId(id); + return new FrontDoorRuleSetResource(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 FrontDoorRuleResource GetFrontDoorRuleResource(ResourceIdentifier id) + { + FrontDoorRuleResource.ValidateResourceId(id); + return new FrontDoorRuleResource(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 FrontDoorSecurityPolicyResource GetFrontDoorSecurityPolicyResource(ResourceIdentifier id) + { + FrontDoorSecurityPolicyResource.ValidateResourceId(id); + return new FrontDoorSecurityPolicyResource(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 FrontDoorSecretResource GetFrontDoorSecretResource(ResourceIdentifier id) + { + FrontDoorSecretResource.ValidateResourceId(id); + return new FrontDoorSecretResource(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 ProfileResource GetProfileResource(ResourceIdentifier id) + { + ProfileResource.ValidateResourceId(id); + return new ProfileResource(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 CdnEndpointResource GetCdnEndpointResource(ResourceIdentifier id) + { + CdnEndpointResource.ValidateResourceId(id); + return new CdnEndpointResource(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 CdnOriginResource GetCdnOriginResource(ResourceIdentifier id) + { + CdnOriginResource.ValidateResourceId(id); + return new CdnOriginResource(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 CdnOriginGroupResource GetCdnOriginGroupResource(ResourceIdentifier id) + { + CdnOriginGroupResource.ValidateResourceId(id); + return new CdnOriginGroupResource(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 CdnCustomDomainResource GetCdnCustomDomainResource(ResourceIdentifier id) + { + CdnCustomDomainResource.ValidateResourceId(id); + return new CdnCustomDomainResource(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 CdnWebApplicationFirewallPolicyResource GetCdnWebApplicationFirewallPolicyResource(ResourceIdentifier id) + { + CdnWebApplicationFirewallPolicyResource.ValidateResourceId(id); + return new CdnWebApplicationFirewallPolicyResource(Client, id); + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs index 33559f67d6c8..c0cc3e3313a7 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Cdn.Mocking; using Azure.ResourceManager.Cdn.Models; using Azure.ResourceManager.Resources; @@ -19,344 +20,278 @@ namespace Azure.ResourceManager.Cdn /// A class to add extension methods to Azure.ResourceManager.Cdn. public static partial class CdnExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CdnArmClientMockingExtension GetCdnArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CdnArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CdnResourceGroupMockingExtension GetCdnResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CdnResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CdnSubscriptionMockingExtension GetCdnSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CdnSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CdnTenantMockingExtension GetCdnTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CdnTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region FrontDoorCustomDomainResource /// /// 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. /// Returns a object. public static FrontDoorCustomDomainResource GetFrontDoorCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorCustomDomainResource.ValidateResourceId(id); - return new FrontDoorCustomDomainResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorCustomDomainResource(id); } - #endregion - #region FrontDoorEndpointResource /// /// 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. /// Returns a object. public static FrontDoorEndpointResource GetFrontDoorEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorEndpointResource.ValidateResourceId(id); - return new FrontDoorEndpointResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorEndpointResource(id); } - #endregion - #region FrontDoorOriginGroupResource /// /// 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. /// Returns a object. public static FrontDoorOriginGroupResource GetFrontDoorOriginGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorOriginGroupResource.ValidateResourceId(id); - return new FrontDoorOriginGroupResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorOriginGroupResource(id); } - #endregion - #region FrontDoorOriginResource /// /// 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. /// Returns a object. public static FrontDoorOriginResource GetFrontDoorOriginResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorOriginResource.ValidateResourceId(id); - return new FrontDoorOriginResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorOriginResource(id); } - #endregion - #region FrontDoorRouteResource /// /// 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. /// Returns a object. public static FrontDoorRouteResource GetFrontDoorRouteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorRouteResource.ValidateResourceId(id); - return new FrontDoorRouteResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorRouteResource(id); } - #endregion - #region FrontDoorRuleSetResource /// /// 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. /// Returns a object. public static FrontDoorRuleSetResource GetFrontDoorRuleSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorRuleSetResource.ValidateResourceId(id); - return new FrontDoorRuleSetResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorRuleSetResource(id); } - #endregion - #region FrontDoorRuleResource /// /// 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. /// Returns a object. public static FrontDoorRuleResource GetFrontDoorRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorRuleResource.ValidateResourceId(id); - return new FrontDoorRuleResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorRuleResource(id); } - #endregion - #region FrontDoorSecurityPolicyResource /// /// 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. /// Returns a object. public static FrontDoorSecurityPolicyResource GetFrontDoorSecurityPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorSecurityPolicyResource.ValidateResourceId(id); - return new FrontDoorSecurityPolicyResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorSecurityPolicyResource(id); } - #endregion - #region FrontDoorSecretResource /// /// 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. /// Returns a object. public static FrontDoorSecretResource GetFrontDoorSecretResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorSecretResource.ValidateResourceId(id); - return new FrontDoorSecretResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetFrontDoorSecretResource(id); } - #endregion - #region ProfileResource /// /// 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. /// Returns a object. public static ProfileResource GetProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProfileResource.ValidateResourceId(id); - return new ProfileResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetProfileResource(id); } - #endregion - #region CdnEndpointResource /// /// 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. /// Returns a object. public static CdnEndpointResource GetCdnEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CdnEndpointResource.ValidateResourceId(id); - return new CdnEndpointResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetCdnEndpointResource(id); } - #endregion - #region CdnOriginResource /// /// 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. /// Returns a object. public static CdnOriginResource GetCdnOriginResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CdnOriginResource.ValidateResourceId(id); - return new CdnOriginResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetCdnOriginResource(id); } - #endregion - #region CdnOriginGroupResource /// /// 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. /// Returns a object. public static CdnOriginGroupResource GetCdnOriginGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CdnOriginGroupResource.ValidateResourceId(id); - return new CdnOriginGroupResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetCdnOriginGroupResource(id); } - #endregion - #region CdnCustomDomainResource /// /// 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. /// Returns a object. public static CdnCustomDomainResource GetCdnCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CdnCustomDomainResource.ValidateResourceId(id); - return new CdnCustomDomainResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetCdnCustomDomainResource(id); } - #endregion - #region CdnWebApplicationFirewallPolicyResource /// /// 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. /// Returns a object. public static CdnWebApplicationFirewallPolicyResource GetCdnWebApplicationFirewallPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CdnWebApplicationFirewallPolicyResource.ValidateResourceId(id); - return new CdnWebApplicationFirewallPolicyResource(client, id); - } - ); + return GetCdnArmClientMockingExtension(client).GetCdnWebApplicationFirewallPolicyResource(id); } - #endregion - /// Gets a collection of ProfileResources in the ResourceGroupResource. + /// + /// Gets a collection of ProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ProfileResources and their operations over a ProfileResource. public static ProfileCollection GetProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProfiles(); + return GetCdnResourceGroupMockingExtension(resourceGroupResource).GetProfiles(); } /// @@ -371,16 +306,20 @@ public static ProfileCollection GetProfiles(this ResourceGroupResource resourceG /// Profiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. /// The cancellation token to use. - /// 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 static async Task> GetProfileAsync(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + return await GetCdnResourceGroupMockingExtension(resourceGroupResource).GetProfileAsync(profileName, cancellationToken).ConfigureAwait(false); } /// @@ -395,24 +334,34 @@ public static async Task> GetProfileAsync(this Resourc /// Profiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. /// The cancellation token to use. - /// 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 static Response GetProfile(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetProfiles().Get(profileName, cancellationToken); + return GetCdnResourceGroupMockingExtension(resourceGroupResource).GetProfile(profileName, cancellationToken); } - /// Gets a collection of CdnWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of CdnWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CdnWebApplicationFirewallPolicyResources and their operations over a CdnWebApplicationFirewallPolicyResource. public static CdnWebApplicationFirewallPolicyCollection GetCdnWebApplicationFirewallPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCdnWebApplicationFirewallPolicies(); + return GetCdnResourceGroupMockingExtension(resourceGroupResource).GetCdnWebApplicationFirewallPolicies(); } /// @@ -427,16 +376,20 @@ public static CdnWebApplicationFirewallPolicyCollection GetCdnWebApplicationFire /// Policies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the CdnWebApplicationFirewallPolicy. /// The cancellation token to use. - /// 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 static async Task> GetCdnWebApplicationFirewallPolicyAsync(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCdnWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + return await GetCdnResourceGroupMockingExtension(resourceGroupResource).GetCdnWebApplicationFirewallPolicyAsync(policyName, cancellationToken).ConfigureAwait(false); } /// @@ -451,16 +404,20 @@ public static async Task> GetC /// Policies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the CdnWebApplicationFirewallPolicy. /// The cancellation token to use. - /// 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 static Response GetCdnWebApplicationFirewallPolicy(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCdnWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + return GetCdnResourceGroupMockingExtension(resourceGroupResource).GetCdnWebApplicationFirewallPolicy(policyName, cancellationToken); } /// @@ -475,6 +432,10 @@ public static Response GetCdnWebApplica /// CheckEndpointNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -482,9 +443,7 @@ public static Response GetCdnWebApplica /// is null. public static async Task> CheckEndpointNameAvailabilityAsync(this ResourceGroupResource resourceGroupResource, EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckEndpointNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCdnResourceGroupMockingExtension(resourceGroupResource).CheckEndpointNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -499,6 +458,10 @@ public static async Task> CheckEndpoint /// CheckEndpointNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -506,9 +469,7 @@ public static async Task> CheckEndpoint /// is null. public static Response CheckEndpointNameAvailability(this ResourceGroupResource resourceGroupResource, EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckEndpointNameAvailability(content, cancellationToken); + return GetCdnResourceGroupMockingExtension(resourceGroupResource).CheckEndpointNameAvailability(content, cancellationToken); } /// @@ -523,6 +484,10 @@ public static Response CheckEndpointNameAvailabi /// CheckNameAvailabilityWithSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -530,9 +495,7 @@ public static Response CheckEndpointNameAvailabi /// is null. public static async Task> CheckCdnNameAvailabilityWithSubscriptionAsync(this SubscriptionResource subscriptionResource, CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCdnNameAvailabilityWithSubscriptionAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCdnSubscriptionMockingExtension(subscriptionResource).CheckCdnNameAvailabilityWithSubscriptionAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -547,6 +510,10 @@ public static async Task> CheckCdnNameAvaila /// CheckNameAvailabilityWithSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -554,9 +521,7 @@ public static async Task> CheckCdnNameAvaila /// is null. public static Response CheckCdnNameAvailabilityWithSubscription(this SubscriptionResource subscriptionResource, CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCdnNameAvailabilityWithSubscription(content, cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).CheckCdnNameAvailabilityWithSubscription(content, cancellationToken); } /// @@ -571,6 +536,10 @@ public static Response CheckCdnNameAvailabilityWithSu /// ValidateProbe /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -578,9 +547,7 @@ public static Response CheckCdnNameAvailabilityWithSu /// is null. public static async Task> ValidateProbeAsync(this SubscriptionResource subscriptionResource, ValidateProbeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateProbeAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCdnSubscriptionMockingExtension(subscriptionResource).ValidateProbeAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -595,6 +562,10 @@ public static async Task> ValidateProbeAsync(this /// ValidateProbe /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -602,9 +573,7 @@ public static async Task> ValidateProbeAsync(this /// is null. public static Response ValidateProbe(this SubscriptionResource subscriptionResource, ValidateProbeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateProbe(content, cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).ValidateProbe(content, cancellationToken); } /// @@ -619,13 +588,17 @@ public static Response ValidateProbe(this SubscriptionResou /// Profiles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProfilesAsync(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetProfilesAsync(cancellationToken); } /// @@ -640,13 +613,17 @@ public static AsyncPageable GetProfilesAsync(this SubscriptionR /// Profiles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProfiles(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetProfiles(cancellationToken); } /// @@ -661,13 +638,17 @@ public static Pageable GetProfiles(this SubscriptionResource su /// ResourceUsage_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceUsagesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceUsagesAsync(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetResourceUsagesAsync(cancellationToken); } /// @@ -682,13 +663,17 @@ public static AsyncPageable GetResourceUsagesAsync(this SubscriptionRe /// ResourceUsage_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceUsages(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceUsages(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetResourceUsages(cancellationToken); } /// @@ -703,13 +688,17 @@ public static Pageable GetResourceUsages(this SubscriptionResource sub /// ManagedRuleSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedRuleSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedRuleSetsAsync(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetManagedRuleSetsAsync(cancellationToken); } /// @@ -724,13 +713,17 @@ public static AsyncPageable GetManagedRuleSetsAsync(th /// ManagedRuleSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedRuleSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedRuleSets(cancellationToken); + return GetCdnSubscriptionMockingExtension(subscriptionResource).GetManagedRuleSets(cancellationToken); } /// @@ -745,6 +738,10 @@ public static Pageable GetManagedRuleSets(this Subscri /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -752,9 +749,7 @@ public static Pageable GetManagedRuleSets(this Subscri /// is null. public static async Task> CheckCdnNameAvailabilityAsync(this TenantResource tenantResource, CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckCdnNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCdnTenantMockingExtension(tenantResource).CheckCdnNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -769,6 +764,10 @@ public static async Task> CheckCdnNameAvaila /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -776,9 +775,7 @@ public static async Task> CheckCdnNameAvaila /// is null. public static Response CheckCdnNameAvailability(this TenantResource tenantResource, CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CheckCdnNameAvailability(content, cancellationToken); + return GetCdnTenantMockingExtension(tenantResource).CheckCdnNameAvailability(content, cancellationToken); } /// @@ -793,13 +790,17 @@ public static Response CheckCdnNameAvailability(this /// EdgeNodes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEdgeNodesAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetEdgeNodesAsync(cancellationToken); + return GetCdnTenantMockingExtension(tenantResource).GetEdgeNodesAsync(cancellationToken); } /// @@ -814,13 +815,17 @@ public static AsyncPageable GetEdgeNodesAsync(this TenantResource tena /// EdgeNodes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEdgeNodes(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetEdgeNodes(cancellationToken); + return GetCdnTenantMockingExtension(tenantResource).GetEdgeNodes(cancellationToken); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnResourceGroupMockingExtension.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..bd7ebd74670a --- /dev/null +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnResourceGroupMockingExtension.cs @@ -0,0 +1,221 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Cdn; +using Azure.ResourceManager.Cdn.Models; + +namespace Azure.ResourceManager.Cdn.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CdnResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _defaultClientDiagnostics; + private CdnManagementRestOperations _defaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected CdnResourceGroupMockingExtension() + { + } + + /// 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 CdnResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Cdn", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CdnManagementRestOperations DefaultRestClient => _defaultRestClient ??= new CdnManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ProfileResources in the ResourceGroupResource. + /// An object representing collection of ProfileResources and their operations over a ProfileResource. + public virtual ProfileCollection GetProfiles() + { + return GetCachedClient(client => new ProfileCollection(client, Id)); + } + + /// + /// Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName} + /// + /// + /// Operation Id + /// Profiles_Get + /// + /// + /// + /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProfileAsync(string profileName, CancellationToken cancellationToken = default) + { + return await GetProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName} + /// + /// + /// Operation Id + /// Profiles_Get + /// + /// + /// + /// Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProfile(string profileName, CancellationToken cancellationToken = default) + { + return GetProfiles().Get(profileName, cancellationToken); + } + + /// Gets a collection of CdnWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// An object representing collection of CdnWebApplicationFirewallPolicyResources and their operations over a CdnWebApplicationFirewallPolicyResource. + public virtual CdnWebApplicationFirewallPolicyCollection GetCdnWebApplicationFirewallPolicies() + { + return GetCachedClient(client => new CdnWebApplicationFirewallPolicyCollection(client, Id)); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// Policies_Get + /// + /// + /// + /// The name of the CdnWebApplicationFirewallPolicy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCdnWebApplicationFirewallPolicyAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetCdnWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// Policies_Get + /// + /// + /// + /// The name of the CdnWebApplicationFirewallPolicy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCdnWebApplicationFirewallPolicy(string policyName, CancellationToken cancellationToken = default) + { + return GetCdnWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + } + + /// + /// Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability + /// + /// + /// Operation Id + /// CheckEndpointNameAvailability + /// + /// + /// + /// Input to check. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckEndpointNameAvailabilityAsync(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnResourceGroupMockingExtension.CheckEndpointNameAvailability"); + scope.Start(); + try + { + var response = await DefaultRestClient.CheckEndpointNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability + /// + /// + /// Operation Id + /// CheckEndpointNameAvailability + /// + /// + /// + /// Input to check. + /// The cancellation token to use. + /// is null. + public virtual Response CheckEndpointNameAvailability(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnResourceGroupMockingExtension.CheckEndpointNameAvailability"); + scope.Start(); + try + { + var response = DefaultRestClient.CheckEndpointNameAvailability(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnSubscriptionMockingExtension.cs similarity index 89% rename from sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnSubscriptionMockingExtension.cs index 277cbfe600a8..0e73664c8c39 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Cdn; using Azure.ResourceManager.Cdn.Models; -namespace Azure.ResourceManager.Cdn +namespace Azure.ResourceManager.Cdn.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CdnSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private CdnManagementRestOperations _defaultRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _managedRuleSetsClientDiagnostics; private ManagedRuleSetsRestOperations _managedRuleSetsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CdnSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CdnSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,9 +72,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckCdnNameAvailabilityWithSubscriptionAsync(CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCdnNameAvailabilityWithSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnSubscriptionMockingExtension.CheckCdnNameAvailabilityWithSubscription"); scope.Start(); try { @@ -102,9 +106,12 @@ public virtual async Task> CheckCdnNameAvail /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response CheckCdnNameAvailabilityWithSubscription(CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCdnNameAvailabilityWithSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnSubscriptionMockingExtension.CheckCdnNameAvailabilityWithSubscription"); scope.Start(); try { @@ -133,9 +140,12 @@ public virtual Response CheckCdnNameAvailabilityWithS /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateProbeAsync(ValidateProbeContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProbe"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnSubscriptionMockingExtension.ValidateProbe"); scope.Start(); try { @@ -164,9 +174,12 @@ public virtual async Task> ValidateProbeAsync(Vali /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response ValidateProbe(ValidateProbeContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProbe"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnSubscriptionMockingExtension.ValidateProbe"); scope.Start(); try { @@ -199,7 +212,7 @@ public virtual AsyncPageable GetProfilesAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => ProfileRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProfileRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProfileResource(Client, ProfileData.DeserializeProfileData(e)), ProfileClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProfileResource(Client, ProfileData.DeserializeProfileData(e)), ProfileClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetProfiles", "value", "nextLink", cancellationToken); } /// @@ -221,7 +234,7 @@ public virtual Pageable GetProfiles(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ProfileRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProfileRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProfileResource(Client, ProfileData.DeserializeProfileData(e)), ProfileClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProfileResource(Client, ProfileData.DeserializeProfileData(e)), ProfileClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetProfiles", "value", "nextLink", cancellationToken); } /// @@ -243,7 +256,7 @@ public virtual AsyncPageable GetResourceUsagesAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceUsageRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceUsageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CdnUsage.DeserializeCdnUsage, ResourceUsageClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CdnUsage.DeserializeCdnUsage, ResourceUsageClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetResourceUsages", "value", "nextLink", cancellationToken); } /// @@ -265,7 +278,7 @@ public virtual Pageable GetResourceUsages(CancellationToken cancellati { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceUsageRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceUsageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CdnUsage.DeserializeCdnUsage, ResourceUsageClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CdnUsage.DeserializeCdnUsage, ResourceUsageClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetResourceUsages", "value", "nextLink", cancellationToken); } /// @@ -287,7 +300,7 @@ public virtual AsyncPageable GetManagedRuleSetsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedRuleSetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedRuleSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedRuleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetManagedRuleSets", "value", "nextLink", cancellationToken); } /// @@ -309,7 +322,7 @@ public virtual Pageable GetManagedRuleSets(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedRuleSetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedRuleSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedRuleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "CdnSubscriptionMockingExtension.GetManagedRuleSets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnTenantMockingExtension.cs similarity index 86% rename from sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnTenantMockingExtension.cs index 979ac5c9565a..7a14751b5e34 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/CdnTenantMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Cdn; using Azure.ResourceManager.Cdn.Models; -namespace Azure.ResourceManager.Cdn +namespace Azure.ResourceManager.Cdn.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class CdnTenantMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private CdnManagementRestOperations _defaultRestClient; private ClientDiagnostics _edgeNodesClientDiagnostics; private EdgeNodesRestOperations _edgeNodesRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CdnTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CdnTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,9 +64,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckCdnNameAvailabilityAsync(CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckCdnNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnTenantMockingExtension.CheckCdnNameAvailability"); scope.Start(); try { @@ -94,9 +98,12 @@ public virtual async Task> CheckCdnNameAvail /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response CheckCdnNameAvailability(CdnNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckCdnNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CdnTenantMockingExtension.CheckCdnNameAvailability"); scope.Start(); try { @@ -129,7 +136,7 @@ public virtual AsyncPageable GetEdgeNodesAsync(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeNodesRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeNodesRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EdgeNode.DeserializeEdgeNode, EdgeNodesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetEdgeNodes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EdgeNode.DeserializeEdgeNode, EdgeNodesClientDiagnostics, Pipeline, "CdnTenantMockingExtension.GetEdgeNodes", "value", "nextLink", cancellationToken); } /// @@ -151,7 +158,7 @@ public virtual Pageable GetEdgeNodes(CancellationToken cancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeNodesRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeNodesRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EdgeNode.DeserializeEdgeNode, EdgeNodesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetEdgeNodes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EdgeNode.DeserializeEdgeNode, EdgeNodesClientDiagnostics, Pipeline, "CdnTenantMockingExtension.GetEdgeNodes", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 96fe20d50a77..000000000000 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,122 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Cdn.Models; - -namespace Azure.ResourceManager.Cdn -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _defaultClientDiagnostics; - private CdnManagementRestOperations _defaultRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Cdn", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private CdnManagementRestOperations DefaultRestClient => _defaultRestClient ??= new CdnManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ProfileResources in the ResourceGroupResource. - /// An object representing collection of ProfileResources and their operations over a ProfileResource. - public virtual ProfileCollection GetProfiles() - { - return GetCachedClient(Client => new ProfileCollection(Client, Id)); - } - - /// Gets a collection of CdnWebApplicationFirewallPolicyResources in the ResourceGroupResource. - /// An object representing collection of CdnWebApplicationFirewallPolicyResources and their operations over a CdnWebApplicationFirewallPolicyResource. - public virtual CdnWebApplicationFirewallPolicyCollection GetCdnWebApplicationFirewallPolicies() - { - return GetCachedClient(Client => new CdnWebApplicationFirewallPolicyCollection(Client, Id)); - } - - /// - /// Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability - /// - /// - /// Operation Id - /// CheckEndpointNameAvailability - /// - /// - /// - /// Input to check. - /// The cancellation token to use. - public virtual async Task> CheckEndpointNameAvailabilityAsync(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckEndpointNameAvailability"); - scope.Start(); - try - { - var response = await DefaultRestClient.CheckEndpointNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability - /// - /// - /// Operation Id - /// CheckEndpointNameAvailability - /// - /// - /// - /// Input to check. - /// The cancellation token to use. - public virtual Response CheckEndpointNameAvailability(EndpointNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckEndpointNameAvailability"); - scope.Start(); - try - { - var response = DefaultRestClient.CheckEndpointNameAvailability(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs index 0444fa36d6a3..d53e72392145 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorEndpointResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontDoorRouteResources and their operations over a FrontDoorRouteResource. public virtual FrontDoorRouteCollection GetFrontDoorRoutes() { - return GetCachedClient(Client => new FrontDoorRouteCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorRouteCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual FrontDoorRouteCollection GetFrontDoorRoutes() /// /// Name of the routing rule. /// The cancellation token to use. - /// 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> GetFrontDoorRouteAsync(string routeName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetFrontDoorRouteAsy /// /// Name of the routing rule. /// The cancellation token to use. - /// 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 GetFrontDoorRoute(string routeName, CancellationToken cancellationToken = default) { diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs index 7f21e219876a..6c83fb960687 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorOriginGroupResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontDoorOriginResources and their operations over a FrontDoorOriginResource. public virtual FrontDoorOriginCollection GetFrontDoorOrigins() { - return GetCachedClient(Client => new FrontDoorOriginCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorOriginCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual FrontDoorOriginCollection GetFrontDoorOrigins() /// /// Name of the origin which is unique within the profile. /// The cancellation token to use. - /// 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> GetFrontDoorOriginAsync(string originName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetFrontDoorOriginA /// /// Name of the origin which is unique within the profile. /// The cancellation token to use. - /// 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 GetFrontDoorOrigin(string originName, CancellationToken cancellationToken = default) { diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs index 28a5a3bd0609..3b64c5868655 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/FrontDoorRuleSetResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontDoorRuleResources and their operations over a FrontDoorRuleResource. public virtual FrontDoorRuleCollection GetFrontDoorRules() { - return GetCachedClient(Client => new FrontDoorRuleCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorRuleCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual FrontDoorRuleCollection GetFrontDoorRules() /// /// Name of the delivery rule which is unique within the endpoint. /// The cancellation token to use. - /// 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> GetFrontDoorRuleAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetFrontDoorRuleAsync /// /// Name of the delivery rule which is unique within the endpoint. /// The cancellation token to use. - /// 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 GetFrontDoorRule(string ruleName, CancellationToken cancellationToken = default) { diff --git a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs index 1895bb6d9b09..d134331f4361 100644 --- a/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs +++ b/sdk/cdn/Azure.ResourceManager.Cdn/src/Generated/ProfileResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontDoorCustomDomainResources and their operations over a FrontDoorCustomDomainResource. public virtual FrontDoorCustomDomainCollection GetFrontDoorCustomDomains() { - return GetCachedClient(Client => new FrontDoorCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorCustomDomainCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual FrontDoorCustomDomainCollection GetFrontDoorCustomDomains() /// /// Name of the domain under the profile which is unique globally. /// The cancellation token to use. - /// 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> GetFrontDoorCustomDomainAsync(string customDomainName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> GetFrontDoorC /// /// Name of the domain under the profile which is unique globally. /// The cancellation token to use. - /// 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 GetFrontDoorCustomDomain(string customDomainName, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual Response GetFrontDoorCustomDomain( /// An object representing collection of FrontDoorEndpointResources and their operations over a FrontDoorEndpointResource. public virtual FrontDoorEndpointCollection GetFrontDoorEndpoints() { - return GetCachedClient(Client => new FrontDoorEndpointCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorEndpointCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual FrontDoorEndpointCollection GetFrontDoorEndpoints() /// /// Name of the endpoint under the profile which is unique globally. /// The cancellation token to use. - /// 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> GetFrontDoorEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task> GetFrontDoorEndpo /// /// Name of the endpoint under the profile which is unique globally. /// The cancellation token to use. - /// 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 GetFrontDoorEndpoint(string endpointName, CancellationToken cancellationToken = default) { @@ -208,7 +208,7 @@ public virtual Response GetFrontDoorEndpoint(string e /// An object representing collection of FrontDoorOriginGroupResources and their operations over a FrontDoorOriginGroupResource. public virtual FrontDoorOriginGroupCollection GetFrontDoorOriginGroups() { - return GetCachedClient(Client => new FrontDoorOriginGroupCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorOriginGroupCollection(client, Id)); } /// @@ -226,8 +226,8 @@ public virtual FrontDoorOriginGroupCollection GetFrontDoorOriginGroups() /// /// Name of the origin group which is unique within the endpoint. /// The cancellation token to use. - /// 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> GetFrontDoorOriginGroupAsync(string originGroupName, CancellationToken cancellationToken = default) { @@ -249,8 +249,8 @@ public virtual async Task> GetFrontDoorOr /// /// Name of the origin group which is unique within the endpoint. /// The cancellation token to use. - /// 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 GetFrontDoorOriginGroup(string originGroupName, CancellationToken cancellationToken = default) { @@ -261,7 +261,7 @@ public virtual Response GetFrontDoorOriginGroup(st /// An object representing collection of FrontDoorRuleSetResources and their operations over a FrontDoorRuleSetResource. public virtual FrontDoorRuleSetCollection GetFrontDoorRuleSets() { - return GetCachedClient(Client => new FrontDoorRuleSetCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorRuleSetCollection(client, Id)); } /// @@ -279,8 +279,8 @@ public virtual FrontDoorRuleSetCollection GetFrontDoorRuleSets() /// /// Name of the rule set under the profile which is unique globally. /// The cancellation token to use. - /// 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> GetFrontDoorRuleSetAsync(string ruleSetName, CancellationToken cancellationToken = default) { @@ -302,8 +302,8 @@ public virtual async Task> GetFrontDoorRuleSe /// /// Name of the rule set under the profile which is unique globally. /// The cancellation token to use. - /// 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 GetFrontDoorRuleSet(string ruleSetName, CancellationToken cancellationToken = default) { @@ -314,7 +314,7 @@ public virtual Response GetFrontDoorRuleSet(string rul /// An object representing collection of FrontDoorSecurityPolicyResources and their operations over a FrontDoorSecurityPolicyResource. public virtual FrontDoorSecurityPolicyCollection GetFrontDoorSecurityPolicies() { - return GetCachedClient(Client => new FrontDoorSecurityPolicyCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorSecurityPolicyCollection(client, Id)); } /// @@ -332,8 +332,8 @@ public virtual FrontDoorSecurityPolicyCollection GetFrontDoorSecurityPolicies() /// /// Name of the security policy under the profile. /// The cancellation token to use. - /// 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> GetFrontDoorSecurityPolicyAsync(string securityPolicyName, CancellationToken cancellationToken = default) { @@ -355,8 +355,8 @@ public virtual async Task> GetFrontDoo /// /// Name of the security policy under the profile. /// The cancellation token to use. - /// 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 GetFrontDoorSecurityPolicy(string securityPolicyName, CancellationToken cancellationToken = default) { @@ -367,7 +367,7 @@ public virtual Response GetFrontDoorSecurityPol /// An object representing collection of FrontDoorSecretResources and their operations over a FrontDoorSecretResource. public virtual FrontDoorSecretCollection GetFrontDoorSecrets() { - return GetCachedClient(Client => new FrontDoorSecretCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorSecretCollection(client, Id)); } /// @@ -385,8 +385,8 @@ public virtual FrontDoorSecretCollection GetFrontDoorSecrets() /// /// Name of the Secret under the profile. /// The cancellation token to use. - /// 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> GetFrontDoorSecretAsync(string secretName, CancellationToken cancellationToken = default) { @@ -408,8 +408,8 @@ public virtual async Task> GetFrontDoorSecretA /// /// Name of the Secret under the profile. /// The cancellation token to use. - /// 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 GetFrontDoorSecret(string secretName, CancellationToken cancellationToken = default) { @@ -420,7 +420,7 @@ public virtual Response GetFrontDoorSecret(string secre /// An object representing collection of CdnEndpointResources and their operations over a CdnEndpointResource. public virtual CdnEndpointCollection GetCdnEndpoints() { - return GetCachedClient(Client => new CdnEndpointCollection(Client, Id)); + return GetCachedClient(client => new CdnEndpointCollection(client, Id)); } /// @@ -438,8 +438,8 @@ public virtual CdnEndpointCollection GetCdnEndpoints() /// /// Name of the endpoint under the profile which is unique globally. /// The cancellation token to use. - /// 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> GetCdnEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -461,8 +461,8 @@ public virtual async Task> GetCdnEndpointAsync(str /// /// Name of the endpoint under the profile which is unique globally. /// The cancellation token to use. - /// 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 GetCdnEndpoint(string endpointName, CancellationToken cancellationToken = default) { diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisExtensions.cs b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisExtensions.cs index b9522805852b..20f198f693ec 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisExtensions.cs +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisExtensions.cs @@ -8,8 +8,8 @@ using System; using System.Threading; using Azure; -using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ChangeAnalysis.Mocking; using Azure.ResourceManager.ChangeAnalysis.Models; using Azure.ResourceManager.Resources; @@ -18,52 +18,19 @@ namespace Azure.ResourceManager.ChangeAnalysis /// A class to add extension methods to Azure.ResourceManager.ChangeAnalysis. public static partial class ChangeAnalysisExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ChangeAnalysisResourceGroupMockingExtension GetChangeAnalysisResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ChangeAnalysisResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ChangeAnalysisSubscriptionMockingExtension GetChangeAnalysisSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ChangeAnalysisSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ChangeAnalysisTenantMockingExtension GetChangeAnalysisTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ChangeAnalysisTenantMockingExtension(client, resource.Id)); } /// @@ -78,6 +45,10 @@ private static TenantResourceExtensionClient GetTenantResourceExtensionClient(Ar /// Changes_ListChangesByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specifies the start time of the changes request. @@ -87,7 +58,7 @@ private static TenantResourceExtensionClient GetTenantResourceExtensionClient(Ar /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetChangesByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetChangesByResourceGroupAsync(startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisResourceGroupMockingExtension(resourceGroupResource).GetChangesByResourceGroupAsync(startTime, endTime, skipToken, cancellationToken); } /// @@ -102,6 +73,10 @@ public static AsyncPageable GetChangesByResourceGroupAsync(t /// Changes_ListChangesByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specifies the start time of the changes request. @@ -111,7 +86,7 @@ public static AsyncPageable GetChangesByResourceGroupAsync(t /// A collection of that may take multiple service requests to iterate over. public static Pageable GetChangesByResourceGroup(this ResourceGroupResource resourceGroupResource, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetChangesByResourceGroup(startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisResourceGroupMockingExtension(resourceGroupResource).GetChangesByResourceGroup(startTime, endTime, skipToken, cancellationToken); } /// @@ -126,6 +101,10 @@ public static Pageable GetChangesByResourceGroup(this Resour /// Changes_ListChangesBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specifies the start time of the changes request. @@ -135,7 +114,7 @@ public static Pageable GetChangesByResourceGroup(this Resour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetChangesBySubscriptionAsync(this SubscriptionResource subscriptionResource, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetChangesBySubscriptionAsync(startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisSubscriptionMockingExtension(subscriptionResource).GetChangesBySubscriptionAsync(startTime, endTime, skipToken, cancellationToken); } /// @@ -150,6 +129,10 @@ public static AsyncPageable GetChangesBySubscriptionAsync(th /// Changes_ListChangesBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specifies the start time of the changes request. @@ -159,7 +142,7 @@ public static AsyncPageable GetChangesBySubscriptionAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetChangesBySubscription(this SubscriptionResource subscriptionResource, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetChangesBySubscription(startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisSubscriptionMockingExtension(subscriptionResource).GetChangesBySubscription(startTime, endTime, skipToken, cancellationToken); } /// @@ -174,6 +157,10 @@ public static Pageable GetChangesBySubscription(this Subscri /// ResourceChanges_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier of the resource. @@ -186,9 +173,7 @@ public static Pageable GetChangesBySubscription(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceChangesAsync(this TenantResource tenantResource, string resourceId, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceId, nameof(resourceId)); - - return GetTenantResourceExtensionClient(tenantResource).GetResourceChangesAsync(resourceId, startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisTenantMockingExtension(tenantResource).GetResourceChangesAsync(resourceId, startTime, endTime, skipToken, cancellationToken); } /// @@ -203,6 +188,10 @@ public static AsyncPageable GetResourceChangesAsync(this Ten /// ResourceChanges_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier of the resource. @@ -215,9 +204,7 @@ public static AsyncPageable GetResourceChangesAsync(this Ten /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceChanges(this TenantResource tenantResource, string resourceId, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceId, nameof(resourceId)); - - return GetTenantResourceExtensionClient(tenantResource).GetResourceChanges(resourceId, startTime, endTime, skipToken, cancellationToken); + return GetChangeAnalysisTenantMockingExtension(tenantResource).GetResourceChanges(resourceId, startTime, endTime, skipToken, cancellationToken); } } } diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisResourceGroupMockingExtension.cs similarity index 87% rename from sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisResourceGroupMockingExtension.cs index 1a781308b800..909a0a852d84 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisResourceGroupMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ChangeAnalysis; using Azure.ResourceManager.ChangeAnalysis.Models; -namespace Azure.ResourceManager.ChangeAnalysis +namespace Azure.ResourceManager.ChangeAnalysis.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class ChangeAnalysisResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _changesClientDiagnostics; private ChangesRestOperations _changesRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ChangeAnalysisResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChangeAnalysisResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetChangesByResourceGroupAsync( { HttpMessage FirstPageRequest(int? pageSizeHint) => ChangesRestClient.CreateListChangesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChangesRestClient.CreateListChangesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetChangesByResourceGroup", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ChangeAnalysisResourceGroupMockingExtension.GetChangesByResourceGroup", "value", "nextLink", cancellationToken); } /// @@ -90,7 +91,7 @@ public virtual Pageable GetChangesByResourceGroup(DateTimeOf { HttpMessage FirstPageRequest(int? pageSizeHint) => ChangesRestClient.CreateListChangesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChangesRestClient.CreateListChangesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetChangesByResourceGroup", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ChangeAnalysisResourceGroupMockingExtension.GetChangesByResourceGroup", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisSubscriptionMockingExtension.cs similarity index 86% rename from sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisSubscriptionMockingExtension.cs index 1e322024f133..82ef562f7ebf 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisSubscriptionMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ChangeAnalysis; using Azure.ResourceManager.ChangeAnalysis.Models; -namespace Azure.ResourceManager.ChangeAnalysis +namespace Azure.ResourceManager.ChangeAnalysis.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ChangeAnalysisSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _changesClientDiagnostics; private ChangesRestOperations _changesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ChangeAnalysisSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChangeAnalysisSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetChangesBySubscriptionAsync(D { HttpMessage FirstPageRequest(int? pageSizeHint) => ChangesRestClient.CreateListChangesBySubscriptionRequest(Id.SubscriptionId, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChangesRestClient.CreateListChangesBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetChangesBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ChangeAnalysisSubscriptionMockingExtension.GetChangesBySubscription", "value", "nextLink", cancellationToken); } /// @@ -90,7 +91,7 @@ public virtual Pageable GetChangesBySubscription(DateTimeOff { HttpMessage FirstPageRequest(int? pageSizeHint) => ChangesRestClient.CreateListChangesBySubscriptionRequest(Id.SubscriptionId, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChangesRestClient.CreateListChangesBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetChangesBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ChangesClientDiagnostics, Pipeline, "ChangeAnalysisSubscriptionMockingExtension.GetChangesBySubscription", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisTenantMockingExtension.cs similarity index 80% rename from sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisTenantMockingExtension.cs index 2b60242e5f21..36ca31932a4b 100644 --- a/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/src/Generated/Extensions/ChangeAnalysisTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ChangeAnalysis; using Azure.ResourceManager.ChangeAnalysis.Models; -namespace Azure.ResourceManager.ChangeAnalysis +namespace Azure.ResourceManager.ChangeAnalysis.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ChangeAnalysisTenantMockingExtension : ArmResource { private ClientDiagnostics _resourceChangesClientDiagnostics; private ResourceChangesRestOperations _resourceChangesRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ChangeAnalysisTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChangeAnalysisTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,12 +62,16 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Specifies the end time of the changes request. /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetResourceChangesAsync(string resourceId, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceId, nameof(resourceId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceChangesRestClient.CreateListRequest(resourceId, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceChangesRestClient.CreateListNextPageRequest(nextLink, resourceId, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ResourceChangesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetResourceChanges", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ResourceChangesClientDiagnostics, Pipeline, "ChangeAnalysisTenantMockingExtension.GetResourceChanges", "value", "nextLink", cancellationToken); } /// @@ -87,12 +92,16 @@ public virtual AsyncPageable GetResourceChangesAsync(string /// Specifies the end time of the changes request. /// A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetResourceChanges(string resourceId, DateTimeOffset startTime, DateTimeOffset endTime, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceId, nameof(resourceId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceChangesRestClient.CreateListRequest(resourceId, startTime, endTime, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceChangesRestClient.CreateListNextPageRequest(nextLink, resourceId, startTime, endTime, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ResourceChangesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetResourceChanges", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DetectedChangeData.DeserializeDetectedChangeData, ResourceChangesClientDiagnostics, Pipeline, "ChangeAnalysisTenantMockingExtension.GetResourceChanges", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ExperimentResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ExperimentResource.cs index dc58416ff238..07012ead71ab 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ExperimentResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ExperimentResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExperimentStatusResources and their operations over a ExperimentStatusResource. public virtual ExperimentStatusCollection GetExperimentStatuses() { - return GetCachedClient(Client => new ExperimentStatusCollection(Client, Id)); + return GetCachedClient(client => new ExperimentStatusCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ExperimentStatusCollection GetExperimentStatuses() /// /// GUID that represents a Experiment status. /// The cancellation token to use. - /// 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> GetExperimentStatusAsync(string statusId, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetExperimentStatu /// /// GUID that represents a Experiment status. /// The cancellation token to use. - /// 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 GetExperimentStatus(string statusId, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetExperimentStatus(string sta /// An object representing collection of ExperimentExecutionDetailResources and their operations over a ExperimentExecutionDetailResource. public virtual ExperimentExecutionDetailCollection GetExperimentExecutionDetails() { - return GetCachedClient(Client => new ExperimentExecutionDetailCollection(Client, Id)); + return GetCachedClient(client => new ExperimentExecutionDetailCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual ExperimentExecutionDetailCollection GetExperimentExecutionDetails /// /// GUID that represents a Experiment execution detail. /// The cancellation token to use. - /// 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> GetExperimentExecutionDetailAsync(string executionDetailsId, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> GetExperi /// /// GUID that represents a Experiment execution detail. /// The cancellation token to use. - /// 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 GetExperimentExecutionDetail(string executionDetailsId, CancellationToken cancellationToken = default) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosArmClientMockingExtension.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosArmClientMockingExtension.cs new file mode 100644 index 000000000000..97e1ce7dd1de --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Chaos; + +namespace Azure.ResourceManager.Chaos.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ChaosArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ChaosArmClientMockingExtension() + { + } + + /// 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 ChaosArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ChaosArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CapabilityResource GetCapabilityResource(ResourceIdentifier id) + { + CapabilityResource.ValidateResourceId(id); + return new CapabilityResource(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 CapabilityTypeResource GetCapabilityTypeResource(ResourceIdentifier id) + { + CapabilityTypeResource.ValidateResourceId(id); + return new CapabilityTypeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExperimentResource GetExperimentResource(ResourceIdentifier id) + { + ExperimentResource.ValidateResourceId(id); + return new ExperimentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExperimentStatusResource GetExperimentStatusResource(ResourceIdentifier id) + { + ExperimentStatusResource.ValidateResourceId(id); + return new ExperimentStatusResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExperimentExecutionDetailResource GetExperimentExecutionDetailResource(ResourceIdentifier id) + { + ExperimentExecutionDetailResource.ValidateResourceId(id); + return new ExperimentExecutionDetailResource(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 TargetTypeResource GetTargetTypeResource(ResourceIdentifier id) + { + TargetTypeResource.ValidateResourceId(id); + return new TargetTypeResource(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 TargetResource GetTargetResource(ResourceIdentifier id) + { + TargetResource.ValidateResourceId(id); + return new TargetResource(Client, id); + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs index f6b1db062998..ceec78134039 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Chaos.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Chaos @@ -18,176 +19,145 @@ namespace Azure.ResourceManager.Chaos /// A class to add extension methods to Azure.ResourceManager.Chaos. public static partial class ChaosExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ChaosArmClientMockingExtension GetChaosArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ChaosArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ChaosResourceGroupMockingExtension GetChaosResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ChaosResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ChaosSubscriptionMockingExtension GetChaosSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ChaosSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CapabilityResource /// /// 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. /// Returns a object. public static CapabilityResource GetCapabilityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CapabilityResource.ValidateResourceId(id); - return new CapabilityResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetCapabilityResource(id); } - #endregion - #region CapabilityTypeResource /// /// 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. /// Returns a object. public static CapabilityTypeResource GetCapabilityTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CapabilityTypeResource.ValidateResourceId(id); - return new CapabilityTypeResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetCapabilityTypeResource(id); } - #endregion - #region ExperimentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExperimentResource GetExperimentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExperimentResource.ValidateResourceId(id); - return new ExperimentResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetExperimentResource(id); } - #endregion - #region ExperimentStatusResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExperimentStatusResource GetExperimentStatusResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExperimentStatusResource.ValidateResourceId(id); - return new ExperimentStatusResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetExperimentStatusResource(id); } - #endregion - #region ExperimentExecutionDetailResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExperimentExecutionDetailResource GetExperimentExecutionDetailResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExperimentExecutionDetailResource.ValidateResourceId(id); - return new ExperimentExecutionDetailResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetExperimentExecutionDetailResource(id); } - #endregion - #region TargetTypeResource /// /// 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. /// Returns a object. public static TargetTypeResource GetTargetTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TargetTypeResource.ValidateResourceId(id); - return new TargetTypeResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetTargetTypeResource(id); } - #endregion - #region TargetResource /// /// 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. /// Returns a object. public static TargetResource GetTargetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TargetResource.ValidateResourceId(id); - return new TargetResource(client, id); - } - ); + return GetChaosArmClientMockingExtension(client).GetTargetResource(id); } - #endregion - /// Gets a collection of ExperimentResources in the ResourceGroupResource. + /// + /// Gets a collection of ExperimentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExperimentResources and their operations over a ExperimentResource. public static ExperimentCollection GetExperiments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExperiments(); + return GetChaosResourceGroupMockingExtension(resourceGroupResource).GetExperiments(); } /// @@ -202,16 +172,20 @@ public static ExperimentCollection GetExperiments(this ResourceGroupResource res /// Experiments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a Experiment resource name. /// The cancellation token to use. - /// 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 static async Task> GetExperimentAsync(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetExperiments().GetAsync(experimentName, cancellationToken).ConfigureAwait(false); + return await GetChaosResourceGroupMockingExtension(resourceGroupResource).GetExperimentAsync(experimentName, cancellationToken).ConfigureAwait(false); } /// @@ -226,33 +200,39 @@ public static async Task> GetExperimentAsync(this R /// Experiments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a Experiment resource name. /// The cancellation token to use. - /// 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 static Response GetExperiment(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetExperiments().Get(experimentName, cancellationToken); + return GetChaosResourceGroupMockingExtension(resourceGroupResource).GetExperiment(experimentName, cancellationToken); } - /// Gets a collection of TargetResources in the ResourceGroupResource. + /// + /// Gets a collection of TargetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// String that represents a resource provider namespace. /// String that represents a resource type. /// String that represents a resource name. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of TargetResources and their operations over a TargetResource. public static TargetCollection GetTargets(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName) { - Argument.AssertNotNullOrEmpty(parentProviderNamespace, nameof(parentProviderNamespace)); - Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); - Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTargets(parentProviderNamespace, parentResourceType, parentResourceName); + return GetChaosResourceGroupMockingExtension(resourceGroupResource).GetTargets(parentProviderNamespace, parentResourceType, parentResourceName); } /// @@ -267,6 +247,10 @@ public static TargetCollection GetTargets(this ResourceGroupResource resourceGro /// Targets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a resource provider namespace. @@ -274,12 +258,12 @@ public static TargetCollection GetTargets(this ResourceGroupResource resourceGro /// String that represents a resource name. /// String that represents a Target resource name. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetTargetAsync(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetTargets(parentProviderNamespace, parentResourceType, parentResourceName).GetAsync(targetName, cancellationToken).ConfigureAwait(false); + return await GetChaosResourceGroupMockingExtension(resourceGroupResource).GetTargetAsync(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken).ConfigureAwait(false); } /// @@ -294,6 +278,10 @@ public static async Task> GetTargetAsync(this ResourceG /// Targets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a resource provider namespace. @@ -301,25 +289,29 @@ public static async Task> GetTargetAsync(this ResourceG /// String that represents a resource name. /// String that represents a Target resource name. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetTarget(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetTargets(parentProviderNamespace, parentResourceType, parentResourceName).Get(targetName, cancellationToken); + return GetChaosResourceGroupMockingExtension(resourceGroupResource).GetTarget(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken); } - /// Gets a collection of TargetTypeResources in the SubscriptionResource. + /// + /// Gets a collection of TargetTypeResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// String that represents a Location resource name. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of TargetTypeResources and their operations over a TargetTypeResource. public static TargetTypeCollection GetTargetTypes(this SubscriptionResource subscriptionResource, string locationName) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTargetTypes(locationName); + return GetChaosSubscriptionMockingExtension(subscriptionResource).GetTargetTypes(locationName); } /// @@ -334,17 +326,21 @@ public static TargetTypeCollection GetTargetTypes(this SubscriptionResource subs /// TargetTypes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a Location resource name. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetTargetTypeAsync(this SubscriptionResource subscriptionResource, string locationName, string targetTypeName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetTargetTypes(locationName).GetAsync(targetTypeName, cancellationToken).ConfigureAwait(false); + return await GetChaosSubscriptionMockingExtension(subscriptionResource).GetTargetTypeAsync(locationName, targetTypeName, cancellationToken).ConfigureAwait(false); } /// @@ -359,17 +355,21 @@ public static async Task> GetTargetTypeAsync(this S /// TargetTypes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// String that represents a Location resource name. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetTargetType(this SubscriptionResource subscriptionResource, string locationName, string targetTypeName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetTargetTypes(locationName).Get(targetTypeName, cancellationToken); + return GetChaosSubscriptionMockingExtension(subscriptionResource).GetTargetType(locationName, targetTypeName, cancellationToken); } /// @@ -384,6 +384,10 @@ public static Response GetTargetType(this SubscriptionResour /// Experiments_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. @@ -392,7 +396,7 @@ public static Response GetTargetType(this SubscriptionResour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExperimentsAsync(this SubscriptionResource subscriptionResource, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExperimentsAsync(running, continuationToken, cancellationToken); + return GetChaosSubscriptionMockingExtension(subscriptionResource).GetExperimentsAsync(running, continuationToken, cancellationToken); } /// @@ -407,6 +411,10 @@ public static AsyncPageable GetExperimentsAsync(this Subscri /// Experiments_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. @@ -415,7 +423,7 @@ public static AsyncPageable GetExperimentsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExperiments(this SubscriptionResource subscriptionResource, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExperiments(running, continuationToken, cancellationToken); + return GetChaosSubscriptionMockingExtension(subscriptionResource).GetExperiments(running, continuationToken, cancellationToken); } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosResourceGroupMockingExtension.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..2074fb7b1fa6 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosResourceGroupMockingExtension.cs @@ -0,0 +1,156 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Chaos; + +namespace Azure.ResourceManager.Chaos.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ChaosResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ChaosResourceGroupMockingExtension() + { + } + + /// 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 ChaosResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ExperimentResources in the ResourceGroupResource. + /// An object representing collection of ExperimentResources and their operations over a ExperimentResource. + public virtual ExperimentCollection GetExperiments() + { + return GetCachedClient(client => new ExperimentCollection(client, Id)); + } + + /// + /// Get a Experiment resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// + /// + /// Operation Id + /// Experiments_Get + /// + /// + /// + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExperimentAsync(string experimentName, CancellationToken cancellationToken = default) + { + return await GetExperiments().GetAsync(experimentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Experiment resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// + /// + /// Operation Id + /// Experiments_Get + /// + /// + /// + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExperiment(string experimentName, CancellationToken cancellationToken = default) + { + return GetExperiments().Get(experimentName, cancellationToken); + } + + /// Gets a collection of TargetResources in the ResourceGroupResource. + /// String that represents a resource provider namespace. + /// String that represents a resource type. + /// String that represents a resource name. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of TargetResources and their operations over a TargetResource. + public virtual TargetCollection GetTargets(string parentProviderNamespace, string parentResourceType, string parentResourceName) + { + return new TargetCollection(Client, Id, parentProviderNamespace, parentResourceType, parentResourceName); + } + + /// + /// Get a Target resource that extends a tracked regional resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// + /// + /// Operation Id + /// Targets_Get + /// + /// + /// + /// String that represents a resource provider namespace. + /// String that represents a resource type. + /// String that represents a resource name. + /// String that represents a Target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTargetAsync(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + { + return await GetTargets(parentProviderNamespace, parentResourceType, parentResourceName).GetAsync(targetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Target resource that extends a tracked regional resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// + /// + /// Operation Id + /// Targets_Get + /// + /// + /// + /// String that represents a resource provider namespace. + /// String that represents a resource type. + /// String that represents a resource name. + /// String that represents a Target resource name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTarget(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + { + return GetTargets(parentProviderNamespace, parentResourceType, parentResourceName).Get(targetName, cancellationToken); + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosSubscriptionMockingExtension.cs similarity index 58% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosSubscriptionMockingExtension.cs index 6c32f2eb0fb8..d7b368491edc 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosSubscriptionMockingExtension.cs @@ -5,30 +5,33 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Chaos; -namespace Azure.ResourceManager.Chaos +namespace Azure.ResourceManager.Chaos.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ChaosSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _experimentClientDiagnostics; private ExperimentsRestOperations _experimentRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ChaosSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChaosSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -43,12 +46,62 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Gets a collection of TargetTypeResources in the SubscriptionResource. /// String that represents a Location resource name. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of TargetTypeResources and their operations over a TargetTypeResource. public virtual TargetTypeCollection GetTargetTypes(string locationName) { return new TargetTypeCollection(Client, Id, locationName); } + /// + /// Get a Target Type resources for given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// + /// + /// Operation Id + /// TargetTypes_Get + /// + /// + /// + /// String that represents a Location resource name. + /// String that represents a Target Type resource name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTargetTypeAsync(string locationName, string targetTypeName, CancellationToken cancellationToken = default) + { + return await GetTargetTypes(locationName).GetAsync(targetTypeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Target Type resources for given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// + /// + /// Operation Id + /// TargetTypes_Get + /// + /// + /// + /// String that represents a Location resource name. + /// String that represents a Target Type resource name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTargetType(string locationName, string targetTypeName, CancellationToken cancellationToken = default) + { + return GetTargetTypes(locationName).Get(targetTypeName, cancellationToken); + } + /// /// Get a list of Experiment resources in a subscription. /// @@ -70,7 +123,7 @@ public virtual AsyncPageable GetExperimentsAsync(bool? runni { HttpMessage FirstPageRequest(int? pageSizeHint) => ExperimentRestClient.CreateListAllRequest(Id.SubscriptionId, running, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExperimentRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId, running, continuationToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExperimentResource(Client, ExperimentData.DeserializeExperimentData(e)), ExperimentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExperiments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExperimentResource(Client, ExperimentData.DeserializeExperimentData(e)), ExperimentClientDiagnostics, Pipeline, "ChaosSubscriptionMockingExtension.GetExperiments", "value", "nextLink", cancellationToken); } /// @@ -94,7 +147,7 @@ public virtual Pageable GetExperiments(bool? running = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => ExperimentRestClient.CreateListAllRequest(Id.SubscriptionId, running, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExperimentRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId, running, continuationToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExperimentResource(Client, ExperimentData.DeserializeExperimentData(e)), ExperimentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExperiments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExperimentResource(Client, ExperimentData.DeserializeExperimentData(e)), ExperimentClientDiagnostics, Pipeline, "ChaosSubscriptionMockingExtension.GetExperiments", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 74cc3789b98b..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Chaos -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ExperimentResources in the ResourceGroupResource. - /// An object representing collection of ExperimentResources and their operations over a ExperimentResource. - public virtual ExperimentCollection GetExperiments() - { - return GetCachedClient(Client => new ExperimentCollection(Client, Id)); - } - - /// Gets a collection of TargetResources in the ResourceGroupResource. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// An object representing collection of TargetResources and their operations over a TargetResource. - public virtual TargetCollection GetTargets(string parentProviderNamespace, string parentResourceType, string parentResourceName) - { - return new TargetCollection(Client, Id, parentProviderNamespace, parentResourceType, parentResourceName); - } - } -} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetResource.cs index d88d43085bd8..023e35bf0b9a 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CapabilityResources and their operations over a CapabilityResource. public virtual CapabilityCollection GetCapabilities() { - return GetCachedClient(Client => new CapabilityCollection(Client, Id)); + return GetCachedClient(client => new CapabilityCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual CapabilityCollection GetCapabilities() /// /// String that represents a Capability resource name. /// The cancellation token to use. - /// 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> GetCapabilityAsync(string capabilityName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetCapabilityAsync(strin /// /// String that represents a Capability resource name. /// The cancellation token to use. - /// 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 GetCapability(string capabilityName, CancellationToken cancellationToken = default) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetTypeResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetTypeResource.cs index 4e9fe2287eb7..937ed326730e 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetTypeResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/TargetTypeResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CapabilityTypeResources and their operations over a CapabilityTypeResource. public virtual CapabilityTypeCollection GetCapabilityTypes() { - return GetCachedClient(Client => new CapabilityTypeCollection(Client, Id)); + return GetCachedClient(client => new CapabilityTypeCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual CapabilityTypeCollection GetCapabilityTypes() /// /// String that represents a Capability Type resource name. /// The cancellation token to use. - /// 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> GetCapabilityTypeAsync(string capabilityTypeName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetCapabilityTypeAsy /// /// String that represents a Capability Type resource name. /// The cancellation token to use. - /// 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 GetCapabilityType(string capabilityTypeName, CancellationToken cancellationToken = default) { diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs index c6ae32bd1ca9..911e1dafca77 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CognitiveServicesPrivateEndpointConnectionResources and their operations over a CognitiveServicesPrivateEndpointConnectionResource. public virtual CognitiveServicesPrivateEndpointConnectionCollection GetCognitiveServicesPrivateEndpointConnections() { - return GetCachedClient(Client => new CognitiveServicesPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new CognitiveServicesPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual CognitiveServicesPrivateEndpointConnectionCollection GetCognitive /// /// The name of the private endpoint connection associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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> GetCognitiveServicesPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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 GetCognitiveServicesPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetC /// An object representing collection of CognitiveServicesAccountDeploymentResources and their operations over a CognitiveServicesAccountDeploymentResource. public virtual CognitiveServicesAccountDeploymentCollection GetCognitiveServicesAccountDeployments() { - return GetCachedClient(Client => new CognitiveServicesAccountDeploymentCollection(Client, Id)); + return GetCachedClient(client => new CognitiveServicesAccountDeploymentCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual CognitiveServicesAccountDeploymentCollection GetCognitiveServices /// /// The name of the deployment associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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> GetCognitiveServicesAccountDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> /// /// The name of the deployment associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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 GetCognitiveServicesAccountDeployment(string deploymentName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetCognitive /// An object representing collection of CommitmentPlanResources and their operations over a CommitmentPlanResource. public virtual CommitmentPlanCollection GetCommitmentPlans() { - return GetCachedClient(Client => new CommitmentPlanCollection(Client, Id)); + return GetCachedClient(client => new CommitmentPlanCollection(client, Id)); } /// @@ -222,8 +222,8 @@ public virtual CommitmentPlanCollection GetCommitmentPlans() /// /// The name of the commitmentPlan associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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> GetCommitmentPlanAsync(string commitmentPlanName, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task> GetCommitmentPlanAsy /// /// The name of the commitmentPlan associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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 GetCommitmentPlan(string commitmentPlanName, CancellationToken cancellationToken = default) { diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs index 229e7da09c57..8e9518f93699 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CommitmentPlanAccountAssociationResources and their operations over a CommitmentPlanAccountAssociationResource. public virtual CommitmentPlanAccountAssociationCollection GetCommitmentPlanAccountAssociations() { - return GetCachedClient(Client => new CommitmentPlanAccountAssociationCollection(Client, Id)); + return GetCachedClient(client => new CommitmentPlanAccountAssociationCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CommitmentPlanAccountAssociationCollection GetCommitmentPlanAccou /// /// The name of the commitment plan association with the Cognitive Services Account. /// The cancellation token to use. - /// 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> GetCommitmentPlanAccountAssociationAsync(string commitmentPlanAssociationName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// The name of the commitment plan association with the Cognitive Services Account. /// The cancellation token to use. - /// 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 GetCommitmentPlanAccountAssociation(string commitmentPlanAssociationName, CancellationToken cancellationToken = default) { diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesArmClientMockingExtension.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..300a6960acd0 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CognitiveServices; + +namespace Azure.ResourceManager.CognitiveServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CognitiveServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CognitiveServicesArmClientMockingExtension() + { + } + + /// 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 CognitiveServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CognitiveServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CognitiveServicesAccountResource GetCognitiveServicesAccountResource(ResourceIdentifier id) + { + CognitiveServicesAccountResource.ValidateResourceId(id); + return new CognitiveServicesAccountResource(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 CognitiveServicesDeletedAccountResource GetCognitiveServicesDeletedAccountResource(ResourceIdentifier id) + { + CognitiveServicesDeletedAccountResource.ValidateResourceId(id); + return new CognitiveServicesDeletedAccountResource(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 CognitiveServicesPrivateEndpointConnectionResource GetCognitiveServicesPrivateEndpointConnectionResource(ResourceIdentifier id) + { + CognitiveServicesPrivateEndpointConnectionResource.ValidateResourceId(id); + return new CognitiveServicesPrivateEndpointConnectionResource(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 CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(ResourceIdentifier id) + { + CognitiveServicesAccountDeploymentResource.ValidateResourceId(id); + return new CognitiveServicesAccountDeploymentResource(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 CommitmentPlanResource GetCommitmentPlanResource(ResourceIdentifier id) + { + CommitmentPlanResource.ValidateResourceId(id); + return new CommitmentPlanResource(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 CognitiveServicesCommitmentPlanResource GetCognitiveServicesCommitmentPlanResource(ResourceIdentifier id) + { + CognitiveServicesCommitmentPlanResource.ValidateResourceId(id); + return new CognitiveServicesCommitmentPlanResource(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 CommitmentPlanAccountAssociationResource GetCommitmentPlanAccountAssociationResource(ResourceIdentifier id) + { + CommitmentPlanAccountAssociationResource.ValidateResourceId(id); + return new CommitmentPlanAccountAssociationResource(Client, id); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs index ea024c743dd1..eda7d0b72bd5 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.CognitiveServices.Mocking; using Azure.ResourceManager.CognitiveServices.Models; using Azure.ResourceManager.Resources; @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.CognitiveServices /// A class to add extension methods to Azure.ResourceManager.CognitiveServices. public static partial class CognitiveServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CognitiveServicesArmClientMockingExtension GetCognitiveServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CognitiveServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CognitiveServicesResourceGroupMockingExtension GetCognitiveServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CognitiveServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CognitiveServicesSubscriptionMockingExtension GetCognitiveServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CognitiveServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CognitiveServicesAccountResource /// /// 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. /// Returns a object. public static CognitiveServicesAccountResource GetCognitiveServicesAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CognitiveServicesAccountResource.ValidateResourceId(id); - return new CognitiveServicesAccountResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCognitiveServicesAccountResource(id); } - #endregion - #region CognitiveServicesDeletedAccountResource /// /// 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. /// Returns a object. public static CognitiveServicesDeletedAccountResource GetCognitiveServicesDeletedAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CognitiveServicesDeletedAccountResource.ValidateResourceId(id); - return new CognitiveServicesDeletedAccountResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCognitiveServicesDeletedAccountResource(id); } - #endregion - #region CognitiveServicesPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static CognitiveServicesPrivateEndpointConnectionResource GetCognitiveServicesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CognitiveServicesPrivateEndpointConnectionResource.ValidateResourceId(id); - return new CognitiveServicesPrivateEndpointConnectionResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCognitiveServicesPrivateEndpointConnectionResource(id); } - #endregion - #region CognitiveServicesAccountDeploymentResource /// /// 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. /// Returns a object. public static CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CognitiveServicesAccountDeploymentResource.ValidateResourceId(id); - return new CognitiveServicesAccountDeploymentResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCognitiveServicesAccountDeploymentResource(id); } - #endregion - #region CommitmentPlanResource /// /// 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. /// Returns a object. public static CommitmentPlanResource GetCommitmentPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommitmentPlanResource.ValidateResourceId(id); - return new CommitmentPlanResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCommitmentPlanResource(id); } - #endregion - #region CognitiveServicesCommitmentPlanResource /// /// 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. /// Returns a object. public static CognitiveServicesCommitmentPlanResource GetCognitiveServicesCommitmentPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CognitiveServicesCommitmentPlanResource.ValidateResourceId(id); - return new CognitiveServicesCommitmentPlanResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCognitiveServicesCommitmentPlanResource(id); } - #endregion - #region CommitmentPlanAccountAssociationResource /// /// 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. /// Returns a object. public static CommitmentPlanAccountAssociationResource GetCommitmentPlanAccountAssociationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommitmentPlanAccountAssociationResource.ValidateResourceId(id); - return new CommitmentPlanAccountAssociationResource(client, id); - } - ); + return GetCognitiveServicesArmClientMockingExtension(client).GetCommitmentPlanAccountAssociationResource(id); } - #endregion - /// Gets a collection of CognitiveServicesAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of CognitiveServicesAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CognitiveServicesAccountResources and their operations over a CognitiveServicesAccountResource. public static CognitiveServicesAccountCollection GetCognitiveServicesAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCognitiveServicesAccounts(); + return GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesAccounts(); } /// @@ -203,16 +173,20 @@ public static CognitiveServicesAccountCollection GetCognitiveServicesAccounts(th /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Cognitive Services account. /// The cancellation token to use. - /// 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 static async Task> GetCognitiveServicesAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCognitiveServicesAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -227,24 +201,34 @@ public static async Task> GetCognitiv /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Cognitive Services account. /// The cancellation token to use. - /// 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 static Response GetCognitiveServicesAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCognitiveServicesAccounts().Get(accountName, cancellationToken); + return GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesAccount(accountName, cancellationToken); } - /// Gets a collection of CognitiveServicesCommitmentPlanResources in the ResourceGroupResource. + /// + /// Gets a collection of CognitiveServicesCommitmentPlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CognitiveServicesCommitmentPlanResources and their operations over a CognitiveServicesCommitmentPlanResource. public static CognitiveServicesCommitmentPlanCollection GetCognitiveServicesCommitmentPlans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCognitiveServicesCommitmentPlans(); + return GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesCommitmentPlans(); } /// @@ -259,16 +243,20 @@ public static CognitiveServicesCommitmentPlanCollection GetCognitiveServicesComm /// CommitmentPlans_GetPlan /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the commitmentPlan associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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 static async Task> GetCognitiveServicesCommitmentPlanAsync(this ResourceGroupResource resourceGroupResource, string commitmentPlanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCognitiveServicesCommitmentPlans().GetAsync(commitmentPlanName, cancellationToken).ConfigureAwait(false); + return await GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesCommitmentPlanAsync(commitmentPlanName, cancellationToken).ConfigureAwait(false); } /// @@ -283,24 +271,34 @@ public static async Task> GetC /// CommitmentPlans_GetPlan /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the commitmentPlan associated with the Cognitive Services Account. /// The cancellation token to use. - /// 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 static Response GetCognitiveServicesCommitmentPlan(this ResourceGroupResource resourceGroupResource, string commitmentPlanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCognitiveServicesCommitmentPlans().Get(commitmentPlanName, cancellationToken); + return GetCognitiveServicesResourceGroupMockingExtension(resourceGroupResource).GetCognitiveServicesCommitmentPlan(commitmentPlanName, cancellationToken); } - /// Gets a collection of CognitiveServicesDeletedAccountResources in the SubscriptionResource. + /// + /// Gets a collection of CognitiveServicesDeletedAccountResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CognitiveServicesDeletedAccountResources and their operations over a CognitiveServicesDeletedAccountResource. public static CognitiveServicesDeletedAccountCollection GetCognitiveServicesDeletedAccounts(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCognitiveServicesDeletedAccounts(); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesDeletedAccounts(); } /// @@ -315,18 +313,22 @@ public static CognitiveServicesDeletedAccountCollection GetCognitiveServicesDele /// DeletedAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The name of the resource group. The name is case insensitive. /// The name of Cognitive Services account. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetCognitiveServicesDeletedAccountAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetCognitiveServicesDeletedAccounts().GetAsync(location, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + return await GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesDeletedAccountAsync(location, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); } /// @@ -341,18 +343,22 @@ public static async Task> GetC /// DeletedAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The name of the resource group. The name is case insensitive. /// The name of Cognitive Services account. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetCognitiveServicesDeletedAccount(this SubscriptionResource subscriptionResource, AzureLocation location, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCognitiveServicesDeletedAccounts().Get(location, resourceGroupName, accountName, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesDeletedAccount(location, resourceGroupName, accountName, cancellationToken); } /// @@ -367,13 +373,17 @@ public static Response GetCognitiveServ /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCognitiveServicesAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCognitiveServicesAccountsAsync(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesAccountsAsync(cancellationToken); } /// @@ -388,13 +398,17 @@ public static AsyncPageable GetCognitiveServic /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCognitiveServicesAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCognitiveServicesAccounts(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesAccounts(cancellationToken); } /// @@ -409,13 +423,17 @@ public static Pageable GetCognitiveServicesAcc /// DeletedAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAccountsAsync(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetDeletedAccountsAsync(cancellationToken); } /// @@ -430,13 +448,17 @@ public static AsyncPageable GetDeletedA /// DeletedAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAccounts(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetDeletedAccounts(cancellationToken); } /// @@ -451,13 +473,17 @@ public static Pageable GetDeletedAccoun /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceSkusAsync(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetResourceSkusAsync(cancellationToken); } /// @@ -472,13 +498,17 @@ public static AsyncPageable GetResourceSkusAsync( /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceSkus(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetResourceSkus(cancellationToken); } /// @@ -493,6 +523,10 @@ public static Pageable GetResourceSkus(this Subsc /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -501,7 +535,7 @@ public static Pageable GetResourceSkus(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, filter, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, filter, cancellationToken); } /// @@ -516,6 +550,10 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -524,7 +562,7 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, filter, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetUsages(location, filter, cancellationToken); } /// @@ -539,6 +577,10 @@ public static Pageable GetUsages(this SubscriptionResource /// CheckSkuAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -548,9 +590,7 @@ public static Pageable GetUsages(this SubscriptionResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable CheckSkuAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CognitiveServicesSkuAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSkuAvailabilityAsync(location, content, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).CheckSkuAvailabilityAsync(location, content, cancellationToken); } /// @@ -565,6 +605,10 @@ public static AsyncPageable CheckSkuAvaila /// CheckSkuAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -574,9 +618,7 @@ public static AsyncPageable CheckSkuAvaila /// A collection of that may take multiple service requests to iterate over. public static Pageable CheckSkuAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, CognitiveServicesSkuAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSkuAvailability(location, content, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).CheckSkuAvailability(location, content, cancellationToken); } /// @@ -591,6 +633,10 @@ public static Pageable CheckSkuAvailabilit /// CheckDomainAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Check Domain Availability parameter. @@ -598,9 +644,7 @@ public static Pageable CheckSkuAvailabilit /// is null. public static async Task> CheckDomainAvailabilityAsync(this SubscriptionResource subscriptionResource, CognitiveServicesDomainAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDomainAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).CheckDomainAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -615,6 +659,10 @@ public static async Task> Chec /// CheckDomainAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Check Domain Availability parameter. @@ -622,9 +670,7 @@ public static async Task> Chec /// is null. public static Response CheckDomainAvailability(this SubscriptionResource subscriptionResource, CognitiveServicesDomainAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDomainAvailability(content, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).CheckDomainAvailability(content, cancellationToken); } /// @@ -639,6 +685,10 @@ public static Response CheckDomainAvail /// CommitmentTiers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -646,7 +696,7 @@ public static Response CheckDomainAvail /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCommitmentTiersAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCommitmentTiersAsync(location, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCommitmentTiersAsync(location, cancellationToken); } /// @@ -661,6 +711,10 @@ public static AsyncPageable GetCommitmentTiersAsync(this Subscri /// CommitmentTiers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -668,7 +722,7 @@ public static AsyncPageable GetCommitmentTiersAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCommitmentTiers(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCommitmentTiers(location, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCommitmentTiers(location, cancellationToken); } /// @@ -683,6 +737,10 @@ public static Pageable GetCommitmentTiers(this SubscriptionResou /// Models_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -690,7 +748,7 @@ public static Pageable GetCommitmentTiers(this SubscriptionResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetModelsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetModelsAsync(location, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetModelsAsync(location, cancellationToken); } /// @@ -705,6 +763,10 @@ public static AsyncPageable GetModelsAsync(this Subscrip /// Models_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. @@ -712,7 +774,7 @@ public static AsyncPageable GetModelsAsync(this Subscrip /// A collection of that may take multiple service requests to iterate over. public static Pageable GetModels(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetModels(location, cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetModels(location, cancellationToken); } /// @@ -727,13 +789,17 @@ public static Pageable GetModels(this SubscriptionResour /// CommitmentPlans_ListPlansBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCognitiveServicesCommitmentPlansAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCognitiveServicesCommitmentPlansAsync(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesCommitmentPlansAsync(cancellationToken); } /// @@ -748,13 +814,17 @@ public static AsyncPageable GetCognitiv /// CommitmentPlans_ListPlansBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCognitiveServicesCommitmentPlans(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCognitiveServicesCommitmentPlans(cancellationToken); + return GetCognitiveServicesSubscriptionMockingExtension(subscriptionResource).GetCognitiveServicesCommitmentPlans(cancellationToken); } } } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesResourceGroupMockingExtension.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8cd16d4a6a57 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CognitiveServices; + +namespace Azure.ResourceManager.CognitiveServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CognitiveServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CognitiveServicesResourceGroupMockingExtension() + { + } + + /// 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 CognitiveServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CognitiveServicesAccountResources in the ResourceGroupResource. + /// An object representing collection of CognitiveServicesAccountResources and their operations over a CognitiveServicesAccountResource. + public virtual CognitiveServicesAccountCollection GetCognitiveServicesAccounts() + { + return GetCachedClient(client => new CognitiveServicesAccountCollection(client, Id)); + } + + /// + /// Returns a Cognitive Services account specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of Cognitive Services account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCognitiveServicesAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetCognitiveServicesAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Cognitive Services account specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of Cognitive Services account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCognitiveServicesAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetCognitiveServicesAccounts().Get(accountName, cancellationToken); + } + + /// Gets a collection of CognitiveServicesCommitmentPlanResources in the ResourceGroupResource. + /// An object representing collection of CognitiveServicesCommitmentPlanResources and their operations over a CognitiveServicesCommitmentPlanResource. + public virtual CognitiveServicesCommitmentPlanCollection GetCognitiveServicesCommitmentPlans() + { + return GetCachedClient(client => new CognitiveServicesCommitmentPlanCollection(client, Id)); + } + + /// + /// Returns a Cognitive Services commitment plan specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName} + /// + /// + /// Operation Id + /// CommitmentPlans_GetPlan + /// + /// + /// + /// The name of the commitmentPlan associated with the Cognitive Services Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCognitiveServicesCommitmentPlanAsync(string commitmentPlanName, CancellationToken cancellationToken = default) + { + return await GetCognitiveServicesCommitmentPlans().GetAsync(commitmentPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Cognitive Services commitment plan specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName} + /// + /// + /// Operation Id + /// CommitmentPlans_GetPlan + /// + /// + /// + /// The name of the commitmentPlan associated with the Cognitive Services Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCognitiveServicesCommitmentPlan(string commitmentPlanName, CancellationToken cancellationToken = default) + { + return GetCognitiveServicesCommitmentPlans().Get(commitmentPlanName, cancellationToken); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesSubscriptionMockingExtension.cs similarity index 82% rename from sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesSubscriptionMockingExtension.cs index 1e92e72295e4..83f3dfba93e4 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CognitiveServices; using Azure.ResourceManager.CognitiveServices.Models; -namespace Azure.ResourceManager.CognitiveServices +namespace Azure.ResourceManager.CognitiveServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CognitiveServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _cognitiveServicesAccountAccountsClientDiagnostics; private AccountsRestOperations _cognitiveServicesAccountAccountsRestClient; @@ -37,15 +38,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _cognitiveServicesCommitmentPlanCommitmentPlansClientDiagnostics; private CommitmentPlansRestOperations _cognitiveServicesCommitmentPlanCommitmentPlansRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CognitiveServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CognitiveServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -76,7 +77,57 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of CognitiveServicesDeletedAccountResources and their operations over a CognitiveServicesDeletedAccountResource. public virtual CognitiveServicesDeletedAccountCollection GetCognitiveServicesDeletedAccounts() { - return GetCachedClient(Client => new CognitiveServicesDeletedAccountCollection(Client, Id)); + return GetCachedClient(client => new CognitiveServicesDeletedAccountCollection(client, Id)); + } + + /// + /// Returns a Cognitive Services account specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName} + /// + /// + /// Operation Id + /// DeletedAccounts_Get + /// + /// + /// + /// Resource location. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCognitiveServicesDeletedAccountAsync(AzureLocation location, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + return await GetCognitiveServicesDeletedAccounts().GetAsync(location, resourceGroupName, accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Cognitive Services account specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName} + /// + /// + /// Operation Id + /// DeletedAccounts_Get + /// + /// + /// + /// Resource location. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCognitiveServicesDeletedAccount(AzureLocation location, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + return GetCognitiveServicesDeletedAccounts().Get(location, resourceGroupName, accountName, cancellationToken); } /// @@ -98,7 +149,7 @@ public virtual AsyncPageable GetCognitiveServi { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCognitiveServicesAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesAccountAccountsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCognitiveServicesAccounts", "value", "nextLink", cancellationToken); } /// @@ -120,7 +171,7 @@ public virtual Pageable GetCognitiveServicesAc { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCognitiveServicesAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesAccountAccountsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCognitiveServicesAccounts", "value", "nextLink", cancellationToken); } /// @@ -142,7 +193,7 @@ public virtual AsyncPageable GetDeleted { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesDeletedAccountDeletedAccountsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesDeletedAccountDeletedAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesDeletedAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesDeletedAccountDeletedAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesDeletedAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesDeletedAccountDeletedAccountsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetDeletedAccounts", "value", "nextLink", cancellationToken); } /// @@ -164,7 +215,7 @@ public virtual Pageable GetDeletedAccou { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesDeletedAccountDeletedAccountsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesDeletedAccountDeletedAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesDeletedAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesDeletedAccountDeletedAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesDeletedAccountResource(Client, CognitiveServicesAccountData.DeserializeCognitiveServicesAccountData(e)), CognitiveServicesDeletedAccountDeletedAccountsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetDeletedAccounts", "value", "nextLink", cancellationToken); } /// @@ -186,7 +237,7 @@ public virtual AsyncPageable GetResourceSkusAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableCognitiveServicesSku.DeserializeAvailableCognitiveServicesSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableCognitiveServicesSku.DeserializeAvailableCognitiveServicesSku, ResourceSkusClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -208,7 +259,7 @@ public virtual Pageable GetResourceSkus(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableCognitiveServicesSku.DeserializeAvailableCognitiveServicesSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableCognitiveServicesSku.DeserializeAvailableCognitiveServicesSku, ResourceSkusClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -232,7 +283,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation l { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceAccountUsage.DeserializeServiceAccountUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceAccountUsage.DeserializeServiceAccountUsage, UsagesClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -256,7 +307,7 @@ public virtual Pageable GetUsages(AzureLocation location, s { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceAccountUsage.DeserializeServiceAccountUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceAccountUsage.DeserializeServiceAccountUsage, UsagesClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -275,11 +326,14 @@ public virtual Pageable GetUsages(AzureLocation location, s /// Resource location. /// Check SKU Availability POST body. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable CheckSkuAvailabilityAsync(AzureLocation location, CognitiveServicesSkuAvailabilityContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateCheckSkuAvailabilityRequest(Id.SubscriptionId, location, content); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CognitiveServicesSkuAvailabilityList.DeserializeCognitiveServicesSkuAvailabilityList, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.CheckSkuAvailability", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CognitiveServicesSkuAvailabilityList.DeserializeCognitiveServicesSkuAvailabilityList, DefaultClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.CheckSkuAvailability", "value", null, cancellationToken); } /// @@ -298,11 +352,14 @@ public virtual AsyncPageable CheckSkuAvail /// Resource location. /// Check SKU Availability POST body. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable CheckSkuAvailability(AzureLocation location, CognitiveServicesSkuAvailabilityContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateCheckSkuAvailabilityRequest(Id.SubscriptionId, location, content); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CognitiveServicesSkuAvailabilityList.DeserializeCognitiveServicesSkuAvailabilityList, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.CheckSkuAvailability", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CognitiveServicesSkuAvailabilityList.DeserializeCognitiveServicesSkuAvailabilityList, DefaultClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.CheckSkuAvailability", "value", null, cancellationToken); } /// @@ -320,9 +377,12 @@ public virtual Pageable CheckSkuAvailabili /// /// Check Domain Availability parameter. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDomainAvailabilityAsync(CognitiveServicesDomainAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDomainAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CognitiveServicesSubscriptionMockingExtension.CheckDomainAvailability"); scope.Start(); try { @@ -351,9 +411,12 @@ public virtual async Task> Che /// /// Check Domain Availability parameter. /// The cancellation token to use. + /// is null. public virtual Response CheckDomainAvailability(CognitiveServicesDomainAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDomainAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("CognitiveServicesSubscriptionMockingExtension.CheckDomainAvailability"); scope.Start(); try { @@ -387,7 +450,7 @@ public virtual AsyncPageable GetCommitmentTiersAsync(AzureLocati { HttpMessage FirstPageRequest(int? pageSizeHint) => CommitmentTiersRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CommitmentTiersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CommitmentTier.DeserializeCommitmentTier, CommitmentTiersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCommitmentTiers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CommitmentTier.DeserializeCommitmentTier, CommitmentTiersClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCommitmentTiers", "value", "nextLink", cancellationToken); } /// @@ -410,7 +473,7 @@ public virtual Pageable GetCommitmentTiers(AzureLocation locatio { HttpMessage FirstPageRequest(int? pageSizeHint) => CommitmentTiersRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CommitmentTiersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CommitmentTier.DeserializeCommitmentTier, CommitmentTiersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCommitmentTiers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CommitmentTier.DeserializeCommitmentTier, CommitmentTiersClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCommitmentTiers", "value", "nextLink", cancellationToken); } /// @@ -433,7 +496,7 @@ public virtual AsyncPageable GetModelsAsync(AzureLocatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ModelsRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ModelsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CognitiveServicesModel.DeserializeCognitiveServicesModel, ModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetModels", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CognitiveServicesModel.DeserializeCognitiveServicesModel, ModelsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetModels", "value", "nextLink", cancellationToken); } /// @@ -456,7 +519,7 @@ public virtual Pageable GetModels(AzureLocation location { HttpMessage FirstPageRequest(int? pageSizeHint) => ModelsRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ModelsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CognitiveServicesModel.DeserializeCognitiveServicesModel, ModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetModels", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CognitiveServicesModel.DeserializeCognitiveServicesModel, ModelsClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetModels", "value", "nextLink", cancellationToken); } /// @@ -478,7 +541,7 @@ public virtual AsyncPageable GetCogniti { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesCommitmentPlanCommitmentPlansRestClient.CreateListPlansBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesCommitmentPlanCommitmentPlansRestClient.CreateListPlansBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesCommitmentPlanResource(Client, CommitmentPlanData.DeserializeCommitmentPlanData(e)), CognitiveServicesCommitmentPlanCommitmentPlansClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCognitiveServicesCommitmentPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesCommitmentPlanResource(Client, CommitmentPlanData.DeserializeCommitmentPlanData(e)), CognitiveServicesCommitmentPlanCommitmentPlansClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCognitiveServicesCommitmentPlans", "value", "nextLink", cancellationToken); } /// @@ -500,7 +563,7 @@ public virtual Pageable GetCognitiveSer { HttpMessage FirstPageRequest(int? pageSizeHint) => CognitiveServicesCommitmentPlanCommitmentPlansRestClient.CreateListPlansBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CognitiveServicesCommitmentPlanCommitmentPlansRestClient.CreateListPlansBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesCommitmentPlanResource(Client, CommitmentPlanData.DeserializeCommitmentPlanData(e)), CognitiveServicesCommitmentPlanCommitmentPlansClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCognitiveServicesCommitmentPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CognitiveServicesCommitmentPlanResource(Client, CommitmentPlanData.DeserializeCommitmentPlanData(e)), CognitiveServicesCommitmentPlanCommitmentPlansClientDiagnostics, Pipeline, "CognitiveServicesSubscriptionMockingExtension.GetCognitiveServicesCommitmentPlans", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4933b3984746..000000000000 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.CognitiveServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CognitiveServicesAccountResources in the ResourceGroupResource. - /// An object representing collection of CognitiveServicesAccountResources and their operations over a CognitiveServicesAccountResource. - public virtual CognitiveServicesAccountCollection GetCognitiveServicesAccounts() - { - return GetCachedClient(Client => new CognitiveServicesAccountCollection(Client, Id)); - } - - /// Gets a collection of CognitiveServicesCommitmentPlanResources in the ResourceGroupResource. - /// An object representing collection of CognitiveServicesCommitmentPlanResources and their operations over a CognitiveServicesCommitmentPlanResource. - public virtual CognitiveServicesCommitmentPlanCollection GetCognitiveServicesCommitmentPlans() - { - return GetCachedClient(Client => new CognitiveServicesCommitmentPlanCollection(Client, Id)); - } - } -} From a8ca6a2208901bd3017fa9ca302f0f08358f26d2 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:23:06 +0000 Subject: [PATCH 4/8] Update SDK codes sq_wo_6 --- .../ResourceGroupResourceExtensionClient.cs | 48 - ...VirtualMachineArmClientMockingExtension.cs | 75 + .../Extensions/SqlVirtualMachineExtensions.cs | 144 +- ...ualMachineResourceGroupMockingExtension.cs | 147 ++ ...ualMachineSubscriptionMockingExtension.cs} | 21 +- .../src/Generated/SqlVmGroupResource.cs | 6 +- .../src/Generated/BlobServiceResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../StorageArmClientMockingExtension.cs | 243 ++ .../Generated/Extensions/StorageExtensions.cs | 366 ++- .../StorageResourceGroupMockingExtension.cs | 95 + ...=> StorageSubscriptionMockingExtension.cs} | 89 +- .../src/Generated/FileServiceResource.cs | 6 +- .../src/Generated/QueueServiceResource.cs | 6 +- .../src/Generated/StorageAccountResource.cs | 24 +- .../src/Generated/TableServiceResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../StorageCacheArmClientMockingExtension.cs | 75 + .../Extensions/StorageCacheExtensions.cs | 204 +- ...orageCacheResourceGroupMockingExtension.cs | 145 ++ ...orageCacheSubscriptionMockingExtension.cs} | 41 +- .../src/Generated/StorageCacheResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../StorageMoverArmClientMockingExtension.cs | 111 + .../Extensions/StorageMoverExtensions.cs | 145 +- ...orageMoverResourceGroupMockingExtension.cs | 92 + ...orageMoverSubscriptionMockingExtension.cs} | 17 +- .../src/Generated/JobDefinitionResource.cs | 6 +- .../Generated/StorageMoverProjectResource.cs | 6 +- .../src/Generated/StorageMoverResource.cs | 18 +- .../src/Generated/DiskPoolResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../StoragePoolArmClientMockingExtension.cs | 63 + .../Extensions/StoragePoolExtensions.cs | 117 +- ...toragePoolResourceGroupMockingExtension.cs | 92 + ...toragePoolSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../StorageSyncArmClientMockingExtension.cs | 123 + .../Extensions/StorageSyncExtensions.cs | 176 +- ...torageSyncResourceGroupMockingExtension.cs | 92 + ...torageSyncSubscriptionMockingExtension.cs} | 31 +- .../src/Generated/StorageSyncGroupResource.cs | 12 +- .../Generated/StorageSyncServiceResource.cs | 20 +- .../ResourceGroupResourceExtensionClient.cs | 48 - ...treamAnalyticsArmClientMockingExtension.cs | 123 + .../Extensions/StreamAnalyticsExtensions.cs | 288 ++- ...mAnalyticsResourceGroupMockingExtension.cs | 147 ++ ...mAnalyticsSubscriptionMockingExtension.cs} | 75 +- .../StreamAnalyticsClusterResource.cs | 6 +- .../src/Generated/StreamingJobResource.cs | 24 +- .../SubscriptionArmClientMockingExtension.cs | 75 + .../Extensions/SubscriptionExtensions.cs | 204 +- ...bscriptionSubscriptionMockingExtension.cs} | 31 +- ... => SubscriptionTenantMockingExtension.cs} | 135 +- .../SupportArmClientMockingExtension.cs | 87 + .../Generated/Extensions/SupportExtensions.cs | 149 +- ...=> SupportSubscriptionMockingExtension.cs} | 71 +- .../SupportTenantMockingExtension.cs | 92 + .../TenantResourceExtensionClient.cs | 41 - .../Generated/SupportAzureServiceResource.cs | 6 +- .../src/Generated/SupportTicketResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../SynapseArmClientMockingExtension.cs | 687 +++++ .../Generated/Extensions/SynapseExtensions.cs | 835 +++---- .../SynapseResourceGroupMockingExtension.cs | 145 ++ ...=> SynapseSubscriptionMockingExtension.cs} | 35 +- .../SynapseDataMaskingPolicyResource.cs | 6 +- .../src/Generated/SynapseDatabaseResource.cs | 12 +- .../src/Generated/SynapseKustoPoolResource.cs | 18 +- .../SynapsePrivateLinkHubResource.cs | 12 +- .../Generated/SynapseSqlPoolColumnResource.cs | 2 +- .../src/Generated/SynapseSqlPoolResource.cs | 36 +- .../Generated/SynapseSqlPoolSchemaResource.cs | 6 +- .../Generated/SynapseSqlPoolTableResource.cs | 6 +- ...eSqlPoolVulnerabilityAssessmentResource.cs | 12 +- .../Generated/SynapseWorkloadGroupResource.cs | 6 +- .../src/Generated/SynapseWorkspaceResource.cs | 90 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...TrafficManagerArmClientMockingExtension.cs | 99 + .../Extensions/TrafficManagerExtensions.cs | 199 +- ...ficManagerResourceGroupMockingExtension.cs | 92 + ...ficManagerSubscriptionMockingExtension.cs} | 27 +- ...> TrafficManagerTenantMockingExtension.cs} | 23 +- .../TrafficManagerProfileResource.cs | 8 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../VoiceServicesArmClientMockingExtension.cs | 63 + .../Extensions/VoiceServicesExtensions.cs | 109 +- ...ceServicesResourceGroupMockingExtension.cs | 92 + ...ceServicesSubscriptionMockingExtension.cs} | 27 +- ...ceServicesCommunicationsGatewayResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../WebPubSubArmClientMockingExtension.cs | 87 + .../Extensions/WebPubSubExtensions.cs | 147 +- .../WebPubSubResourceGroupMockingExtension.cs | 92 + ... WebPubSubSubscriptionMockingExtension.cs} | 31 +- .../src/Generated/WebPubSubResource.cs | 18 +- .../AppServiceCertificateOrderResource.cs | 12 +- .../src/Generated/AppServiceDomainResource.cs | 6 +- .../AppServiceEnvironmentResource.cs | 24 +- .../src/Generated/AppServicePlanResource.cs | 12 +- ...icePlanVirtualNetworkConnectionResource.cs | 6 +- .../AppServiceArmClientMockingExtension.cs | 1395 +++++++++++ .../Extensions/AppServiceExtensions.cs | 2225 +++++++++-------- ...AppServiceResourceGroupMockingExtension.cs | 588 +++++ ...AppServiceSubscriptionMockingExtension.cs} | 321 ++- ...cs => AppServiceTenantMockingExtension.cs} | 95 +- .../ResourceGroupResourceExtensionClient.cs | 169 -- .../src/Generated/SiteDiagnosticResource.cs | 12 +- .../Generated/SiteInstanceProcessResource.cs | 6 +- .../src/Generated/SiteInstanceResource.cs | 6 +- .../src/Generated/SiteProcessResource.cs | 6 +- .../Generated/SiteSlotDiagnosticResource.cs | 12 +- .../SiteSlotInstanceProcessResource.cs | 6 +- .../src/Generated/SiteSlotInstanceResource.cs | 6 +- .../src/Generated/SiteSlotProcessResource.cs | 6 +- ...iteSlotVirtualNetworkConnectionResource.cs | 6 +- .../SiteVirtualNetworkConnectionResource.cs | 6 +- .../src/Generated/StaticSiteBuildResource.cs | 6 +- .../src/Generated/StaticSiteResource.cs | 24 +- .../src/Generated/WebSiteConfigResource.cs | 6 +- .../src/Generated/WebSiteResource.cs | 138 +- .../Generated/WebSiteSlotConfigResource.cs | 6 +- .../src/Generated/WebSiteSlotResource.cs | 132 +- .../WebSiteSlotTriggeredWebJobResource.cs | 6 +- .../WebSiteTriggeredwebJobResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 44 - ...orkloadMonitorArmClientMockingExtension.cs | 63 + .../Extensions/WorkloadMonitorExtensions.cs | 74 +- ...oadMonitorResourceGroupMockingExtension.cs | 105 + .../src/Generated/HealthMonitorResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../WorkloadsArmClientMockingExtension.cs | 123 + .../Extensions/WorkloadsExtensions.cs | 244 +- .../WorkloadsResourceGroupMockingExtension.cs | 145 ++ ... WorkloadsSubscriptionMockingExtension.cs} | 37 +- .../src/Generated/SapMonitorResource.cs | 6 +- .../Generated/SapVirtualInstanceResource.cs | 18 +- 137 files changed, 9826 insertions(+), 4260 deletions(-) delete mode 100644 sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineArmClientMockingExtension.cs create mode 100644 sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineResourceGroupMockingExtension.cs rename sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SqlVirtualMachineSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageArmClientMockingExtension.cs create mode 100644 sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageResourceGroupMockingExtension.cs rename sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StorageSubscriptionMockingExtension.cs} (78%) delete mode 100644 sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheArmClientMockingExtension.cs create mode 100644 sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheResourceGroupMockingExtension.cs rename sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StorageCacheSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverArmClientMockingExtension.cs create mode 100644 sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverResourceGroupMockingExtension.cs rename sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StorageMoverSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolArmClientMockingExtension.cs create mode 100644 sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolResourceGroupMockingExtension.cs rename sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StoragePoolSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncArmClientMockingExtension.cs create mode 100644 sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncResourceGroupMockingExtension.cs rename sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StorageSyncSubscriptionMockingExtension.cs} (79%) delete mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsArmClientMockingExtension.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsResourceGroupMockingExtension.cs rename sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => StreamAnalyticsSubscriptionMockingExtension.cs} (90%) create mode 100644 sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionArmClientMockingExtension.cs rename sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SubscriptionSubscriptionMockingExtension.cs} (87%) rename sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/{TenantResourceExtensionClient.cs => SubscriptionTenantMockingExtension.cs} (55%) create mode 100644 sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportArmClientMockingExtension.cs rename sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SupportSubscriptionMockingExtension.cs} (56%) create mode 100644 sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportTenantMockingExtension.cs delete mode 100644 sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/TenantResourceExtensionClient.cs delete mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseArmClientMockingExtension.cs create mode 100644 sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseResourceGroupMockingExtension.cs rename sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SynapseSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerArmClientMockingExtension.cs create mode 100644 sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerResourceGroupMockingExtension.cs rename sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => TrafficManagerSubscriptionMockingExtension.cs} (86%) rename sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/{TenantResourceExtensionClient.cs => TrafficManagerTenantMockingExtension.cs} (83%) delete mode 100644 sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesArmClientMockingExtension.cs create mode 100644 sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesResourceGroupMockingExtension.cs rename sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => VoiceServicesSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubArmClientMockingExtension.cs create mode 100644 sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubResourceGroupMockingExtension.cs rename sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => WebPubSubSubscriptionMockingExtension.cs} (87%) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceArmClientMockingExtension.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceResourceGroupMockingExtension.cs rename sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AppServiceSubscriptionMockingExtension.cs} (82%) rename sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/{TenantResourceExtensionClient.cs => AppServiceTenantMockingExtension.cs} (84%) delete mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorArmClientMockingExtension.cs create mode 100644 sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorResourceGroupMockingExtension.cs delete mode 100644 sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsArmClientMockingExtension.cs create mode 100644 sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsResourceGroupMockingExtension.cs rename sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => WorkloadsSubscriptionMockingExtension.cs} (93%) diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d69906e0a11e..000000000000 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SqlVirtualMachine -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SqlVmGroupResources in the ResourceGroupResource. - /// An object representing collection of SqlVmGroupResources and their operations over a SqlVmGroupResource. - public virtual SqlVmGroupCollection GetSqlVmGroups() - { - return GetCachedClient(Client => new SqlVmGroupCollection(Client, Id)); - } - - /// Gets a collection of SqlVmResources in the ResourceGroupResource. - /// An object representing collection of SqlVmResources and their operations over a SqlVmResource. - public virtual SqlVmCollection GetSqlVms() - { - return GetCachedClient(Client => new SqlVmCollection(Client, Id)); - } - } -} diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineArmClientMockingExtension.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineArmClientMockingExtension.cs new file mode 100644 index 000000000000..11f96e06a4a9 --- /dev/null +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SqlVirtualMachine; + +namespace Azure.ResourceManager.SqlVirtualMachine.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SqlVirtualMachineArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SqlVirtualMachineArmClientMockingExtension() + { + } + + /// 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 SqlVirtualMachineArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SqlVirtualMachineArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvailabilityGroupListenerResource GetAvailabilityGroupListenerResource(ResourceIdentifier id) + { + AvailabilityGroupListenerResource.ValidateResourceId(id); + return new AvailabilityGroupListenerResource(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 SqlVmGroupResource GetSqlVmGroupResource(ResourceIdentifier id) + { + SqlVmGroupResource.ValidateResourceId(id); + return new SqlVmGroupResource(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 SqlVmResource GetSqlVmResource(ResourceIdentifier id) + { + SqlVmResource.ValidateResourceId(id); + return new SqlVmResource(Client, id); + } + } +} diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineExtensions.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineExtensions.cs index 61beb79b4530..6ede75f6e220 100644 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineExtensions.cs +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineExtensions.cs @@ -12,106 +12,88 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SqlVirtualMachine.Mocking; namespace Azure.ResourceManager.SqlVirtualMachine { /// A class to add extension methods to Azure.ResourceManager.SqlVirtualMachine. public static partial class SqlVirtualMachineExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SqlVirtualMachineArmClientMockingExtension GetSqlVirtualMachineArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SqlVirtualMachineArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SqlVirtualMachineResourceGroupMockingExtension GetSqlVirtualMachineResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SqlVirtualMachineResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SqlVirtualMachineSubscriptionMockingExtension GetSqlVirtualMachineSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SqlVirtualMachineSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AvailabilityGroupListenerResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvailabilityGroupListenerResource GetAvailabilityGroupListenerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvailabilityGroupListenerResource.ValidateResourceId(id); - return new AvailabilityGroupListenerResource(client, id); - } - ); + return GetSqlVirtualMachineArmClientMockingExtension(client).GetAvailabilityGroupListenerResource(id); } - #endregion - #region SqlVmGroupResource /// /// 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. /// Returns a object. public static SqlVmGroupResource GetSqlVmGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlVmGroupResource.ValidateResourceId(id); - return new SqlVmGroupResource(client, id); - } - ); + return GetSqlVirtualMachineArmClientMockingExtension(client).GetSqlVmGroupResource(id); } - #endregion - #region SqlVmResource /// /// 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. /// Returns a object. public static SqlVmResource GetSqlVmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlVmResource.ValidateResourceId(id); - return new SqlVmResource(client, id); - } - ); + return GetSqlVirtualMachineArmClientMockingExtension(client).GetSqlVmResource(id); } - #endregion - /// Gets a collection of SqlVmGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of SqlVmGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SqlVmGroupResources and their operations over a SqlVmGroupResource. public static SqlVmGroupCollection GetSqlVmGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSqlVmGroups(); + return GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVmGroups(); } /// @@ -126,16 +108,20 @@ public static SqlVmGroupCollection GetSqlVmGroups(this ResourceGroupResource res /// SqlVirtualMachineGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL virtual machine group. /// The cancellation token to use. - /// 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 static async Task> GetSqlVmGroupAsync(this ResourceGroupResource resourceGroupResource, string sqlVmGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSqlVmGroups().GetAsync(sqlVmGroupName, cancellationToken).ConfigureAwait(false); + return await GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVmGroupAsync(sqlVmGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -150,24 +136,34 @@ public static async Task> GetSqlVmGroupAsync(this R /// SqlVirtualMachineGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL virtual machine group. /// The cancellation token to use. - /// 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 static Response GetSqlVmGroup(this ResourceGroupResource resourceGroupResource, string sqlVmGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSqlVmGroups().Get(sqlVmGroupName, cancellationToken); + return GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVmGroup(sqlVmGroupName, cancellationToken); } - /// Gets a collection of SqlVmResources in the ResourceGroupResource. + /// + /// Gets a collection of SqlVmResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SqlVmResources and their operations over a SqlVmResource. public static SqlVmCollection GetSqlVms(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSqlVms(); + return GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVms(); } /// @@ -182,17 +178,21 @@ public static SqlVmCollection GetSqlVms(this ResourceGroupResource resourceGroup /// SqlVirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL virtual machine. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static async Task> GetSqlVmAsync(this ResourceGroupResource resourceGroupResource, string sqlVmName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSqlVms().GetAsync(sqlVmName, expand, cancellationToken).ConfigureAwait(false); + return await GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVmAsync(sqlVmName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -207,17 +207,21 @@ public static async Task> GetSqlVmAsync(this ResourceGro /// SqlVirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL virtual machine. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static Response GetSqlVm(this ResourceGroupResource resourceGroupResource, string sqlVmName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSqlVms().Get(sqlVmName, expand, cancellationToken); + return GetSqlVirtualMachineResourceGroupMockingExtension(resourceGroupResource).GetSqlVm(sqlVmName, expand, cancellationToken); } /// @@ -232,13 +236,17 @@ public static Response GetSqlVm(this ResourceGroupResource resour /// SqlVirtualMachineGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSqlVmGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlVmGroupsAsync(cancellationToken); + return GetSqlVirtualMachineSubscriptionMockingExtension(subscriptionResource).GetSqlVmGroupsAsync(cancellationToken); } /// @@ -253,13 +261,17 @@ public static AsyncPageable GetSqlVmGroupsAsync(this Subscri /// SqlVirtualMachineGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSqlVmGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlVmGroups(cancellationToken); + return GetSqlVirtualMachineSubscriptionMockingExtension(subscriptionResource).GetSqlVmGroups(cancellationToken); } /// @@ -274,13 +286,17 @@ public static Pageable GetSqlVmGroups(this SubscriptionResou /// SqlVirtualMachines_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSqlVmsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlVmsAsync(cancellationToken); + return GetSqlVirtualMachineSubscriptionMockingExtension(subscriptionResource).GetSqlVmsAsync(cancellationToken); } /// @@ -295,13 +311,17 @@ public static AsyncPageable GetSqlVmsAsync(this SubscriptionResou /// SqlVirtualMachines_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSqlVms(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlVms(cancellationToken); + return GetSqlVirtualMachineSubscriptionMockingExtension(subscriptionResource).GetSqlVms(cancellationToken); } } } diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineResourceGroupMockingExtension.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..622c99fa573f --- /dev/null +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineResourceGroupMockingExtension.cs @@ -0,0 +1,147 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SqlVirtualMachine; + +namespace Azure.ResourceManager.SqlVirtualMachine.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SqlVirtualMachineResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SqlVirtualMachineResourceGroupMockingExtension() + { + } + + /// 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 SqlVirtualMachineResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SqlVmGroupResources in the ResourceGroupResource. + /// An object representing collection of SqlVmGroupResources and their operations over a SqlVmGroupResource. + public virtual SqlVmGroupCollection GetSqlVmGroups() + { + return GetCachedClient(client => new SqlVmGroupCollection(client, Id)); + } + + /// + /// Gets a SQL virtual machine group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName} + /// + /// + /// Operation Id + /// SqlVirtualMachineGroups_Get + /// + /// + /// + /// Name of the SQL virtual machine group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlVmGroupAsync(string sqlVmGroupName, CancellationToken cancellationToken = default) + { + return await GetSqlVmGroups().GetAsync(sqlVmGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a SQL virtual machine group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName} + /// + /// + /// Operation Id + /// SqlVirtualMachineGroups_Get + /// + /// + /// + /// Name of the SQL virtual machine group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlVmGroup(string sqlVmGroupName, CancellationToken cancellationToken = default) + { + return GetSqlVmGroups().Get(sqlVmGroupName, cancellationToken); + } + + /// Gets a collection of SqlVmResources in the ResourceGroupResource. + /// An object representing collection of SqlVmResources and their operations over a SqlVmResource. + public virtual SqlVmCollection GetSqlVms() + { + return GetCachedClient(client => new SqlVmCollection(client, Id)); + } + + /// + /// Gets a SQL virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName} + /// + /// + /// Operation Id + /// SqlVirtualMachines_Get + /// + /// + /// + /// Name of the SQL virtual machine. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlVmAsync(string sqlVmName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetSqlVms().GetAsync(sqlVmName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a SQL virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName} + /// + /// + /// Operation Id + /// SqlVirtualMachines_Get + /// + /// + /// + /// Name of the SQL virtual machine. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlVm(string sqlVmName, string expand = null, CancellationToken cancellationToken = default) + { + return GetSqlVms().Get(sqlVmName, expand, cancellationToken); + } + } +} diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineSubscriptionMockingExtension.cs similarity index 87% rename from sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineSubscriptionMockingExtension.cs index 67f20c2e2358..18be0f52d1c3 100644 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/Extensions/SqlVirtualMachineSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SqlVirtualMachine; -namespace Azure.ResourceManager.SqlVirtualMachine +namespace Azure.ResourceManager.SqlVirtualMachine.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SqlVirtualMachineSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _sqlVmGroupSqlVmGroupsClientDiagnostics; private SqlVirtualMachineGroupsRestOperations _sqlVmGroupSqlVmGroupsRestClient; private ClientDiagnostics _sqlVmSqlVirtualMachinesClientDiagnostics; private SqlVirtualMachinesRestOperations _sqlVmSqlVirtualMachinesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SqlVirtualMachineSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SqlVirtualMachineSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ public virtual AsyncPageable GetSqlVmGroupsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlVmGroupSqlVirtualMachineGroupsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlVmGroupSqlVirtualMachineGroupsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlVmGroupResource(Client, SqlVmGroupData.DeserializeSqlVmGroupData(e)), SqlVmGroupSqlVirtualMachineGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlVmGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlVmGroupResource(Client, SqlVmGroupData.DeserializeSqlVmGroupData(e)), SqlVmGroupSqlVirtualMachineGroupsClientDiagnostics, Pipeline, "SqlVirtualMachineSubscriptionMockingExtension.GetSqlVmGroups", "value", "nextLink", cancellationToken); } /// @@ -86,7 +87,7 @@ public virtual Pageable GetSqlVmGroups(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlVmGroupSqlVirtualMachineGroupsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlVmGroupSqlVirtualMachineGroupsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlVmGroupResource(Client, SqlVmGroupData.DeserializeSqlVmGroupData(e)), SqlVmGroupSqlVirtualMachineGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlVmGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlVmGroupResource(Client, SqlVmGroupData.DeserializeSqlVmGroupData(e)), SqlVmGroupSqlVirtualMachineGroupsClientDiagnostics, Pipeline, "SqlVirtualMachineSubscriptionMockingExtension.GetSqlVmGroups", "value", "nextLink", cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual AsyncPageable GetSqlVmsAsync(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlVmSqlVirtualMachinesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlVmSqlVirtualMachinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlVmResource(Client, SqlVmData.DeserializeSqlVmData(e)), SqlVmSqlVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlVms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlVmResource(Client, SqlVmData.DeserializeSqlVmData(e)), SqlVmSqlVirtualMachinesClientDiagnostics, Pipeline, "SqlVirtualMachineSubscriptionMockingExtension.GetSqlVms", "value", "nextLink", cancellationToken); } /// @@ -130,7 +131,7 @@ public virtual Pageable GetSqlVms(CancellationToken cancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlVmSqlVirtualMachinesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlVmSqlVirtualMachinesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlVmResource(Client, SqlVmData.DeserializeSqlVmData(e)), SqlVmSqlVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlVms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlVmResource(Client, SqlVmData.DeserializeSqlVmData(e)), SqlVmSqlVirtualMachinesClientDiagnostics, Pipeline, "SqlVirtualMachineSubscriptionMockingExtension.GetSqlVms", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/SqlVmGroupResource.cs b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/SqlVmGroupResource.cs index de52f02ba589..7162b9c40947 100644 --- a/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/SqlVmGroupResource.cs +++ b/sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/src/Generated/SqlVmGroupResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AvailabilityGroupListenerResources and their operations over a AvailabilityGroupListenerResource. public virtual AvailabilityGroupListenerCollection GetAvailabilityGroupListeners() { - return GetCachedClient(Client => new AvailabilityGroupListenerCollection(Client, Id)); + return GetCachedClient(client => new AvailabilityGroupListenerCollection(client, Id)); } /// @@ -118,8 +118,8 @@ public virtual AvailabilityGroupListenerCollection GetAvailabilityGroupListeners /// Name of the availability group listener. /// The child resources to include in the response. /// The cancellation token to use. - /// 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> GetAvailabilityGroupListenerAsync(string availabilityGroupListenerName, string expand = null, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> GetAvaila /// Name of the availability group listener. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 GetAvailabilityGroupListener(string availabilityGroupListenerName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/BlobServiceResource.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/BlobServiceResource.cs index 467a18b31000..1cba1b8173d1 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/BlobServiceResource.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/BlobServiceResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BlobContainerResources and their operations over a BlobContainerResource. public virtual BlobContainerCollection GetBlobContainers() { - return GetCachedClient(Client => new BlobContainerCollection(Client, Id)); + return GetCachedClient(client => new BlobContainerCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual BlobContainerCollection GetBlobContainers() /// /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// The cancellation token to use. - /// 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> GetBlobContainerAsync(string containerName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetBlobContainerAsync /// /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// The cancellation token to use. - /// 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 GetBlobContainer(string containerName, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 5283e3414155..000000000000 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Storage -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of StorageAccountResources in the ResourceGroupResource. - /// An object representing collection of StorageAccountResources and their operations over a StorageAccountResource. - public virtual StorageAccountCollection GetStorageAccounts() - { - return GetCachedClient(Client => new StorageAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageArmClientMockingExtension.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageArmClientMockingExtension.cs new file mode 100644 index 000000000000..5e1f3cfb1027 --- /dev/null +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageArmClientMockingExtension.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Storage; + +namespace Azure.ResourceManager.Storage.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StorageArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageArmClientMockingExtension() + { + } + + /// 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 StorageArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StorageArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StorageAccountResource GetStorageAccountResource(ResourceIdentifier id) + { + StorageAccountResource.ValidateResourceId(id); + return new StorageAccountResource(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 DeletedAccountResource GetDeletedAccountResource(ResourceIdentifier id) + { + DeletedAccountResource.ValidateResourceId(id); + return new DeletedAccountResource(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 StorageAccountManagementPolicyResource GetStorageAccountManagementPolicyResource(ResourceIdentifier id) + { + StorageAccountManagementPolicyResource.ValidateResourceId(id); + return new StorageAccountManagementPolicyResource(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 BlobInventoryPolicyResource GetBlobInventoryPolicyResource(ResourceIdentifier id) + { + BlobInventoryPolicyResource.ValidateResourceId(id); + return new BlobInventoryPolicyResource(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 StoragePrivateEndpointConnectionResource GetStoragePrivateEndpointConnectionResource(ResourceIdentifier id) + { + StoragePrivateEndpointConnectionResource.ValidateResourceId(id); + return new StoragePrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ObjectReplicationPolicyResource GetObjectReplicationPolicyResource(ResourceIdentifier id) + { + ObjectReplicationPolicyResource.ValidateResourceId(id); + return new ObjectReplicationPolicyResource(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 StorageAccountLocalUserResource GetStorageAccountLocalUserResource(ResourceIdentifier id) + { + StorageAccountLocalUserResource.ValidateResourceId(id); + return new StorageAccountLocalUserResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EncryptionScopeResource GetEncryptionScopeResource(ResourceIdentifier id) + { + EncryptionScopeResource.ValidateResourceId(id); + return new EncryptionScopeResource(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 BlobServiceResource GetBlobServiceResource(ResourceIdentifier id) + { + BlobServiceResource.ValidateResourceId(id); + return new BlobServiceResource(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 BlobContainerResource GetBlobContainerResource(ResourceIdentifier id) + { + BlobContainerResource.ValidateResourceId(id); + return new BlobContainerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ImmutabilityPolicyResource GetImmutabilityPolicyResource(ResourceIdentifier id) + { + ImmutabilityPolicyResource.ValidateResourceId(id); + return new ImmutabilityPolicyResource(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 FileServiceResource GetFileServiceResource(ResourceIdentifier id) + { + FileServiceResource.ValidateResourceId(id); + return new FileServiceResource(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 FileShareResource GetFileShareResource(ResourceIdentifier id) + { + FileShareResource.ValidateResourceId(id); + return new FileShareResource(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 QueueServiceResource GetQueueServiceResource(ResourceIdentifier id) + { + QueueServiceResource.ValidateResourceId(id); + return new QueueServiceResource(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 StorageQueueResource GetStorageQueueResource(ResourceIdentifier id) + { + StorageQueueResource.ValidateResourceId(id); + return new StorageQueueResource(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 TableServiceResource GetTableServiceResource(ResourceIdentifier id) + { + TableServiceResource.ValidateResourceId(id); + return new TableServiceResource(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 TableResource GetTableResource(ResourceIdentifier id) + { + TableResource.ValidateResourceId(id); + return new TableResource(Client, id); + } + } +} diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageExtensions.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageExtensions.cs index ca92c4f28b28..539b550bd600 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageExtensions.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Storage.Mocking; using Azure.ResourceManager.Storage.Models; namespace Azure.ResourceManager.Storage @@ -19,366 +20,305 @@ namespace Azure.ResourceManager.Storage /// A class to add extension methods to Azure.ResourceManager.Storage. public static partial class StorageExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StorageArmClientMockingExtension GetStorageArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StorageArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StorageResourceGroupMockingExtension GetStorageResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StorageResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StorageSubscriptionMockingExtension GetStorageSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StorageSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region StorageAccountResource /// /// 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. /// Returns a object. public static StorageAccountResource GetStorageAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageAccountResource.ValidateResourceId(id); - return new StorageAccountResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetStorageAccountResource(id); } - #endregion - #region DeletedAccountResource /// /// 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. /// Returns a object. public static DeletedAccountResource GetDeletedAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedAccountResource.ValidateResourceId(id); - return new DeletedAccountResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetDeletedAccountResource(id); } - #endregion - #region StorageAccountManagementPolicyResource /// /// 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. /// Returns a object. public static StorageAccountManagementPolicyResource GetStorageAccountManagementPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageAccountManagementPolicyResource.ValidateResourceId(id); - return new StorageAccountManagementPolicyResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetStorageAccountManagementPolicyResource(id); } - #endregion - #region BlobInventoryPolicyResource /// /// 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. /// Returns a object. public static BlobInventoryPolicyResource GetBlobInventoryPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BlobInventoryPolicyResource.ValidateResourceId(id); - return new BlobInventoryPolicyResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetBlobInventoryPolicyResource(id); } - #endregion - #region StoragePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static StoragePrivateEndpointConnectionResource GetStoragePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StoragePrivateEndpointConnectionResource.ValidateResourceId(id); - return new StoragePrivateEndpointConnectionResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetStoragePrivateEndpointConnectionResource(id); } - #endregion - #region ObjectReplicationPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ObjectReplicationPolicyResource GetObjectReplicationPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ObjectReplicationPolicyResource.ValidateResourceId(id); - return new ObjectReplicationPolicyResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetObjectReplicationPolicyResource(id); } - #endregion - #region StorageAccountLocalUserResource /// /// 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. /// Returns a object. public static StorageAccountLocalUserResource GetStorageAccountLocalUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageAccountLocalUserResource.ValidateResourceId(id); - return new StorageAccountLocalUserResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetStorageAccountLocalUserResource(id); } - #endregion - #region EncryptionScopeResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EncryptionScopeResource GetEncryptionScopeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EncryptionScopeResource.ValidateResourceId(id); - return new EncryptionScopeResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetEncryptionScopeResource(id); } - #endregion - #region BlobServiceResource /// /// 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. /// Returns a object. public static BlobServiceResource GetBlobServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BlobServiceResource.ValidateResourceId(id); - return new BlobServiceResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetBlobServiceResource(id); } - #endregion - #region BlobContainerResource /// /// 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. /// Returns a object. public static BlobContainerResource GetBlobContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BlobContainerResource.ValidateResourceId(id); - return new BlobContainerResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetBlobContainerResource(id); } - #endregion - #region ImmutabilityPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ImmutabilityPolicyResource GetImmutabilityPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ImmutabilityPolicyResource.ValidateResourceId(id); - return new ImmutabilityPolicyResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetImmutabilityPolicyResource(id); } - #endregion - #region FileServiceResource /// /// 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. /// Returns a object. public static FileServiceResource GetFileServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FileServiceResource.ValidateResourceId(id); - return new FileServiceResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetFileServiceResource(id); } - #endregion - #region FileShareResource /// /// 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. /// Returns a object. public static FileShareResource GetFileShareResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FileShareResource.ValidateResourceId(id); - return new FileShareResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetFileShareResource(id); } - #endregion - #region QueueServiceResource /// /// 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. /// Returns a object. public static QueueServiceResource GetQueueServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - QueueServiceResource.ValidateResourceId(id); - return new QueueServiceResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetQueueServiceResource(id); } - #endregion - #region StorageQueueResource /// /// 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. /// Returns a object. public static StorageQueueResource GetStorageQueueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageQueueResource.ValidateResourceId(id); - return new StorageQueueResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetStorageQueueResource(id); } - #endregion - #region TableServiceResource /// /// 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. /// Returns a object. public static TableServiceResource GetTableServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TableServiceResource.ValidateResourceId(id); - return new TableServiceResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetTableServiceResource(id); } - #endregion - #region TableResource /// /// 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. /// Returns a object. public static TableResource GetTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TableResource.ValidateResourceId(id); - return new TableResource(client, id); - } - ); + return GetStorageArmClientMockingExtension(client).GetTableResource(id); } - #endregion - /// Gets a collection of StorageAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of StorageAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StorageAccountResources and their operations over a StorageAccountResource. public static StorageAccountCollection GetStorageAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageAccounts(); + return GetStorageResourceGroupMockingExtension(resourceGroupResource).GetStorageAccounts(); } /// @@ -393,17 +333,21 @@ public static StorageAccountCollection GetStorageAccounts(this ResourceGroupReso /// StorageAccounts_GetProperties /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. /// The cancellation token to use. - /// 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 static async Task> GetStorageAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStorageAccounts().GetAsync(accountName, expand, cancellationToken).ConfigureAwait(false); + return await GetStorageResourceGroupMockingExtension(resourceGroupResource).GetStorageAccountAsync(accountName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -418,25 +362,35 @@ public static async Task> GetStorageAccountAsyn /// StorageAccounts_GetProperties /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. /// The cancellation token to use. - /// 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 static Response GetStorageAccount(this ResourceGroupResource resourceGroupResource, string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStorageAccounts().Get(accountName, expand, cancellationToken); + return GetStorageResourceGroupMockingExtension(resourceGroupResource).GetStorageAccount(accountName, expand, cancellationToken); } - /// Gets a collection of DeletedAccountResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedAccountResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeletedAccountResources and their operations over a DeletedAccountResource. public static DeletedAccountCollection GetDeletedAccounts(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAccounts(); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetDeletedAccounts(); } /// @@ -451,17 +405,21 @@ public static DeletedAccountCollection GetDeletedAccounts(this SubscriptionResou /// DeletedAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted storage account. /// Name of the deleted storage account. /// The cancellation token to use. - /// 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 static async Task> GetDeletedAccountAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string deletedAccountName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedAccounts().GetAsync(location, deletedAccountName, cancellationToken).ConfigureAwait(false); + return await GetStorageSubscriptionMockingExtension(subscriptionResource).GetDeletedAccountAsync(location, deletedAccountName, cancellationToken).ConfigureAwait(false); } /// @@ -476,17 +434,21 @@ public static async Task> GetDeletedAccountAsyn /// DeletedAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the deleted storage account. /// Name of the deleted storage account. /// The cancellation token to use. - /// 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 static Response GetDeletedAccount(this SubscriptionResource subscriptionResource, AzureLocation location, string deletedAccountName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedAccounts().Get(location, deletedAccountName, cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetDeletedAccount(location, deletedAccountName, cancellationToken); } /// @@ -501,13 +463,17 @@ public static Response GetDeletedAccount(this Subscripti /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(cancellationToken); } /// @@ -522,13 +488,17 @@ public static AsyncPageable GetSkusAsync(this Subscriptio /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetSkus(cancellationToken); } /// @@ -543,6 +513,10 @@ public static Pageable GetSkus(this SubscriptionResource /// StorageAccounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -550,9 +524,7 @@ public static Pageable GetSkus(this SubscriptionResource /// is null. public static async Task> CheckStorageAccountNameAvailabilityAsync(this SubscriptionResource subscriptionResource, StorageAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckStorageAccountNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetStorageSubscriptionMockingExtension(subscriptionResource).CheckStorageAccountNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -567,6 +539,10 @@ public static async Task> CheckSt /// StorageAccounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -574,9 +550,7 @@ public static async Task> CheckSt /// is null. public static Response CheckStorageAccountNameAvailability(this SubscriptionResource subscriptionResource, StorageAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckStorageAccountNameAvailability(content, cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).CheckStorageAccountNameAvailability(content, cancellationToken); } /// @@ -591,13 +565,17 @@ public static Response CheckStorageAccount /// StorageAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageAccountsAsync(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetStorageAccountsAsync(cancellationToken); } /// @@ -612,13 +590,17 @@ public static AsyncPageable GetStorageAccountsAsync(this /// StorageAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageAccounts(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetStorageAccounts(cancellationToken); } /// @@ -633,13 +615,17 @@ public static Pageable GetStorageAccounts(this Subscript /// DeletedAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAccountsAsync(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetDeletedAccountsAsync(cancellationToken); } /// @@ -654,13 +640,17 @@ public static AsyncPageable GetDeletedAccountsAsync(this /// DeletedAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedAccounts(cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetDeletedAccounts(cancellationToken); } /// @@ -675,6 +665,10 @@ public static Pageable GetDeletedAccounts(this Subscript /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the Azure Storage resource. @@ -682,7 +676,7 @@ public static Pageable GetDeletedAccounts(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesByLocationAsync(location, cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetUsagesByLocationAsync(location, cancellationToken); } /// @@ -697,6 +691,10 @@ public static AsyncPageable GetUsagesByLocationAsync(this Subscrip /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the Azure Storage resource. @@ -704,7 +702,7 @@ public static AsyncPageable GetUsagesByLocationAsync(this Subscrip /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsagesByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesByLocation(location, cancellationToken); + return GetStorageSubscriptionMockingExtension(subscriptionResource).GetUsagesByLocation(location, cancellationToken); } } } diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageResourceGroupMockingExtension.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..376a050b099b --- /dev/null +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageResourceGroupMockingExtension.cs @@ -0,0 +1,95 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Storage; +using Azure.ResourceManager.Storage.Models; + +namespace Azure.ResourceManager.Storage.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StorageResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageResourceGroupMockingExtension() + { + } + + /// 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 StorageResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of StorageAccountResources in the ResourceGroupResource. + /// An object representing collection of StorageAccountResources and their operations over a StorageAccountResource. + public virtual StorageAccountCollection GetStorageAccounts() + { + return GetCachedClient(client => new StorageAccountCollection(client, Id)); + } + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName} + /// + /// + /// Operation Id + /// StorageAccounts_GetProperties + /// + /// + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageAccountAsync(string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) + { + return await GetStorageAccounts().GetAsync(accountName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName} + /// + /// + /// Operation Id + /// StorageAccounts_GetProperties + /// + /// + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageAccount(string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) + { + return GetStorageAccounts().Get(accountName, expand, cancellationToken); + } + } +} diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageSubscriptionMockingExtension.cs similarity index 78% rename from sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageSubscriptionMockingExtension.cs index ccb6b9722988..3ccf370e378b 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Extensions/StorageSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Storage; using Azure.ResourceManager.Storage.Models; -namespace Azure.ResourceManager.Storage +namespace Azure.ResourceManager.Storage.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StorageSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _skusClientDiagnostics; private SkusRestOperations _skusRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StorageSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StorageSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,55 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of DeletedAccountResources and their operations over a DeletedAccountResource. public virtual DeletedAccountCollection GetDeletedAccounts() { - return GetCachedClient(Client => new DeletedAccountCollection(Client, Id)); + return GetCachedClient(client => new DeletedAccountCollection(client, Id)); + } + + /// + /// Get properties of specified deleted account resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName} + /// + /// + /// Operation Id + /// DeletedAccounts_Get + /// + /// + /// + /// The location of the deleted storage account. + /// Name of the deleted storage account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedAccountAsync(AzureLocation location, string deletedAccountName, CancellationToken cancellationToken = default) + { + return await GetDeletedAccounts().GetAsync(location, deletedAccountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of specified deleted account resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName} + /// + /// + /// Operation Id + /// DeletedAccounts_Get + /// + /// + /// + /// The location of the deleted storage account. + /// Name of the deleted storage account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedAccount(AzureLocation location, string deletedAccountName, CancellationToken cancellationToken = default) + { + return GetDeletedAccounts().Get(location, deletedAccountName, cancellationToken); } /// @@ -81,7 +130,7 @@ public virtual DeletedAccountCollection GetDeletedAccounts() public virtual AsyncPageable GetSkusAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StorageSkuInformation.DeserializeStorageSkuInformation, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StorageSkuInformation.DeserializeStorageSkuInformation, SkusClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } /// @@ -102,7 +151,7 @@ public virtual AsyncPageable GetSkusAsync(CancellationTok public virtual Pageable GetSkus(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StorageSkuInformation.DeserializeStorageSkuInformation, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StorageSkuInformation.DeserializeStorageSkuInformation, SkusClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } /// @@ -120,9 +169,12 @@ public virtual Pageable GetSkus(CancellationToken cancell /// /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// The cancellation token to use. + /// is null. public virtual async Task> CheckStorageAccountNameAvailabilityAsync(StorageAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = StorageAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckStorageAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StorageAccountClientDiagnostics.CreateScope("StorageSubscriptionMockingExtension.CheckStorageAccountNameAvailability"); scope.Start(); try { @@ -151,9 +203,12 @@ public virtual async Task> CheckS /// /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// The cancellation token to use. + /// is null. public virtual Response CheckStorageAccountNameAvailability(StorageAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = StorageAccountClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckStorageAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StorageAccountClientDiagnostics.CreateScope("StorageSubscriptionMockingExtension.CheckStorageAccountNameAvailability"); scope.Start(); try { @@ -186,7 +241,7 @@ public virtual AsyncPageable GetStorageAccountsAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageAccountResource(Client, StorageAccountData.DeserializeStorageAccountData(e)), StorageAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageAccountResource(Client, StorageAccountData.DeserializeStorageAccountData(e)), StorageAccountClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetStorageAccounts", "value", "nextLink", cancellationToken); } /// @@ -208,7 +263,7 @@ public virtual Pageable GetStorageAccounts(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageAccountResource(Client, StorageAccountData.DeserializeStorageAccountData(e)), StorageAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageAccountResource(Client, StorageAccountData.DeserializeStorageAccountData(e)), StorageAccountClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetStorageAccounts", "value", "nextLink", cancellationToken); } /// @@ -230,7 +285,7 @@ public virtual AsyncPageable GetDeletedAccountsAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedAccountResource(Client, DeletedAccountData.DeserializeDeletedAccountData(e)), DeletedAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedAccountResource(Client, DeletedAccountData.DeserializeDeletedAccountData(e)), DeletedAccountClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetDeletedAccounts", "value", "nextLink", cancellationToken); } /// @@ -252,7 +307,7 @@ public virtual Pageable GetDeletedAccounts(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedAccountRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedAccountResource(Client, DeletedAccountData.DeserializeDeletedAccountData(e)), DeletedAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedAccountResource(Client, DeletedAccountData.DeserializeDeletedAccountData(e)), DeletedAccountClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetDeletedAccounts", "value", "nextLink", cancellationToken); } /// @@ -274,7 +329,7 @@ public virtual Pageable GetDeletedAccounts(CancellationT public virtual AsyncPageable GetUsagesByLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StorageUsage.DeserializeStorageUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesByLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StorageUsage.DeserializeStorageUsage, UsagesClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetUsagesByLocation", "value", null, cancellationToken); } /// @@ -296,7 +351,7 @@ public virtual AsyncPageable GetUsagesByLocationAsync(AzureLocatio public virtual Pageable GetUsagesByLocation(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StorageUsage.DeserializeStorageUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesByLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StorageUsage.DeserializeStorageUsage, UsagesClientDiagnostics, Pipeline, "StorageSubscriptionMockingExtension.GetUsagesByLocation", "value", null, cancellationToken); } } } diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/FileServiceResource.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/FileServiceResource.cs index 3d0509967fc3..6787359a992b 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/FileServiceResource.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/FileServiceResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FileShareResources and their operations over a FileShareResource. public virtual FileShareCollection GetFileShares() { - return GetCachedClient(Client => new FileShareCollection(Client, Id)); + return GetCachedClient(client => new FileShareCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual FileShareCollection GetFileShares() /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','. /// Optional, used to retrieve properties of a snapshot. /// The cancellation token to use. - /// 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> GetFileShareAsync(string shareName, string expand = null, string xMsSnapshot = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetFileShareAsync(string /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','. /// Optional, used to retrieve properties of a snapshot. /// The cancellation token to use. - /// 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 GetFileShare(string shareName, string expand = null, string xMsSnapshot = null, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/QueueServiceResource.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/QueueServiceResource.cs index 315a9eda7d16..81a481e11a08 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/QueueServiceResource.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/QueueServiceResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StorageQueueResources and their operations over a StorageQueueResource. public virtual StorageQueueCollection GetStorageQueues() { - return GetCachedClient(Client => new StorageQueueCollection(Client, Id)); + return GetCachedClient(client => new StorageQueueCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual StorageQueueCollection GetStorageQueues() /// /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. /// The cancellation token to use. - /// 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> GetStorageQueueAsync(string queueName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetStorageQueueAsync(s /// /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. /// The cancellation token to use. - /// 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 GetStorageQueue(string queueName, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/StorageAccountResource.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/StorageAccountResource.cs index e363dc33f4e7..a374f058fef7 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/StorageAccountResource.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/StorageAccountResource.cs @@ -112,7 +112,7 @@ public virtual BlobInventoryPolicyResource GetBlobInventoryPolicy() /// An object representing collection of StoragePrivateEndpointConnectionResources and their operations over a StoragePrivateEndpointConnectionResource. public virtual StoragePrivateEndpointConnectionCollection GetStoragePrivateEndpointConnections() { - return GetCachedClient(Client => new StoragePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new StoragePrivateEndpointConnectionCollection(client, Id)); } /// @@ -130,8 +130,8 @@ public virtual StoragePrivateEndpointConnectionCollection GetStoragePrivateEndpo /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetStoragePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -153,8 +153,8 @@ public virtual async Task> Ge /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetStoragePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -165,7 +165,7 @@ public virtual Response GetStoragePriv /// An object representing collection of ObjectReplicationPolicyResources and their operations over a ObjectReplicationPolicyResource. public virtual ObjectReplicationPolicyCollection GetObjectReplicationPolicies() { - return GetCachedClient(Client => new ObjectReplicationPolicyCollection(Client, Id)); + return GetCachedClient(client => new ObjectReplicationPolicyCollection(client, Id)); } /// @@ -183,8 +183,8 @@ public virtual ObjectReplicationPolicyCollection GetObjectReplicationPolicies() /// /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. /// The cancellation token to use. - /// 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> GetObjectReplicationPolicyAsync(string objectReplicationPolicyId, CancellationToken cancellationToken = default) { @@ -206,8 +206,8 @@ public virtual async Task> GetObjectRe /// /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. /// The cancellation token to use. - /// 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 GetObjectReplicationPolicy(string objectReplicationPolicyId, CancellationToken cancellationToken = default) { @@ -218,7 +218,7 @@ public virtual Response GetObjectReplicationPol /// An object representing collection of StorageAccountLocalUserResources and their operations over a StorageAccountLocalUserResource. public virtual StorageAccountLocalUserCollection GetStorageAccountLocalUsers() { - return GetCachedClient(Client => new StorageAccountLocalUserCollection(Client, Id)); + return GetCachedClient(client => new StorageAccountLocalUserCollection(client, Id)); } /// @@ -236,8 +236,8 @@ public virtual StorageAccountLocalUserCollection GetStorageAccountLocalUsers() /// /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. /// The cancellation token to use. - /// 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> GetStorageAccountLocalUserAsync(string username, CancellationToken cancellationToken = default) { @@ -259,8 +259,8 @@ public virtual async Task> GetStorageA /// /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. /// The cancellation token to use. - /// 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 GetStorageAccountLocalUser(string username, CancellationToken cancellationToken = default) { @@ -271,7 +271,7 @@ public virtual Response GetStorageAccountLocalU /// An object representing collection of EncryptionScopeResources and their operations over a EncryptionScopeResource. public virtual EncryptionScopeCollection GetEncryptionScopes() { - return GetCachedClient(Client => new EncryptionScopeCollection(Client, Id)); + return GetCachedClient(client => new EncryptionScopeCollection(client, Id)); } /// @@ -289,8 +289,8 @@ public virtual EncryptionScopeCollection GetEncryptionScopes() /// /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// The cancellation token to use. - /// 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> GetEncryptionScopeAsync(string encryptionScopeName, CancellationToken cancellationToken = default) { @@ -312,8 +312,8 @@ public virtual async Task> GetEncryptionScopeA /// /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// The cancellation token to use. - /// 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 GetEncryptionScope(string encryptionScopeName, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/TableServiceResource.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/TableServiceResource.cs index 4708c04ddbd0..3a112cd12fa4 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/TableServiceResource.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/TableServiceResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of TableResources and their operations over a TableResource. public virtual TableCollection GetTables() { - return GetCachedClient(Client => new TableCollection(Client, Id)); + return GetCachedClient(client => new TableCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual TableCollection GetTables() /// /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. /// The cancellation token to use. - /// 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> GetTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetTableAsync(string tableNam /// /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. /// The cancellation token to use. - /// 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 GetTable(string tableName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 62200da00892..000000000000 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.StorageCache -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AmlFileSystemResources in the ResourceGroupResource. - /// An object representing collection of AmlFileSystemResources and their operations over a AmlFileSystemResource. - public virtual AmlFileSystemCollection GetAmlFileSystems() - { - return GetCachedClient(Client => new AmlFileSystemCollection(Client, Id)); - } - - /// Gets a collection of StorageCacheResources in the ResourceGroupResource. - /// An object representing collection of StorageCacheResources and their operations over a StorageCacheResource. - public virtual StorageCacheCollection GetStorageCaches() - { - return GetCachedClient(Client => new StorageCacheCollection(Client, Id)); - } - } -} diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheArmClientMockingExtension.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheArmClientMockingExtension.cs new file mode 100644 index 000000000000..f81b3e3615ba --- /dev/null +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageCache; + +namespace Azure.ResourceManager.StorageCache.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StorageCacheArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageCacheArmClientMockingExtension() + { + } + + /// 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 StorageCacheArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StorageCacheArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AmlFileSystemResource GetAmlFileSystemResource(ResourceIdentifier id) + { + AmlFileSystemResource.ValidateResourceId(id); + return new AmlFileSystemResource(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 StorageCacheResource GetStorageCacheResource(ResourceIdentifier id) + { + StorageCacheResource.ValidateResourceId(id); + return new StorageCacheResource(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 StorageTargetResource GetStorageTargetResource(ResourceIdentifier id) + { + StorageTargetResource.ValidateResourceId(id); + return new StorageTargetResource(Client, id); + } + } +} diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheExtensions.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheExtensions.cs index 43cac92f1980..c6048d19ae6a 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheExtensions.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StorageCache.Mocking; using Azure.ResourceManager.StorageCache.Models; namespace Azure.ResourceManager.StorageCache @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.StorageCache /// A class to add extension methods to Azure.ResourceManager.StorageCache. public static partial class StorageCacheExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StorageCacheArmClientMockingExtension GetStorageCacheArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StorageCacheArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StorageCacheResourceGroupMockingExtension GetStorageCacheResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StorageCacheResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StorageCacheSubscriptionMockingExtension GetStorageCacheSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StorageCacheSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AmlFileSystemResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AmlFileSystemResource GetAmlFileSystemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AmlFileSystemResource.ValidateResourceId(id); - return new AmlFileSystemResource(client, id); - } - ); + return GetStorageCacheArmClientMockingExtension(client).GetAmlFileSystemResource(id); } - #endregion - #region StorageCacheResource /// /// 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. /// Returns a object. public static StorageCacheResource GetStorageCacheResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageCacheResource.ValidateResourceId(id); - return new StorageCacheResource(client, id); - } - ); + return GetStorageCacheArmClientMockingExtension(client).GetStorageCacheResource(id); } - #endregion - #region StorageTargetResource /// /// 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. /// Returns a object. public static StorageTargetResource GetStorageTargetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageTargetResource.ValidateResourceId(id); - return new StorageTargetResource(client, id); - } - ); + return GetStorageCacheArmClientMockingExtension(client).GetStorageTargetResource(id); } - #endregion - /// Gets a collection of AmlFileSystemResources in the ResourceGroupResource. + /// + /// Gets a collection of AmlFileSystemResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AmlFileSystemResources and their operations over a AmlFileSystemResource. public static AmlFileSystemCollection GetAmlFileSystems(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAmlFileSystems(); + return GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetAmlFileSystems(); } /// @@ -127,16 +109,20 @@ public static AmlFileSystemCollection GetAmlFileSystems(this ResourceGroupResour /// amlFilesystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the AML file system. Allows alphanumerics, underscores, and hyphens. Start and end with alphanumeric. /// The cancellation token to use. - /// 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 static async Task> GetAmlFileSystemAsync(this ResourceGroupResource resourceGroupResource, string amlFileSystemName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAmlFileSystems().GetAsync(amlFileSystemName, cancellationToken).ConfigureAwait(false); + return await GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetAmlFileSystemAsync(amlFileSystemName, cancellationToken).ConfigureAwait(false); } /// @@ -151,24 +137,34 @@ public static async Task> GetAmlFileSystemAsync( /// amlFilesystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the AML file system. Allows alphanumerics, underscores, and hyphens. Start and end with alphanumeric. /// The cancellation token to use. - /// 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 static Response GetAmlFileSystem(this ResourceGroupResource resourceGroupResource, string amlFileSystemName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAmlFileSystems().Get(amlFileSystemName, cancellationToken); + return GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetAmlFileSystem(amlFileSystemName, cancellationToken); } - /// Gets a collection of StorageCacheResources in the ResourceGroupResource. + /// + /// Gets a collection of StorageCacheResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StorageCacheResources and their operations over a StorageCacheResource. public static StorageCacheCollection GetStorageCaches(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageCaches(); + return GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetStorageCaches(); } /// @@ -183,16 +179,20 @@ public static StorageCacheCollection GetStorageCaches(this ResourceGroupResource /// Caches_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. /// The cancellation token to use. - /// 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 static async Task> GetStorageCacheAsync(this ResourceGroupResource resourceGroupResource, string cacheName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStorageCaches().GetAsync(cacheName, cancellationToken).ConfigureAwait(false); + return await GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetStorageCacheAsync(cacheName, cancellationToken).ConfigureAwait(false); } /// @@ -207,16 +207,20 @@ public static async Task> GetStorageCacheAsync(th /// Caches_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. /// The cancellation token to use. - /// 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 static Response GetStorageCache(this ResourceGroupResource resourceGroupResource, string cacheName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStorageCaches().Get(cacheName, cancellationToken); + return GetStorageCacheResourceGroupMockingExtension(resourceGroupResource).GetStorageCache(cacheName, cancellationToken); } /// @@ -231,13 +235,17 @@ public static Response GetStorageCache(this ResourceGroupR /// amlFilesystems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAmlFileSystemsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAmlFileSystemsAsync(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetAmlFileSystemsAsync(cancellationToken); } /// @@ -252,13 +260,17 @@ public static AsyncPageable GetAmlFileSystemsAsync(this S /// amlFilesystems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAmlFileSystems(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAmlFileSystems(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetAmlFileSystems(cancellationToken); } /// @@ -273,13 +285,17 @@ public static Pageable GetAmlFileSystems(this Subscriptio /// checkAmlFSSubnets /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information about the subnets to validate. /// The cancellation token to use. public static async Task CheckAmlFSSubnetsAsync(this SubscriptionResource subscriptionResource, AmlFileSystemSubnetContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAmlFSSubnetsAsync(content, cancellationToken).ConfigureAwait(false); + return await GetStorageCacheSubscriptionMockingExtension(subscriptionResource).CheckAmlFSSubnetsAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -294,13 +310,17 @@ public static async Task CheckAmlFSSubnetsAsync(this SubscriptionResou /// checkAmlFSSubnets /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information about the subnets to validate. /// The cancellation token to use. public static Response CheckAmlFSSubnets(this SubscriptionResource subscriptionResource, AmlFileSystemSubnetContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAmlFSSubnets(content, cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).CheckAmlFSSubnets(content, cancellationToken); } /// @@ -315,13 +335,17 @@ public static Response CheckAmlFSSubnets(this SubscriptionResource subscriptionR /// getRequiredAmlFSSubnetsSize /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information to determine the number of available IPs a subnet will need to host the AML file system. /// The cancellation token to use. public static async Task> GetRequiredAmlFSSubnetsSizeAsync(this SubscriptionResource subscriptionResource, RequiredAmlFileSystemSubnetsSizeContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetRequiredAmlFSSubnetsSizeAsync(content, cancellationToken).ConfigureAwait(false); + return await GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetRequiredAmlFSSubnetsSizeAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -336,13 +360,17 @@ public static async Task> GetRequired /// getRequiredAmlFSSubnetsSize /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information to determine the number of available IPs a subnet will need to host the AML file system. /// The cancellation token to use. public static Response GetRequiredAmlFSSubnetsSize(this SubscriptionResource subscriptionResource, RequiredAmlFileSystemSubnetsSizeContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRequiredAmlFSSubnetsSize(content, cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetRequiredAmlFSSubnetsSize(content, cancellationToken); } /// @@ -357,13 +385,17 @@ public static Response GetRequiredAmlFSSubnets /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageCacheSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCacheSkusAsync(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCacheSkusAsync(cancellationToken); } /// @@ -378,13 +410,17 @@ public static AsyncPageable GetStorageCacheSkusAsync(this Subsc /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageCacheSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCacheSkus(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCacheSkus(cancellationToken); } /// @@ -399,13 +435,17 @@ public static Pageable GetStorageCacheSkus(this SubscriptionRes /// UsageModels_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsageModelsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsageModelsAsync(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetUsageModelsAsync(cancellationToken); } /// @@ -420,13 +460,17 @@ public static AsyncPageable GetUsageModelsAsync(this Sub /// UsageModels_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsageModels(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsageModels(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetUsageModels(cancellationToken); } /// @@ -441,6 +485,10 @@ public static Pageable GetUsageModels(this SubscriptionR /// AscUsages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region to query for usage information. @@ -448,7 +496,7 @@ public static Pageable GetUsageModels(this SubscriptionR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageCacheUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCacheUsagesAsync(location, cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCacheUsagesAsync(location, cancellationToken); } /// @@ -463,6 +511,10 @@ public static AsyncPageable GetStorageCacheUsagesAsync(this S /// AscUsages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region to query for usage information. @@ -470,7 +522,7 @@ public static AsyncPageable GetStorageCacheUsagesAsync(this S /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageCacheUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCacheUsages(location, cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCacheUsages(location, cancellationToken); } /// @@ -485,13 +537,17 @@ public static Pageable GetStorageCacheUsages(this Subscriptio /// Caches_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageCachesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCachesAsync(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCachesAsync(cancellationToken); } /// @@ -506,13 +562,17 @@ public static AsyncPageable GetStorageCachesAsync(this Sub /// Caches_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageCaches(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageCaches(cancellationToken); + return GetStorageCacheSubscriptionMockingExtension(subscriptionResource).GetStorageCaches(cancellationToken); } } } diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheResourceGroupMockingExtension.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..98b775c13465 --- /dev/null +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageCache; + +namespace Azure.ResourceManager.StorageCache.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StorageCacheResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageCacheResourceGroupMockingExtension() + { + } + + /// 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 StorageCacheResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AmlFileSystemResources in the ResourceGroupResource. + /// An object representing collection of AmlFileSystemResources and their operations over a AmlFileSystemResource. + public virtual AmlFileSystemCollection GetAmlFileSystems() + { + return GetCachedClient(client => new AmlFileSystemCollection(client, Id)); + } + + /// + /// Returns an AML file system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName} + /// + /// + /// Operation Id + /// amlFilesystems_Get + /// + /// + /// + /// Name for the AML file system. Allows alphanumerics, underscores, and hyphens. Start and end with alphanumeric. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAmlFileSystemAsync(string amlFileSystemName, CancellationToken cancellationToken = default) + { + return await GetAmlFileSystems().GetAsync(amlFileSystemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns an AML file system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName} + /// + /// + /// Operation Id + /// amlFilesystems_Get + /// + /// + /// + /// Name for the AML file system. Allows alphanumerics, underscores, and hyphens. Start and end with alphanumeric. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAmlFileSystem(string amlFileSystemName, CancellationToken cancellationToken = default) + { + return GetAmlFileSystems().Get(amlFileSystemName, cancellationToken); + } + + /// Gets a collection of StorageCacheResources in the ResourceGroupResource. + /// An object representing collection of StorageCacheResources and their operations over a StorageCacheResource. + public virtual StorageCacheCollection GetStorageCaches() + { + return GetCachedClient(client => new StorageCacheCollection(client, Id)); + } + + /// + /// Returns a cache. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName} + /// + /// + /// Operation Id + /// Caches_Get + /// + /// + /// + /// Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageCacheAsync(string cacheName, CancellationToken cancellationToken = default) + { + return await GetStorageCaches().GetAsync(cacheName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a cache. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName} + /// + /// + /// Operation Id + /// Caches_Get + /// + /// + /// + /// Name of cache. Length of name must not be greater than 80 and chars must be from the [-0-9a-zA-Z_] char class. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageCache(string cacheName, CancellationToken cancellationToken = default) + { + return GetStorageCaches().Get(cacheName, cancellationToken); + } + } +} diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheSubscriptionMockingExtension.cs similarity index 91% rename from sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheSubscriptionMockingExtension.cs index 726aaed7e109..58177b5c6c11 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/Extensions/StorageCacheSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.StorageCache; using Azure.ResourceManager.StorageCache.Models; -namespace Azure.ResourceManager.StorageCache +namespace Azure.ResourceManager.StorageCache.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StorageCacheSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _amlFileSystemamlFilesystemsClientDiagnostics; private AmlFilesystemsRestOperations _amlFileSystemamlFilesystemsRestClient; @@ -33,15 +34,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _storageCacheCachesClientDiagnostics; private CachesRestOperations _storageCacheCachesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StorageCacheSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StorageCacheSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -83,7 +84,7 @@ public virtual AsyncPageable GetAmlFileSystemsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => AmlFileSystemamlFilesystemsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AmlFileSystemamlFilesystemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AmlFileSystemResource(Client, AmlFileSystemData.DeserializeAmlFileSystemData(e)), AmlFileSystemamlFilesystemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAmlFileSystems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AmlFileSystemResource(Client, AmlFileSystemData.DeserializeAmlFileSystemData(e)), AmlFileSystemamlFilesystemsClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetAmlFileSystems", "value", "nextLink", cancellationToken); } /// @@ -105,7 +106,7 @@ public virtual Pageable GetAmlFileSystems(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => AmlFileSystemamlFilesystemsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AmlFileSystemamlFilesystemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AmlFileSystemResource(Client, AmlFileSystemData.DeserializeAmlFileSystemData(e)), AmlFileSystemamlFilesystemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAmlFileSystems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AmlFileSystemResource(Client, AmlFileSystemData.DeserializeAmlFileSystemData(e)), AmlFileSystemamlFilesystemsClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetAmlFileSystems", "value", "nextLink", cancellationToken); } /// @@ -125,7 +126,7 @@ public virtual Pageable GetAmlFileSystems(CancellationTok /// The cancellation token to use. public virtual async Task CheckAmlFSSubnetsAsync(AmlFileSystemSubnetContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAmlFSSubnets"); + using var scope = DefaultClientDiagnostics.CreateScope("StorageCacheSubscriptionMockingExtension.CheckAmlFSSubnets"); scope.Start(); try { @@ -156,7 +157,7 @@ public virtual async Task CheckAmlFSSubnetsAsync(AmlFileSystemSubnetCo /// The cancellation token to use. public virtual Response CheckAmlFSSubnets(AmlFileSystemSubnetContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAmlFSSubnets"); + using var scope = DefaultClientDiagnostics.CreateScope("StorageCacheSubscriptionMockingExtension.CheckAmlFSSubnets"); scope.Start(); try { @@ -187,7 +188,7 @@ public virtual Response CheckAmlFSSubnets(AmlFileSystemSubnetContent content = n /// The cancellation token to use. public virtual async Task> GetRequiredAmlFSSubnetsSizeAsync(RequiredAmlFileSystemSubnetsSizeContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRequiredAmlFSSubnetsSize"); + using var scope = DefaultClientDiagnostics.CreateScope("StorageCacheSubscriptionMockingExtension.GetRequiredAmlFSSubnetsSize"); scope.Start(); try { @@ -218,7 +219,7 @@ public virtual async Task> GetRequire /// The cancellation token to use. public virtual Response GetRequiredAmlFSSubnetsSize(RequiredAmlFileSystemSubnetsSizeContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRequiredAmlFSSubnetsSize"); + using var scope = DefaultClientDiagnostics.CreateScope("StorageCacheSubscriptionMockingExtension.GetRequiredAmlFSSubnetsSize"); scope.Start(); try { @@ -251,7 +252,7 @@ public virtual AsyncPageable GetStorageCacheSkusAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheSku.DeserializeStorageCacheSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCacheSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheSku.DeserializeStorageCacheSku, SkusClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCacheSkus", "value", "nextLink", cancellationToken); } /// @@ -273,7 +274,7 @@ public virtual Pageable GetStorageCacheSkus(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheSku.DeserializeStorageCacheSku, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCacheSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheSku.DeserializeStorageCacheSku, SkusClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCacheSkus", "value", "nextLink", cancellationToken); } /// @@ -295,7 +296,7 @@ public virtual AsyncPageable GetUsageModelsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => UsageModelsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageModelsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheUsageModel.DeserializeStorageCacheUsageModel, UsageModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsageModels", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheUsageModel.DeserializeStorageCacheUsageModel, UsageModelsClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetUsageModels", "value", "nextLink", cancellationToken); } /// @@ -317,7 +318,7 @@ public virtual Pageable GetUsageModels(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => UsageModelsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageModelsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheUsageModel.DeserializeStorageCacheUsageModel, UsageModelsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsageModels", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheUsageModel.DeserializeStorageCacheUsageModel, UsageModelsClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetUsageModels", "value", "nextLink", cancellationToken); } /// @@ -340,7 +341,7 @@ public virtual AsyncPageable GetStorageCacheUsagesAsync(Azure { HttpMessage FirstPageRequest(int? pageSizeHint) => AscUsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AscUsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheUsage.DeserializeStorageCacheUsage, AscUsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCacheUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StorageCacheUsage.DeserializeStorageCacheUsage, AscUsagesClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCacheUsages", "value", "nextLink", cancellationToken); } /// @@ -363,7 +364,7 @@ public virtual Pageable GetStorageCacheUsages(AzureLocation l { HttpMessage FirstPageRequest(int? pageSizeHint) => AscUsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AscUsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheUsage.DeserializeStorageCacheUsage, AscUsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCacheUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StorageCacheUsage.DeserializeStorageCacheUsage, AscUsagesClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCacheUsages", "value", "nextLink", cancellationToken); } /// @@ -385,7 +386,7 @@ public virtual AsyncPageable GetStorageCachesAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageCacheCachesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageCacheCachesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageCacheResource(Client, StorageCacheData.DeserializeStorageCacheData(e)), StorageCacheCachesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCaches", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageCacheResource(Client, StorageCacheData.DeserializeStorageCacheData(e)), StorageCacheCachesClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCaches", "value", "nextLink", cancellationToken); } /// @@ -407,7 +408,7 @@ public virtual Pageable GetStorageCaches(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageCacheCachesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageCacheCachesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageCacheResource(Client, StorageCacheData.DeserializeStorageCacheData(e)), StorageCacheCachesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageCaches", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageCacheResource(Client, StorageCacheData.DeserializeStorageCacheData(e)), StorageCacheCachesClientDiagnostics, Pipeline, "StorageCacheSubscriptionMockingExtension.GetStorageCaches", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/StorageCacheResource.cs b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/StorageCacheResource.cs index f656ba2a921a..1e8e996f9b43 100644 --- a/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/StorageCacheResource.cs +++ b/sdk/storagecache/Azure.ResourceManager.StorageCache/src/Generated/StorageCacheResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StorageTargetResources and their operations over a StorageTargetResource. public virtual StorageTargetCollection GetStorageTargets() { - return GetCachedClient(Client => new StorageTargetCollection(Client, Id)); + return GetCachedClient(client => new StorageTargetCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual StorageTargetCollection GetStorageTargets() /// /// Name of Storage Target. /// The cancellation token to use. - /// 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> GetStorageTargetAsync(string storageTargetName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetStorageTargetAsync /// /// Name of Storage Target. /// The cancellation token to use. - /// 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 GetStorageTarget(string storageTargetName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index c52fbfd40f43..000000000000 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.StorageMover -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of StorageMoverResources in the ResourceGroupResource. - /// An object representing collection of StorageMoverResources and their operations over a StorageMoverResource. - public virtual StorageMoverCollection GetStorageMovers() - { - return GetCachedClient(Client => new StorageMoverCollection(Client, Id)); - } - } -} diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverArmClientMockingExtension.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverArmClientMockingExtension.cs new file mode 100644 index 000000000000..69f6f5bfdd0d --- /dev/null +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageMover; + +namespace Azure.ResourceManager.StorageMover.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StorageMoverArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageMoverArmClientMockingExtension() + { + } + + /// 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 StorageMoverArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StorageMoverArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StorageMoverResource GetStorageMoverResource(ResourceIdentifier id) + { + StorageMoverResource.ValidateResourceId(id); + return new StorageMoverResource(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 StorageMoverAgentResource GetStorageMoverAgentResource(ResourceIdentifier id) + { + StorageMoverAgentResource.ValidateResourceId(id); + return new StorageMoverAgentResource(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 StorageMoverEndpointResource GetStorageMoverEndpointResource(ResourceIdentifier id) + { + StorageMoverEndpointResource.ValidateResourceId(id); + return new StorageMoverEndpointResource(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 StorageMoverProjectResource GetStorageMoverProjectResource(ResourceIdentifier id) + { + StorageMoverProjectResource.ValidateResourceId(id); + return new StorageMoverProjectResource(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 JobDefinitionResource GetJobDefinitionResource(ResourceIdentifier id) + { + JobDefinitionResource.ValidateResourceId(id); + return new JobDefinitionResource(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 JobRunResource GetJobRunResource(ResourceIdentifier id) + { + JobRunResource.ValidateResourceId(id); + return new JobRunResource(Client, id); + } + } +} diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverExtensions.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverExtensions.cs index 37bc4a95afa3..5abf9b26a30b 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverExtensions.cs +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverExtensions.cs @@ -12,163 +12,136 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StorageMover.Mocking; namespace Azure.ResourceManager.StorageMover { /// A class to add extension methods to Azure.ResourceManager.StorageMover. public static partial class StorageMoverExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StorageMoverArmClientMockingExtension GetStorageMoverArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StorageMoverArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StorageMoverResourceGroupMockingExtension GetStorageMoverResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StorageMoverResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StorageMoverSubscriptionMockingExtension GetStorageMoverSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StorageMoverSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region StorageMoverResource /// /// 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. /// Returns a object. public static StorageMoverResource GetStorageMoverResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageMoverResource.ValidateResourceId(id); - return new StorageMoverResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetStorageMoverResource(id); } - #endregion - #region StorageMoverAgentResource /// /// 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. /// Returns a object. public static StorageMoverAgentResource GetStorageMoverAgentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageMoverAgentResource.ValidateResourceId(id); - return new StorageMoverAgentResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetStorageMoverAgentResource(id); } - #endregion - #region StorageMoverEndpointResource /// /// 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. /// Returns a object. public static StorageMoverEndpointResource GetStorageMoverEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageMoverEndpointResource.ValidateResourceId(id); - return new StorageMoverEndpointResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetStorageMoverEndpointResource(id); } - #endregion - #region StorageMoverProjectResource /// /// 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. /// Returns a object. public static StorageMoverProjectResource GetStorageMoverProjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageMoverProjectResource.ValidateResourceId(id); - return new StorageMoverProjectResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetStorageMoverProjectResource(id); } - #endregion - #region JobDefinitionResource /// /// 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. /// Returns a object. public static JobDefinitionResource GetJobDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - JobDefinitionResource.ValidateResourceId(id); - return new JobDefinitionResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetJobDefinitionResource(id); } - #endregion - #region JobRunResource /// /// 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. /// Returns a object. public static JobRunResource GetJobRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - JobRunResource.ValidateResourceId(id); - return new JobRunResource(client, id); - } - ); + return GetStorageMoverArmClientMockingExtension(client).GetJobRunResource(id); } - #endregion - /// Gets a collection of StorageMoverResources in the ResourceGroupResource. + /// + /// Gets a collection of StorageMoverResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StorageMoverResources and their operations over a StorageMoverResource. public static StorageMoverCollection GetStorageMovers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageMovers(); + return GetStorageMoverResourceGroupMockingExtension(resourceGroupResource).GetStorageMovers(); } /// @@ -183,16 +156,20 @@ public static StorageMoverCollection GetStorageMovers(this ResourceGroupResource /// StorageMovers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Storage Mover resource. /// The cancellation token to use. - /// 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 static async Task> GetStorageMoverAsync(this ResourceGroupResource resourceGroupResource, string storageMoverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStorageMovers().GetAsync(storageMoverName, cancellationToken).ConfigureAwait(false); + return await GetStorageMoverResourceGroupMockingExtension(resourceGroupResource).GetStorageMoverAsync(storageMoverName, cancellationToken).ConfigureAwait(false); } /// @@ -207,16 +184,20 @@ public static async Task> GetStorageMoverAsync(th /// StorageMovers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Storage Mover resource. /// The cancellation token to use. - /// 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 static Response GetStorageMover(this ResourceGroupResource resourceGroupResource, string storageMoverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStorageMovers().Get(storageMoverName, cancellationToken); + return GetStorageMoverResourceGroupMockingExtension(resourceGroupResource).GetStorageMover(storageMoverName, cancellationToken); } /// @@ -231,13 +212,17 @@ public static Response GetStorageMover(this ResourceGroupR /// StorageMovers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageMoversAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageMoversAsync(cancellationToken); + return GetStorageMoverSubscriptionMockingExtension(subscriptionResource).GetStorageMoversAsync(cancellationToken); } /// @@ -252,13 +237,17 @@ public static AsyncPageable GetStorageMoversAsync(this Sub /// StorageMovers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageMovers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageMovers(cancellationToken); + return GetStorageMoverSubscriptionMockingExtension(subscriptionResource).GetStorageMovers(cancellationToken); } } } diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverResourceGroupMockingExtension.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..717f04ff767e --- /dev/null +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageMover; + +namespace Azure.ResourceManager.StorageMover.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StorageMoverResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageMoverResourceGroupMockingExtension() + { + } + + /// 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 StorageMoverResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of StorageMoverResources in the ResourceGroupResource. + /// An object representing collection of StorageMoverResources and their operations over a StorageMoverResource. + public virtual StorageMoverCollection GetStorageMovers() + { + return GetCachedClient(client => new StorageMoverCollection(client, Id)); + } + + /// + /// Gets a Storage Mover resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName} + /// + /// + /// Operation Id + /// StorageMovers_Get + /// + /// + /// + /// The name of the Storage Mover resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageMoverAsync(string storageMoverName, CancellationToken cancellationToken = default) + { + return await GetStorageMovers().GetAsync(storageMoverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Storage Mover resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName} + /// + /// + /// Operation Id + /// StorageMovers_Get + /// + /// + /// + /// The name of the Storage Mover resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageMover(string storageMoverName, CancellationToken cancellationToken = default) + { + return GetStorageMovers().Get(storageMoverName, cancellationToken); + } + } +} diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverSubscriptionMockingExtension.cs similarity index 84% rename from sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverSubscriptionMockingExtension.cs index 46a2b2c0e970..2edd3ac096ef 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/Extensions/StorageMoverSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.StorageMover; -namespace Azure.ResourceManager.StorageMover +namespace Azure.ResourceManager.StorageMover.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StorageMoverSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _storageMoverClientDiagnostics; private StorageMoversRestOperations _storageMoverRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StorageMoverSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StorageMoverSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetStorageMoversAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageMoverRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageMoverRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageMoverResource(Client, StorageMoverData.DeserializeStorageMoverData(e)), StorageMoverClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageMovers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageMoverResource(Client, StorageMoverData.DeserializeStorageMoverData(e)), StorageMoverClientDiagnostics, Pipeline, "StorageMoverSubscriptionMockingExtension.GetStorageMovers", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetStorageMovers(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageMoverRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageMoverRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageMoverResource(Client, StorageMoverData.DeserializeStorageMoverData(e)), StorageMoverClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageMovers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageMoverResource(Client, StorageMoverData.DeserializeStorageMoverData(e)), StorageMoverClientDiagnostics, Pipeline, "StorageMoverSubscriptionMockingExtension.GetStorageMovers", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/JobDefinitionResource.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/JobDefinitionResource.cs index c5373f91d5df..adcd57ffc0a6 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/JobDefinitionResource.cs +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/JobDefinitionResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of JobRunResources and their operations over a JobRunResource. public virtual JobRunCollection GetJobRuns() { - return GetCachedClient(Client => new JobRunCollection(Client, Id)); + return GetCachedClient(client => new JobRunCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual JobRunCollection GetJobRuns() /// /// The name of the Job Run resource. /// The cancellation token to use. - /// 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> GetJobRunAsync(string jobRunName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetJobRunAsync(string jobRun /// /// The name of the Job Run resource. /// The cancellation token to use. - /// 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 GetJobRun(string jobRunName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverProjectResource.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverProjectResource.cs index 4cc96b97d163..e9e181145ac2 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverProjectResource.cs +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverProjectResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of JobDefinitionResources and their operations over a JobDefinitionResource. public virtual JobDefinitionCollection GetJobDefinitions() { - return GetCachedClient(Client => new JobDefinitionCollection(Client, Id)); + return GetCachedClient(client => new JobDefinitionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual JobDefinitionCollection GetJobDefinitions() /// /// The name of the Job Definition resource. /// The cancellation token to use. - /// 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> GetJobDefinitionAsync(string jobDefinitionName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetJobDefinitionAsync /// /// The name of the Job Definition resource. /// The cancellation token to use. - /// 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 GetJobDefinition(string jobDefinitionName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverResource.cs b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverResource.cs index 202d9fd9b491..89664f4cbfc9 100644 --- a/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverResource.cs +++ b/sdk/storagemover/Azure.ResourceManager.StorageMover/src/Generated/StorageMoverResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StorageMoverAgentResources and their operations over a StorageMoverAgentResource. public virtual StorageMoverAgentCollection GetStorageMoverAgents() { - return GetCachedClient(Client => new StorageMoverAgentCollection(Client, Id)); + return GetCachedClient(client => new StorageMoverAgentCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual StorageMoverAgentCollection GetStorageMoverAgents() /// /// The name of the Agent resource. /// The cancellation token to use. - /// 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> GetStorageMoverAgentAsync(string agentName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetStorageMoverAg /// /// The name of the Agent resource. /// The cancellation token to use. - /// 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 GetStorageMoverAgent(string agentName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetStorageMoverAgent(string a /// An object representing collection of StorageMoverEndpointResources and their operations over a StorageMoverEndpointResource. public virtual StorageMoverEndpointCollection GetStorageMoverEndpoints() { - return GetCachedClient(Client => new StorageMoverEndpointCollection(Client, Id)); + return GetCachedClient(client => new StorageMoverEndpointCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual StorageMoverEndpointCollection GetStorageMoverEndpoints() /// /// The name of the Endpoint resource. /// The cancellation token to use. - /// 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> GetStorageMoverEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetStorageMove /// /// The name of the Endpoint resource. /// The cancellation token to use. - /// 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 GetStorageMoverEndpoint(string endpointName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetStorageMoverEndpoint(st /// An object representing collection of StorageMoverProjectResources and their operations over a StorageMoverProjectResource. public virtual StorageMoverProjectCollection GetStorageMoverProjects() { - return GetCachedClient(Client => new StorageMoverProjectCollection(Client, Id)); + return GetCachedClient(client => new StorageMoverProjectCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual StorageMoverProjectCollection GetStorageMoverProjects() /// /// The name of the Project resource. /// The cancellation token to use. - /// 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> GetStorageMoverProjectAsync(string projectName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetStorageMover /// /// The name of the Project resource. /// The cancellation token to use. - /// 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 GetStorageMoverProject(string projectName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/DiskPoolResource.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/DiskPoolResource.cs index ce502d22237e..9dd6c92b79a4 100644 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/DiskPoolResource.cs +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/DiskPoolResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DiskPoolIscsiTargetResources and their operations over a DiskPoolIscsiTargetResource. public virtual DiskPoolIscsiTargetCollection GetDiskPoolIscsiTargets() { - return GetCachedClient(Client => new DiskPoolIscsiTargetCollection(Client, Id)); + return GetCachedClient(client => new DiskPoolIscsiTargetCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual DiskPoolIscsiTargetCollection GetDiskPoolIscsiTargets() /// /// The name of the iSCSI Target. /// The cancellation token to use. - /// 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> GetDiskPoolIscsiTargetAsync(string iscsiTargetName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDiskPoolIscs /// /// The name of the iSCSI Target. /// The cancellation token to use. - /// 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 GetDiskPoolIscsiTarget(string iscsiTargetName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6698c42f3252..000000000000 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.StoragePool -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DiskPoolResources in the ResourceGroupResource. - /// An object representing collection of DiskPoolResources and their operations over a DiskPoolResource. - public virtual DiskPoolCollection GetDiskPools() - { - return GetCachedClient(Client => new DiskPoolCollection(Client, Id)); - } - } -} diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolArmClientMockingExtension.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolArmClientMockingExtension.cs new file mode 100644 index 000000000000..598c6fef0b38 --- /dev/null +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StoragePool; + +namespace Azure.ResourceManager.StoragePool.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StoragePoolArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StoragePoolArmClientMockingExtension() + { + } + + /// 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 StoragePoolArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StoragePoolArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DiskPoolResource GetDiskPoolResource(ResourceIdentifier id) + { + DiskPoolResource.ValidateResourceId(id); + return new DiskPoolResource(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 DiskPoolIscsiTargetResource GetDiskPoolIscsiTargetResource(ResourceIdentifier id) + { + DiskPoolIscsiTargetResource.ValidateResourceId(id); + return new DiskPoolIscsiTargetResource(Client, id); + } + } +} diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolExtensions.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolExtensions.cs index 1b68977665fc..bfa2ae66cc4c 100644 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolExtensions.cs +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StoragePool.Mocking; using Azure.ResourceManager.StoragePool.Models; namespace Azure.ResourceManager.StoragePool @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.StoragePool /// A class to add extension methods to Azure.ResourceManager.StoragePool. public static partial class StoragePoolExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StoragePoolArmClientMockingExtension GetStoragePoolArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StoragePoolArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StoragePoolResourceGroupMockingExtension GetStoragePoolResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StoragePoolResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StoragePoolSubscriptionMockingExtension GetStoragePoolSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StoragePoolSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DiskPoolResource /// /// 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. /// Returns a object. public static DiskPoolResource GetDiskPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskPoolResource.ValidateResourceId(id); - return new DiskPoolResource(client, id); - } - ); + return GetStoragePoolArmClientMockingExtension(client).GetDiskPoolResource(id); } - #endregion - #region DiskPoolIscsiTargetResource /// /// 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. /// Returns a object. public static DiskPoolIscsiTargetResource GetDiskPoolIscsiTargetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskPoolIscsiTargetResource.ValidateResourceId(id); - return new DiskPoolIscsiTargetResource(client, id); - } - ); + return GetStoragePoolArmClientMockingExtension(client).GetDiskPoolIscsiTargetResource(id); } - #endregion - /// Gets a collection of DiskPoolResources in the ResourceGroupResource. + /// + /// Gets a collection of DiskPoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DiskPoolResources and their operations over a DiskPoolResource. public static DiskPoolCollection GetDiskPools(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiskPools(); + return GetStoragePoolResourceGroupMockingExtension(resourceGroupResource).GetDiskPools(); } /// @@ -108,16 +93,20 @@ public static DiskPoolCollection GetDiskPools(this ResourceGroupResource resourc /// DiskPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Disk Pool. /// The cancellation token to use. - /// 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 static async Task> GetDiskPoolAsync(this ResourceGroupResource resourceGroupResource, string diskPoolName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDiskPools().GetAsync(diskPoolName, cancellationToken).ConfigureAwait(false); + return await GetStoragePoolResourceGroupMockingExtension(resourceGroupResource).GetDiskPoolAsync(diskPoolName, cancellationToken).ConfigureAwait(false); } /// @@ -132,16 +121,20 @@ public static async Task> GetDiskPoolAsync(this Resou /// DiskPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Disk Pool. /// The cancellation token to use. - /// 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 static Response GetDiskPool(this ResourceGroupResource resourceGroupResource, string diskPoolName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDiskPools().Get(diskPoolName, cancellationToken); + return GetStoragePoolResourceGroupMockingExtension(resourceGroupResource).GetDiskPool(diskPoolName, cancellationToken); } /// @@ -156,13 +149,17 @@ public static Response GetDiskPool(this ResourceGroupResource /// DiskPools_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiskPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskPoolsAsync(cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetDiskPoolsAsync(cancellationToken); } /// @@ -177,13 +174,17 @@ public static AsyncPageable GetDiskPoolsAsync(this Subscriptio /// DiskPools_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiskPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskPools(cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetDiskPools(cancellationToken); } /// @@ -198,6 +199,10 @@ public static Pageable GetDiskPools(this SubscriptionResource /// DiskPoolZones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -205,7 +210,7 @@ public static Pageable GetDiskPools(this SubscriptionResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiskPoolZonesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskPoolZonesAsync(location, cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetDiskPoolZonesAsync(location, cancellationToken); } /// @@ -220,6 +225,10 @@ public static AsyncPageable GetDiskPoolZonesAsync(this Subscri /// DiskPoolZones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -227,7 +236,7 @@ public static AsyncPageable GetDiskPoolZonesAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiskPoolZones(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskPoolZones(location, cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetDiskPoolZones(location, cancellationToken); } /// @@ -242,6 +251,10 @@ public static Pageable GetDiskPoolZones(this SubscriptionResou /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -249,7 +262,7 @@ public static Pageable GetDiskPoolZones(this SubscriptionResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceSkusAsync(location, cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetResourceSkusAsync(location, cancellationToken); } /// @@ -264,6 +277,10 @@ public static AsyncPageable GetResourceSkusAsync(this Subscr /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -271,7 +288,7 @@ public static AsyncPageable GetResourceSkusAsync(this Subscr /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceSkus(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceSkus(location, cancellationToken); + return GetStoragePoolSubscriptionMockingExtension(subscriptionResource).GetResourceSkus(location, cancellationToken); } } } diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolResourceGroupMockingExtension.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..315080a0fd37 --- /dev/null +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StoragePool; + +namespace Azure.ResourceManager.StoragePool.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StoragePoolResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StoragePoolResourceGroupMockingExtension() + { + } + + /// 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 StoragePoolResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DiskPoolResources in the ResourceGroupResource. + /// An object representing collection of DiskPoolResources and their operations over a DiskPoolResource. + public virtual DiskPoolCollection GetDiskPools() + { + return GetCachedClient(client => new DiskPoolCollection(client, Id)); + } + + /// + /// Get a Disk pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName} + /// + /// + /// Operation Id + /// DiskPools_Get + /// + /// + /// + /// The name of the Disk Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiskPoolAsync(string diskPoolName, CancellationToken cancellationToken = default) + { + return await GetDiskPools().GetAsync(diskPoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Disk pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool/diskPools/{diskPoolName} + /// + /// + /// Operation Id + /// DiskPools_Get + /// + /// + /// + /// The name of the Disk Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiskPool(string diskPoolName, CancellationToken cancellationToken = default) + { + return GetDiskPools().Get(diskPoolName, cancellationToken); + } + } +} diff --git a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolSubscriptionMockingExtension.cs similarity index 89% rename from sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolSubscriptionMockingExtension.cs index 223f73b1f11a..87703833da09 100644 --- a/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/storagepool/Azure.ResourceManager.StoragePool/src/Generated/Extensions/StoragePoolSubscriptionMockingExtension.cs @@ -11,12 +11,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.StoragePool; using Azure.ResourceManager.StoragePool.Models; -namespace Azure.ResourceManager.StoragePool +namespace Azure.ResourceManager.StoragePool.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StoragePoolSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _diskPoolClientDiagnostics; private DiskPoolsRestOperations _diskPoolRestClient; @@ -25,15 +26,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _resourceSkusClientDiagnostics; private ResourceSkusRestOperations _resourceSkusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StoragePoolSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StoragePoolSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -69,7 +70,7 @@ public virtual AsyncPageable GetDiskPoolsAsync(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskPoolRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskPoolRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskPoolResource(Client, DiskPoolData.DeserializeDiskPoolData(e)), DiskPoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskPoolResource(Client, DiskPoolData.DeserializeDiskPoolData(e)), DiskPoolClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetDiskPools", "value", "nextLink", cancellationToken); } /// @@ -91,7 +92,7 @@ public virtual Pageable GetDiskPools(CancellationToken cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskPoolRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskPoolRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskPoolResource(Client, DiskPoolData.DeserializeDiskPoolData(e)), DiskPoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskPoolResource(Client, DiskPoolData.DeserializeDiskPoolData(e)), DiskPoolClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetDiskPools", "value", "nextLink", cancellationToken); } /// @@ -114,7 +115,7 @@ public virtual AsyncPageable GetDiskPoolZonesAsync(AzureLocati { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskPoolZonesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskPoolZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiskPoolZoneInfo.DeserializeDiskPoolZoneInfo, DiskPoolZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskPoolZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiskPoolZoneInfo.DeserializeDiskPoolZoneInfo, DiskPoolZonesClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetDiskPoolZones", "value", "nextLink", cancellationToken); } /// @@ -137,7 +138,7 @@ public virtual Pageable GetDiskPoolZones(AzureLocation locatio { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskPoolZonesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskPoolZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiskPoolZoneInfo.DeserializeDiskPoolZoneInfo, DiskPoolZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskPoolZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiskPoolZoneInfo.DeserializeDiskPoolZoneInfo, DiskPoolZonesClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetDiskPoolZones", "value", "nextLink", cancellationToken); } /// @@ -160,7 +161,7 @@ public virtual AsyncPageable GetResourceSkusAsync(AzureLocat { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StoragePoolSkuInfo.DeserializeStoragePoolSkuInfo, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, StoragePoolSkuInfo.DeserializeStoragePoolSkuInfo, ResourceSkusClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -183,7 +184,7 @@ public virtual Pageable GetResourceSkus(AzureLocation locati { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StoragePoolSkuInfo.DeserializeStoragePoolSkuInfo, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, StoragePoolSkuInfo.DeserializeStoragePoolSkuInfo, ResourceSkusClientDiagnostics, Pipeline, "StoragePoolSubscriptionMockingExtension.GetResourceSkus", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index c5274b6edc5c..000000000000 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.StorageSync -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of StorageSyncServiceResources in the ResourceGroupResource. - /// An object representing collection of StorageSyncServiceResources and their operations over a StorageSyncServiceResource. - public virtual StorageSyncServiceCollection GetStorageSyncServices() - { - return GetCachedClient(Client => new StorageSyncServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncArmClientMockingExtension.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncArmClientMockingExtension.cs new file mode 100644 index 000000000000..c3c8616a02cd --- /dev/null +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageSync; + +namespace Azure.ResourceManager.StorageSync.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StorageSyncArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageSyncArmClientMockingExtension() + { + } + + /// 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 StorageSyncArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StorageSyncArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StorageSyncServiceResource GetStorageSyncServiceResource(ResourceIdentifier id) + { + StorageSyncServiceResource.ValidateResourceId(id); + return new StorageSyncServiceResource(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 StorageSyncPrivateEndpointConnectionResource GetStorageSyncPrivateEndpointConnectionResource(ResourceIdentifier id) + { + StorageSyncPrivateEndpointConnectionResource.ValidateResourceId(id); + return new StorageSyncPrivateEndpointConnectionResource(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 StorageSyncGroupResource GetStorageSyncGroupResource(ResourceIdentifier id) + { + StorageSyncGroupResource.ValidateResourceId(id); + return new StorageSyncGroupResource(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 CloudEndpointResource GetCloudEndpointResource(ResourceIdentifier id) + { + CloudEndpointResource.ValidateResourceId(id); + return new CloudEndpointResource(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 StorageSyncServerEndpointResource GetStorageSyncServerEndpointResource(ResourceIdentifier id) + { + StorageSyncServerEndpointResource.ValidateResourceId(id); + return new StorageSyncServerEndpointResource(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 StorageSyncRegisteredServerResource GetStorageSyncRegisteredServerResource(ResourceIdentifier id) + { + StorageSyncRegisteredServerResource.ValidateResourceId(id); + return new StorageSyncRegisteredServerResource(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 StorageSyncWorkflowResource GetStorageSyncWorkflowResource(ResourceIdentifier id) + { + StorageSyncWorkflowResource.ValidateResourceId(id); + return new StorageSyncWorkflowResource(Client, id); + } + } +} diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncExtensions.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncExtensions.cs index 7f0698e250c8..a71d03075ac2 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncExtensions.cs +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StorageSync.Mocking; using Azure.ResourceManager.StorageSync.Models; namespace Azure.ResourceManager.StorageSync @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.StorageSync /// A class to add extension methods to Azure.ResourceManager.StorageSync. public static partial class StorageSyncExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StorageSyncArmClientMockingExtension GetStorageSyncArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StorageSyncArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StorageSyncResourceGroupMockingExtension GetStorageSyncResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StorageSyncResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StorageSyncSubscriptionMockingExtension GetStorageSyncSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StorageSyncSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region StorageSyncServiceResource /// /// 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. /// Returns a object. public static StorageSyncServiceResource GetStorageSyncServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncServiceResource.ValidateResourceId(id); - return new StorageSyncServiceResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncServiceResource(id); } - #endregion - #region StorageSyncPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static StorageSyncPrivateEndpointConnectionResource GetStorageSyncPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncPrivateEndpointConnectionResource.ValidateResourceId(id); - return new StorageSyncPrivateEndpointConnectionResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncPrivateEndpointConnectionResource(id); } - #endregion - #region StorageSyncGroupResource /// /// 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. /// Returns a object. public static StorageSyncGroupResource GetStorageSyncGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncGroupResource.ValidateResourceId(id); - return new StorageSyncGroupResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncGroupResource(id); } - #endregion - #region CloudEndpointResource /// /// 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. /// Returns a object. public static CloudEndpointResource GetCloudEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudEndpointResource.ValidateResourceId(id); - return new CloudEndpointResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetCloudEndpointResource(id); } - #endregion - #region StorageSyncServerEndpointResource /// /// 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. /// Returns a object. public static StorageSyncServerEndpointResource GetStorageSyncServerEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncServerEndpointResource.ValidateResourceId(id); - return new StorageSyncServerEndpointResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncServerEndpointResource(id); } - #endregion - #region StorageSyncRegisteredServerResource /// /// 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. /// Returns a object. public static StorageSyncRegisteredServerResource GetStorageSyncRegisteredServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncRegisteredServerResource.ValidateResourceId(id); - return new StorageSyncRegisteredServerResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncRegisteredServerResource(id); } - #endregion - #region StorageSyncWorkflowResource /// /// 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. /// Returns a object. public static StorageSyncWorkflowResource GetStorageSyncWorkflowResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageSyncWorkflowResource.ValidateResourceId(id); - return new StorageSyncWorkflowResource(client, id); - } - ); + return GetStorageSyncArmClientMockingExtension(client).GetStorageSyncWorkflowResource(id); } - #endregion - /// Gets a collection of StorageSyncServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of StorageSyncServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StorageSyncServiceResources and their operations over a StorageSyncServiceResource. public static StorageSyncServiceCollection GetStorageSyncServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageSyncServices(); + return GetStorageSyncResourceGroupMockingExtension(resourceGroupResource).GetStorageSyncServices(); } /// @@ -203,16 +173,20 @@ public static StorageSyncServiceCollection GetStorageSyncServices(this ResourceG /// StorageSyncServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Storage Sync Service resource. /// The cancellation token to use. - /// 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 static async Task> GetStorageSyncServiceAsync(this ResourceGroupResource resourceGroupResource, string storageSyncServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken).ConfigureAwait(false); + return await GetStorageSyncResourceGroupMockingExtension(resourceGroupResource).GetStorageSyncServiceAsync(storageSyncServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -227,16 +201,20 @@ public static async Task> GetStorageSyncSer /// StorageSyncServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Storage Sync Service resource. /// The cancellation token to use. - /// 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 static Response GetStorageSyncService(this ResourceGroupResource resourceGroupResource, string storageSyncServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStorageSyncServices().Get(storageSyncServiceName, cancellationToken); + return GetStorageSyncResourceGroupMockingExtension(resourceGroupResource).GetStorageSyncService(storageSyncServiceName, cancellationToken); } /// @@ -251,6 +229,10 @@ public static Response GetStorageSyncService(this Re /// StorageSyncServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The desired region for the name check. @@ -260,10 +242,7 @@ public static Response GetStorageSyncService(this Re /// or is null. public static async Task> CheckStorageSyncNameAvailabilityAsync(this SubscriptionResource subscriptionResource, string locationName, StorageSyncNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckStorageSyncNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetStorageSyncSubscriptionMockingExtension(subscriptionResource).CheckStorageSyncNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -278,6 +257,10 @@ public static async Task> CheckStora /// StorageSyncServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The desired region for the name check. @@ -287,10 +270,7 @@ public static async Task> CheckStora /// or is null. public static Response CheckStorageSyncNameAvailability(this SubscriptionResource subscriptionResource, string locationName, StorageSyncNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckStorageSyncNameAvailability(locationName, content, cancellationToken); + return GetStorageSyncSubscriptionMockingExtension(subscriptionResource).CheckStorageSyncNameAvailability(locationName, content, cancellationToken); } /// @@ -305,13 +285,17 @@ public static Response CheckStorageSyncNameAv /// StorageSyncServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageSyncServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageSyncServicesAsync(cancellationToken); + return GetStorageSyncSubscriptionMockingExtension(subscriptionResource).GetStorageSyncServicesAsync(cancellationToken); } /// @@ -326,13 +310,17 @@ public static AsyncPageable GetStorageSyncServicesAs /// StorageSyncServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageSyncServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStorageSyncServices(cancellationToken); + return GetStorageSyncSubscriptionMockingExtension(subscriptionResource).GetStorageSyncServices(cancellationToken); } } } diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncResourceGroupMockingExtension.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..5bdb0615ec20 --- /dev/null +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StorageSync; + +namespace Azure.ResourceManager.StorageSync.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StorageSyncResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StorageSyncResourceGroupMockingExtension() + { + } + + /// 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 StorageSyncResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of StorageSyncServiceResources in the ResourceGroupResource. + /// An object representing collection of StorageSyncServiceResources and their operations over a StorageSyncServiceResource. + public virtual StorageSyncServiceCollection GetStorageSyncServices() + { + return GetCachedClient(client => new StorageSyncServiceCollection(client, Id)); + } + + /// + /// Get a given StorageSyncService. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName} + /// + /// + /// Operation Id + /// StorageSyncServices_Get + /// + /// + /// + /// Name of Storage Sync Service resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStorageSyncServiceAsync(string storageSyncServiceName, CancellationToken cancellationToken = default) + { + return await GetStorageSyncServices().GetAsync(storageSyncServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a given StorageSyncService. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName} + /// + /// + /// Operation Id + /// StorageSyncServices_Get + /// + /// + /// + /// Name of Storage Sync Service resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStorageSyncService(string storageSyncServiceName, CancellationToken cancellationToken = default) + { + return GetStorageSyncServices().Get(storageSyncServiceName, cancellationToken); + } + } +} diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncSubscriptionMockingExtension.cs similarity index 79% rename from sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncSubscriptionMockingExtension.cs index e67cff5463bb..4327d5539113 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/Extensions/StorageSyncSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.StorageSync; using Azure.ResourceManager.StorageSync.Models; -namespace Azure.ResourceManager.StorageSync +namespace Azure.ResourceManager.StorageSync.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StorageSyncSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _storageSyncServiceClientDiagnostics; private StorageSyncServicesRestOperations _storageSyncServiceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StorageSyncSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StorageSyncSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,9 +61,14 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The desired region for the name check. /// Parameters to check availability of the given namespace name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> CheckStorageSyncNameAvailabilityAsync(string locationName, StorageSyncNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = StorageSyncServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckStorageSyncNameAvailability"); + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StorageSyncServiceClientDiagnostics.CreateScope("StorageSyncSubscriptionMockingExtension.CheckStorageSyncNameAvailability"); scope.Start(); try { @@ -92,9 +98,14 @@ public virtual async Task> CheckStor /// The desired region for the name check. /// Parameters to check availability of the given namespace name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response CheckStorageSyncNameAvailability(string locationName, StorageSyncNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = StorageSyncServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckStorageSyncNameAvailability"); + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StorageSyncServiceClientDiagnostics.CreateScope("StorageSyncSubscriptionMockingExtension.CheckStorageSyncNameAvailability"); scope.Start(); try { @@ -126,7 +137,7 @@ public virtual Response CheckStorageSyncNameA public virtual AsyncPageable GetStorageSyncServicesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageSyncServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new StorageSyncServiceResource(Client, StorageSyncServiceData.DeserializeStorageSyncServiceData(e)), StorageSyncServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageSyncServices", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new StorageSyncServiceResource(Client, StorageSyncServiceData.DeserializeStorageSyncServiceData(e)), StorageSyncServiceClientDiagnostics, Pipeline, "StorageSyncSubscriptionMockingExtension.GetStorageSyncServices", "value", null, cancellationToken); } /// @@ -147,7 +158,7 @@ public virtual AsyncPageable GetStorageSyncServicesA public virtual Pageable GetStorageSyncServices(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => StorageSyncServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new StorageSyncServiceResource(Client, StorageSyncServiceData.DeserializeStorageSyncServiceData(e)), StorageSyncServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStorageSyncServices", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new StorageSyncServiceResource(Client, StorageSyncServiceData.DeserializeStorageSyncServiceData(e)), StorageSyncServiceClientDiagnostics, Pipeline, "StorageSyncSubscriptionMockingExtension.GetStorageSyncServices", "value", null, cancellationToken); } } } diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncGroupResource.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncGroupResource.cs index ded93ef8aedb..5f2454ac6cd2 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncGroupResource.cs +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncGroupResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CloudEndpointResources and their operations over a CloudEndpointResource. public virtual CloudEndpointCollection GetCloudEndpoints() { - return GetCachedClient(Client => new CloudEndpointCollection(Client, Id)); + return GetCachedClient(client => new CloudEndpointCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual CloudEndpointCollection GetCloudEndpoints() /// /// Name of Cloud Endpoint object. /// The cancellation token to use. - /// 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> GetCloudEndpointAsync(string cloudEndpointName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetCloudEndpointAsync /// /// Name of Cloud Endpoint object. /// The cancellation token to use. - /// 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 GetCloudEndpoint(string cloudEndpointName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetCloudEndpoint(string cloudEndp /// An object representing collection of StorageSyncServerEndpointResources and their operations over a StorageSyncServerEndpointResource. public virtual StorageSyncServerEndpointCollection GetStorageSyncServerEndpoints() { - return GetCachedClient(Client => new StorageSyncServerEndpointCollection(Client, Id)); + return GetCachedClient(client => new StorageSyncServerEndpointCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual StorageSyncServerEndpointCollection GetStorageSyncServerEndpoints /// /// Name of Server Endpoint object. /// The cancellation token to use. - /// 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> GetStorageSyncServerEndpointAsync(string serverEndpointName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetStorag /// /// Name of Server Endpoint object. /// The cancellation token to use. - /// 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 GetStorageSyncServerEndpoint(string serverEndpointName, CancellationToken cancellationToken = default) { diff --git a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncServiceResource.cs b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncServiceResource.cs index 7eeaf292079d..d11727d3bf5b 100644 --- a/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncServiceResource.cs +++ b/sdk/storagesync/Azure.ResourceManager.StorageSync/src/Generated/StorageSyncServiceResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StorageSyncPrivateEndpointConnectionResources and their operations over a StorageSyncPrivateEndpointConnectionResource. public virtual StorageSyncPrivateEndpointConnectionCollection GetStorageSyncPrivateEndpointConnections() { - return GetCachedClient(Client => new StorageSyncPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new StorageSyncPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual StorageSyncPrivateEndpointConnectionCollection GetStorageSyncPriv /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetStorageSyncPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetStorageSyncPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetStorage /// An object representing collection of StorageSyncGroupResources and their operations over a StorageSyncGroupResource. public virtual StorageSyncGroupCollection GetStorageSyncGroups() { - return GetCachedClient(Client => new StorageSyncGroupCollection(Client, Id)); + return GetCachedClient(client => new StorageSyncGroupCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual StorageSyncGroupCollection GetStorageSyncGroups() /// /// Name of Sync Group resource. /// The cancellation token to use. - /// 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> GetStorageSyncGroupAsync(string syncGroupName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetStorageSyncGrou /// /// Name of Sync Group resource. /// The cancellation token to use. - /// 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 GetStorageSyncGroup(string syncGroupName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetStorageSyncGroup(string syn /// An object representing collection of StorageSyncRegisteredServerResources and their operations over a StorageSyncRegisteredServerResource. public virtual StorageSyncRegisteredServerCollection GetStorageSyncRegisteredServers() { - return GetCachedClient(Client => new StorageSyncRegisteredServerCollection(Client, Id)); + return GetCachedClient(client => new StorageSyncRegisteredServerCollection(client, Id)); } /// @@ -253,7 +253,7 @@ public virtual Response GetStorageSyncRegis /// An object representing collection of StorageSyncWorkflowResources and their operations over a StorageSyncWorkflowResource. public virtual StorageSyncWorkflowCollection GetStorageSyncWorkflows() { - return GetCachedClient(Client => new StorageSyncWorkflowCollection(Client, Id)); + return GetCachedClient(client => new StorageSyncWorkflowCollection(client, Id)); } /// @@ -271,8 +271,8 @@ public virtual StorageSyncWorkflowCollection GetStorageSyncWorkflows() /// /// workflow Id. /// The cancellation token to use. - /// 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> GetStorageSyncWorkflowAsync(string workflowId, CancellationToken cancellationToken = default) { @@ -294,8 +294,8 @@ public virtual async Task> GetStorageSyncW /// /// workflow Id. /// The cancellation token to use. - /// 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 GetStorageSyncWorkflow(string workflowId, CancellationToken cancellationToken = default) { diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 84a4593d2e73..000000000000 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.StreamAnalytics -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of StreamingJobResources in the ResourceGroupResource. - /// An object representing collection of StreamingJobResources and their operations over a StreamingJobResource. - public virtual StreamingJobCollection GetStreamingJobs() - { - return GetCachedClient(Client => new StreamingJobCollection(Client, Id)); - } - - /// Gets a collection of StreamAnalyticsClusterResources in the ResourceGroupResource. - /// An object representing collection of StreamAnalyticsClusterResources and their operations over a StreamAnalyticsClusterResource. - public virtual StreamAnalyticsClusterCollection GetStreamAnalyticsClusters() - { - return GetCachedClient(Client => new StreamAnalyticsClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsArmClientMockingExtension.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsArmClientMockingExtension.cs new file mode 100644 index 000000000000..4b33521e98d0 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StreamAnalytics; + +namespace Azure.ResourceManager.StreamAnalytics.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class StreamAnalyticsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StreamAnalyticsArmClientMockingExtension() + { + } + + /// 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 StreamAnalyticsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal StreamAnalyticsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StreamingJobFunctionResource GetStreamingJobFunctionResource(ResourceIdentifier id) + { + StreamingJobFunctionResource.ValidateResourceId(id); + return new StreamingJobFunctionResource(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 StreamingJobInputResource GetStreamingJobInputResource(ResourceIdentifier id) + { + StreamingJobInputResource.ValidateResourceId(id); + return new StreamingJobInputResource(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 StreamingJobOutputResource GetStreamingJobOutputResource(ResourceIdentifier id) + { + StreamingJobOutputResource.ValidateResourceId(id); + return new StreamingJobOutputResource(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 StreamingJobResource GetStreamingJobResource(ResourceIdentifier id) + { + StreamingJobResource.ValidateResourceId(id); + return new StreamingJobResource(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 StreamingJobTransformationResource GetStreamingJobTransformationResource(ResourceIdentifier id) + { + StreamingJobTransformationResource.ValidateResourceId(id); + return new StreamingJobTransformationResource(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 StreamAnalyticsClusterResource GetStreamAnalyticsClusterResource(ResourceIdentifier id) + { + StreamAnalyticsClusterResource.ValidateResourceId(id); + return new StreamAnalyticsClusterResource(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 StreamAnalyticsPrivateEndpointResource GetStreamAnalyticsPrivateEndpointResource(ResourceIdentifier id) + { + StreamAnalyticsPrivateEndpointResource.ValidateResourceId(id); + return new StreamAnalyticsPrivateEndpointResource(Client, id); + } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsExtensions.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsExtensions.cs index 407a34ad7862..c11b6f5e7e8a 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsExtensions.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.StreamAnalytics.Mocking; using Azure.ResourceManager.StreamAnalytics.Models; namespace Azure.ResourceManager.StreamAnalytics @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.StreamAnalytics /// A class to add extension methods to Azure.ResourceManager.StreamAnalytics. public static partial class StreamAnalyticsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static StreamAnalyticsArmClientMockingExtension GetStreamAnalyticsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new StreamAnalyticsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static StreamAnalyticsResourceGroupMockingExtension GetStreamAnalyticsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new StreamAnalyticsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static StreamAnalyticsSubscriptionMockingExtension GetStreamAnalyticsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new StreamAnalyticsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region StreamingJobFunctionResource /// /// 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. /// Returns a object. public static StreamingJobFunctionResource GetStreamingJobFunctionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingJobFunctionResource.ValidateResourceId(id); - return new StreamingJobFunctionResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamingJobFunctionResource(id); } - #endregion - #region StreamingJobInputResource /// /// 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. /// Returns a object. public static StreamingJobInputResource GetStreamingJobInputResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingJobInputResource.ValidateResourceId(id); - return new StreamingJobInputResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamingJobInputResource(id); } - #endregion - #region StreamingJobOutputResource /// /// 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. /// Returns a object. public static StreamingJobOutputResource GetStreamingJobOutputResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingJobOutputResource.ValidateResourceId(id); - return new StreamingJobOutputResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamingJobOutputResource(id); } - #endregion - #region StreamingJobResource /// /// 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. /// Returns a object. public static StreamingJobResource GetStreamingJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingJobResource.ValidateResourceId(id); - return new StreamingJobResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamingJobResource(id); } - #endregion - #region StreamingJobTransformationResource /// /// 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. /// Returns a object. public static StreamingJobTransformationResource GetStreamingJobTransformationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingJobTransformationResource.ValidateResourceId(id); - return new StreamingJobTransformationResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamingJobTransformationResource(id); } - #endregion - #region StreamAnalyticsClusterResource /// /// 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. /// Returns a object. public static StreamAnalyticsClusterResource GetStreamAnalyticsClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamAnalyticsClusterResource.ValidateResourceId(id); - return new StreamAnalyticsClusterResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamAnalyticsClusterResource(id); } - #endregion - #region StreamAnalyticsPrivateEndpointResource /// /// 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. /// Returns a object. public static StreamAnalyticsPrivateEndpointResource GetStreamAnalyticsPrivateEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamAnalyticsPrivateEndpointResource.ValidateResourceId(id); - return new StreamAnalyticsPrivateEndpointResource(client, id); - } - ); + return GetStreamAnalyticsArmClientMockingExtension(client).GetStreamAnalyticsPrivateEndpointResource(id); } - #endregion - /// Gets a collection of StreamingJobResources in the ResourceGroupResource. + /// + /// Gets a collection of StreamingJobResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StreamingJobResources and their operations over a StreamingJobResource. public static StreamingJobCollection GetStreamingJobs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStreamingJobs(); + return GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamingJobs(); } /// @@ -203,17 +173,21 @@ public static StreamingJobCollection GetStreamingJobs(this ResourceGroupResource /// StreamingJobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the streaming job. /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. /// The cancellation token to use. - /// 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 static async Task> GetStreamingJobAsync(this ResourceGroupResource resourceGroupResource, string jobName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStreamingJobs().GetAsync(jobName, expand, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamingJobAsync(jobName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -228,25 +202,35 @@ public static async Task> GetStreamingJobAsync(th /// StreamingJobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the streaming job. /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. /// The cancellation token to use. - /// 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 static Response GetStreamingJob(this ResourceGroupResource resourceGroupResource, string jobName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStreamingJobs().Get(jobName, expand, cancellationToken); + return GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamingJob(jobName, expand, cancellationToken); } - /// Gets a collection of StreamAnalyticsClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of StreamAnalyticsClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StreamAnalyticsClusterResources and their operations over a StreamAnalyticsClusterResource. public static StreamAnalyticsClusterCollection GetStreamAnalyticsClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStreamAnalyticsClusters(); + return GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamAnalyticsClusters(); } /// @@ -261,16 +245,20 @@ public static StreamAnalyticsClusterCollection GetStreamAnalyticsClusters(this R /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetStreamAnalyticsClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStreamAnalyticsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamAnalyticsClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -285,16 +273,20 @@ public static async Task> GetStreamAnal /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetStreamAnalyticsCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStreamAnalyticsClusters().Get(clusterName, cancellationToken); + return GetStreamAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetStreamAnalyticsCluster(clusterName, cancellationToken); } /// @@ -309,6 +301,10 @@ public static Response GetStreamAnalyticsCluster /// StreamingJobs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. @@ -316,7 +312,7 @@ public static Response GetStreamAnalyticsCluster /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStreamingJobsAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStreamingJobsAsync(expand, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetStreamingJobsAsync(expand, cancellationToken); } /// @@ -331,6 +327,10 @@ public static AsyncPageable GetStreamingJobsAsync(this Sub /// StreamingJobs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. @@ -338,7 +338,7 @@ public static AsyncPageable GetStreamingJobsAsync(this Sub /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStreamingJobs(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStreamingJobs(expand, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetStreamingJobs(expand, cancellationToken); } /// @@ -353,6 +353,10 @@ public static Pageable GetStreamingJobs(this SubscriptionR /// Subscriptions_ListQuotas /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. @@ -360,7 +364,7 @@ public static Pageable GetStreamingJobs(this SubscriptionR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetQuotasSubscriptionsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQuotasSubscriptionsAsync(location, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetQuotasSubscriptionsAsync(location, cancellationToken); } /// @@ -375,6 +379,10 @@ public static AsyncPageable GetQuotasSubscript /// Subscriptions_ListQuotas /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. @@ -382,7 +390,7 @@ public static AsyncPageable GetQuotasSubscript /// A collection of that may take multiple service requests to iterate over. public static Pageable GetQuotasSubscriptions(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQuotasSubscriptions(location, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetQuotasSubscriptions(location, cancellationToken); } /// @@ -397,6 +405,10 @@ public static Pageable GetQuotasSubscriptions( /// Subscriptions_TestQuery /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -406,9 +418,7 @@ public static Pageable GetQuotasSubscriptions( /// is null. public static async Task> TestQuerySubscriptionAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestQuery testQuery, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(testQuery, nameof(testQuery)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).TestQuerySubscriptionAsync(waitUntil, location, testQuery, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestQuerySubscriptionAsync(waitUntil, location, testQuery, cancellationToken).ConfigureAwait(false); } /// @@ -423,6 +433,10 @@ public static async Task> TestQu /// Subscriptions_TestQuery /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -432,9 +446,7 @@ public static async Task> TestQu /// is null. public static ArmOperation TestQuerySubscription(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestQuery testQuery, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(testQuery, nameof(testQuery)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).TestQuerySubscription(waitUntil, location, testQuery, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestQuerySubscription(waitUntil, location, testQuery, cancellationToken); } /// @@ -449,6 +461,10 @@ public static ArmOperation TestQuerySubscript /// Subscriptions_CompileQuery /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. @@ -457,9 +473,7 @@ public static ArmOperation TestQuerySubscript /// is null. public static async Task> CompileQuerySubscriptionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, StreamAnalyticsCompileQuery compileQuery, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(compileQuery, nameof(compileQuery)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CompileQuerySubscriptionAsync(location, compileQuery, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).CompileQuerySubscriptionAsync(location, compileQuery, cancellationToken).ConfigureAwait(false); } /// @@ -474,6 +488,10 @@ public static async Task> Compil /// Subscriptions_CompileQuery /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. @@ -482,9 +500,7 @@ public static async Task> Compil /// is null. public static Response CompileQuerySubscription(this SubscriptionResource subscriptionResource, AzureLocation location, StreamAnalyticsCompileQuery compileQuery, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(compileQuery, nameof(compileQuery)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CompileQuerySubscription(location, compileQuery, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).CompileQuerySubscription(location, compileQuery, cancellationToken); } /// @@ -499,6 +515,10 @@ public static Response CompileQuerySubscr /// Subscriptions_SampleInput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -508,9 +528,7 @@ public static Response CompileQuerySubscr /// is null. public static async Task> SampleInputSubscriptionAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsSampleInputContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SampleInputSubscriptionAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).SampleInputSubscriptionAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -525,6 +543,10 @@ public static async Task> SampleI /// Subscriptions_SampleInput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -534,9 +556,7 @@ public static async Task> SampleI /// is null. public static ArmOperation SampleInputSubscription(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsSampleInputContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).SampleInputSubscription(waitUntil, location, content, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).SampleInputSubscription(waitUntil, location, content, cancellationToken); } /// @@ -551,6 +571,10 @@ public static ArmOperation SampleInputSubscrip /// Subscriptions_TestInput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -560,9 +584,7 @@ public static ArmOperation SampleInputSubscrip /// is null. public static async Task> TestInputSubscriptionAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).TestInputSubscriptionAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestInputSubscriptionAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -577,6 +599,10 @@ public static async Task> Test /// Subscriptions_TestInput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -586,9 +612,7 @@ public static async Task> Test /// is null. public static ArmOperation TestInputSubscription(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).TestInputSubscription(waitUntil, location, content, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestInputSubscription(waitUntil, location, content, cancellationToken); } /// @@ -603,6 +627,10 @@ public static ArmOperation TestInputSubscri /// Subscriptions_TestOutput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -612,9 +640,7 @@ public static ArmOperation TestInputSubscri /// is null. public static async Task> TestOutputSubscriptionAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestOutput testOutput, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(testOutput, nameof(testOutput)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).TestOutputSubscriptionAsync(waitUntil, location, testOutput, cancellationToken).ConfigureAwait(false); + return await GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestOutputSubscriptionAsync(waitUntil, location, testOutput, cancellationToken).ConfigureAwait(false); } /// @@ -629,6 +655,10 @@ public static async Task> Test /// Subscriptions_TestOutput /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -638,9 +668,7 @@ public static async Task> Test /// is null. public static ArmOperation TestOutputSubscription(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestOutput testOutput, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(testOutput, nameof(testOutput)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).TestOutputSubscription(waitUntil, location, testOutput, cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).TestOutputSubscription(waitUntil, location, testOutput, cancellationToken); } /// @@ -655,13 +683,17 @@ public static ArmOperation TestOutputSubscr /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStreamAnalyticsClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStreamAnalyticsClustersAsync(cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetStreamAnalyticsClustersAsync(cancellationToken); } /// @@ -676,13 +708,17 @@ public static AsyncPageable GetStreamAnalyticsCl /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStreamAnalyticsClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStreamAnalyticsClusters(cancellationToken); + return GetStreamAnalyticsSubscriptionMockingExtension(subscriptionResource).GetStreamAnalyticsClusters(cancellationToken); } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsResourceGroupMockingExtension.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..5435d6091a55 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsResourceGroupMockingExtension.cs @@ -0,0 +1,147 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.StreamAnalytics; + +namespace Azure.ResourceManager.StreamAnalytics.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class StreamAnalyticsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected StreamAnalyticsResourceGroupMockingExtension() + { + } + + /// 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 StreamAnalyticsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of StreamingJobResources in the ResourceGroupResource. + /// An object representing collection of StreamingJobResources and their operations over a StreamingJobResource. + public virtual StreamingJobCollection GetStreamingJobs() + { + return GetCachedClient(client => new StreamingJobCollection(client, Id)); + } + + /// + /// Gets details about the specified streaming job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName} + /// + /// + /// Operation Id + /// StreamingJobs_Get + /// + /// + /// + /// The name of the streaming job. + /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStreamingJobAsync(string jobName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetStreamingJobs().GetAsync(jobName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details about the specified streaming job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName} + /// + /// + /// Operation Id + /// StreamingJobs_Get + /// + /// + /// + /// The name of the streaming job. + /// The $expand OData query parameter. This is a comma-separated list of additional streaming job properties to include in the response, beyond the default set returned when this parameter is absent. The default set is all streaming job properties other than 'inputs', 'transformation', 'outputs', and 'functions'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStreamingJob(string jobName, string expand = null, CancellationToken cancellationToken = default) + { + return GetStreamingJobs().Get(jobName, expand, cancellationToken); + } + + /// Gets a collection of StreamAnalyticsClusterResources in the ResourceGroupResource. + /// An object representing collection of StreamAnalyticsClusterResources and their operations over a StreamAnalyticsClusterResource. + public virtual StreamAnalyticsClusterCollection GetStreamAnalyticsClusters() + { + return GetCachedClient(client => new StreamAnalyticsClusterCollection(client, Id)); + } + + /// + /// Gets information about the specified cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStreamAnalyticsClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetStreamAnalyticsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStreamAnalyticsCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetStreamAnalyticsClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsSubscriptionMockingExtension.cs similarity index 90% rename from sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsSubscriptionMockingExtension.cs index 9518ddcb0555..2da289e82688 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/StreamAnalyticsSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.StreamAnalytics; using Azure.ResourceManager.StreamAnalytics.Models; -namespace Azure.ResourceManager.StreamAnalytics +namespace Azure.ResourceManager.StreamAnalytics.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class StreamAnalyticsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _streamingJobClientDiagnostics; private StreamingJobsRestOperations _streamingJobRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _streamAnalyticsClusterClustersClientDiagnostics; private ClustersRestOperations _streamAnalyticsClusterClustersRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected StreamAnalyticsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StreamAnalyticsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -72,7 +73,7 @@ public virtual AsyncPageable GetStreamingJobsAsync(string { HttpMessage FirstPageRequest(int? pageSizeHint) => StreamingJobRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StreamingJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StreamingJobResource(Client, StreamingJobData.DeserializeStreamingJobData(e)), StreamingJobClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStreamingJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StreamingJobResource(Client, StreamingJobData.DeserializeStreamingJobData(e)), StreamingJobClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetStreamingJobs", "value", "nextLink", cancellationToken); } /// @@ -95,7 +96,7 @@ public virtual Pageable GetStreamingJobs(string expand = n { HttpMessage FirstPageRequest(int? pageSizeHint) => StreamingJobRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StreamingJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StreamingJobResource(Client, StreamingJobData.DeserializeStreamingJobData(e)), StreamingJobClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStreamingJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StreamingJobResource(Client, StreamingJobData.DeserializeStreamingJobData(e)), StreamingJobClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetStreamingJobs", "value", "nextLink", cancellationToken); } /// @@ -117,7 +118,7 @@ public virtual Pageable GetStreamingJobs(string expand = n public virtual AsyncPageable GetQuotasSubscriptionsAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SubscriptionsRestClient.CreateListQuotasRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StreamAnalyticsSubscriptionQuota.DeserializeStreamAnalyticsSubscriptionQuota, SubscriptionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQuotasSubscriptions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, StreamAnalyticsSubscriptionQuota.DeserializeStreamAnalyticsSubscriptionQuota, SubscriptionsClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetQuotasSubscriptions", "value", null, cancellationToken); } /// @@ -139,7 +140,7 @@ public virtual AsyncPageable GetQuotasSubscrip public virtual Pageable GetQuotasSubscriptions(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SubscriptionsRestClient.CreateListQuotasRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StreamAnalyticsSubscriptionQuota.DeserializeStreamAnalyticsSubscriptionQuota, SubscriptionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQuotasSubscriptions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, StreamAnalyticsSubscriptionQuota.DeserializeStreamAnalyticsSubscriptionQuota, SubscriptionsClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetQuotasSubscriptions", "value", null, cancellationToken); } /// @@ -159,9 +160,12 @@ public virtual Pageable GetQuotasSubscriptions /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// The query testing object that defines the input, output, and transformation for the query testing. /// The cancellation token to use. + /// is null. public virtual async Task> TestQuerySubscriptionAsync(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestQuery testQuery, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestQuerySubscription"); + Argument.AssertNotNull(testQuery, nameof(testQuery)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestQuerySubscription"); scope.Start(); try { @@ -195,9 +199,12 @@ public virtual async Task> TestQ /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// The query testing object that defines the input, output, and transformation for the query testing. /// The cancellation token to use. + /// is null. public virtual ArmOperation TestQuerySubscription(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestQuery testQuery, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestQuerySubscription"); + Argument.AssertNotNull(testQuery, nameof(testQuery)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestQuerySubscription"); scope.Start(); try { @@ -230,9 +237,12 @@ public virtual ArmOperation TestQuerySubscrip /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// The query compilation object which defines the input, output, and transformation for the query compilation. /// The cancellation token to use. + /// is null. public virtual async Task> CompileQuerySubscriptionAsync(AzureLocation location, StreamAnalyticsCompileQuery compileQuery, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CompileQuerySubscription"); + Argument.AssertNotNull(compileQuery, nameof(compileQuery)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.CompileQuerySubscription"); scope.Start(); try { @@ -262,9 +272,12 @@ public virtual async Task> Compi /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// The query compilation object which defines the input, output, and transformation for the query compilation. /// The cancellation token to use. + /// is null. public virtual Response CompileQuerySubscription(AzureLocation location, StreamAnalyticsCompileQuery compileQuery, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CompileQuerySubscription"); + Argument.AssertNotNull(compileQuery, nameof(compileQuery)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.CompileQuerySubscription"); scope.Start(); try { @@ -295,9 +308,12 @@ public virtual Response CompileQuerySubsc /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for sampling the Stream Analytics input data. /// The cancellation token to use. + /// is null. public virtual async Task> SampleInputSubscriptionAsync(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsSampleInputContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SampleInputSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.SampleInputSubscription"); scope.Start(); try { @@ -331,9 +347,12 @@ public virtual async Task> Sample /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for sampling the Stream Analytics input data. /// The cancellation token to use. + /// is null. public virtual ArmOperation SampleInputSubscription(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsSampleInputContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SampleInputSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.SampleInputSubscription"); scope.Start(); try { @@ -367,9 +386,12 @@ public virtual ArmOperation SampleInputSubscri /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for testing the Stream Analytics input. /// The cancellation token to use. + /// is null. public virtual async Task> TestInputSubscriptionAsync(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestInputSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestInputSubscription"); scope.Start(); try { @@ -403,9 +425,12 @@ public virtual async Task> Tes /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for testing the Stream Analytics input. /// The cancellation token to use. + /// is null. public virtual ArmOperation TestInputSubscription(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestInputSubscription"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestInputSubscription"); scope.Start(); try { @@ -439,9 +464,12 @@ public virtual ArmOperation TestInputSubscr /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for testing the Stream Analytics output. /// The cancellation token to use. + /// is null. public virtual async Task> TestOutputSubscriptionAsync(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestOutput testOutput, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestOutputSubscription"); + Argument.AssertNotNull(testOutput, nameof(testOutput)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestOutputSubscription"); scope.Start(); try { @@ -475,9 +503,12 @@ public virtual async Task> Tes /// The region to which the request is sent. You can find out which regions Azure Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/. /// Defines the necessary parameters for testing the Stream Analytics output. /// The cancellation token to use. + /// is null. public virtual ArmOperation TestOutputSubscription(WaitUntil waitUntil, AzureLocation location, StreamAnalyticsTestOutput testOutput, CancellationToken cancellationToken = default) { - using var scope = SubscriptionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TestOutputSubscription"); + Argument.AssertNotNull(testOutput, nameof(testOutput)); + + using var scope = SubscriptionsClientDiagnostics.CreateScope("StreamAnalyticsSubscriptionMockingExtension.TestOutputSubscription"); scope.Start(); try { @@ -513,7 +544,7 @@ public virtual AsyncPageable GetStreamAnalyticsC { HttpMessage FirstPageRequest(int? pageSizeHint) => StreamAnalyticsClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StreamAnalyticsClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StreamAnalyticsClusterResource(Client, StreamAnalyticsClusterData.DeserializeStreamAnalyticsClusterData(e)), StreamAnalyticsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStreamAnalyticsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StreamAnalyticsClusterResource(Client, StreamAnalyticsClusterData.DeserializeStreamAnalyticsClusterData(e)), StreamAnalyticsClusterClustersClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetStreamAnalyticsClusters", "value", "nextLink", cancellationToken); } /// @@ -535,7 +566,7 @@ public virtual Pageable GetStreamAnalyticsCluste { HttpMessage FirstPageRequest(int? pageSizeHint) => StreamAnalyticsClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StreamAnalyticsClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StreamAnalyticsClusterResource(Client, StreamAnalyticsClusterData.DeserializeStreamAnalyticsClusterData(e)), StreamAnalyticsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStreamAnalyticsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StreamAnalyticsClusterResource(Client, StreamAnalyticsClusterData.DeserializeStreamAnalyticsClusterData(e)), StreamAnalyticsClusterClustersClientDiagnostics, Pipeline, "StreamAnalyticsSubscriptionMockingExtension.GetStreamAnalyticsClusters", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs index f437c5ec109f..0f01f11c94e8 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StreamAnalyticsPrivateEndpointResources and their operations over a StreamAnalyticsPrivateEndpointResource. public virtual StreamAnalyticsPrivateEndpointCollection GetStreamAnalyticsPrivateEndpoints() { - return GetCachedClient(Client => new StreamAnalyticsPrivateEndpointCollection(Client, Id)); + return GetCachedClient(client => new StreamAnalyticsPrivateEndpointCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual StreamAnalyticsPrivateEndpointCollection GetStreamAnalyticsPrivat /// /// The name of the private endpoint. /// The cancellation token to use. - /// 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> GetStreamAnalyticsPrivateEndpointAsync(string privateEndpointName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetS /// /// The name of the private endpoint. /// The cancellation token to use. - /// 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 GetStreamAnalyticsPrivateEndpoint(string privateEndpointName, CancellationToken cancellationToken = default) { diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs index 50901678a975..22f3d327117d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StreamingJobFunctionResources and their operations over a StreamingJobFunctionResource. public virtual StreamingJobFunctionCollection GetStreamingJobFunctions() { - return GetCachedClient(Client => new StreamingJobFunctionCollection(Client, Id)); + return GetCachedClient(client => new StreamingJobFunctionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual StreamingJobFunctionCollection GetStreamingJobFunctions() /// /// The name of the function. /// The cancellation token to use. - /// 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> GetStreamingJobFunctionAsync(string functionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetStreamingJo /// /// The name of the function. /// The cancellation token to use. - /// 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 GetStreamingJobFunction(string functionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetStreamingJobFunction(st /// An object representing collection of StreamingJobInputResources and their operations over a StreamingJobInputResource. public virtual StreamingJobInputCollection GetStreamingJobInputs() { - return GetCachedClient(Client => new StreamingJobInputCollection(Client, Id)); + return GetCachedClient(client => new StreamingJobInputCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual StreamingJobInputCollection GetStreamingJobInputs() /// /// The name of the input. /// The cancellation token to use. - /// 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> GetStreamingJobInputAsync(string inputName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetStreamingJobIn /// /// The name of the input. /// The cancellation token to use. - /// 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 GetStreamingJobInput(string inputName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetStreamingJobInput(string i /// An object representing collection of StreamingJobOutputResources and their operations over a StreamingJobOutputResource. public virtual StreamingJobOutputCollection GetStreamingJobOutputs() { - return GetCachedClient(Client => new StreamingJobOutputCollection(Client, Id)); + return GetCachedClient(client => new StreamingJobOutputCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual StreamingJobOutputCollection GetStreamingJobOutputs() /// /// The name of the output. /// The cancellation token to use. - /// 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> GetStreamingJobOutputAsync(string outputName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetStreamingJobO /// /// The name of the output. /// The cancellation token to use. - /// 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 GetStreamingJobOutput(string outputName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetStreamingJobOutput(string /// An object representing collection of StreamingJobTransformationResources and their operations over a StreamingJobTransformationResource. public virtual StreamingJobTransformationCollection GetStreamingJobTransformations() { - return GetCachedClient(Client => new StreamingJobTransformationCollection(Client, Id)); + return GetCachedClient(client => new StreamingJobTransformationCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual StreamingJobTransformationCollection GetStreamingJobTransformatio /// /// The name of the transformation. /// The cancellation token to use. - /// 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> GetStreamingJobTransformationAsync(string transformationName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetStrea /// /// The name of the transformation. /// The cancellation token to use. - /// 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 GetStreamingJobTransformation(string transformationName, CancellationToken cancellationToken = default) { diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionArmClientMockingExtension.cs b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionArmClientMockingExtension.cs new file mode 100644 index 000000000000..88d32e6993cc --- /dev/null +++ b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Subscription; + +namespace Azure.ResourceManager.Subscription.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SubscriptionArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SubscriptionArmClientMockingExtension() + { + } + + /// 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 SubscriptionArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SubscriptionArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SubscriptionAliasResource GetSubscriptionAliasResource(ResourceIdentifier id) + { + SubscriptionAliasResource.ValidateResourceId(id); + return new SubscriptionAliasResource(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 TenantPolicyResource GetTenantPolicyResource(ResourceIdentifier id) + { + TenantPolicyResource.ValidateResourceId(id); + return new TenantPolicyResource(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 BillingAccountPolicyResource GetBillingAccountPolicyResource(ResourceIdentifier id) + { + BillingAccountPolicyResource.ValidateResourceId(id); + return new BillingAccountPolicyResource(Client, id); + } + } +} diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionExtensions.cs b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionExtensions.cs index edb892b6dba8..a92bbfe9e278 100644 --- a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionExtensions.cs +++ b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Subscription.Mocking; using Azure.ResourceManager.Subscription.Models; namespace Azure.ResourceManager.Subscription @@ -19,93 +20,68 @@ namespace Azure.ResourceManager.Subscription /// A class to add extension methods to Azure.ResourceManager.Subscription. public static partial class SubscriptionExtensions { - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SubscriptionArmClientMockingExtension GetSubscriptionArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SubscriptionArmClientMockingExtension(client0)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SubscriptionSubscriptionMockingExtension GetSubscriptionSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SubscriptionSubscriptionMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static SubscriptionTenantMockingExtension GetSubscriptionTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SubscriptionTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region SubscriptionAliasResource /// /// 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. /// Returns a object. public static SubscriptionAliasResource GetSubscriptionAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionAliasResource.ValidateResourceId(id); - return new SubscriptionAliasResource(client, id); - } - ); + return GetSubscriptionArmClientMockingExtension(client).GetSubscriptionAliasResource(id); } - #endregion - #region TenantPolicyResource /// /// 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. /// Returns a object. public static TenantPolicyResource GetTenantPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TenantPolicyResource.ValidateResourceId(id); - return new TenantPolicyResource(client, id); - } - ); + return GetSubscriptionArmClientMockingExtension(client).GetTenantPolicyResource(id); } - #endregion - #region BillingAccountPolicyResource /// /// 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. /// Returns a object. public static BillingAccountPolicyResource GetBillingAccountPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BillingAccountPolicyResource.ValidateResourceId(id); - return new BillingAccountPolicyResource(client, id); - } - ); + return GetSubscriptionArmClientMockingExtension(client).GetBillingAccountPolicyResource(id); } - #endregion /// /// The operation to cancel a subscription @@ -119,12 +95,16 @@ public static BillingAccountPolicyResource GetBillingAccountPolicyResource(this /// Subscription_Cancel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> CancelSubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CancelSubscriptionAsync(cancellationToken).ConfigureAwait(false); + return await GetSubscriptionSubscriptionMockingExtension(subscriptionResource).CancelSubscriptionAsync(cancellationToken).ConfigureAwait(false); } /// @@ -139,12 +119,16 @@ public static async Task> CancelSubscriptionAsy /// Subscription_Cancel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response CancelSubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CancelSubscription(cancellationToken); + return GetSubscriptionSubscriptionMockingExtension(subscriptionResource).CancelSubscription(cancellationToken); } /// @@ -159,6 +143,10 @@ public static Response CancelSubscription(this Subscript /// Subscription_Rename /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Subscription Name. @@ -166,9 +154,7 @@ public static Response CancelSubscription(this Subscript /// is null. public static async Task> RenameSubscriptionAsync(this SubscriptionResource subscriptionResource, SubscriptionName body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).RenameSubscriptionAsync(body, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionSubscriptionMockingExtension(subscriptionResource).RenameSubscriptionAsync(body, cancellationToken).ConfigureAwait(false); } /// @@ -183,6 +169,10 @@ public static async Task> RenameSubscriptionAsyn /// Subscription_Rename /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Subscription Name. @@ -190,9 +180,7 @@ public static async Task> RenameSubscriptionAsyn /// is null. public static Response RenameSubscription(this SubscriptionResource subscriptionResource, SubscriptionName body, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(body, nameof(body)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).RenameSubscription(body, cancellationToken); + return GetSubscriptionSubscriptionMockingExtension(subscriptionResource).RenameSubscription(body, cancellationToken); } /// @@ -207,12 +195,16 @@ public static Response RenameSubscription(this Subscripti /// Subscription_Enable /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> EnableSubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).EnableSubscriptionAsync(cancellationToken).ConfigureAwait(false); + return await GetSubscriptionSubscriptionMockingExtension(subscriptionResource).EnableSubscriptionAsync(cancellationToken).ConfigureAwait(false); } /// @@ -227,20 +219,30 @@ public static async Task> EnableSubscriptionAsyn /// Subscription_Enable /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response EnableSubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).EnableSubscription(cancellationToken); + return GetSubscriptionSubscriptionMockingExtension(subscriptionResource).EnableSubscription(cancellationToken); } - /// Gets a collection of SubscriptionAliasResources in the TenantResource. + /// + /// Gets a collection of SubscriptionAliasResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SubscriptionAliasResources and their operations over a SubscriptionAliasResource. public static SubscriptionAliasCollection GetSubscriptionAliases(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetSubscriptionAliases(); + return GetSubscriptionTenantMockingExtension(tenantResource).GetSubscriptionAliases(); } /// @@ -255,16 +257,20 @@ public static SubscriptionAliasCollection GetSubscriptionAliases(this TenantReso /// Alias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionAliasAsync(this TenantResource tenantResource, string aliasName, CancellationToken cancellationToken = default) { - return await tenantResource.GetSubscriptionAliases().GetAsync(aliasName, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionTenantMockingExtension(tenantResource).GetSubscriptionAliasAsync(aliasName, cancellationToken).ConfigureAwait(false); } /// @@ -279,32 +285,48 @@ public static async Task> GetSubscriptionAli /// Alias_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. /// The cancellation token to use. - /// 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 static Response GetSubscriptionAlias(this TenantResource tenantResource, string aliasName, CancellationToken cancellationToken = default) { - return tenantResource.GetSubscriptionAliases().Get(aliasName, cancellationToken); + return GetSubscriptionTenantMockingExtension(tenantResource).GetSubscriptionAlias(aliasName, cancellationToken); } - /// Gets an object representing a TenantPolicyResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Gets an object representing a TenantPolicyResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static TenantPolicyResource GetTenantPolicy(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantPolicy(); + return GetSubscriptionTenantMockingExtension(tenantResource).GetTenantPolicy(); } - /// Gets a collection of BillingAccountPolicyResources in the TenantResource. + /// + /// Gets a collection of BillingAccountPolicyResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BillingAccountPolicyResources and their operations over a BillingAccountPolicyResource. public static BillingAccountPolicyCollection GetBillingAccountPolicies(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetBillingAccountPolicies(); + return GetSubscriptionTenantMockingExtension(tenantResource).GetBillingAccountPolicies(); } /// @@ -319,16 +341,20 @@ public static BillingAccountPolicyCollection GetBillingAccountPolicies(this Tena /// BillingAccount_GetPolicy /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing Account Id. /// The cancellation token to use. - /// 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 static async Task> GetBillingAccountPolicyAsync(this TenantResource tenantResource, string billingAccountId, CancellationToken cancellationToken = default) { - return await tenantResource.GetBillingAccountPolicies().GetAsync(billingAccountId, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionTenantMockingExtension(tenantResource).GetBillingAccountPolicyAsync(billingAccountId, cancellationToken).ConfigureAwait(false); } /// @@ -343,16 +369,20 @@ public static async Task> GetBillingAccou /// BillingAccount_GetPolicy /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing Account Id. /// The cancellation token to use. - /// 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 static Response GetBillingAccountPolicy(this TenantResource tenantResource, string billingAccountId, CancellationToken cancellationToken = default) { - return tenantResource.GetBillingAccountPolicies().Get(billingAccountId, cancellationToken); + return GetSubscriptionTenantMockingExtension(tenantResource).GetBillingAccountPolicy(billingAccountId, cancellationToken); } /// @@ -367,6 +397,10 @@ public static Response GetBillingAccountPolicy(thi /// Subscription_AcceptOwnership /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -377,10 +411,7 @@ public static Response GetBillingAccountPolicy(thi /// or is null. public static async Task AcceptSubscriptionOwnershipAsync(this TenantResource tenantResource, WaitUntil waitUntil, string subscriptionId, AcceptOwnershipContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).AcceptSubscriptionOwnershipAsync(waitUntil, subscriptionId, content, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionTenantMockingExtension(tenantResource).AcceptSubscriptionOwnershipAsync(waitUntil, subscriptionId, content, cancellationToken).ConfigureAwait(false); } /// @@ -395,6 +426,10 @@ public static async Task AcceptSubscriptionOwnershipAsync(this Ten /// Subscription_AcceptOwnership /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -405,10 +440,7 @@ public static async Task AcceptSubscriptionOwnershipAsync(this Ten /// or is null. public static ArmOperation AcceptSubscriptionOwnership(this TenantResource tenantResource, WaitUntil waitUntil, string subscriptionId, AcceptOwnershipContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).AcceptSubscriptionOwnership(waitUntil, subscriptionId, content, cancellationToken); + return GetSubscriptionTenantMockingExtension(tenantResource).AcceptSubscriptionOwnership(waitUntil, subscriptionId, content, cancellationToken); } /// @@ -423,6 +455,10 @@ public static ArmOperation AcceptSubscriptionOwnership(this TenantResource tenan /// Subscription_AcceptOwnershipStatus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Subscription Id. @@ -431,9 +467,7 @@ public static ArmOperation AcceptSubscriptionOwnership(this TenantResource tenan /// is null. public static async Task> GetAcceptOwnershipStatusAsync(this TenantResource tenantResource, string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - return await GetTenantResourceExtensionClient(tenantResource).GetAcceptOwnershipStatusAsync(subscriptionId, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionTenantMockingExtension(tenantResource).GetAcceptOwnershipStatusAsync(subscriptionId, cancellationToken).ConfigureAwait(false); } /// @@ -448,6 +482,10 @@ public static async Task> GetAcceptOwnershipStat /// Subscription_AcceptOwnershipStatus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Subscription Id. @@ -456,9 +494,7 @@ public static async Task> GetAcceptOwnershipStat /// is null. public static Response GetAcceptOwnershipStatus(this TenantResource tenantResource, string subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - return GetTenantResourceExtensionClient(tenantResource).GetAcceptOwnershipStatus(subscriptionId, cancellationToken); + return GetSubscriptionTenantMockingExtension(tenantResource).GetAcceptOwnershipStatus(subscriptionId, cancellationToken); } } } diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionSubscriptionMockingExtension.cs similarity index 87% rename from sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionSubscriptionMockingExtension.cs index 379101de0772..770112933f14 100644 --- a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionSubscriptionMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Subscription; using Azure.ResourceManager.Subscription.Models; -namespace Azure.ResourceManager.Subscription +namespace Azure.ResourceManager.Subscription.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SubscriptionSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _subscriptionClientDiagnostics; private SubscriptionRestOperations _subscriptionRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SubscriptionSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SubscriptionSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,7 +60,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> CancelSubscriptionAsync(CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CancelSubscription"); + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.CancelSubscription"); scope.Start(); try { @@ -89,7 +90,7 @@ public virtual async Task> CancelSubscriptionAs /// The cancellation token to use. public virtual Response CancelSubscription(CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CancelSubscription"); + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.CancelSubscription"); scope.Start(); try { @@ -118,9 +119,12 @@ public virtual Response CancelSubscription(CancellationT /// /// Subscription Name. /// The cancellation token to use. + /// is null. public virtual async Task> RenameSubscriptionAsync(SubscriptionName body, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.RenameSubscription"); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.RenameSubscription"); scope.Start(); try { @@ -149,9 +153,12 @@ public virtual async Task> RenameSubscriptionAsy /// /// Subscription Name. /// The cancellation token to use. + /// is null. public virtual Response RenameSubscription(SubscriptionName body, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.RenameSubscription"); + Argument.AssertNotNull(body, nameof(body)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.RenameSubscription"); scope.Start(); try { @@ -181,7 +188,7 @@ public virtual Response RenameSubscription(SubscriptionNa /// The cancellation token to use. public virtual async Task> EnableSubscriptionAsync(CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.EnableSubscription"); + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.EnableSubscription"); scope.Start(); try { @@ -211,7 +218,7 @@ public virtual async Task> EnableSubscriptionAsy /// The cancellation token to use. public virtual Response EnableSubscription(CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.EnableSubscription"); + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionSubscriptionMockingExtension.EnableSubscription"); scope.Start(); try { diff --git a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionTenantMockingExtension.cs similarity index 55% rename from sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionTenantMockingExtension.cs index 7bc08b2df639..42d547d1207a 100644 --- a/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/subscription/Azure.ResourceManager.Subscription/src/Generated/Extensions/SubscriptionTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Subscription; using Azure.ResourceManager.Subscription.Models; -namespace Azure.ResourceManager.Subscription +namespace Azure.ResourceManager.Subscription.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class SubscriptionTenantMockingExtension : ArmResource { private ClientDiagnostics _subscriptionClientDiagnostics; private SubscriptionRestOperations _subscriptionRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SubscriptionTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SubscriptionTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,7 +48,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of SubscriptionAliasResources and their operations over a SubscriptionAliasResource. public virtual SubscriptionAliasCollection GetSubscriptionAliases() { - return GetCachedClient(Client => new SubscriptionAliasCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionAliasCollection(client, Id)); + } + + /// + /// Get Alias Subscription. + /// + /// + /// Request Path + /// /providers/Microsoft.Subscription/aliases/{aliasName} + /// + /// + /// Operation Id + /// Alias_Get + /// + /// + /// + /// AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionAliasAsync(string aliasName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionAliases().GetAsync(aliasName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Alias Subscription. + /// + /// + /// Request Path + /// /providers/Microsoft.Subscription/aliases/{aliasName} + /// + /// + /// Operation Id + /// Alias_Get + /// + /// + /// + /// AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionAlias(string aliasName, CancellationToken cancellationToken = default) + { + return GetSubscriptionAliases().Get(aliasName, cancellationToken); } /// Gets an object representing a TenantPolicyResource along with the instance operations that can be performed on it in the TenantResource. @@ -61,7 +108,53 @@ public virtual TenantPolicyResource GetTenantPolicy() /// An object representing collection of BillingAccountPolicyResources and their operations over a BillingAccountPolicyResource. public virtual BillingAccountPolicyCollection GetBillingAccountPolicies() { - return GetCachedClient(Client => new BillingAccountPolicyCollection(Client, Id)); + return GetCachedClient(client => new BillingAccountPolicyCollection(client, Id)); + } + + /// + /// Get Billing Account Policy. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default + /// + /// + /// Operation Id + /// BillingAccount_GetPolicy + /// + /// + /// + /// Billing Account Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBillingAccountPolicyAsync(string billingAccountId, CancellationToken cancellationToken = default) + { + return await GetBillingAccountPolicies().GetAsync(billingAccountId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Billing Account Policy. + /// + /// + /// Request Path + /// /providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default + /// + /// + /// Operation Id + /// BillingAccount_GetPolicy + /// + /// + /// + /// Billing Account Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBillingAccountPolicy(string billingAccountId, CancellationToken cancellationToken = default) + { + return GetBillingAccountPolicies().Get(billingAccountId, cancellationToken); } /// @@ -81,9 +174,14 @@ public virtual BillingAccountPolicyCollection GetBillingAccountPolicies() /// Subscription Id. /// The AcceptOwnershipContent to use. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task AcceptSubscriptionOwnershipAsync(WaitUntil waitUntil, string subscriptionId, AcceptOwnershipContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("TenantResourceExtensionClient.AcceptSubscriptionOwnership"); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionTenantMockingExtension.AcceptSubscriptionOwnership"); scope.Start(); try { @@ -117,9 +215,14 @@ public virtual async Task AcceptSubscriptionOwnershipAsync(WaitUnt /// Subscription Id. /// The AcceptOwnershipContent to use. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation AcceptSubscriptionOwnership(WaitUntil waitUntil, string subscriptionId, AcceptOwnershipContent content, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("TenantResourceExtensionClient.AcceptSubscriptionOwnership"); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionTenantMockingExtension.AcceptSubscriptionOwnership"); scope.Start(); try { @@ -151,9 +254,13 @@ public virtual ArmOperation AcceptSubscriptionOwnership(WaitUntil waitUntil, str /// /// Subscription Id. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetAcceptOwnershipStatusAsync(string subscriptionId, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetAcceptOwnershipStatus"); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionTenantMockingExtension.GetAcceptOwnershipStatus"); scope.Start(); try { @@ -182,9 +289,13 @@ public virtual async Task> GetAcceptOwnershipSta /// /// Subscription Id. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetAcceptOwnershipStatus(string subscriptionId, CancellationToken cancellationToken = default) { - using var scope = SubscriptionClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetAcceptOwnershipStatus"); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var scope = SubscriptionClientDiagnostics.CreateScope("SubscriptionTenantMockingExtension.GetAcceptOwnershipStatus"); scope.Start(); try { diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportArmClientMockingExtension.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportArmClientMockingExtension.cs new file mode 100644 index 000000000000..2d72ee7652d2 --- /dev/null +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Support; + +namespace Azure.ResourceManager.Support.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SupportArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SupportArmClientMockingExtension() + { + } + + /// 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 SupportArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SupportArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SupportAzureServiceResource GetSupportAzureServiceResource(ResourceIdentifier id) + { + SupportAzureServiceResource.ValidateResourceId(id); + return new SupportAzureServiceResource(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 ProblemClassificationResource GetProblemClassificationResource(ResourceIdentifier id) + { + ProblemClassificationResource.ValidateResourceId(id); + return new ProblemClassificationResource(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 SupportTicketResource GetSupportTicketResource(ResourceIdentifier id) + { + SupportTicketResource.ValidateResourceId(id); + return new SupportTicketResource(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 SupportTicketCommunicationResource GetSupportTicketCommunicationResource(ResourceIdentifier id) + { + SupportTicketCommunicationResource.ValidateResourceId(id); + return new SupportTicketCommunicationResource(Client, id); + } + } +} diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportExtensions.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportExtensions.cs index 6b245c28dabb..3d698b2e636b 100644 --- a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportExtensions.cs +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Support.Mocking; using Azure.ResourceManager.Support.Models; namespace Azure.ResourceManager.Support @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.Support /// A class to add extension methods to Azure.ResourceManager.Support. public static partial class SupportExtensions { - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SupportArmClientMockingExtension GetSupportArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SupportArmClientMockingExtension(client0)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SupportSubscriptionMockingExtension GetSupportSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SupportSubscriptionMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static SupportTenantMockingExtension GetSupportTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SupportTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region SupportAzureServiceResource /// /// 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. /// Returns a object. public static SupportAzureServiceResource GetSupportAzureServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SupportAzureServiceResource.ValidateResourceId(id); - return new SupportAzureServiceResource(client, id); - } - ); + return GetSupportArmClientMockingExtension(client).GetSupportAzureServiceResource(id); } - #endregion - #region ProblemClassificationResource /// /// 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. /// Returns a object. public static ProblemClassificationResource GetProblemClassificationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProblemClassificationResource.ValidateResourceId(id); - return new ProblemClassificationResource(client, id); - } - ); + return GetSupportArmClientMockingExtension(client).GetProblemClassificationResource(id); } - #endregion - #region SupportTicketResource /// /// 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. /// Returns a object. public static SupportTicketResource GetSupportTicketResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SupportTicketResource.ValidateResourceId(id); - return new SupportTicketResource(client, id); - } - ); + return GetSupportArmClientMockingExtension(client).GetSupportTicketResource(id); } - #endregion - #region SupportTicketCommunicationResource /// /// 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. /// Returns a object. public static SupportTicketCommunicationResource GetSupportTicketCommunicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SupportTicketCommunicationResource.ValidateResourceId(id); - return new SupportTicketCommunicationResource(client, id); - } - ); + return GetSupportArmClientMockingExtension(client).GetSupportTicketCommunicationResource(id); } - #endregion - /// Gets a collection of SupportTicketResources in the SubscriptionResource. + /// + /// Gets a collection of SupportTicketResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SupportTicketResources and their operations over a SupportTicketResource. public static SupportTicketCollection GetSupportTickets(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSupportTickets(); + return GetSupportSubscriptionMockingExtension(subscriptionResource).GetSupportTickets(); } /// @@ -146,16 +125,20 @@ public static SupportTicketCollection GetSupportTickets(this SubscriptionResourc /// SupportTickets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Support ticket name. /// The cancellation token to use. - /// 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 static async Task> GetSupportTicketAsync(this SubscriptionResource subscriptionResource, string supportTicketName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSupportTickets().GetAsync(supportTicketName, cancellationToken).ConfigureAwait(false); + return await GetSupportSubscriptionMockingExtension(subscriptionResource).GetSupportTicketAsync(supportTicketName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetSupportTicketAsync( /// SupportTickets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Support ticket name. /// The cancellation token to use. - /// 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 static Response GetSupportTicket(this SubscriptionResource subscriptionResource, string supportTicketName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSupportTickets().Get(supportTicketName, cancellationToken); + return GetSupportSubscriptionMockingExtension(subscriptionResource).GetSupportTicket(supportTicketName, cancellationToken); } /// @@ -194,6 +181,10 @@ public static Response GetSupportTicket(this Subscription /// SupportTickets_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -201,9 +192,7 @@ public static Response GetSupportTicket(this Subscription /// is null. public static async Task> CheckSupportTicketNameAvailabilityAsync(this SubscriptionResource subscriptionResource, SupportNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSupportTicketNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetSupportSubscriptionMockingExtension(subscriptionResource).CheckSupportTicketNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -218,6 +207,10 @@ public static async Task> CheckSupportTi /// SupportTickets_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -225,17 +218,21 @@ public static async Task> CheckSupportTi /// is null. public static Response CheckSupportTicketNameAvailability(this SubscriptionResource subscriptionResource, SupportNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSupportTicketNameAvailability(content, cancellationToken); + return GetSupportSubscriptionMockingExtension(subscriptionResource).CheckSupportTicketNameAvailability(content, cancellationToken); } - /// Gets a collection of SupportAzureServiceResources in the TenantResource. + /// + /// Gets a collection of SupportAzureServiceResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SupportAzureServiceResources and their operations over a SupportAzureServiceResource. public static SupportAzureServiceCollection GetSupportAzureServices(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetSupportAzureServices(); + return GetSupportTenantMockingExtension(tenantResource).GetSupportAzureServices(); } /// @@ -250,16 +247,20 @@ public static SupportAzureServiceCollection GetSupportAzureServices(this TenantR /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Azure service. /// The cancellation token to use. - /// 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 static async Task> GetSupportAzureServiceAsync(this TenantResource tenantResource, string serviceName, CancellationToken cancellationToken = default) { - return await tenantResource.GetSupportAzureServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetSupportTenantMockingExtension(tenantResource).GetSupportAzureServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -274,16 +275,20 @@ public static async Task> GetSupportAzureS /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Azure service. /// The cancellation token to use. - /// 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 static Response GetSupportAzureService(this TenantResource tenantResource, string serviceName, CancellationToken cancellationToken = default) { - return tenantResource.GetSupportAzureServices().Get(serviceName, cancellationToken); + return GetSupportTenantMockingExtension(tenantResource).GetSupportAzureService(serviceName, cancellationToken); } } } diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportSubscriptionMockingExtension.cs similarity index 56% rename from sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportSubscriptionMockingExtension.cs index 2724e97ffaff..a1b20642fb2a 100644 --- a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportSubscriptionMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Support; using Azure.ResourceManager.Support.Models; -namespace Azure.ResourceManager.Support +namespace Azure.ResourceManager.Support.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SupportSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _supportTicketClientDiagnostics; private SupportTicketsRestOperations _supportTicketRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SupportSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SupportSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,7 +48,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of SupportTicketResources and their operations over a SupportTicketResource. public virtual SupportTicketCollection GetSupportTickets() { - return GetCachedClient(Client => new SupportTicketCollection(Client, Id)); + return GetCachedClient(client => new SupportTicketCollection(client, Id)); + } + + /// + /// Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName} + /// + /// + /// Operation Id + /// SupportTickets_Get + /// + /// + /// + /// Support ticket name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSupportTicketAsync(string supportTicketName, CancellationToken cancellationToken = default) + { + return await GetSupportTickets().GetAsync(supportTicketName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName} + /// + /// + /// Operation Id + /// SupportTickets_Get + /// + /// + /// + /// Support ticket name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSupportTicket(string supportTicketName, CancellationToken cancellationToken = default) + { + return GetSupportTickets().Get(supportTicketName, cancellationToken); } /// @@ -65,9 +112,12 @@ public virtual SupportTicketCollection GetSupportTickets() /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckSupportTicketNameAvailabilityAsync(SupportNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SupportTicketClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSupportTicketNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SupportTicketClientDiagnostics.CreateScope("SupportSubscriptionMockingExtension.CheckSupportTicketNameAvailability"); scope.Start(); try { @@ -96,9 +146,12 @@ public virtual async Task> CheckSupportT /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response CheckSupportTicketNameAvailability(SupportNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SupportTicketClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSupportTicketNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SupportTicketClientDiagnostics.CreateScope("SupportSubscriptionMockingExtension.CheckSupportTicketNameAvailability"); scope.Start(); try { diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportTenantMockingExtension.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportTenantMockingExtension.cs new file mode 100644 index 000000000000..d07f341de953 --- /dev/null +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/SupportTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Support; + +namespace Azure.ResourceManager.Support.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class SupportTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SupportTenantMockingExtension() + { + } + + /// 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 SupportTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SupportAzureServiceResources in the TenantResource. + /// An object representing collection of SupportAzureServiceResources and their operations over a SupportAzureServiceResource. + public virtual SupportAzureServiceCollection GetSupportAzureServices() + { + return GetCachedClient(client => new SupportAzureServiceCollection(client, Id)); + } + + /// + /// Gets a specific Azure service for support ticket creation. + /// + /// + /// Request Path + /// /providers/Microsoft.Support/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Name of the Azure service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSupportAzureServiceAsync(string serviceName, CancellationToken cancellationToken = default) + { + return await GetSupportAzureServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a specific Azure service for support ticket creation. + /// + /// + /// Request Path + /// /providers/Microsoft.Support/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Name of the Azure service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSupportAzureService(string serviceName, CancellationToken cancellationToken = default) + { + return GetSupportAzureServices().Get(serviceName, cancellationToken); + } + } +} diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index f468488b4dd1..000000000000 --- a/sdk/support/Azure.ResourceManager.Support/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Support -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SupportAzureServiceResources in the TenantResource. - /// An object representing collection of SupportAzureServiceResources and their operations over a SupportAzureServiceResource. - public virtual SupportAzureServiceCollection GetSupportAzureServices() - { - return GetCachedClient(Client => new SupportAzureServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportAzureServiceResource.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportAzureServiceResource.cs index 519f6c44777c..34c844c07c98 100644 --- a/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportAzureServiceResource.cs +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportAzureServiceResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ProblemClassificationResources and their operations over a ProblemClassificationResource. public virtual ProblemClassificationCollection GetProblemClassifications() { - return GetCachedClient(Client => new ProblemClassificationCollection(Client, Id)); + return GetCachedClient(client => new ProblemClassificationCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ProblemClassificationCollection GetProblemClassifications() /// /// Name of problem classification. /// The cancellation token to use. - /// 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> GetProblemClassificationAsync(string problemClassificationName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetProblemCla /// /// Name of problem classification. /// The cancellation token to use. - /// 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 GetProblemClassification(string problemClassificationName, CancellationToken cancellationToken = default) { diff --git a/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportTicketResource.cs b/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportTicketResource.cs index 81b74e036e77..939833f5af16 100644 --- a/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportTicketResource.cs +++ b/sdk/support/Azure.ResourceManager.Support/src/Generated/SupportTicketResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SupportTicketCommunicationResources and their operations over a SupportTicketCommunicationResource. public virtual SupportTicketCommunicationCollection GetSupportTicketCommunications() { - return GetCachedClient(Client => new SupportTicketCommunicationCollection(Client, Id)); + return GetCachedClient(client => new SupportTicketCommunicationCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SupportTicketCommunicationCollection GetSupportTicketCommunicatio /// /// Communication name. /// The cancellation token to use. - /// 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> GetSupportTicketCommunicationAsync(string communicationName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetSuppo /// /// Communication name. /// The cancellation token to use. - /// 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 GetSupportTicketCommunication(string communicationName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 8075636c1e27..000000000000 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Synapse -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SynapsePrivateLinkHubResources in the ResourceGroupResource. - /// An object representing collection of SynapsePrivateLinkHubResources and their operations over a SynapsePrivateLinkHubResource. - public virtual SynapsePrivateLinkHubCollection GetSynapsePrivateLinkHubs() - { - return GetCachedClient(Client => new SynapsePrivateLinkHubCollection(Client, Id)); - } - - /// Gets a collection of SynapseWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of SynapseWorkspaceResources and their operations over a SynapseWorkspaceResource. - public virtual SynapseWorkspaceCollection GetSynapseWorkspaces() - { - return GetCachedClient(Client => new SynapseWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseArmClientMockingExtension.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseArmClientMockingExtension.cs new file mode 100644 index 000000000000..9a41f6771601 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseArmClientMockingExtension.cs @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Synapse; + +namespace Azure.ResourceManager.Synapse.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SynapseArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SynapseArmClientMockingExtension() + { + } + + /// 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 SynapseArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SynapseArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SynapseAadOnlyAuthenticationResource GetSynapseAadOnlyAuthenticationResource(ResourceIdentifier id) + { + SynapseAadOnlyAuthenticationResource.ValidateResourceId(id); + return new SynapseAadOnlyAuthenticationResource(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 SynapseIPFirewallRuleInfoResource GetSynapseIPFirewallRuleInfoResource(ResourceIdentifier id) + { + SynapseIPFirewallRuleInfoResource.ValidateResourceId(id); + return new SynapseIPFirewallRuleInfoResource(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 SynapseKeyResource GetSynapseKeyResource(ResourceIdentifier id) + { + SynapseKeyResource.ValidateResourceId(id); + return new SynapseKeyResource(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 SynapsePrivateEndpointConnectionResource GetSynapsePrivateEndpointConnectionResource(ResourceIdentifier id) + { + SynapsePrivateEndpointConnectionResource.ValidateResourceId(id); + return new SynapsePrivateEndpointConnectionResource(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 SynapseWorkspacePrivateLinkResource GetSynapseWorkspacePrivateLinkResource(ResourceIdentifier id) + { + SynapseWorkspacePrivateLinkResource.ValidateResourceId(id); + return new SynapseWorkspacePrivateLinkResource(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 SynapsePrivateLinkResource GetSynapsePrivateLinkResource(ResourceIdentifier id) + { + SynapsePrivateLinkResource.ValidateResourceId(id); + return new SynapsePrivateLinkResource(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 SynapsePrivateLinkHubResource GetSynapsePrivateLinkHubResource(ResourceIdentifier id) + { + SynapsePrivateLinkHubResource.ValidateResourceId(id); + return new SynapsePrivateLinkHubResource(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 SynapsePrivateEndpointConnectionForPrivateLinkHubResource GetSynapsePrivateEndpointConnectionForPrivateLinkHubResource(ResourceIdentifier id) + { + SynapsePrivateEndpointConnectionForPrivateLinkHubResource.ValidateResourceId(id); + return new SynapsePrivateEndpointConnectionForPrivateLinkHubResource(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 SynapseSqlPoolResource GetSynapseSqlPoolResource(ResourceIdentifier id) + { + SynapseSqlPoolResource.ValidateResourceId(id); + return new SynapseSqlPoolResource(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 SynapseMetadataSyncConfigurationResource GetSynapseMetadataSyncConfigurationResource(ResourceIdentifier id) + { + SynapseMetadataSyncConfigurationResource.ValidateResourceId(id); + return new SynapseMetadataSyncConfigurationResource(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 SynapseGeoBackupPolicyResource GetSynapseGeoBackupPolicyResource(ResourceIdentifier id) + { + SynapseGeoBackupPolicyResource.ValidateResourceId(id); + return new SynapseGeoBackupPolicyResource(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 SynapseDataWarehouseUserActivityResource GetSynapseDataWarehouseUserActivityResource(ResourceIdentifier id) + { + SynapseDataWarehouseUserActivityResource.ValidateResourceId(id); + return new SynapseDataWarehouseUserActivityResource(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 SynapseRestorePointResource GetSynapseRestorePointResource(ResourceIdentifier id) + { + SynapseRestorePointResource.ValidateResourceId(id); + return new SynapseRestorePointResource(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 SynapseReplicationLinkResource GetSynapseReplicationLinkResource(ResourceIdentifier id) + { + SynapseReplicationLinkResource.ValidateResourceId(id); + return new SynapseReplicationLinkResource(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 SynapseMaintenanceWindowResource GetSynapseMaintenanceWindowResource(ResourceIdentifier id) + { + SynapseMaintenanceWindowResource.ValidateResourceId(id); + return new SynapseMaintenanceWindowResource(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 SynapseMaintenanceWindowOptionResource GetSynapseMaintenanceWindowOptionResource(ResourceIdentifier id) + { + SynapseMaintenanceWindowOptionResource.ValidateResourceId(id); + return new SynapseMaintenanceWindowOptionResource(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 SynapseTransparentDataEncryptionResource GetSynapseTransparentDataEncryptionResource(ResourceIdentifier id) + { + SynapseTransparentDataEncryptionResource.ValidateResourceId(id); + return new SynapseTransparentDataEncryptionResource(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 SynapseSqlPoolBlobAuditingPolicyResource GetSynapseSqlPoolBlobAuditingPolicyResource(ResourceIdentifier id) + { + SynapseSqlPoolBlobAuditingPolicyResource.ValidateResourceId(id); + return new SynapseSqlPoolBlobAuditingPolicyResource(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 SynapseSensitivityLabelResource GetSynapseSensitivityLabelResource(ResourceIdentifier id) + { + SynapseSensitivityLabelResource.ValidateResourceId(id); + return new SynapseSensitivityLabelResource(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 SynapseSqlPoolSchemaResource GetSynapseSqlPoolSchemaResource(ResourceIdentifier id) + { + SynapseSqlPoolSchemaResource.ValidateResourceId(id); + return new SynapseSqlPoolSchemaResource(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 SynapseSqlPoolTableResource GetSynapseSqlPoolTableResource(ResourceIdentifier id) + { + SynapseSqlPoolTableResource.ValidateResourceId(id); + return new SynapseSqlPoolTableResource(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 SynapseSqlPoolConnectionPolicyResource GetSynapseSqlPoolConnectionPolicyResource(ResourceIdentifier id) + { + SynapseSqlPoolConnectionPolicyResource.ValidateResourceId(id); + return new SynapseSqlPoolConnectionPolicyResource(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 SynapseSqlPoolVulnerabilityAssessmentResource GetSynapseSqlPoolVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SynapseSqlPoolVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SynapseSqlPoolVulnerabilityAssessmentResource(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 SynapseVulnerabilityAssessmentScanRecordResource GetSynapseVulnerabilityAssessmentScanRecordResource(ResourceIdentifier id) + { + SynapseVulnerabilityAssessmentScanRecordResource.ValidateResourceId(id); + return new SynapseVulnerabilityAssessmentScanRecordResource(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 SynapseSqlPoolSecurityAlertPolicyResource GetSynapseSqlPoolSecurityAlertPolicyResource(ResourceIdentifier id) + { + SynapseSqlPoolSecurityAlertPolicyResource.ValidateResourceId(id); + return new SynapseSqlPoolSecurityAlertPolicyResource(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 SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource GetSynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource(ResourceIdentifier id) + { + SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); + return new SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource(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 SynapseExtendedSqlPoolBlobAuditingPolicyResource GetSynapseExtendedSqlPoolBlobAuditingPolicyResource(ResourceIdentifier id) + { + SynapseExtendedSqlPoolBlobAuditingPolicyResource.ValidateResourceId(id); + return new SynapseExtendedSqlPoolBlobAuditingPolicyResource(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 SynapseDataMaskingPolicyResource GetSynapseDataMaskingPolicyResource(ResourceIdentifier id) + { + SynapseDataMaskingPolicyResource.ValidateResourceId(id); + return new SynapseDataMaskingPolicyResource(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 SynapseDataMaskingRuleResource GetSynapseDataMaskingRuleResource(ResourceIdentifier id) + { + SynapseDataMaskingRuleResource.ValidateResourceId(id); + return new SynapseDataMaskingRuleResource(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 SynapseSqlPoolColumnResource GetSynapseSqlPoolColumnResource(ResourceIdentifier id) + { + SynapseSqlPoolColumnResource.ValidateResourceId(id); + return new SynapseSqlPoolColumnResource(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 SynapseWorkloadGroupResource GetSynapseWorkloadGroupResource(ResourceIdentifier id) + { + SynapseWorkloadGroupResource.ValidateResourceId(id); + return new SynapseWorkloadGroupResource(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 SynapseWorkloadClassifierResource GetSynapseWorkloadClassifierResource(ResourceIdentifier id) + { + SynapseWorkloadClassifierResource.ValidateResourceId(id); + return new SynapseWorkloadClassifierResource(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 SynapseServerBlobAuditingPolicyResource GetSynapseServerBlobAuditingPolicyResource(ResourceIdentifier id) + { + SynapseServerBlobAuditingPolicyResource.ValidateResourceId(id); + return new SynapseServerBlobAuditingPolicyResource(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 SynapseExtendedServerBlobAuditingPolicyResource GetSynapseExtendedServerBlobAuditingPolicyResource(ResourceIdentifier id) + { + SynapseExtendedServerBlobAuditingPolicyResource.ValidateResourceId(id); + return new SynapseExtendedServerBlobAuditingPolicyResource(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 SynapseServerSecurityAlertPolicyResource GetSynapseServerSecurityAlertPolicyResource(ResourceIdentifier id) + { + SynapseServerSecurityAlertPolicyResource.ValidateResourceId(id); + return new SynapseServerSecurityAlertPolicyResource(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 SynapseServerVulnerabilityAssessmentResource GetSynapseServerVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SynapseServerVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SynapseServerVulnerabilityAssessmentResource(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 SynapseEncryptionProtectorResource GetSynapseEncryptionProtectorResource(ResourceIdentifier id) + { + SynapseEncryptionProtectorResource.ValidateResourceId(id); + return new SynapseEncryptionProtectorResource(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 SynapseRecoverableSqlPoolResource GetSynapseRecoverableSqlPoolResource(ResourceIdentifier id) + { + SynapseRecoverableSqlPoolResource.ValidateResourceId(id); + return new SynapseRecoverableSqlPoolResource(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 SynapseDedicatedSqlMinimalTlsSettingResource GetSynapseDedicatedSqlMinimalTlsSettingResource(ResourceIdentifier id) + { + SynapseDedicatedSqlMinimalTlsSettingResource.ValidateResourceId(id); + return new SynapseDedicatedSqlMinimalTlsSettingResource(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 SynapseWorkspaceResource GetSynapseWorkspaceResource(ResourceIdentifier id) + { + SynapseWorkspaceResource.ValidateResourceId(id); + return new SynapseWorkspaceResource(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 SynapseWorkspaceAdministratorResource GetSynapseWorkspaceAdministratorResource(ResourceIdentifier id) + { + SynapseWorkspaceAdministratorResource.ValidateResourceId(id); + return new SynapseWorkspaceAdministratorResource(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 SynapseWorkspaceSqlAdministratorResource GetSynapseWorkspaceSqlAdministratorResource(ResourceIdentifier id) + { + SynapseWorkspaceSqlAdministratorResource.ValidateResourceId(id); + return new SynapseWorkspaceSqlAdministratorResource(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 SynapseManagedIdentitySqlControlSettingResource GetSynapseManagedIdentitySqlControlSettingResource(ResourceIdentifier id) + { + SynapseManagedIdentitySqlControlSettingResource.ValidateResourceId(id); + return new SynapseManagedIdentitySqlControlSettingResource(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 SynapseRestorableDroppedSqlPoolResource GetSynapseRestorableDroppedSqlPoolResource(ResourceIdentifier id) + { + SynapseRestorableDroppedSqlPoolResource.ValidateResourceId(id); + return new SynapseRestorableDroppedSqlPoolResource(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 SynapseBigDataPoolInfoResource GetSynapseBigDataPoolInfoResource(ResourceIdentifier id) + { + SynapseBigDataPoolInfoResource.ValidateResourceId(id); + return new SynapseBigDataPoolInfoResource(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 SynapseLibraryResource GetSynapseLibraryResource(ResourceIdentifier id) + { + SynapseLibraryResource.ValidateResourceId(id); + return new SynapseLibraryResource(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 SynapseIntegrationRuntimeResource GetSynapseIntegrationRuntimeResource(ResourceIdentifier id) + { + SynapseIntegrationRuntimeResource.ValidateResourceId(id); + return new SynapseIntegrationRuntimeResource(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 SynapseSparkConfigurationResource GetSynapseSparkConfigurationResource(ResourceIdentifier id) + { + SynapseSparkConfigurationResource.ValidateResourceId(id); + return new SynapseSparkConfigurationResource(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 SynapseKustoPoolResource GetSynapseKustoPoolResource(ResourceIdentifier id) + { + SynapseKustoPoolResource.ValidateResourceId(id); + return new SynapseKustoPoolResource(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 SynapseAttachedDatabaseConfigurationResource GetSynapseAttachedDatabaseConfigurationResource(ResourceIdentifier id) + { + SynapseAttachedDatabaseConfigurationResource.ValidateResourceId(id); + return new SynapseAttachedDatabaseConfigurationResource(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 SynapseDatabaseResource GetSynapseDatabaseResource(ResourceIdentifier id) + { + SynapseDatabaseResource.ValidateResourceId(id); + return new SynapseDatabaseResource(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 SynapseDataConnectionResource GetSynapseDataConnectionResource(ResourceIdentifier id) + { + SynapseDataConnectionResource.ValidateResourceId(id); + return new SynapseDataConnectionResource(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 SynapseClusterPrincipalAssignmentResource GetSynapseClusterPrincipalAssignmentResource(ResourceIdentifier id) + { + SynapseClusterPrincipalAssignmentResource.ValidateResourceId(id); + return new SynapseClusterPrincipalAssignmentResource(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 SynapseDatabasePrincipalAssignmentResource GetSynapseDatabasePrincipalAssignmentResource(ResourceIdentifier id) + { + SynapseDatabasePrincipalAssignmentResource.ValidateResourceId(id); + return new SynapseDatabasePrincipalAssignmentResource(Client, id); + } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseExtensions.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseExtensions.cs index f5cbc1dd43c6..bea3a424793f 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseExtensions.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Synapse.Mocking; using Azure.ResourceManager.Synapse.Models; namespace Azure.ResourceManager.Synapse @@ -19,1069 +20,897 @@ namespace Azure.ResourceManager.Synapse /// A class to add extension methods to Azure.ResourceManager.Synapse. public static partial class SynapseExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SynapseArmClientMockingExtension GetSynapseArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SynapseArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SynapseResourceGroupMockingExtension GetSynapseResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SynapseResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SynapseSubscriptionMockingExtension GetSynapseSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SynapseSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SynapseAadOnlyAuthenticationResource /// /// 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. /// Returns a object. public static SynapseAadOnlyAuthenticationResource GetSynapseAadOnlyAuthenticationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseAadOnlyAuthenticationResource.ValidateResourceId(id); - return new SynapseAadOnlyAuthenticationResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseAadOnlyAuthenticationResource(id); } - #endregion - #region SynapseIPFirewallRuleInfoResource /// /// 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. /// Returns a object. public static SynapseIPFirewallRuleInfoResource GetSynapseIPFirewallRuleInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseIPFirewallRuleInfoResource.ValidateResourceId(id); - return new SynapseIPFirewallRuleInfoResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseIPFirewallRuleInfoResource(id); } - #endregion - #region SynapseKeyResource /// /// 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. /// Returns a object. public static SynapseKeyResource GetSynapseKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseKeyResource.ValidateResourceId(id); - return new SynapseKeyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseKeyResource(id); } - #endregion - #region SynapsePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SynapsePrivateEndpointConnectionResource GetSynapsePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapsePrivateEndpointConnectionResource.ValidateResourceId(id); - return new SynapsePrivateEndpointConnectionResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapsePrivateEndpointConnectionResource(id); } - #endregion - #region SynapseWorkspacePrivateLinkResource /// /// 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. /// Returns a object. public static SynapseWorkspacePrivateLinkResource GetSynapseWorkspacePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkspacePrivateLinkResource.ValidateResourceId(id); - return new SynapseWorkspacePrivateLinkResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkspacePrivateLinkResource(id); } - #endregion - #region SynapsePrivateLinkResource /// /// 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. /// Returns a object. public static SynapsePrivateLinkResource GetSynapsePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapsePrivateLinkResource.ValidateResourceId(id); - return new SynapsePrivateLinkResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapsePrivateLinkResource(id); } - #endregion - #region SynapsePrivateLinkHubResource /// /// 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. /// Returns a object. public static SynapsePrivateLinkHubResource GetSynapsePrivateLinkHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapsePrivateLinkHubResource.ValidateResourceId(id); - return new SynapsePrivateLinkHubResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapsePrivateLinkHubResource(id); } - #endregion - #region SynapsePrivateEndpointConnectionForPrivateLinkHubResource /// /// 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. /// Returns a object. public static SynapsePrivateEndpointConnectionForPrivateLinkHubResource GetSynapsePrivateEndpointConnectionForPrivateLinkHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapsePrivateEndpointConnectionForPrivateLinkHubResource.ValidateResourceId(id); - return new SynapsePrivateEndpointConnectionForPrivateLinkHubResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapsePrivateEndpointConnectionForPrivateLinkHubResource(id); } - #endregion - #region SynapseSqlPoolResource /// /// 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. /// Returns a object. public static SynapseSqlPoolResource GetSynapseSqlPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolResource.ValidateResourceId(id); - return new SynapseSqlPoolResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolResource(id); } - #endregion - #region SynapseMetadataSyncConfigurationResource /// /// 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. /// Returns a object. public static SynapseMetadataSyncConfigurationResource GetSynapseMetadataSyncConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseMetadataSyncConfigurationResource.ValidateResourceId(id); - return new SynapseMetadataSyncConfigurationResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseMetadataSyncConfigurationResource(id); } - #endregion - #region SynapseGeoBackupPolicyResource /// /// 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. /// Returns a object. public static SynapseGeoBackupPolicyResource GetSynapseGeoBackupPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseGeoBackupPolicyResource.ValidateResourceId(id); - return new SynapseGeoBackupPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseGeoBackupPolicyResource(id); } - #endregion - #region SynapseDataWarehouseUserActivityResource /// /// 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. /// Returns a object. public static SynapseDataWarehouseUserActivityResource GetSynapseDataWarehouseUserActivityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDataWarehouseUserActivityResource.ValidateResourceId(id); - return new SynapseDataWarehouseUserActivityResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDataWarehouseUserActivityResource(id); } - #endregion - #region SynapseRestorePointResource /// /// 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. /// Returns a object. public static SynapseRestorePointResource GetSynapseRestorePointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseRestorePointResource.ValidateResourceId(id); - return new SynapseRestorePointResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseRestorePointResource(id); } - #endregion - #region SynapseReplicationLinkResource /// /// 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. /// Returns a object. public static SynapseReplicationLinkResource GetSynapseReplicationLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseReplicationLinkResource.ValidateResourceId(id); - return new SynapseReplicationLinkResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseReplicationLinkResource(id); } - #endregion - #region SynapseMaintenanceWindowResource /// /// 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. /// Returns a object. public static SynapseMaintenanceWindowResource GetSynapseMaintenanceWindowResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseMaintenanceWindowResource.ValidateResourceId(id); - return new SynapseMaintenanceWindowResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseMaintenanceWindowResource(id); } - #endregion - #region SynapseMaintenanceWindowOptionResource /// /// 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. /// Returns a object. public static SynapseMaintenanceWindowOptionResource GetSynapseMaintenanceWindowOptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseMaintenanceWindowOptionResource.ValidateResourceId(id); - return new SynapseMaintenanceWindowOptionResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseMaintenanceWindowOptionResource(id); } - #endregion - #region SynapseTransparentDataEncryptionResource /// /// 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. /// Returns a object. public static SynapseTransparentDataEncryptionResource GetSynapseTransparentDataEncryptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseTransparentDataEncryptionResource.ValidateResourceId(id); - return new SynapseTransparentDataEncryptionResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseTransparentDataEncryptionResource(id); } - #endregion - #region SynapseSqlPoolBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SynapseSqlPoolBlobAuditingPolicyResource GetSynapseSqlPoolBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolBlobAuditingPolicyResource.ValidateResourceId(id); - return new SynapseSqlPoolBlobAuditingPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolBlobAuditingPolicyResource(id); } - #endregion - #region SynapseSensitivityLabelResource /// /// 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. /// Returns a object. public static SynapseSensitivityLabelResource GetSynapseSensitivityLabelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSensitivityLabelResource.ValidateResourceId(id); - return new SynapseSensitivityLabelResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSensitivityLabelResource(id); } - #endregion - #region SynapseSqlPoolSchemaResource /// /// 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. /// Returns a object. public static SynapseSqlPoolSchemaResource GetSynapseSqlPoolSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolSchemaResource.ValidateResourceId(id); - return new SynapseSqlPoolSchemaResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolSchemaResource(id); } - #endregion - #region SynapseSqlPoolTableResource /// /// 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. /// Returns a object. public static SynapseSqlPoolTableResource GetSynapseSqlPoolTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolTableResource.ValidateResourceId(id); - return new SynapseSqlPoolTableResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolTableResource(id); } - #endregion - #region SynapseSqlPoolConnectionPolicyResource /// /// 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. /// Returns a object. public static SynapseSqlPoolConnectionPolicyResource GetSynapseSqlPoolConnectionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolConnectionPolicyResource.ValidateResourceId(id); - return new SynapseSqlPoolConnectionPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolConnectionPolicyResource(id); } - #endregion - #region SynapseSqlPoolVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SynapseSqlPoolVulnerabilityAssessmentResource GetSynapseSqlPoolVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SynapseSqlPoolVulnerabilityAssessmentResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolVulnerabilityAssessmentResource(id); } - #endregion - #region SynapseVulnerabilityAssessmentScanRecordResource /// /// 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. /// Returns a object. public static SynapseVulnerabilityAssessmentScanRecordResource GetSynapseVulnerabilityAssessmentScanRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseVulnerabilityAssessmentScanRecordResource.ValidateResourceId(id); - return new SynapseVulnerabilityAssessmentScanRecordResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseVulnerabilityAssessmentScanRecordResource(id); } - #endregion - #region SynapseSqlPoolSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static SynapseSqlPoolSecurityAlertPolicyResource GetSynapseSqlPoolSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolSecurityAlertPolicyResource.ValidateResourceId(id); - return new SynapseSqlPoolSecurityAlertPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolSecurityAlertPolicyResource(id); } - #endregion - #region SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource /// /// 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. /// Returns a object. public static SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource GetSynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); - return new SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource(id); } - #endregion - #region SynapseExtendedSqlPoolBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SynapseExtendedSqlPoolBlobAuditingPolicyResource GetSynapseExtendedSqlPoolBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseExtendedSqlPoolBlobAuditingPolicyResource.ValidateResourceId(id); - return new SynapseExtendedSqlPoolBlobAuditingPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseExtendedSqlPoolBlobAuditingPolicyResource(id); } - #endregion - #region SynapseDataMaskingPolicyResource /// /// 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. /// Returns a object. public static SynapseDataMaskingPolicyResource GetSynapseDataMaskingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDataMaskingPolicyResource.ValidateResourceId(id); - return new SynapseDataMaskingPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDataMaskingPolicyResource(id); } - #endregion - #region SynapseDataMaskingRuleResource /// /// 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. /// Returns a object. public static SynapseDataMaskingRuleResource GetSynapseDataMaskingRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDataMaskingRuleResource.ValidateResourceId(id); - return new SynapseDataMaskingRuleResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDataMaskingRuleResource(id); } - #endregion - #region SynapseSqlPoolColumnResource /// /// 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. /// Returns a object. public static SynapseSqlPoolColumnResource GetSynapseSqlPoolColumnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSqlPoolColumnResource.ValidateResourceId(id); - return new SynapseSqlPoolColumnResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSqlPoolColumnResource(id); } - #endregion - #region SynapseWorkloadGroupResource /// /// 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. /// Returns a object. public static SynapseWorkloadGroupResource GetSynapseWorkloadGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkloadGroupResource.ValidateResourceId(id); - return new SynapseWorkloadGroupResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkloadGroupResource(id); } - #endregion - #region SynapseWorkloadClassifierResource /// /// 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. /// Returns a object. public static SynapseWorkloadClassifierResource GetSynapseWorkloadClassifierResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkloadClassifierResource.ValidateResourceId(id); - return new SynapseWorkloadClassifierResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkloadClassifierResource(id); } - #endregion - #region SynapseServerBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SynapseServerBlobAuditingPolicyResource GetSynapseServerBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseServerBlobAuditingPolicyResource.ValidateResourceId(id); - return new SynapseServerBlobAuditingPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseServerBlobAuditingPolicyResource(id); } - #endregion - #region SynapseExtendedServerBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SynapseExtendedServerBlobAuditingPolicyResource GetSynapseExtendedServerBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseExtendedServerBlobAuditingPolicyResource.ValidateResourceId(id); - return new SynapseExtendedServerBlobAuditingPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseExtendedServerBlobAuditingPolicyResource(id); } - #endregion - #region SynapseServerSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static SynapseServerSecurityAlertPolicyResource GetSynapseServerSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseServerSecurityAlertPolicyResource.ValidateResourceId(id); - return new SynapseServerSecurityAlertPolicyResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseServerSecurityAlertPolicyResource(id); } - #endregion - #region SynapseServerVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SynapseServerVulnerabilityAssessmentResource GetSynapseServerVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseServerVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SynapseServerVulnerabilityAssessmentResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseServerVulnerabilityAssessmentResource(id); } - #endregion - #region SynapseEncryptionProtectorResource /// /// 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. /// Returns a object. public static SynapseEncryptionProtectorResource GetSynapseEncryptionProtectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseEncryptionProtectorResource.ValidateResourceId(id); - return new SynapseEncryptionProtectorResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseEncryptionProtectorResource(id); } - #endregion - #region SynapseRecoverableSqlPoolResource /// /// 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. /// Returns a object. public static SynapseRecoverableSqlPoolResource GetSynapseRecoverableSqlPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseRecoverableSqlPoolResource.ValidateResourceId(id); - return new SynapseRecoverableSqlPoolResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseRecoverableSqlPoolResource(id); } - #endregion - #region SynapseDedicatedSqlMinimalTlsSettingResource /// /// 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. /// Returns a object. public static SynapseDedicatedSqlMinimalTlsSettingResource GetSynapseDedicatedSqlMinimalTlsSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDedicatedSqlMinimalTlsSettingResource.ValidateResourceId(id); - return new SynapseDedicatedSqlMinimalTlsSettingResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDedicatedSqlMinimalTlsSettingResource(id); } - #endregion - #region SynapseWorkspaceResource /// /// 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. /// Returns a object. public static SynapseWorkspaceResource GetSynapseWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkspaceResource.ValidateResourceId(id); - return new SynapseWorkspaceResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkspaceResource(id); } - #endregion - #region SynapseWorkspaceAdministratorResource /// /// 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. /// Returns a object. public static SynapseWorkspaceAdministratorResource GetSynapseWorkspaceAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkspaceAdministratorResource.ValidateResourceId(id); - return new SynapseWorkspaceAdministratorResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkspaceAdministratorResource(id); } - #endregion - #region SynapseWorkspaceSqlAdministratorResource /// /// 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. /// Returns a object. public static SynapseWorkspaceSqlAdministratorResource GetSynapseWorkspaceSqlAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseWorkspaceSqlAdministratorResource.ValidateResourceId(id); - return new SynapseWorkspaceSqlAdministratorResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseWorkspaceSqlAdministratorResource(id); } - #endregion - #region SynapseManagedIdentitySqlControlSettingResource /// /// 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. /// Returns a object. public static SynapseManagedIdentitySqlControlSettingResource GetSynapseManagedIdentitySqlControlSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseManagedIdentitySqlControlSettingResource.ValidateResourceId(id); - return new SynapseManagedIdentitySqlControlSettingResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseManagedIdentitySqlControlSettingResource(id); } - #endregion - #region SynapseRestorableDroppedSqlPoolResource /// /// 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. /// Returns a object. public static SynapseRestorableDroppedSqlPoolResource GetSynapseRestorableDroppedSqlPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseRestorableDroppedSqlPoolResource.ValidateResourceId(id); - return new SynapseRestorableDroppedSqlPoolResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseRestorableDroppedSqlPoolResource(id); } - #endregion - #region SynapseBigDataPoolInfoResource /// /// 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. /// Returns a object. public static SynapseBigDataPoolInfoResource GetSynapseBigDataPoolInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseBigDataPoolInfoResource.ValidateResourceId(id); - return new SynapseBigDataPoolInfoResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseBigDataPoolInfoResource(id); } - #endregion - #region SynapseLibraryResource /// /// 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. /// Returns a object. public static SynapseLibraryResource GetSynapseLibraryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseLibraryResource.ValidateResourceId(id); - return new SynapseLibraryResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseLibraryResource(id); } - #endregion - #region SynapseIntegrationRuntimeResource /// /// 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. /// Returns a object. public static SynapseIntegrationRuntimeResource GetSynapseIntegrationRuntimeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseIntegrationRuntimeResource.ValidateResourceId(id); - return new SynapseIntegrationRuntimeResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseIntegrationRuntimeResource(id); } - #endregion - #region SynapseSparkConfigurationResource /// /// 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. /// Returns a object. public static SynapseSparkConfigurationResource GetSynapseSparkConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseSparkConfigurationResource.ValidateResourceId(id); - return new SynapseSparkConfigurationResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseSparkConfigurationResource(id); } - #endregion - #region SynapseKustoPoolResource /// /// 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. /// Returns a object. public static SynapseKustoPoolResource GetSynapseKustoPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseKustoPoolResource.ValidateResourceId(id); - return new SynapseKustoPoolResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseKustoPoolResource(id); } - #endregion - #region SynapseAttachedDatabaseConfigurationResource /// /// 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. /// Returns a object. public static SynapseAttachedDatabaseConfigurationResource GetSynapseAttachedDatabaseConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseAttachedDatabaseConfigurationResource.ValidateResourceId(id); - return new SynapseAttachedDatabaseConfigurationResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseAttachedDatabaseConfigurationResource(id); } - #endregion - #region SynapseDatabaseResource /// /// 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. /// Returns a object. public static SynapseDatabaseResource GetSynapseDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDatabaseResource.ValidateResourceId(id); - return new SynapseDatabaseResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDatabaseResource(id); } - #endregion - #region SynapseDataConnectionResource /// /// 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. /// Returns a object. public static SynapseDataConnectionResource GetSynapseDataConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDataConnectionResource.ValidateResourceId(id); - return new SynapseDataConnectionResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDataConnectionResource(id); } - #endregion - #region SynapseClusterPrincipalAssignmentResource /// /// 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. /// Returns a object. public static SynapseClusterPrincipalAssignmentResource GetSynapseClusterPrincipalAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseClusterPrincipalAssignmentResource.ValidateResourceId(id); - return new SynapseClusterPrincipalAssignmentResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseClusterPrincipalAssignmentResource(id); } - #endregion - #region SynapseDatabasePrincipalAssignmentResource /// /// 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. /// Returns a object. public static SynapseDatabasePrincipalAssignmentResource GetSynapseDatabasePrincipalAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SynapseDatabasePrincipalAssignmentResource.ValidateResourceId(id); - return new SynapseDatabasePrincipalAssignmentResource(client, id); - } - ); + return GetSynapseArmClientMockingExtension(client).GetSynapseDatabasePrincipalAssignmentResource(id); } - #endregion - /// Gets a collection of SynapsePrivateLinkHubResources in the ResourceGroupResource. + /// + /// Gets a collection of SynapsePrivateLinkHubResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SynapsePrivateLinkHubResources and their operations over a SynapsePrivateLinkHubResource. public static SynapsePrivateLinkHubCollection GetSynapsePrivateLinkHubs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSynapsePrivateLinkHubs(); + return GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapsePrivateLinkHubs(); } /// @@ -1096,16 +925,20 @@ public static SynapsePrivateLinkHubCollection GetSynapsePrivateLinkHubs(this Res /// PrivateLinkHubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the privateLinkHub. /// The cancellation token to use. - /// 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 static async Task> GetSynapsePrivateLinkHubAsync(this ResourceGroupResource resourceGroupResource, string privateLinkHubName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSynapsePrivateLinkHubs().GetAsync(privateLinkHubName, cancellationToken).ConfigureAwait(false); + return await GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapsePrivateLinkHubAsync(privateLinkHubName, cancellationToken).ConfigureAwait(false); } /// @@ -1120,24 +953,34 @@ public static async Task> GetSynapsePriv /// PrivateLinkHubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the privateLinkHub. /// The cancellation token to use. - /// 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 static Response GetSynapsePrivateLinkHub(this ResourceGroupResource resourceGroupResource, string privateLinkHubName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSynapsePrivateLinkHubs().Get(privateLinkHubName, cancellationToken); + return GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapsePrivateLinkHub(privateLinkHubName, cancellationToken); } - /// Gets a collection of SynapseWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of SynapseWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SynapseWorkspaceResources and their operations over a SynapseWorkspaceResource. public static SynapseWorkspaceCollection GetSynapseWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSynapseWorkspaces(); + return GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapseWorkspaces(); } /// @@ -1152,16 +995,20 @@ public static SynapseWorkspaceCollection GetSynapseWorkspaces(this ResourceGroup /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static async Task> GetSynapseWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSynapseWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapseWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -1176,16 +1023,20 @@ public static async Task> GetSynapseWorkspace /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static Response GetSynapseWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSynapseWorkspaces().Get(workspaceName, cancellationToken); + return GetSynapseResourceGroupMockingExtension(resourceGroupResource).GetSynapseWorkspace(workspaceName, cancellationToken); } /// @@ -1200,13 +1051,17 @@ public static Response GetSynapseWorkspace(this Resour /// PrivateLinkHubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSynapsePrivateLinkHubsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSynapsePrivateLinkHubsAsync(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSynapsePrivateLinkHubsAsync(cancellationToken); } /// @@ -1221,13 +1076,17 @@ public static AsyncPageable GetSynapsePrivateLink /// PrivateLinkHubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSynapsePrivateLinkHubs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSynapsePrivateLinkHubs(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSynapsePrivateLinkHubs(cancellationToken); } /// @@ -1242,13 +1101,17 @@ public static Pageable GetSynapsePrivateLinkHubs( /// Workspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSynapseWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSynapseWorkspacesAsync(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSynapseWorkspacesAsync(cancellationToken); } /// @@ -1263,13 +1126,17 @@ public static AsyncPageable GetSynapseWorkspacesAsync( /// Workspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSynapseWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSynapseWorkspaces(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSynapseWorkspaces(cancellationToken); } /// @@ -1284,13 +1151,17 @@ public static Pageable GetSynapseWorkspaces(this Subsc /// KustoPools_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusKustoPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusKustoPoolsAsync(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSkusKustoPoolsAsync(cancellationToken); } /// @@ -1305,13 +1176,17 @@ public static AsyncPageable GetSkusKustoPoolsAsync(this /// KustoPools_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkusKustoPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusKustoPools(cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).GetSkusKustoPools(cancellationToken); } /// @@ -1326,6 +1201,10 @@ public static Pageable GetSkusKustoPools(this Subscript /// KustoPools_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -1334,9 +1213,7 @@ public static Pageable GetSkusKustoPools(this Subscript /// is null. public static async Task> CheckKustoPoolNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, KustoPoolNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKustoPoolNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetSynapseSubscriptionMockingExtension(subscriptionResource).CheckKustoPoolNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -1351,6 +1228,10 @@ public static async Task> CheckKustoPo /// KustoPools_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -1359,9 +1240,7 @@ public static async Task> CheckKustoPo /// is null. public static Response CheckKustoPoolNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, KustoPoolNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckKustoPoolNameAvailability(location, content, cancellationToken); + return GetSynapseSubscriptionMockingExtension(subscriptionResource).CheckKustoPoolNameAvailability(location, content, cancellationToken); } } } diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseResourceGroupMockingExtension.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..085e10ccc408 --- /dev/null +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Synapse; + +namespace Azure.ResourceManager.Synapse.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SynapseResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SynapseResourceGroupMockingExtension() + { + } + + /// 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 SynapseResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SynapsePrivateLinkHubResources in the ResourceGroupResource. + /// An object representing collection of SynapsePrivateLinkHubResources and their operations over a SynapsePrivateLinkHubResource. + public virtual SynapsePrivateLinkHubCollection GetSynapsePrivateLinkHubs() + { + return GetCachedClient(client => new SynapsePrivateLinkHubCollection(client, Id)); + } + + /// + /// Gets a privateLinkHub + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName} + /// + /// + /// Operation Id + /// PrivateLinkHubs_Get + /// + /// + /// + /// Name of the privateLinkHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSynapsePrivateLinkHubAsync(string privateLinkHubName, CancellationToken cancellationToken = default) + { + return await GetSynapsePrivateLinkHubs().GetAsync(privateLinkHubName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a privateLinkHub + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName} + /// + /// + /// Operation Id + /// PrivateLinkHubs_Get + /// + /// + /// + /// Name of the privateLinkHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSynapsePrivateLinkHub(string privateLinkHubName, CancellationToken cancellationToken = default) + { + return GetSynapsePrivateLinkHubs().Get(privateLinkHubName, cancellationToken); + } + + /// Gets a collection of SynapseWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of SynapseWorkspaceResources and their operations over a SynapseWorkspaceResource. + public virtual SynapseWorkspaceCollection GetSynapseWorkspaces() + { + return GetCachedClient(client => new SynapseWorkspaceCollection(client, Id)); + } + + /// + /// Gets a workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSynapseWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetSynapseWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSynapseWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetSynapseWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseSubscriptionMockingExtension.cs similarity index 91% rename from sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseSubscriptionMockingExtension.cs index a48e7d51276b..fb1ebb3ccd0f 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/Extensions/SynapseSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Synapse; using Azure.ResourceManager.Synapse.Models; -namespace Azure.ResourceManager.Synapse +namespace Azure.ResourceManager.Synapse.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SynapseSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _synapsePrivateLinkHubPrivateLinkHubsClientDiagnostics; private PrivateLinkHubsRestOperations _synapsePrivateLinkHubPrivateLinkHubsRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _synapseKustoPoolKustoPoolsClientDiagnostics; private KustoPoolsRestOperations _synapseKustoPoolKustoPoolsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SynapseSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SynapseSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +72,7 @@ public virtual AsyncPageable GetSynapsePrivateLin { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapsePrivateLinkHubPrivateLinkHubsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SynapsePrivateLinkHubPrivateLinkHubsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SynapsePrivateLinkHubResource(Client, SynapsePrivateLinkHubData.DeserializeSynapsePrivateLinkHubData(e)), SynapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSynapsePrivateLinkHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SynapsePrivateLinkHubResource(Client, SynapsePrivateLinkHubData.DeserializeSynapsePrivateLinkHubData(e)), SynapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSynapsePrivateLinkHubs", "value", "nextLink", cancellationToken); } /// @@ -93,7 +94,7 @@ public virtual Pageable GetSynapsePrivateLinkHubs { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapsePrivateLinkHubPrivateLinkHubsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SynapsePrivateLinkHubPrivateLinkHubsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SynapsePrivateLinkHubResource(Client, SynapsePrivateLinkHubData.DeserializeSynapsePrivateLinkHubData(e)), SynapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSynapsePrivateLinkHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SynapsePrivateLinkHubResource(Client, SynapsePrivateLinkHubData.DeserializeSynapsePrivateLinkHubData(e)), SynapsePrivateLinkHubPrivateLinkHubsClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSynapsePrivateLinkHubs", "value", "nextLink", cancellationToken); } /// @@ -115,7 +116,7 @@ public virtual AsyncPageable GetSynapseWorkspacesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapseWorkspaceWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SynapseWorkspaceWorkspacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SynapseWorkspaceResource(Client, SynapseWorkspaceData.DeserializeSynapseWorkspaceData(e)), SynapseWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSynapseWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SynapseWorkspaceResource(Client, SynapseWorkspaceData.DeserializeSynapseWorkspaceData(e)), SynapseWorkspaceWorkspacesClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSynapseWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -137,7 +138,7 @@ public virtual Pageable GetSynapseWorkspaces(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapseWorkspaceWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SynapseWorkspaceWorkspacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SynapseWorkspaceResource(Client, SynapseWorkspaceData.DeserializeSynapseWorkspaceData(e)), SynapseWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSynapseWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SynapseWorkspaceResource(Client, SynapseWorkspaceData.DeserializeSynapseWorkspaceData(e)), SynapseWorkspaceWorkspacesClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSynapseWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -158,7 +159,7 @@ public virtual Pageable GetSynapseWorkspaces(Cancellat public virtual AsyncPageable GetSkusKustoPoolsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapseKustoPoolKustoPoolsRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoPoolSkuDescription.DeserializeKustoPoolSkuDescription, SynapseKustoPoolKustoPoolsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusKustoPools", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, KustoPoolSkuDescription.DeserializeKustoPoolSkuDescription, SynapseKustoPoolKustoPoolsClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSkusKustoPools", "value", null, cancellationToken); } /// @@ -179,7 +180,7 @@ public virtual AsyncPageable GetSkusKustoPoolsAsync(Can public virtual Pageable GetSkusKustoPools(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SynapseKustoPoolKustoPoolsRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoPoolSkuDescription.DeserializeKustoPoolSkuDescription, SynapseKustoPoolKustoPoolsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusKustoPools", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, KustoPoolSkuDescription.DeserializeKustoPoolSkuDescription, SynapseKustoPoolKustoPoolsClientDiagnostics, Pipeline, "SynapseSubscriptionMockingExtension.GetSkusKustoPools", "value", null, cancellationToken); } /// @@ -198,9 +199,12 @@ public virtual Pageable GetSkusKustoPools(CancellationT /// The name of Azure region. /// The name of the cluster. /// The cancellation token to use. + /// is null. public virtual async Task> CheckKustoPoolNameAvailabilityAsync(AzureLocation location, KustoPoolNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SynapseKustoPoolKustoPoolsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKustoPoolNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SynapseKustoPoolKustoPoolsClientDiagnostics.CreateScope("SynapseSubscriptionMockingExtension.CheckKustoPoolNameAvailability"); scope.Start(); try { @@ -230,9 +234,12 @@ public virtual async Task> CheckKustoP /// The name of Azure region. /// The name of the cluster. /// The cancellation token to use. + /// is null. public virtual Response CheckKustoPoolNameAvailability(AzureLocation location, KustoPoolNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SynapseKustoPoolKustoPoolsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckKustoPoolNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SynapseKustoPoolKustoPoolsClientDiagnostics.CreateScope("SynapseSubscriptionMockingExtension.CheckKustoPoolNameAvailability"); scope.Start(); try { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDataMaskingPolicyResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDataMaskingPolicyResource.cs index 7d784d0ab0d2..0325f4211cab 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDataMaskingPolicyResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDataMaskingPolicyResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseDataMaskingRuleResources and their operations over a SynapseDataMaskingRuleResource. public virtual SynapseDataMaskingRuleCollection GetSynapseDataMaskingRules() { - return GetCachedClient(Client => new SynapseDataMaskingRuleCollection(Client, Id)); + return GetCachedClient(client => new SynapseDataMaskingRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SynapseDataMaskingRuleCollection GetSynapseDataMaskingRules() /// /// The name of the data masking rule. /// The cancellation token to use. - /// 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> GetSynapseDataMaskingRuleAsync(string dataMaskingRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSynapseDa /// /// The name of the data masking rule. /// The cancellation token to use. - /// 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 GetSynapseDataMaskingRule(string dataMaskingRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDatabaseResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDatabaseResource.cs index 11d08868d64d..4a00202940e0 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDatabaseResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseDatabaseResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseDataConnectionResources and their operations over a SynapseDataConnectionResource. public virtual SynapseDataConnectionCollection GetSynapseDataConnections() { - return GetCachedClient(Client => new SynapseDataConnectionCollection(Client, Id)); + return GetCachedClient(client => new SynapseDataConnectionCollection(client, Id)); } /// @@ -119,8 +119,8 @@ public virtual SynapseDataConnectionCollection GetSynapseDataConnections() /// /// The name of the data connection. /// The cancellation token to use. - /// 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> GetSynapseDataConnectionAsync(string dataConnectionName, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> GetSynapseDat /// /// The name of the data connection. /// The cancellation token to use. - /// 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 GetSynapseDataConnection(string dataConnectionName, CancellationToken cancellationToken = default) { @@ -154,7 +154,7 @@ public virtual Response GetSynapseDataConnection( /// An object representing collection of SynapseDatabasePrincipalAssignmentResources and their operations over a SynapseDatabasePrincipalAssignmentResource. public virtual SynapseDatabasePrincipalAssignmentCollection GetSynapseDatabasePrincipalAssignments() { - return GetCachedClient(Client => new SynapseDatabasePrincipalAssignmentCollection(Client, Id)); + return GetCachedClient(client => new SynapseDatabasePrincipalAssignmentCollection(client, Id)); } /// @@ -172,8 +172,8 @@ public virtual SynapseDatabasePrincipalAssignmentCollection GetSynapseDatabasePr /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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> GetSynapseDatabasePrincipalAssignmentAsync(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -195,8 +195,8 @@ public virtual async Task> /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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 GetSynapseDatabasePrincipalAssignment(string principalAssignmentName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseKustoPoolResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseKustoPoolResource.cs index 937a3d380a1b..116d8a4fc99c 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseKustoPoolResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseKustoPoolResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseAttachedDatabaseConfigurationResources and their operations over a SynapseAttachedDatabaseConfigurationResource. public virtual SynapseAttachedDatabaseConfigurationCollection GetSynapseAttachedDatabaseConfigurations() { - return GetCachedClient(Client => new SynapseAttachedDatabaseConfigurationCollection(Client, Id)); + return GetCachedClient(client => new SynapseAttachedDatabaseConfigurationCollection(client, Id)); } /// @@ -124,8 +124,8 @@ public virtual SynapseAttachedDatabaseConfigurationCollection GetSynapseAttached /// /// The name of the attached database configuration. /// The cancellation token to use. - /// 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> GetSynapseAttachedDatabaseConfigurationAsync(string attachedDatabaseConfigurationName, CancellationToken cancellationToken = default) { @@ -147,8 +147,8 @@ public virtual async Task /// /// The name of the attached database configuration. /// The cancellation token to use. - /// 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 GetSynapseAttachedDatabaseConfiguration(string attachedDatabaseConfigurationName, CancellationToken cancellationToken = default) { @@ -159,7 +159,7 @@ public virtual Response GetSynapse /// An object representing collection of SynapseDatabaseResources and their operations over a SynapseDatabaseResource. public virtual SynapseDatabaseCollection GetSynapseDatabases() { - return GetCachedClient(Client => new SynapseDatabaseCollection(Client, Id)); + return GetCachedClient(client => new SynapseDatabaseCollection(client, Id)); } /// @@ -177,8 +177,8 @@ public virtual SynapseDatabaseCollection GetSynapseDatabases() /// /// The name of the database in the Kusto pool. /// The cancellation token to use. - /// 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> GetSynapseDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -200,8 +200,8 @@ public virtual async Task> GetSynapseDatabaseA /// /// The name of the database in the Kusto pool. /// The cancellation token to use. - /// 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 GetSynapseDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -212,7 +212,7 @@ public virtual Response GetSynapseDatabase(string datab /// An object representing collection of SynapseClusterPrincipalAssignmentResources and their operations over a SynapseClusterPrincipalAssignmentResource. public virtual SynapseClusterPrincipalAssignmentCollection GetSynapseClusterPrincipalAssignments() { - return GetCachedClient(Client => new SynapseClusterPrincipalAssignmentCollection(Client, Id)); + return GetCachedClient(client => new SynapseClusterPrincipalAssignmentCollection(client, Id)); } /// @@ -230,8 +230,8 @@ public virtual SynapseClusterPrincipalAssignmentCollection GetSynapseClusterPrin /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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> GetSynapseClusterPrincipalAssignmentAsync(string principalAssignmentName, CancellationToken cancellationToken = default) { @@ -253,8 +253,8 @@ public virtual async Task> G /// /// The name of the Kusto principalAssignment. /// The cancellation token to use. - /// 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 GetSynapseClusterPrincipalAssignment(string principalAssignmentName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs index 4304d83a1a96..ee66817ddc44 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapsePrivateLinkHubResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapsePrivateLinkResources and their operations over a SynapsePrivateLinkResource. public virtual SynapsePrivateLinkResourceCollection GetSynapsePrivateLinkResources() { - return GetCachedClient(Client => new SynapsePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new SynapsePrivateLinkResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SynapsePrivateLinkResourceCollection GetSynapsePrivateLinkResourc /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetSynapsePrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSynapsePrivat /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetSynapsePrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetSynapsePrivateLinkResourc /// An object representing collection of SynapsePrivateEndpointConnectionForPrivateLinkHubResources and their operations over a SynapsePrivateEndpointConnectionForPrivateLinkHubResource. public virtual SynapsePrivateEndpointConnectionForPrivateLinkHubCollection GetSynapsePrivateEndpointConnectionForPrivateLinkHubs() { - return GetCachedClient(Client => new SynapsePrivateEndpointConnectionForPrivateLinkHubCollection(Client, Id)); + return GetCachedClient(client => new SynapsePrivateEndpointConnectionForPrivateLinkHubCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual SynapsePrivateEndpointConnectionForPrivateLinkHubCollection GetSy /// /// Name of the privateEndpointConnection. /// The cancellation token to use. - /// 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> GetSynapsePrivateEndpointConnectionForPrivateLinkHubAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// Name of the privateEndpointConnection. /// The cancellation token to use. - /// 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 GetSynapsePrivateEndpointConnectionForPrivateLinkHub(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolColumnResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolColumnResource.cs index c0a2fd94b55d..c36f184aa79e 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolColumnResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolColumnResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseSensitivityLabelResources and their operations over a SynapseSensitivityLabelResource. public virtual SynapseSensitivityLabelCollection GetSynapseSensitivityLabels() { - return GetCachedClient(Client => new SynapseSensitivityLabelCollection(Client, Id)); + return GetCachedClient(client => new SynapseSensitivityLabelCollection(client, Id)); } /// diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs index 98d4c7988cfe..0481eea21b3e 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolResource.cs @@ -118,7 +118,7 @@ public virtual SynapseMetadataSyncConfigurationResource GetSynapseMetadataSyncCo /// An object representing collection of SynapseGeoBackupPolicyResources and their operations over a SynapseGeoBackupPolicyResource. public virtual SynapseGeoBackupPolicyCollection GetSynapseGeoBackupPolicies() { - return GetCachedClient(Client => new SynapseGeoBackupPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseGeoBackupPolicyCollection(client, Id)); } /// @@ -167,7 +167,7 @@ public virtual Response GetSynapseGeoBackupPolic /// An object representing collection of SynapseDataWarehouseUserActivityResources and their operations over a SynapseDataWarehouseUserActivityResource. public virtual SynapseDataWarehouseUserActivityCollection GetSynapseDataWarehouseUserActivities() { - return GetCachedClient(Client => new SynapseDataWarehouseUserActivityCollection(Client, Id)); + return GetCachedClient(client => new SynapseDataWarehouseUserActivityCollection(client, Id)); } /// @@ -216,7 +216,7 @@ public virtual Response GetSynapseData /// An object representing collection of SynapseRestorePointResources and their operations over a SynapseRestorePointResource. public virtual SynapseRestorePointCollection GetSynapseRestorePoints() { - return GetCachedClient(Client => new SynapseRestorePointCollection(Client, Id)); + return GetCachedClient(client => new SynapseRestorePointCollection(client, Id)); } /// @@ -234,8 +234,8 @@ public virtual SynapseRestorePointCollection GetSynapseRestorePoints() /// /// The name of the restore point. /// The cancellation token to use. - /// 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> GetSynapseRestorePointAsync(string restorePointName, CancellationToken cancellationToken = default) { @@ -257,8 +257,8 @@ public virtual async Task> GetSynapseResto /// /// The name of the restore point. /// The cancellation token to use. - /// 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 GetSynapseRestorePoint(string restorePointName, CancellationToken cancellationToken = default) { @@ -269,7 +269,7 @@ public virtual Response GetSynapseRestorePoint(stri /// An object representing collection of SynapseReplicationLinkResources and their operations over a SynapseReplicationLinkResource. public virtual SynapseReplicationLinkCollection GetSynapseReplicationLinks() { - return GetCachedClient(Client => new SynapseReplicationLinkCollection(Client, Id)); + return GetCachedClient(client => new SynapseReplicationLinkCollection(client, Id)); } /// @@ -287,8 +287,8 @@ public virtual SynapseReplicationLinkCollection GetSynapseReplicationLinks() /// /// The ID of the replication link. /// The cancellation token to use. - /// 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> GetSynapseReplicationLinkAsync(string linkId, CancellationToken cancellationToken = default) { @@ -310,8 +310,8 @@ public virtual async Task> GetSynapseRe /// /// The ID of the replication link. /// The cancellation token to use. - /// 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 GetSynapseReplicationLink(string linkId, CancellationToken cancellationToken = default) { @@ -336,7 +336,7 @@ public virtual SynapseMaintenanceWindowOptionResource GetSynapseMaintenanceWindo /// An object representing collection of SynapseTransparentDataEncryptionResources and their operations over a SynapseTransparentDataEncryptionResource. public virtual SynapseTransparentDataEncryptionCollection GetSynapseTransparentDataEncryptions() { - return GetCachedClient(Client => new SynapseTransparentDataEncryptionCollection(Client, Id)); + return GetCachedClient(client => new SynapseTransparentDataEncryptionCollection(client, Id)); } /// @@ -392,7 +392,7 @@ public virtual SynapseSqlPoolBlobAuditingPolicyResource GetSynapseSqlPoolBlobAud /// An object representing collection of SynapseSqlPoolSchemaResources and their operations over a SynapseSqlPoolSchemaResource. public virtual SynapseSqlPoolSchemaCollection GetSynapseSqlPoolSchemas() { - return GetCachedClient(Client => new SynapseSqlPoolSchemaCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolSchemaCollection(client, Id)); } /// @@ -410,8 +410,8 @@ public virtual SynapseSqlPoolSchemaCollection GetSynapseSqlPoolSchemas() /// /// The name of the schema. /// The cancellation token to use. - /// 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> GetSynapseSqlPoolSchemaAsync(string schemaName, CancellationToken cancellationToken = default) { @@ -433,8 +433,8 @@ public virtual async Task> GetSynapseSqlP /// /// The name of the schema. /// The cancellation token to use. - /// 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 GetSynapseSqlPoolSchema(string schemaName, CancellationToken cancellationToken = default) { @@ -445,7 +445,7 @@ public virtual Response GetSynapseSqlPoolSchema(st /// An object representing collection of SynapseSqlPoolConnectionPolicyResources and their operations over a SynapseSqlPoolConnectionPolicyResource. public virtual SynapseSqlPoolConnectionPolicyCollection GetSynapseSqlPoolConnectionPolicies() { - return GetCachedClient(Client => new SynapseSqlPoolConnectionPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolConnectionPolicyCollection(client, Id)); } /// @@ -494,7 +494,7 @@ public virtual Response GetSynapseSqlPoo /// An object representing collection of SynapseSqlPoolVulnerabilityAssessmentResources and their operations over a SynapseSqlPoolVulnerabilityAssessmentResource. public virtual SynapseSqlPoolVulnerabilityAssessmentCollection GetSynapseSqlPoolVulnerabilityAssessments() { - return GetCachedClient(Client => new SynapseSqlPoolVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolVulnerabilityAssessmentCollection(client, Id)); } /// @@ -543,7 +543,7 @@ public virtual Response GetSynaps /// An object representing collection of SynapseSqlPoolSecurityAlertPolicyResources and their operations over a SynapseSqlPoolSecurityAlertPolicyResource. public virtual SynapseSqlPoolSecurityAlertPolicyCollection GetSynapseSqlPoolSecurityAlertPolicies() { - return GetCachedClient(Client => new SynapseSqlPoolSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolSecurityAlertPolicyCollection(client, Id)); } /// @@ -606,7 +606,7 @@ public virtual SynapseDataMaskingPolicyResource GetSynapseDataMaskingPolicy() /// An object representing collection of SynapseWorkloadGroupResources and their operations over a SynapseWorkloadGroupResource. public virtual SynapseWorkloadGroupCollection GetSynapseWorkloadGroups() { - return GetCachedClient(Client => new SynapseWorkloadGroupCollection(Client, Id)); + return GetCachedClient(client => new SynapseWorkloadGroupCollection(client, Id)); } /// @@ -624,8 +624,8 @@ public virtual SynapseWorkloadGroupCollection GetSynapseWorkloadGroups() /// /// The name of the workload group. /// The cancellation token to use. - /// 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> GetSynapseWorkloadGroupAsync(string workloadGroupName, CancellationToken cancellationToken = default) { @@ -647,8 +647,8 @@ public virtual async Task> GetSynapseWork /// /// The name of the workload group. /// The cancellation token to use. - /// 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 GetSynapseWorkloadGroup(string workloadGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolSchemaResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolSchemaResource.cs index db9460bb216e..1c05759481f4 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolSchemaResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolSchemaResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseSqlPoolTableResources and their operations over a SynapseSqlPoolTableResource. public virtual SynapseSqlPoolTableCollection GetSynapseSqlPoolTables() { - return GetCachedClient(Client => new SynapseSqlPoolTableCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolTableCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SynapseSqlPoolTableCollection GetSynapseSqlPoolTables() /// /// The name of the table. /// The cancellation token to use. - /// 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> GetSynapseSqlPoolTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSynapseSqlPo /// /// The name of the table. /// The cancellation token to use. - /// 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 GetSynapseSqlPoolTable(string tableName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolTableResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolTableResource.cs index 7df41c315989..e94528ec03b2 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolTableResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolTableResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseSqlPoolColumnResources and their operations over a SynapseSqlPoolColumnResource. public virtual SynapseSqlPoolColumnCollection GetSynapseSqlPoolColumns() { - return GetCachedClient(Client => new SynapseSqlPoolColumnCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolColumnCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SynapseSqlPoolColumnCollection GetSynapseSqlPoolColumns() /// /// The name of the column. /// The cancellation token to use. - /// 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> GetSynapseSqlPoolColumnAsync(string columnName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSynapseSqlP /// /// The name of the column. /// The cancellation token to use. - /// 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 GetSynapseSqlPoolColumn(string columnName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolVulnerabilityAssessmentResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolVulnerabilityAssessmentResource.cs index 3e814a675a81..d622f50c671c 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolVulnerabilityAssessmentResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseSqlPoolVulnerabilityAssessmentResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseVulnerabilityAssessmentScanRecordResources and their operations over a SynapseVulnerabilityAssessmentScanRecordResource. public virtual SynapseVulnerabilityAssessmentScanRecordCollection GetSynapseVulnerabilityAssessmentScanRecords() { - return GetCachedClient(Client => new SynapseVulnerabilityAssessmentScanRecordCollection(Client, Id)); + return GetCachedClient(client => new SynapseVulnerabilityAssessmentScanRecordCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SynapseVulnerabilityAssessmentScanRecordCollection GetSynapseVuln /// /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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> GetSynapseVulnerabilityAssessmentScanRecordAsync(string scanId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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 GetSynapseVulnerabilityAssessmentScanRecord(string scanId, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetSyn /// An object representing collection of SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResources and their operations over a SynapseSqlPoolVulnerabilityAssessmentRuleBaselineResource. public virtual SynapseSqlPoolVulnerabilityAssessmentRuleBaselineCollection GetSynapseSqlPoolVulnerabilityAssessmentRuleBaselines() { - return GetCachedClient(Client => new SynapseSqlPoolVulnerabilityAssessmentRuleBaselineCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolVulnerabilityAssessmentRuleBaselineCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual SynapseSqlPoolVulnerabilityAssessmentRuleBaselineCollection GetSy /// The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). /// The cancellation token to use. - /// 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> GetSynapseSqlPoolVulnerabilityAssessmentRuleBaselineAsync(string ruleId, SynapseVulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). /// The cancellation token to use. - /// 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 GetSynapseSqlPoolVulnerabilityAssessmentRuleBaseline(string ruleId, SynapseVulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkloadGroupResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkloadGroupResource.cs index 82785de75f0f..1854632c062c 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkloadGroupResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkloadGroupResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseWorkloadClassifierResources and their operations over a SynapseWorkloadClassifierResource. public virtual SynapseWorkloadClassifierCollection GetSynapseWorkloadClassifiers() { - return GetCachedClient(Client => new SynapseWorkloadClassifierCollection(Client, Id)); + return GetCachedClient(client => new SynapseWorkloadClassifierCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SynapseWorkloadClassifierCollection GetSynapseWorkloadClassifiers /// /// The name of the workload classifier. /// The cancellation token to use. - /// 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> GetSynapseWorkloadClassifierAsync(string workloadClassifierName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSynaps /// /// The name of the workload classifier. /// The cancellation token to use. - /// 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 GetSynapseWorkloadClassifier(string workloadClassifierName, CancellationToken cancellationToken = default) { diff --git a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceResource.cs b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceResource.cs index 61f3185f5a7a..3ffbb3e27d34 100644 --- a/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceResource.cs +++ b/sdk/synapse/Azure.ResourceManager.Synapse/src/Generated/SynapseWorkspaceResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SynapseAadOnlyAuthenticationResources and their operations over a SynapseAadOnlyAuthenticationResource. public virtual SynapseAadOnlyAuthenticationCollection GetSynapseAadOnlyAuthentications() { - return GetCachedClient(Client => new SynapseAadOnlyAuthenticationCollection(Client, Id)); + return GetCachedClient(client => new SynapseAadOnlyAuthenticationCollection(client, Id)); } /// @@ -152,7 +152,7 @@ public virtual Response GetSynapseAadOnlyA /// An object representing collection of SynapseIPFirewallRuleInfoResources and their operations over a SynapseIPFirewallRuleInfoResource. public virtual SynapseIPFirewallRuleInfoCollection GetSynapseIPFirewallRuleInfos() { - return GetCachedClient(Client => new SynapseIPFirewallRuleInfoCollection(Client, Id)); + return GetCachedClient(client => new SynapseIPFirewallRuleInfoCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual SynapseIPFirewallRuleInfoCollection GetSynapseIPFirewallRuleInfos /// /// The IP firewall rule name. /// The cancellation token to use. - /// 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> GetSynapseIPFirewallRuleInfoAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetSynaps /// /// The IP firewall rule name. /// The cancellation token to use. - /// 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 GetSynapseIPFirewallRuleInfo(string ruleName, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetSynapseIPFirewallR /// An object representing collection of SynapseKeyResources and their operations over a SynapseKeyResource. public virtual SynapseKeyCollection GetSynapseKeys() { - return GetCachedClient(Client => new SynapseKeyCollection(Client, Id)); + return GetCachedClient(client => new SynapseKeyCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual SynapseKeyCollection GetSynapseKeys() /// /// The name of the workspace key. /// The cancellation token to use. - /// 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> GetSynapseKeyAsync(string keyName, CancellationToken cancellationToken = default) { @@ -246,8 +246,8 @@ public virtual async Task> GetSynapseKeyAsync(strin /// /// The name of the workspace key. /// The cancellation token to use. - /// 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 GetSynapseKey(string keyName, CancellationToken cancellationToken = default) { @@ -258,7 +258,7 @@ public virtual Response GetSynapseKey(string keyName, Cancel /// An object representing collection of SynapsePrivateEndpointConnectionResources and their operations over a SynapsePrivateEndpointConnectionResource. public virtual SynapsePrivateEndpointConnectionCollection GetSynapsePrivateEndpointConnections() { - return GetCachedClient(Client => new SynapsePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SynapsePrivateEndpointConnectionCollection(client, Id)); } /// @@ -276,8 +276,8 @@ public virtual SynapsePrivateEndpointConnectionCollection GetSynapsePrivateEndpo /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetSynapsePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -299,8 +299,8 @@ public virtual async Task> Ge /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetSynapsePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -311,7 +311,7 @@ public virtual Response GetSynapsePriv /// An object representing collection of SynapseWorkspacePrivateLinkResources and their operations over a SynapseWorkspacePrivateLinkResource. public virtual SynapseWorkspacePrivateLinkResourceCollection GetSynapseWorkspacePrivateLinkResources() { - return GetCachedClient(Client => new SynapseWorkspacePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new SynapseWorkspacePrivateLinkResourceCollection(client, Id)); } /// @@ -329,8 +329,8 @@ public virtual SynapseWorkspacePrivateLinkResourceCollection GetSynapseWorkspace /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetSynapseWorkspacePrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -352,8 +352,8 @@ public virtual async Task> GetSyna /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetSynapseWorkspacePrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -364,7 +364,7 @@ public virtual Response GetSynapseWorkspace /// An object representing collection of SynapseSqlPoolResources and their operations over a SynapseSqlPoolResource. public virtual SynapseSqlPoolCollection GetSynapseSqlPools() { - return GetCachedClient(Client => new SynapseSqlPoolCollection(Client, Id)); + return GetCachedClient(client => new SynapseSqlPoolCollection(client, Id)); } /// @@ -382,8 +382,8 @@ public virtual SynapseSqlPoolCollection GetSynapseSqlPools() /// /// SQL pool name. /// The cancellation token to use. - /// 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> GetSynapseSqlPoolAsync(string sqlPoolName, CancellationToken cancellationToken = default) { @@ -405,8 +405,8 @@ public virtual async Task> GetSynapseSqlPoolAsy /// /// SQL pool name. /// The cancellation token to use. - /// 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 GetSynapseSqlPool(string sqlPoolName, CancellationToken cancellationToken = default) { @@ -417,7 +417,7 @@ public virtual Response GetSynapseSqlPool(string sqlPool /// An object representing collection of SynapseServerBlobAuditingPolicyResources and their operations over a SynapseServerBlobAuditingPolicyResource. public virtual SynapseServerBlobAuditingPolicyCollection GetSynapseServerBlobAuditingPolicies() { - return GetCachedClient(Client => new SynapseServerBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseServerBlobAuditingPolicyCollection(client, Id)); } /// @@ -466,7 +466,7 @@ public virtual Response GetSynapseServe /// An object representing collection of SynapseExtendedServerBlobAuditingPolicyResources and their operations over a SynapseExtendedServerBlobAuditingPolicyResource. public virtual SynapseExtendedServerBlobAuditingPolicyCollection GetSynapseExtendedServerBlobAuditingPolicies() { - return GetCachedClient(Client => new SynapseExtendedServerBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseExtendedServerBlobAuditingPolicyCollection(client, Id)); } /// @@ -515,7 +515,7 @@ public virtual Response GetSyna /// An object representing collection of SynapseServerSecurityAlertPolicyResources and their operations over a SynapseServerSecurityAlertPolicyResource. public virtual SynapseServerSecurityAlertPolicyCollection GetSynapseServerSecurityAlertPolicies() { - return GetCachedClient(Client => new SynapseServerSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new SynapseServerSecurityAlertPolicyCollection(client, Id)); } /// @@ -564,7 +564,7 @@ public virtual Response GetSynapseServ /// An object representing collection of SynapseServerVulnerabilityAssessmentResources and their operations over a SynapseServerVulnerabilityAssessmentResource. public virtual SynapseServerVulnerabilityAssessmentCollection GetSynapseServerVulnerabilityAssessments() { - return GetCachedClient(Client => new SynapseServerVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SynapseServerVulnerabilityAssessmentCollection(client, Id)); } /// @@ -613,7 +613,7 @@ public virtual Response GetSynapse /// An object representing collection of SynapseEncryptionProtectorResources and their operations over a SynapseEncryptionProtectorResource. public virtual SynapseEncryptionProtectorCollection GetSynapseEncryptionProtectors() { - return GetCachedClient(Client => new SynapseEncryptionProtectorCollection(Client, Id)); + return GetCachedClient(client => new SynapseEncryptionProtectorCollection(client, Id)); } /// @@ -662,7 +662,7 @@ public virtual Response GetSynapseEncryption /// An object representing collection of SynapseRecoverableSqlPoolResources and their operations over a SynapseRecoverableSqlPoolResource. public virtual SynapseRecoverableSqlPoolCollection GetSynapseRecoverableSqlPools() { - return GetCachedClient(Client => new SynapseRecoverableSqlPoolCollection(Client, Id)); + return GetCachedClient(client => new SynapseRecoverableSqlPoolCollection(client, Id)); } /// @@ -680,8 +680,8 @@ public virtual SynapseRecoverableSqlPoolCollection GetSynapseRecoverableSqlPools /// /// The name of the sql pool. /// The cancellation token to use. - /// 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> GetSynapseRecoverableSqlPoolAsync(string sqlPoolName, CancellationToken cancellationToken = default) { @@ -703,8 +703,8 @@ public virtual async Task> GetSynaps /// /// The name of the sql pool. /// The cancellation token to use. - /// 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 GetSynapseRecoverableSqlPool(string sqlPoolName, CancellationToken cancellationToken = default) { @@ -715,7 +715,7 @@ public virtual Response GetSynapseRecoverable /// An object representing collection of SynapseDedicatedSqlMinimalTlsSettingResources and their operations over a SynapseDedicatedSqlMinimalTlsSettingResource. public virtual SynapseDedicatedSqlMinimalTlsSettingCollection GetSynapseDedicatedSqlMinimalTlsSettings() { - return GetCachedClient(Client => new SynapseDedicatedSqlMinimalTlsSettingCollection(Client, Id)); + return GetCachedClient(client => new SynapseDedicatedSqlMinimalTlsSettingCollection(client, Id)); } /// @@ -733,8 +733,8 @@ public virtual SynapseDedicatedSqlMinimalTlsSettingCollection GetSynapseDedicate /// /// The name of the dedicated sql minimal tls settings. /// The cancellation token to use. - /// 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> GetSynapseDedicatedSqlMinimalTlsSettingAsync(string dedicatedSQLminimalTlsSettingsName, CancellationToken cancellationToken = default) { @@ -756,8 +756,8 @@ public virtual async Task /// /// The name of the dedicated sql minimal tls settings. /// The cancellation token to use. - /// 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 GetSynapseDedicatedSqlMinimalTlsSetting(string dedicatedSQLminimalTlsSettingsName, CancellationToken cancellationToken = default) { @@ -789,7 +789,7 @@ public virtual SynapseManagedIdentitySqlControlSettingResource GetSynapseManaged /// An object representing collection of SynapseRestorableDroppedSqlPoolResources and their operations over a SynapseRestorableDroppedSqlPoolResource. public virtual SynapseRestorableDroppedSqlPoolCollection GetSynapseRestorableDroppedSqlPools() { - return GetCachedClient(Client => new SynapseRestorableDroppedSqlPoolCollection(Client, Id)); + return GetCachedClient(client => new SynapseRestorableDroppedSqlPoolCollection(client, Id)); } /// @@ -807,8 +807,8 @@ public virtual SynapseRestorableDroppedSqlPoolCollection GetSynapseRestorableDro /// /// The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat. /// The cancellation token to use. - /// 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> GetSynapseRestorableDroppedSqlPoolAsync(string restorableDroppedSqlPoolId, CancellationToken cancellationToken = default) { @@ -830,8 +830,8 @@ public virtual async Task> Get /// /// The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat. /// The cancellation token to use. - /// 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 GetSynapseRestorableDroppedSqlPool(string restorableDroppedSqlPoolId, CancellationToken cancellationToken = default) { @@ -842,7 +842,7 @@ public virtual Response GetSynapseResto /// An object representing collection of SynapseBigDataPoolInfoResources and their operations over a SynapseBigDataPoolInfoResource. public virtual SynapseBigDataPoolInfoCollection GetSynapseBigDataPoolInfos() { - return GetCachedClient(Client => new SynapseBigDataPoolInfoCollection(Client, Id)); + return GetCachedClient(client => new SynapseBigDataPoolInfoCollection(client, Id)); } /// @@ -860,8 +860,8 @@ public virtual SynapseBigDataPoolInfoCollection GetSynapseBigDataPoolInfos() /// /// Big Data pool name. /// The cancellation token to use. - /// 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> GetSynapseBigDataPoolInfoAsync(string bigDataPoolName, CancellationToken cancellationToken = default) { @@ -883,8 +883,8 @@ public virtual async Task> GetSynapseBi /// /// Big Data pool name. /// The cancellation token to use. - /// 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 GetSynapseBigDataPoolInfo(string bigDataPoolName, CancellationToken cancellationToken = default) { @@ -895,7 +895,7 @@ public virtual Response GetSynapseBigDataPoolInf /// An object representing collection of SynapseLibraryResources and their operations over a SynapseLibraryResource. public virtual SynapseLibraryCollection GetSynapseLibraries() { - return GetCachedClient(Client => new SynapseLibraryCollection(Client, Id)); + return GetCachedClient(client => new SynapseLibraryCollection(client, Id)); } /// @@ -913,8 +913,8 @@ public virtual SynapseLibraryCollection GetSynapseLibraries() /// /// Library name. /// The cancellation token to use. - /// 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> GetSynapseLibraryAsync(string libraryName, CancellationToken cancellationToken = default) { @@ -936,8 +936,8 @@ public virtual async Task> GetSynapseLibraryAsy /// /// Library name. /// The cancellation token to use. - /// 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 GetSynapseLibrary(string libraryName, CancellationToken cancellationToken = default) { @@ -948,7 +948,7 @@ public virtual Response GetSynapseLibrary(string library /// An object representing collection of SynapseIntegrationRuntimeResources and their operations over a SynapseIntegrationRuntimeResource. public virtual SynapseIntegrationRuntimeCollection GetSynapseIntegrationRuntimes() { - return GetCachedClient(Client => new SynapseIntegrationRuntimeCollection(Client, Id)); + return GetCachedClient(client => new SynapseIntegrationRuntimeCollection(client, Id)); } /// @@ -967,8 +967,8 @@ public virtual SynapseIntegrationRuntimeCollection GetSynapseIntegrationRuntimes /// Integration runtime name. /// ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetSynapseIntegrationRuntimeAsync(string integrationRuntimeName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -991,8 +991,8 @@ public virtual async Task> GetSynaps /// Integration runtime name. /// ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetSynapseIntegrationRuntime(string integrationRuntimeName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -1003,7 +1003,7 @@ public virtual Response GetSynapseIntegration /// An object representing collection of SynapseSparkConfigurationResources and their operations over a SynapseSparkConfigurationResource. public virtual SynapseSparkConfigurationCollection GetSynapseSparkConfigurations() { - return GetCachedClient(Client => new SynapseSparkConfigurationCollection(Client, Id)); + return GetCachedClient(client => new SynapseSparkConfigurationCollection(client, Id)); } /// @@ -1021,8 +1021,8 @@ public virtual SynapseSparkConfigurationCollection GetSynapseSparkConfigurations /// /// SparkConfiguration name. /// The cancellation token to use. - /// 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> GetSynapseSparkConfigurationAsync(string sparkConfigurationName, CancellationToken cancellationToken = default) { @@ -1044,8 +1044,8 @@ public virtual async Task> GetSynaps /// /// SparkConfiguration name. /// The cancellation token to use. - /// 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 GetSynapseSparkConfiguration(string sparkConfigurationName, CancellationToken cancellationToken = default) { @@ -1056,7 +1056,7 @@ public virtual Response GetSynapseSparkConfig /// An object representing collection of SynapseKustoPoolResources and their operations over a SynapseKustoPoolResource. public virtual SynapseKustoPoolCollection GetSynapseKustoPools() { - return GetCachedClient(Client => new SynapseKustoPoolCollection(Client, Id)); + return GetCachedClient(client => new SynapseKustoPoolCollection(client, Id)); } /// @@ -1074,8 +1074,8 @@ public virtual SynapseKustoPoolCollection GetSynapseKustoPools() /// /// The name of the Kusto pool. /// The cancellation token to use. - /// 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> GetSynapseKustoPoolAsync(string kustoPoolName, CancellationToken cancellationToken = default) { @@ -1097,8 +1097,8 @@ public virtual async Task> GetSynapseKustoPoo /// /// The name of the Kusto pool. /// The cancellation token to use. - /// 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 GetSynapseKustoPool(string kustoPoolName, CancellationToken cancellationToken = default) { diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 5acd415ef629..000000000000 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.TrafficManager -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of TrafficManagerProfileResources in the ResourceGroupResource. - /// An object representing collection of TrafficManagerProfileResources and their operations over a TrafficManagerProfileResource. - public virtual TrafficManagerProfileCollection GetTrafficManagerProfiles() - { - return GetCachedClient(Client => new TrafficManagerProfileCollection(Client, Id)); - } - } -} diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerArmClientMockingExtension.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerArmClientMockingExtension.cs new file mode 100644 index 000000000000..4e390cd381a3 --- /dev/null +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.TrafficManager; + +namespace Azure.ResourceManager.TrafficManager.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class TrafficManagerArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected TrafficManagerArmClientMockingExtension() + { + } + + /// 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 TrafficManagerArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal TrafficManagerArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual TrafficManagerEndpointResource GetTrafficManagerEndpointResource(ResourceIdentifier id) + { + TrafficManagerEndpointResource.ValidateResourceId(id); + return new TrafficManagerEndpointResource(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 TrafficManagerProfileResource GetTrafficManagerProfileResource(ResourceIdentifier id) + { + TrafficManagerProfileResource.ValidateResourceId(id); + return new TrafficManagerProfileResource(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 TrafficManagerGeographicHierarchyResource GetTrafficManagerGeographicHierarchyResource(ResourceIdentifier id) + { + TrafficManagerGeographicHierarchyResource.ValidateResourceId(id); + return new TrafficManagerGeographicHierarchyResource(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 TrafficManagerHeatMapResource GetTrafficManagerHeatMapResource(ResourceIdentifier id) + { + TrafficManagerHeatMapResource.ValidateResourceId(id); + return new TrafficManagerHeatMapResource(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 TrafficManagerUserMetricsResource GetTrafficManagerUserMetricsResource(ResourceIdentifier id) + { + TrafficManagerUserMetricsResource.ValidateResourceId(id); + return new TrafficManagerUserMetricsResource(Client, id); + } + } +} diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerExtensions.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerExtensions.cs index eadf8eb9cabc..dedd35643dc9 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerExtensions.cs +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TrafficManager.Mocking; using Azure.ResourceManager.TrafficManager.Models; namespace Azure.ResourceManager.TrafficManager @@ -19,154 +20,118 @@ namespace Azure.ResourceManager.TrafficManager /// A class to add extension methods to Azure.ResourceManager.TrafficManager. public static partial class TrafficManagerExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static TrafficManagerArmClientMockingExtension GetTrafficManagerArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new TrafficManagerArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static TrafficManagerResourceGroupMockingExtension GetTrafficManagerResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new TrafficManagerResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static TrafficManagerSubscriptionMockingExtension GetTrafficManagerSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new TrafficManagerSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static TrafficManagerTenantMockingExtension GetTrafficManagerTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new TrafficManagerTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region TrafficManagerEndpointResource /// /// 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. /// Returns a object. public static TrafficManagerEndpointResource GetTrafficManagerEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficManagerEndpointResource.ValidateResourceId(id); - return new TrafficManagerEndpointResource(client, id); - } - ); + return GetTrafficManagerArmClientMockingExtension(client).GetTrafficManagerEndpointResource(id); } - #endregion - #region TrafficManagerProfileResource /// /// 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. /// Returns a object. public static TrafficManagerProfileResource GetTrafficManagerProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficManagerProfileResource.ValidateResourceId(id); - return new TrafficManagerProfileResource(client, id); - } - ); + return GetTrafficManagerArmClientMockingExtension(client).GetTrafficManagerProfileResource(id); } - #endregion - #region TrafficManagerGeographicHierarchyResource /// /// 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. /// Returns a object. public static TrafficManagerGeographicHierarchyResource GetTrafficManagerGeographicHierarchyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficManagerGeographicHierarchyResource.ValidateResourceId(id); - return new TrafficManagerGeographicHierarchyResource(client, id); - } - ); + return GetTrafficManagerArmClientMockingExtension(client).GetTrafficManagerGeographicHierarchyResource(id); } - #endregion - #region TrafficManagerHeatMapResource /// /// 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. /// Returns a object. public static TrafficManagerHeatMapResource GetTrafficManagerHeatMapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficManagerHeatMapResource.ValidateResourceId(id); - return new TrafficManagerHeatMapResource(client, id); - } - ); + return GetTrafficManagerArmClientMockingExtension(client).GetTrafficManagerHeatMapResource(id); } - #endregion - #region TrafficManagerUserMetricsResource /// /// 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. /// Returns a object. public static TrafficManagerUserMetricsResource GetTrafficManagerUserMetricsResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficManagerUserMetricsResource.ValidateResourceId(id); - return new TrafficManagerUserMetricsResource(client, id); - } - ); + return GetTrafficManagerArmClientMockingExtension(client).GetTrafficManagerUserMetricsResource(id); } - #endregion - /// Gets a collection of TrafficManagerProfileResources in the ResourceGroupResource. + /// + /// Gets a collection of TrafficManagerProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TrafficManagerProfileResources and their operations over a TrafficManagerProfileResource. public static TrafficManagerProfileCollection GetTrafficManagerProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTrafficManagerProfiles(); + return GetTrafficManagerResourceGroupMockingExtension(resourceGroupResource).GetTrafficManagerProfiles(); } /// @@ -181,16 +146,20 @@ public static TrafficManagerProfileCollection GetTrafficManagerProfiles(this Res /// Profiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Traffic Manager profile. /// The cancellation token to use. - /// 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 static async Task> GetTrafficManagerProfileAsync(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetTrafficManagerProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + return await GetTrafficManagerResourceGroupMockingExtension(resourceGroupResource).GetTrafficManagerProfileAsync(profileName, cancellationToken).ConfigureAwait(false); } /// @@ -205,24 +174,34 @@ public static async Task> GetTrafficMana /// Profiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Traffic Manager profile. /// The cancellation token to use. - /// 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 static Response GetTrafficManagerProfile(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetTrafficManagerProfiles().Get(profileName, cancellationToken); + return GetTrafficManagerResourceGroupMockingExtension(resourceGroupResource).GetTrafficManagerProfile(profileName, cancellationToken); } - /// Gets an object representing a TrafficManagerUserMetricsResource along with the instance operations that can be performed on it in the SubscriptionResource. + /// + /// Gets an object representing a TrafficManagerUserMetricsResource along with the instance operations that can be performed on it in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static TrafficManagerUserMetricsResource GetTrafficManagerUserMetrics(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrafficManagerUserMetrics(); + return GetTrafficManagerSubscriptionMockingExtension(subscriptionResource).GetTrafficManagerUserMetrics(); } /// @@ -237,6 +216,10 @@ public static TrafficManagerUserMetricsResource GetTrafficManagerUserMetrics(thi /// Profiles_checkTrafficManagerNameAvailabilityV2 /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. @@ -244,9 +227,7 @@ public static TrafficManagerUserMetricsResource GetTrafficManagerUserMetrics(thi /// is null. public static async Task> CheckTrafficManagerNameAvailabilityV2Async(this SubscriptionResource subscriptionResource, TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckTrafficManagerNameAvailabilityV2Async(content, cancellationToken).ConfigureAwait(false); + return await GetTrafficManagerSubscriptionMockingExtension(subscriptionResource).CheckTrafficManagerNameAvailabilityV2Async(content, cancellationToken).ConfigureAwait(false); } /// @@ -261,6 +242,10 @@ public static async Task> CheckTr /// Profiles_checkTrafficManagerNameAvailabilityV2 /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. @@ -268,9 +253,7 @@ public static async Task> CheckTr /// is null. public static Response CheckTrafficManagerNameAvailabilityV2(this SubscriptionResource subscriptionResource, TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckTrafficManagerNameAvailabilityV2(content, cancellationToken); + return GetTrafficManagerSubscriptionMockingExtension(subscriptionResource).CheckTrafficManagerNameAvailabilityV2(content, cancellationToken); } /// @@ -285,13 +268,17 @@ public static Response CheckTrafficManager /// Profiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTrafficManagerProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrafficManagerProfilesAsync(cancellationToken); + return GetTrafficManagerSubscriptionMockingExtension(subscriptionResource).GetTrafficManagerProfilesAsync(cancellationToken); } /// @@ -306,21 +293,31 @@ public static AsyncPageable GetTrafficManagerProf /// Profiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTrafficManagerProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrafficManagerProfiles(cancellationToken); + return GetTrafficManagerSubscriptionMockingExtension(subscriptionResource).GetTrafficManagerProfiles(cancellationToken); } - /// Gets an object representing a TrafficManagerGeographicHierarchyResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Gets an object representing a TrafficManagerGeographicHierarchyResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static TrafficManagerGeographicHierarchyResource GetTrafficManagerGeographicHierarchy(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTrafficManagerGeographicHierarchy(); + return GetTrafficManagerTenantMockingExtension(tenantResource).GetTrafficManagerGeographicHierarchy(); } /// @@ -335,6 +332,10 @@ public static TrafficManagerGeographicHierarchyResource GetTrafficManagerGeograp /// Profiles_CheckTrafficManagerRelativeDnsNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. @@ -342,9 +343,7 @@ public static TrafficManagerGeographicHierarchyResource GetTrafficManagerGeograp /// is null. public static async Task> CheckTrafficManagerRelativeDnsNameAvailabilityAsync(this TenantResource tenantResource, TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckTrafficManagerRelativeDnsNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetTrafficManagerTenantMockingExtension(tenantResource).CheckTrafficManagerRelativeDnsNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -359,6 +358,10 @@ public static async Task> CheckTr /// Profiles_CheckTrafficManagerRelativeDnsNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. @@ -366,9 +369,7 @@ public static async Task> CheckTr /// is null. public static Response CheckTrafficManagerRelativeDnsNameAvailability(this TenantResource tenantResource, TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CheckTrafficManagerRelativeDnsNameAvailability(content, cancellationToken); + return GetTrafficManagerTenantMockingExtension(tenantResource).CheckTrafficManagerRelativeDnsNameAvailability(content, cancellationToken); } } } diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerResourceGroupMockingExtension.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c1743a05c00c --- /dev/null +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.TrafficManager; + +namespace Azure.ResourceManager.TrafficManager.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class TrafficManagerResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected TrafficManagerResourceGroupMockingExtension() + { + } + + /// 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 TrafficManagerResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of TrafficManagerProfileResources in the ResourceGroupResource. + /// An object representing collection of TrafficManagerProfileResources and their operations over a TrafficManagerProfileResource. + public virtual TrafficManagerProfileCollection GetTrafficManagerProfiles() + { + return GetCachedClient(client => new TrafficManagerProfileCollection(client, Id)); + } + + /// + /// Gets a Traffic Manager profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName} + /// + /// + /// Operation Id + /// Profiles_Get + /// + /// + /// + /// The name of the Traffic Manager profile. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTrafficManagerProfileAsync(string profileName, CancellationToken cancellationToken = default) + { + return await GetTrafficManagerProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Traffic Manager profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName} + /// + /// + /// Operation Id + /// Profiles_Get + /// + /// + /// + /// The name of the Traffic Manager profile. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTrafficManagerProfile(string profileName, CancellationToken cancellationToken = default) + { + return GetTrafficManagerProfiles().Get(profileName, cancellationToken); + } + } +} diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerSubscriptionMockingExtension.cs similarity index 86% rename from sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerSubscriptionMockingExtension.cs index d9082f7b170a..0ddaeed87b58 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.TrafficManager; using Azure.ResourceManager.TrafficManager.Models; -namespace Azure.ResourceManager.TrafficManager +namespace Azure.ResourceManager.TrafficManager.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class TrafficManagerSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _trafficManagerProfileProfilesClientDiagnostics; private ProfilesRestOperations _trafficManagerProfileProfilesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected TrafficManagerSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal TrafficManagerSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,9 +67,12 @@ public virtual TrafficManagerUserMetricsResource GetTrafficManagerUserMetrics() /// /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckTrafficManagerNameAvailabilityV2Async(TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckTrafficManagerNameAvailabilityV2"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TrafficManagerSubscriptionMockingExtension.CheckTrafficManagerNameAvailabilityV2"); scope.Start(); try { @@ -97,9 +101,12 @@ public virtual async Task> CheckT /// /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual Response CheckTrafficManagerNameAvailabilityV2(TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckTrafficManagerNameAvailabilityV2"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TrafficManagerSubscriptionMockingExtension.CheckTrafficManagerNameAvailabilityV2"); scope.Start(); try { @@ -131,7 +138,7 @@ public virtual Response CheckTrafficManage public virtual AsyncPageable GetTrafficManagerProfilesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => TrafficManagerProfileProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new TrafficManagerProfileResource(Client, TrafficManagerProfileData.DeserializeTrafficManagerProfileData(e)), TrafficManagerProfileProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrafficManagerProfiles", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new TrafficManagerProfileResource(Client, TrafficManagerProfileData.DeserializeTrafficManagerProfileData(e)), TrafficManagerProfileProfilesClientDiagnostics, Pipeline, "TrafficManagerSubscriptionMockingExtension.GetTrafficManagerProfiles", "value", null, cancellationToken); } /// @@ -152,7 +159,7 @@ public virtual AsyncPageable GetTrafficManagerPro public virtual Pageable GetTrafficManagerProfiles(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => TrafficManagerProfileProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new TrafficManagerProfileResource(Client, TrafficManagerProfileData.DeserializeTrafficManagerProfileData(e)), TrafficManagerProfileProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrafficManagerProfiles", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new TrafficManagerProfileResource(Client, TrafficManagerProfileData.DeserializeTrafficManagerProfileData(e)), TrafficManagerProfileProfilesClientDiagnostics, Pipeline, "TrafficManagerSubscriptionMockingExtension.GetTrafficManagerProfiles", "value", null, cancellationToken); } } } diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerTenantMockingExtension.cs similarity index 83% rename from sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerTenantMockingExtension.cs index 8ae33a4d10b3..40cb5f18c600 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/Extensions/TrafficManagerTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.TrafficManager; using Azure.ResourceManager.TrafficManager.Models; -namespace Azure.ResourceManager.TrafficManager +namespace Azure.ResourceManager.TrafficManager.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class TrafficManagerTenantMockingExtension : ArmResource { private ClientDiagnostics _trafficManagerProfileProfilesClientDiagnostics; private ProfilesRestOperations _trafficManagerProfileProfilesRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected TrafficManagerTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal TrafficManagerTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,9 +66,12 @@ public virtual TrafficManagerGeographicHierarchyResource GetTrafficManagerGeogra /// /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckTrafficManagerRelativeDnsNameAvailabilityAsync(TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckTrafficManagerRelativeDnsNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TrafficManagerTenantMockingExtension.CheckTrafficManagerRelativeDnsNameAvailability"); scope.Start(); try { @@ -96,9 +100,12 @@ public virtual async Task> CheckT /// /// The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation. /// The cancellation token to use. + /// is null. public virtual Response CheckTrafficManagerRelativeDnsNameAvailability(TrafficManagerRelativeDnsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckTrafficManagerRelativeDnsNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = TrafficManagerProfileProfilesClientDiagnostics.CreateScope("TrafficManagerTenantMockingExtension.CheckTrafficManagerRelativeDnsNameAvailability"); scope.Start(); try { diff --git a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/TrafficManagerProfileResource.cs b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/TrafficManagerProfileResource.cs index 550b5d8b63fb..464e3db735cd 100644 --- a/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/TrafficManagerProfileResource.cs +++ b/sdk/trafficmanager/Azure.ResourceManager.TrafficManager/src/Generated/TrafficManagerProfileResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of TrafficManagerEndpointResources and their operations over a TrafficManagerEndpointResource. public virtual TrafficManagerEndpointCollection GetTrafficManagerEndpoints() { - return GetCachedClient(Client => new TrafficManagerEndpointCollection(Client, Id)); + return GetCachedClient(client => new TrafficManagerEndpointCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual TrafficManagerEndpointCollection GetTrafficManagerEndpoints() /// The type of the Traffic Manager endpoint. Only AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here. /// The name of the Traffic Manager endpoint. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetTrafficManagerEndpointAsync(string endpointType, string endpointName, CancellationToken cancellationToken = default) { @@ -136,8 +136,8 @@ public virtual async Task> GetTrafficMa /// The type of the Traffic Manager endpoint. Only AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here. /// The name of the Traffic Manager endpoint. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetTrafficManagerEndpoint(string endpointType, string endpointName, CancellationToken cancellationToken = default) { @@ -148,7 +148,7 @@ public virtual Response GetTrafficManagerEndpoin /// An object representing collection of TrafficManagerHeatMapResources and their operations over a TrafficManagerHeatMapResource. public virtual TrafficManagerHeatMapCollection GetTrafficManagerHeatMaps() { - return GetCachedClient(Client => new TrafficManagerHeatMapCollection(Client, Id)); + return GetCachedClient(client => new TrafficManagerHeatMapCollection(client, Id)); } /// diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 39869e5cebc4..000000000000 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.VoiceServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of VoiceServicesCommunicationsGatewayResources in the ResourceGroupResource. - /// An object representing collection of VoiceServicesCommunicationsGatewayResources and their operations over a VoiceServicesCommunicationsGatewayResource. - public virtual VoiceServicesCommunicationsGatewayCollection GetVoiceServicesCommunicationsGateways() - { - return GetCachedClient(Client => new VoiceServicesCommunicationsGatewayCollection(Client, Id)); - } - } -} diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesArmClientMockingExtension.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..8ef7189977ac --- /dev/null +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.VoiceServices; + +namespace Azure.ResourceManager.VoiceServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class VoiceServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected VoiceServicesArmClientMockingExtension() + { + } + + /// 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 VoiceServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal VoiceServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual VoiceServicesCommunicationsGatewayResource GetVoiceServicesCommunicationsGatewayResource(ResourceIdentifier id) + { + VoiceServicesCommunicationsGatewayResource.ValidateResourceId(id); + return new VoiceServicesCommunicationsGatewayResource(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 VoiceServicesTestLineResource GetVoiceServicesTestLineResource(ResourceIdentifier id) + { + VoiceServicesTestLineResource.ValidateResourceId(id); + return new VoiceServicesTestLineResource(Client, id); + } + } +} diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesExtensions.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesExtensions.cs index da5a349f8804..df17217356d4 100644 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesExtensions.cs +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.VoiceServices.Mocking; using Azure.ResourceManager.VoiceServices.Models; namespace Azure.ResourceManager.VoiceServices @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.VoiceServices /// A class to add extension methods to Azure.ResourceManager.VoiceServices. public static partial class VoiceServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static VoiceServicesArmClientMockingExtension GetVoiceServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new VoiceServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static VoiceServicesResourceGroupMockingExtension GetVoiceServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new VoiceServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static VoiceServicesSubscriptionMockingExtension GetVoiceServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new VoiceServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region VoiceServicesCommunicationsGatewayResource /// /// 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. /// Returns a object. public static VoiceServicesCommunicationsGatewayResource GetVoiceServicesCommunicationsGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VoiceServicesCommunicationsGatewayResource.ValidateResourceId(id); - return new VoiceServicesCommunicationsGatewayResource(client, id); - } - ); + return GetVoiceServicesArmClientMockingExtension(client).GetVoiceServicesCommunicationsGatewayResource(id); } - #endregion - #region VoiceServicesTestLineResource /// /// 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. /// Returns a object. public static VoiceServicesTestLineResource GetVoiceServicesTestLineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VoiceServicesTestLineResource.ValidateResourceId(id); - return new VoiceServicesTestLineResource(client, id); - } - ); + return GetVoiceServicesArmClientMockingExtension(client).GetVoiceServicesTestLineResource(id); } - #endregion - /// Gets a collection of VoiceServicesCommunicationsGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of VoiceServicesCommunicationsGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VoiceServicesCommunicationsGatewayResources and their operations over a VoiceServicesCommunicationsGatewayResource. public static VoiceServicesCommunicationsGatewayCollection GetVoiceServicesCommunicationsGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVoiceServicesCommunicationsGateways(); + return GetVoiceServicesResourceGroupMockingExtension(resourceGroupResource).GetVoiceServicesCommunicationsGateways(); } /// @@ -108,16 +93,20 @@ public static VoiceServicesCommunicationsGatewayCollection GetVoiceServicesCommu /// CommunicationsGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique identifier for this deployment. /// The cancellation token to use. - /// 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 static async Task> GetVoiceServicesCommunicationsGatewayAsync(this ResourceGroupResource resourceGroupResource, string communicationsGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVoiceServicesCommunicationsGateways().GetAsync(communicationsGatewayName, cancellationToken).ConfigureAwait(false); + return await GetVoiceServicesResourceGroupMockingExtension(resourceGroupResource).GetVoiceServicesCommunicationsGatewayAsync(communicationsGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -132,16 +121,20 @@ public static async Task> G /// CommunicationsGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Unique identifier for this deployment. /// The cancellation token to use. - /// 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 static Response GetVoiceServicesCommunicationsGateway(this ResourceGroupResource resourceGroupResource, string communicationsGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVoiceServicesCommunicationsGateways().Get(communicationsGatewayName, cancellationToken); + return GetVoiceServicesResourceGroupMockingExtension(resourceGroupResource).GetVoiceServicesCommunicationsGateway(communicationsGatewayName, cancellationToken); } /// @@ -156,13 +149,17 @@ public static Response GetVoiceServi /// CommunicationsGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVoiceServicesCommunicationsGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVoiceServicesCommunicationsGatewaysAsync(cancellationToken); + return GetVoiceServicesSubscriptionMockingExtension(subscriptionResource).GetVoiceServicesCommunicationsGatewaysAsync(cancellationToken); } /// @@ -177,13 +174,17 @@ public static AsyncPageable GetVoice /// CommunicationsGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVoiceServicesCommunicationsGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVoiceServicesCommunicationsGateways(cancellationToken); + return GetVoiceServicesSubscriptionMockingExtension(subscriptionResource).GetVoiceServicesCommunicationsGateways(cancellationToken); } /// @@ -198,6 +199,10 @@ public static Pageable GetVoiceServi /// NameAvailability_CheckLocal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -206,9 +211,7 @@ public static Pageable GetVoiceServi /// is null. public static async Task> CheckVoiceServicesNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, VoiceServicesCheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckVoiceServicesNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetVoiceServicesSubscriptionMockingExtension(subscriptionResource).CheckVoiceServicesNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -223,6 +226,10 @@ public static async Task> Che /// NameAvailability_CheckLocal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -231,9 +238,7 @@ public static async Task> Che /// is null. public static Response CheckVoiceServicesNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, VoiceServicesCheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckVoiceServicesNameAvailability(location, content, cancellationToken); + return GetVoiceServicesSubscriptionMockingExtension(subscriptionResource).CheckVoiceServicesNameAvailability(location, content, cancellationToken); } } } diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesResourceGroupMockingExtension.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8027cba27269 --- /dev/null +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.VoiceServices; + +namespace Azure.ResourceManager.VoiceServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class VoiceServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected VoiceServicesResourceGroupMockingExtension() + { + } + + /// 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 VoiceServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of VoiceServicesCommunicationsGatewayResources in the ResourceGroupResource. + /// An object representing collection of VoiceServicesCommunicationsGatewayResources and their operations over a VoiceServicesCommunicationsGatewayResource. + public virtual VoiceServicesCommunicationsGatewayCollection GetVoiceServicesCommunicationsGateways() + { + return GetCachedClient(client => new VoiceServicesCommunicationsGatewayCollection(client, Id)); + } + + /// + /// Get a CommunicationsGateway + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName} + /// + /// + /// Operation Id + /// CommunicationsGateways_Get + /// + /// + /// + /// Unique identifier for this deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVoiceServicesCommunicationsGatewayAsync(string communicationsGatewayName, CancellationToken cancellationToken = default) + { + return await GetVoiceServicesCommunicationsGateways().GetAsync(communicationsGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CommunicationsGateway + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices/communicationsGateways/{communicationsGatewayName} + /// + /// + /// Operation Id + /// CommunicationsGateways_Get + /// + /// + /// + /// Unique identifier for this deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVoiceServicesCommunicationsGateway(string communicationsGatewayName, CancellationToken cancellationToken = default) + { + return GetVoiceServicesCommunicationsGateways().Get(communicationsGatewayName, cancellationToken); + } + } +} diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesSubscriptionMockingExtension.cs similarity index 87% rename from sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesSubscriptionMockingExtension.cs index dd076a6b992b..94139c6b43bd 100644 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/Extensions/VoiceServicesSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.VoiceServices; using Azure.ResourceManager.VoiceServices.Models; -namespace Azure.ResourceManager.VoiceServices +namespace Azure.ResourceManager.VoiceServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class VoiceServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _voiceServicesCommunicationsGatewayCommunicationsGatewaysClientDiagnostics; private CommunicationsGatewaysRestOperations _voiceServicesCommunicationsGatewayCommunicationsGatewaysRestClient; private ClientDiagnostics _nameAvailabilityClientDiagnostics; private NameAvailabilityRestOperations _nameAvailabilityRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected VoiceServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal VoiceServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetVoic { HttpMessage FirstPageRequest(int? pageSizeHint) => VoiceServicesCommunicationsGatewayCommunicationsGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VoiceServicesCommunicationsGatewayCommunicationsGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VoiceServicesCommunicationsGatewayResource(Client, VoiceServicesCommunicationsGatewayData.DeserializeVoiceServicesCommunicationsGatewayData(e)), VoiceServicesCommunicationsGatewayCommunicationsGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVoiceServicesCommunicationsGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VoiceServicesCommunicationsGatewayResource(Client, VoiceServicesCommunicationsGatewayData.DeserializeVoiceServicesCommunicationsGatewayData(e)), VoiceServicesCommunicationsGatewayCommunicationsGatewaysClientDiagnostics, Pipeline, "VoiceServicesSubscriptionMockingExtension.GetVoiceServicesCommunicationsGateways", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetVoiceServ { HttpMessage FirstPageRequest(int? pageSizeHint) => VoiceServicesCommunicationsGatewayCommunicationsGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VoiceServicesCommunicationsGatewayCommunicationsGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VoiceServicesCommunicationsGatewayResource(Client, VoiceServicesCommunicationsGatewayData.DeserializeVoiceServicesCommunicationsGatewayData(e)), VoiceServicesCommunicationsGatewayCommunicationsGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVoiceServicesCommunicationsGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VoiceServicesCommunicationsGatewayResource(Client, VoiceServicesCommunicationsGatewayData.DeserializeVoiceServicesCommunicationsGatewayData(e)), VoiceServicesCommunicationsGatewayCommunicationsGatewaysClientDiagnostics, Pipeline, "VoiceServicesSubscriptionMockingExtension.GetVoiceServicesCommunicationsGateways", "value", "nextLink", cancellationToken); } /// @@ -108,9 +109,12 @@ public virtual Pageable GetVoiceServ /// The location in which uniqueness will be verified. /// The check availability request body. /// The cancellation token to use. + /// is null. public virtual async Task> CheckVoiceServicesNameAvailabilityAsync(AzureLocation location, VoiceServicesCheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckVoiceServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NameAvailabilityClientDiagnostics.CreateScope("VoiceServicesSubscriptionMockingExtension.CheckVoiceServicesNameAvailability"); scope.Start(); try { @@ -140,9 +144,12 @@ public virtual async Task> Ch /// The location in which uniqueness will be verified. /// The check availability request body. /// The cancellation token to use. + /// is null. public virtual Response CheckVoiceServicesNameAvailability(AzureLocation location, VoiceServicesCheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckVoiceServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NameAvailabilityClientDiagnostics.CreateScope("VoiceServicesSubscriptionMockingExtension.CheckVoiceServicesNameAvailability"); scope.Start(); try { diff --git a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/VoiceServicesCommunicationsGatewayResource.cs b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/VoiceServicesCommunicationsGatewayResource.cs index 8b46fc37f5b7..8048ab2f8781 100644 --- a/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/VoiceServicesCommunicationsGatewayResource.cs +++ b/sdk/voiceservices/Azure.ResourceManager.VoiceServices/src/Generated/VoiceServicesCommunicationsGatewayResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VoiceServicesTestLineResources and their operations over a VoiceServicesTestLineResource. public virtual VoiceServicesTestLineCollection GetVoiceServicesTestLines() { - return GetCachedClient(Client => new VoiceServicesTestLineCollection(Client, Id)); + return GetCachedClient(client => new VoiceServicesTestLineCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual VoiceServicesTestLineCollection GetVoiceServicesTestLines() /// /// Unique identifier for this test line. /// The cancellation token to use. - /// 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> GetVoiceServicesTestLineAsync(string testLineName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetVoiceServi /// /// Unique identifier for this test line. /// The cancellation token to use. - /// 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 GetVoiceServicesTestLine(string testLineName, CancellationToken cancellationToken = default) { diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e863b9d79eca..000000000000 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.WebPubSub -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of WebPubSubResources in the ResourceGroupResource. - /// An object representing collection of WebPubSubResources and their operations over a WebPubSubResource. - public virtual WebPubSubCollection GetWebPubSubs() - { - return GetCachedClient(Client => new WebPubSubCollection(Client, Id)); - } - } -} diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubArmClientMockingExtension.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubArmClientMockingExtension.cs new file mode 100644 index 000000000000..c3dc9e277441 --- /dev/null +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.WebPubSub; + +namespace Azure.ResourceManager.WebPubSub.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class WebPubSubArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WebPubSubArmClientMockingExtension() + { + } + + /// 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 WebPubSubArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal WebPubSubArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WebPubSubResource GetWebPubSubResource(ResourceIdentifier id) + { + WebPubSubResource.ValidateResourceId(id); + return new WebPubSubResource(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 WebPubSubHubResource GetWebPubSubHubResource(ResourceIdentifier id) + { + WebPubSubHubResource.ValidateResourceId(id); + return new WebPubSubHubResource(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 WebPubSubPrivateEndpointConnectionResource GetWebPubSubPrivateEndpointConnectionResource(ResourceIdentifier id) + { + WebPubSubPrivateEndpointConnectionResource.ValidateResourceId(id); + return new WebPubSubPrivateEndpointConnectionResource(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 WebPubSubSharedPrivateLinkResource GetWebPubSubSharedPrivateLinkResource(ResourceIdentifier id) + { + WebPubSubSharedPrivateLinkResource.ValidateResourceId(id); + return new WebPubSubSharedPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubExtensions.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubExtensions.cs index 00131a5ddfbf..0555a2b4bdbd 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubExtensions.cs +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.WebPubSub.Mocking; using Azure.ResourceManager.WebPubSub.Models; namespace Azure.ResourceManager.WebPubSub @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.WebPubSub /// A class to add extension methods to Azure.ResourceManager.WebPubSub. public static partial class WebPubSubExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static WebPubSubArmClientMockingExtension GetWebPubSubArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new WebPubSubArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static WebPubSubResourceGroupMockingExtension GetWebPubSubResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new WebPubSubResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static WebPubSubSubscriptionMockingExtension GetWebPubSubSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new WebPubSubSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region WebPubSubResource /// /// 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. /// Returns a object. public static WebPubSubResource GetWebPubSubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebPubSubResource.ValidateResourceId(id); - return new WebPubSubResource(client, id); - } - ); + return GetWebPubSubArmClientMockingExtension(client).GetWebPubSubResource(id); } - #endregion - #region WebPubSubHubResource /// /// 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. /// Returns a object. public static WebPubSubHubResource GetWebPubSubHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebPubSubHubResource.ValidateResourceId(id); - return new WebPubSubHubResource(client, id); - } - ); + return GetWebPubSubArmClientMockingExtension(client).GetWebPubSubHubResource(id); } - #endregion - #region WebPubSubPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static WebPubSubPrivateEndpointConnectionResource GetWebPubSubPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebPubSubPrivateEndpointConnectionResource.ValidateResourceId(id); - return new WebPubSubPrivateEndpointConnectionResource(client, id); - } - ); + return GetWebPubSubArmClientMockingExtension(client).GetWebPubSubPrivateEndpointConnectionResource(id); } - #endregion - #region WebPubSubSharedPrivateLinkResource /// /// 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. /// Returns a object. public static WebPubSubSharedPrivateLinkResource GetWebPubSubSharedPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebPubSubSharedPrivateLinkResource.ValidateResourceId(id); - return new WebPubSubSharedPrivateLinkResource(client, id); - } - ); + return GetWebPubSubArmClientMockingExtension(client).GetWebPubSubSharedPrivateLinkResource(id); } - #endregion - /// Gets a collection of WebPubSubResources in the ResourceGroupResource. + /// + /// Gets a collection of WebPubSubResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WebPubSubResources and their operations over a WebPubSubResource. public static WebPubSubCollection GetWebPubSubs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWebPubSubs(); + return GetWebPubSubResourceGroupMockingExtension(resourceGroupResource).GetWebPubSubs(); } /// @@ -146,16 +125,20 @@ public static WebPubSubCollection GetWebPubSubs(this ResourceGroupResource resou /// WebPubSub_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static async Task> GetWebPubSubAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWebPubSubs().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetWebPubSubResourceGroupMockingExtension(resourceGroupResource).GetWebPubSubAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetWebPubSubAsync(this Res /// WebPubSub_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static Response GetWebPubSub(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWebPubSubs().Get(resourceName, cancellationToken); + return GetWebPubSubResourceGroupMockingExtension(resourceGroupResource).GetWebPubSub(resourceName, cancellationToken); } /// @@ -194,6 +181,10 @@ public static Response GetWebPubSub(this ResourceGroupResourc /// WebPubSub_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -202,9 +193,7 @@ public static Response GetWebPubSub(this ResourceGroupResourc /// is null. public static async Task> CheckWebPubSubNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, WebPubSubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckWebPubSubNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetWebPubSubSubscriptionMockingExtension(subscriptionResource).CheckWebPubSubNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -219,6 +208,10 @@ public static async Task> CheckWebPubSubName /// WebPubSub_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -227,9 +220,7 @@ public static async Task> CheckWebPubSubName /// is null. public static Response CheckWebPubSubNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, WebPubSubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckWebPubSubNameAvailability(location, content, cancellationToken); + return GetWebPubSubSubscriptionMockingExtension(subscriptionResource).CheckWebPubSubNameAvailability(location, content, cancellationToken); } /// @@ -244,13 +235,17 @@ public static Response CheckWebPubSubNameAvailability /// WebPubSub_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebPubSubsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebPubSubsAsync(cancellationToken); + return GetWebPubSubSubscriptionMockingExtension(subscriptionResource).GetWebPubSubsAsync(cancellationToken); } /// @@ -265,13 +260,17 @@ public static AsyncPageable GetWebPubSubsAsync(this Subscript /// WebPubSub_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebPubSubs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebPubSubs(cancellationToken); + return GetWebPubSubSubscriptionMockingExtension(subscriptionResource).GetWebPubSubs(cancellationToken); } /// @@ -286,6 +285,10 @@ public static Pageable GetWebPubSubs(this SubscriptionResourc /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the location like "eastus". @@ -293,7 +296,7 @@ public static Pageable GetWebPubSubs(this SubscriptionResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, cancellationToken); + return GetWebPubSubSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, cancellationToken); } /// @@ -308,6 +311,10 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the location like "eastus". @@ -315,7 +322,7 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, cancellationToken); + return GetWebPubSubSubscriptionMockingExtension(subscriptionResource).GetUsages(location, cancellationToken); } } } diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubResourceGroupMockingExtension.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f11e6036a075 --- /dev/null +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.WebPubSub; + +namespace Azure.ResourceManager.WebPubSub.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class WebPubSubResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WebPubSubResourceGroupMockingExtension() + { + } + + /// 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 WebPubSubResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of WebPubSubResources in the ResourceGroupResource. + /// An object representing collection of WebPubSubResources and their operations over a WebPubSubResource. + public virtual WebPubSubCollection GetWebPubSubs() + { + return GetCachedClient(client => new WebPubSubCollection(client, Id)); + } + + /// + /// Get the resource and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName} + /// + /// + /// Operation Id + /// WebPubSub_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebPubSubAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetWebPubSubs().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the resource and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName} + /// + /// + /// Operation Id + /// WebPubSub_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebPubSub(string resourceName, CancellationToken cancellationToken = default) + { + return GetWebPubSubs().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubSubscriptionMockingExtension.cs similarity index 87% rename from sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubSubscriptionMockingExtension.cs index 411ed6d4d4e9..7675a34e087a 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/Extensions/WebPubSubSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.WebPubSub; using Azure.ResourceManager.WebPubSub.Models; -namespace Azure.ResourceManager.WebPubSub +namespace Azure.ResourceManager.WebPubSub.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class WebPubSubSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _webPubSubClientDiagnostics; private WebPubSubRestOperations _webPubSubRestClient; private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected WebPubSubSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal WebPubSubSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,9 +65,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckWebPubSubNameAvailabilityAsync(AzureLocation location, WebPubSubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = WebPubSubClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckWebPubSubNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = WebPubSubClientDiagnostics.CreateScope("WebPubSubSubscriptionMockingExtension.CheckWebPubSubNameAvailability"); scope.Start(); try { @@ -96,9 +100,12 @@ public virtual async Task> CheckWebPubSubNam /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual Response CheckWebPubSubNameAvailability(AzureLocation location, WebPubSubNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = WebPubSubClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckWebPubSubNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = WebPubSubClientDiagnostics.CreateScope("WebPubSubSubscriptionMockingExtension.CheckWebPubSubNameAvailability"); scope.Start(); try { @@ -131,7 +138,7 @@ public virtual AsyncPageable GetWebPubSubsAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => WebPubSubRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebPubSubRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebPubSubResource(Client, WebPubSubData.DeserializeWebPubSubData(e)), WebPubSubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebPubSubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebPubSubResource(Client, WebPubSubData.DeserializeWebPubSubData(e)), WebPubSubClientDiagnostics, Pipeline, "WebPubSubSubscriptionMockingExtension.GetWebPubSubs", "value", "nextLink", cancellationToken); } /// @@ -153,7 +160,7 @@ public virtual Pageable GetWebPubSubs(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => WebPubSubRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebPubSubRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebPubSubResource(Client, WebPubSubData.DeserializeWebPubSubData(e)), WebPubSubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebPubSubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebPubSubResource(Client, WebPubSubData.DeserializeWebPubSubData(e)), WebPubSubClientDiagnostics, Pipeline, "WebPubSubSubscriptionMockingExtension.GetWebPubSubs", "value", "nextLink", cancellationToken); } /// @@ -176,7 +183,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation l { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SignalRServiceUsage.DeserializeSignalRServiceUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SignalRServiceUsage.DeserializeSignalRServiceUsage, UsagesClientDiagnostics, Pipeline, "WebPubSubSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -199,7 +206,7 @@ public virtual Pageable GetUsages(AzureLocation location, C { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SignalRServiceUsage.DeserializeSignalRServiceUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SignalRServiceUsage.DeserializeSignalRServiceUsage, UsagesClientDiagnostics, Pipeline, "WebPubSubSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs index f48c72a1a171..a67962a68462 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WebPubSubHubResources and their operations over a WebPubSubHubResource. public virtual WebPubSubHubCollection GetWebPubSubHubs() { - return GetCachedClient(Client => new WebPubSubHubCollection(Client, Id)); + return GetCachedClient(client => new WebPubSubHubCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual WebPubSubHubCollection GetWebPubSubHubs() /// /// The hub name. /// The cancellation token to use. - /// 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> GetWebPubSubHubAsync(string hubName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetWebPubSubHubAsync(s /// /// The hub name. /// The cancellation token to use. - /// 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 GetWebPubSubHub(string hubName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetWebPubSubHub(string hubName, Ca /// An object representing collection of WebPubSubPrivateEndpointConnectionResources and their operations over a WebPubSubPrivateEndpointConnectionResource. public virtual WebPubSubPrivateEndpointConnectionCollection GetWebPubSubPrivateEndpointConnections() { - return GetCachedClient(Client => new WebPubSubPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new WebPubSubPrivateEndpointConnectionCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual WebPubSubPrivateEndpointConnectionCollection GetWebPubSubPrivateE /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetWebPubSubPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetWebPubSubPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetWebPubSub /// An object representing collection of WebPubSubSharedPrivateLinkResources and their operations over a WebPubSubSharedPrivateLinkResource. public virtual WebPubSubSharedPrivateLinkCollection GetWebPubSubSharedPrivateLinks() { - return GetCachedClient(Client => new WebPubSubSharedPrivateLinkCollection(Client, Id)); + return GetCachedClient(client => new WebPubSubSharedPrivateLinkCollection(client, Id)); } /// @@ -222,8 +222,8 @@ public virtual WebPubSubSharedPrivateLinkCollection GetWebPubSubSharedPrivateLin /// /// The name of the shared private link resource. /// The cancellation token to use. - /// 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> GetWebPubSubSharedPrivateLinkAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task> GetWebPu /// /// The name of the shared private link resource. /// The cancellation token to use. - /// 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 GetWebPubSubSharedPrivateLink(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceCertificateOrderResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceCertificateOrderResource.cs index 7dcacd87640a..545d2b7dae66 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceCertificateOrderResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceCertificateOrderResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppServiceCertificateResources and their operations over a AppServiceCertificateResource. public virtual AppServiceCertificateCollection GetAppServiceCertificates() { - return GetCachedClient(Client => new AppServiceCertificateCollection(Client, Id)); + return GetCachedClient(client => new AppServiceCertificateCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual AppServiceCertificateCollection GetAppServiceCertificates() /// /// Name of the certificate. /// The cancellation token to use. - /// 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> GetAppServiceCertificateAsync(string name, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetAppService /// /// Name of the certificate. /// The cancellation token to use. - /// 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 GetAppServiceCertificate(string name, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetAppServiceCertificate( /// An object representing collection of CertificateOrderDetectorResources and their operations over a CertificateOrderDetectorResource. public virtual CertificateOrderDetectorCollection GetCertificateOrderDetectors() { - return GetCachedClient(Client => new CertificateOrderDetectorCollection(Client, Id)); + return GetCachedClient(client => new CertificateOrderDetectorCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual CertificateOrderDetectorCollection GetCertificateOrderDetectors() /// The end time for the detector response. /// The time grain for the detector response. /// The cancellation token to use. - /// 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> GetCertificateOrderDetectorAsync(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetCertifi /// The end time for the detector response. /// The time grain for the detector response. /// The cancellation token to use. - /// 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 GetCertificateOrderDetector(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs index b266a7948be6..71d4ce13aff5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DomainOwnershipIdentifierResources and their operations over a DomainOwnershipIdentifierResource. public virtual DomainOwnershipIdentifierCollection GetDomainOwnershipIdentifiers() { - return GetCachedClient(Client => new DomainOwnershipIdentifierCollection(Client, Id)); + return GetCachedClient(client => new DomainOwnershipIdentifierCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual DomainOwnershipIdentifierCollection GetDomainOwnershipIdentifiers /// /// Name of identifier. /// The cancellation token to use. - /// 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> GetDomainOwnershipIdentifierAsync(string name, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetDomain /// /// Name of identifier. /// The cancellation token to use. - /// 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 GetDomainOwnershipIdentifier(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs index bc74773e7114..0e56bde0a665 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HostingEnvironmentDetectorResources and their operations over a HostingEnvironmentDetectorResource. public virtual HostingEnvironmentDetectorCollection GetHostingEnvironmentDetectors() { - return GetCachedClient(Client => new HostingEnvironmentDetectorCollection(Client, Id)); + return GetCachedClient(client => new HostingEnvironmentDetectorCollection(client, Id)); } /// @@ -123,8 +123,8 @@ public virtual HostingEnvironmentDetectorCollection GetHostingEnvironmentDetecto /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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> GetHostingEnvironmentDetectorAsync(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -149,8 +149,8 @@ public virtual async Task> GetHosti /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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 GetHostingEnvironmentDetector(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -175,7 +175,7 @@ public virtual HostingEnvironmentMultiRolePoolResource GetHostingEnvironmentMult /// An object representing collection of HostingEnvironmentWorkerPoolResources and their operations over a HostingEnvironmentWorkerPoolResource. public virtual HostingEnvironmentWorkerPoolCollection GetHostingEnvironmentWorkerPools() { - return GetCachedClient(Client => new HostingEnvironmentWorkerPoolCollection(Client, Id)); + return GetCachedClient(client => new HostingEnvironmentWorkerPoolCollection(client, Id)); } /// @@ -193,8 +193,8 @@ public virtual HostingEnvironmentWorkerPoolCollection GetHostingEnvironmentWorke /// /// Name of the worker pool. /// The cancellation token to use. - /// 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> GetHostingEnvironmentWorkerPoolAsync(string workerPoolName, CancellationToken cancellationToken = default) { @@ -216,8 +216,8 @@ public virtual async Task> GetHos /// /// Name of the worker pool. /// The cancellation token to use. - /// 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 GetHostingEnvironmentWorkerPool(string workerPoolName, CancellationToken cancellationToken = default) { @@ -228,7 +228,7 @@ public virtual Response GetHostingEnvironm /// An object representing collection of HostingEnvironmentPrivateEndpointConnectionResources and their operations over a HostingEnvironmentPrivateEndpointConnectionResource. public virtual HostingEnvironmentPrivateEndpointConnectionCollection GetHostingEnvironmentPrivateEndpointConnections() { - return GetCachedClient(Client => new HostingEnvironmentPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HostingEnvironmentPrivateEndpointConnectionCollection(client, Id)); } /// @@ -246,8 +246,8 @@ public virtual HostingEnvironmentPrivateEndpointConnectionCollection GetHostingE /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetHostingEnvironmentPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -269,8 +269,8 @@ public virtual async Task /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetHostingEnvironmentPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -281,7 +281,7 @@ public virtual Response Get /// An object representing collection of HostingEnvironmentRecommendationResources and their operations over a HostingEnvironmentRecommendationResource. public virtual HostingEnvironmentRecommendationCollection GetHostingEnvironmentRecommendations() { - return GetCachedClient(Client => new HostingEnvironmentRecommendationCollection(Client, Id)); + return GetCachedClient(client => new HostingEnvironmentRecommendationCollection(client, Id)); } /// @@ -301,8 +301,8 @@ public virtual HostingEnvironmentRecommendationCollection GetHostingEnvironmentR /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. /// The cancellation token to use. - /// 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> GetHostingEnvironmentRecommendationAsync(string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) { @@ -326,8 +326,8 @@ public virtual async Task> Ge /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. /// The cancellation token to use. - /// 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 GetHostingEnvironmentRecommendation(string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanResource.cs index c5dd2f2c9db5..a1713ea2f305 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppServicePlanHybridConnectionNamespaceRelayResources and their operations over a AppServicePlanHybridConnectionNamespaceRelayResource. public virtual AppServicePlanHybridConnectionNamespaceRelayCollection GetAppServicePlanHybridConnectionNamespaceRelays() { - return GetCachedClient(Client => new AppServicePlanHybridConnectionNamespaceRelayCollection(Client, Id)); + return GetCachedClient(client => new AppServicePlanHybridConnectionNamespaceRelayCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual AppServicePlanHybridConnectionNamespaceRelayCollection GetAppServ /// Name of the Service Bus namespace. /// Name of the Service Bus relay. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetAppServicePlanHybridConnectionNamespaceRelayAsync(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -136,8 +136,8 @@ public virtual async Task Name of the Service Bus namespace. /// Name of the Service Bus relay. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetAppServicePlanHybridConnectionNamespaceRelay(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual HybridConnectionLimitResource GetHybridConnectionLimit() /// An object representing collection of AppServicePlanVirtualNetworkConnectionResources and their operations over a AppServicePlanVirtualNetworkConnectionResource. public virtual AppServicePlanVirtualNetworkConnectionCollection GetAppServicePlanVirtualNetworkConnections() { - return GetCachedClient(Client => new AppServicePlanVirtualNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new AppServicePlanVirtualNetworkConnectionCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual AppServicePlanVirtualNetworkConnectionCollection GetAppServicePla /// /// Name of the Virtual Network. /// The cancellation token to use. - /// 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> GetAppServicePlanVirtualNetworkConnectionAsync(string vnetName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task /// Name of the Virtual Network. /// The cancellation token to use. - /// 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 GetAppServicePlanVirtualNetworkConnection(string vnetName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionResource.cs index d24b51e5da15..0a7455fa6c8a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanVirtualNetworkConnectionResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AppServicePlanVirtualNetworkConnectionGatewayResources and their operations over a AppServicePlanVirtualNetworkConnectionGatewayResource. public virtual AppServicePlanVirtualNetworkConnectionGatewayCollection GetAppServicePlanVirtualNetworkConnectionGateways() { - return GetCachedClient(Client => new AppServicePlanVirtualNetworkConnectionGatewayCollection(Client, Id)); + return GetCachedClient(client => new AppServicePlanVirtualNetworkConnectionGatewayCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual AppServicePlanVirtualNetworkConnectionGatewayCollection GetAppSer /// /// Name of the gateway. Only the 'primary' gateway is supported. /// The cancellation token to use. - /// 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> GetAppServicePlanVirtualNetworkConnectionGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task /// Name of the gateway. Only the 'primary' gateway is supported. /// The cancellation token to use. - /// 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 GetAppServicePlanVirtualNetworkConnectionGateway(string gatewayName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceArmClientMockingExtension.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceArmClientMockingExtension.cs new file mode 100644 index 000000000000..8a230778286b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceArmClientMockingExtension.cs @@ -0,0 +1,1395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AppServiceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppServiceArmClientMockingExtension() + { + } + + /// 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 AppServiceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AppServiceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServiceCertificateOrderResource GetAppServiceCertificateOrderResource(ResourceIdentifier id) + { + AppServiceCertificateOrderResource.ValidateResourceId(id); + return new AppServiceCertificateOrderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServiceCertificateResource GetAppServiceCertificateResource(ResourceIdentifier id) + { + AppServiceCertificateResource.ValidateResourceId(id); + return new AppServiceCertificateResource(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 CertificateOrderDetectorResource GetCertificateOrderDetectorResource(ResourceIdentifier id) + { + CertificateOrderDetectorResource.ValidateResourceId(id); + return new CertificateOrderDetectorResource(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 HostingEnvironmentDetectorResource GetHostingEnvironmentDetectorResource(ResourceIdentifier id) + { + HostingEnvironmentDetectorResource.ValidateResourceId(id); + return new HostingEnvironmentDetectorResource(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 SiteDetectorResource GetSiteDetectorResource(ResourceIdentifier id) + { + SiteDetectorResource.ValidateResourceId(id); + return new SiteDetectorResource(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 SiteSlotDetectorResource GetSiteSlotDetectorResource(ResourceIdentifier id) + { + SiteSlotDetectorResource.ValidateResourceId(id); + return new SiteSlotDetectorResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServiceDomainResource GetAppServiceDomainResource(ResourceIdentifier id) + { + AppServiceDomainResource.ValidateResourceId(id); + return new AppServiceDomainResource(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 DomainOwnershipIdentifierResource GetDomainOwnershipIdentifierResource(ResourceIdentifier id) + { + DomainOwnershipIdentifierResource.ValidateResourceId(id); + return new DomainOwnershipIdentifierResource(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 TopLevelDomainResource GetTopLevelDomainResource(ResourceIdentifier id) + { + TopLevelDomainResource.ValidateResourceId(id); + return new TopLevelDomainResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServiceEnvironmentResource GetAppServiceEnvironmentResource(ResourceIdentifier id) + { + AppServiceEnvironmentResource.ValidateResourceId(id); + return new AppServiceEnvironmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AseV3NetworkingConfigurationResource GetAseV3NetworkingConfigurationResource(ResourceIdentifier id) + { + AseV3NetworkingConfigurationResource.ValidateResourceId(id); + return new AseV3NetworkingConfigurationResource(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 HostingEnvironmentMultiRolePoolResource GetHostingEnvironmentMultiRolePoolResource(ResourceIdentifier id) + { + HostingEnvironmentMultiRolePoolResource.ValidateResourceId(id); + return new HostingEnvironmentMultiRolePoolResource(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 HostingEnvironmentWorkerPoolResource GetHostingEnvironmentWorkerPoolResource(ResourceIdentifier id) + { + HostingEnvironmentWorkerPoolResource.ValidateResourceId(id); + return new HostingEnvironmentWorkerPoolResource(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 HostingEnvironmentPrivateEndpointConnectionResource GetHostingEnvironmentPrivateEndpointConnectionResource(ResourceIdentifier id) + { + HostingEnvironmentPrivateEndpointConnectionResource.ValidateResourceId(id); + return new HostingEnvironmentPrivateEndpointConnectionResource(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 StaticSitePrivateEndpointConnectionResource GetStaticSitePrivateEndpointConnectionResource(ResourceIdentifier id) + { + StaticSitePrivateEndpointConnectionResource.ValidateResourceId(id); + return new StaticSitePrivateEndpointConnectionResource(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 SitePrivateEndpointConnectionResource GetSitePrivateEndpointConnectionResource(ResourceIdentifier id) + { + SitePrivateEndpointConnectionResource.ValidateResourceId(id); + return new SitePrivateEndpointConnectionResource(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 SiteSlotPrivateEndpointConnectionResource GetSiteSlotPrivateEndpointConnectionResource(ResourceIdentifier id) + { + SiteSlotPrivateEndpointConnectionResource.ValidateResourceId(id); + return new SiteSlotPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServicePlanResource GetAppServicePlanResource(ResourceIdentifier id) + { + AppServicePlanResource.ValidateResourceId(id); + return new AppServicePlanResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServicePlanHybridConnectionNamespaceRelayResource GetAppServicePlanHybridConnectionNamespaceRelayResource(ResourceIdentifier id) + { + AppServicePlanHybridConnectionNamespaceRelayResource.ValidateResourceId(id); + return new AppServicePlanHybridConnectionNamespaceRelayResource(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 SiteHybridConnectionNamespaceRelayResource GetSiteHybridConnectionNamespaceRelayResource(ResourceIdentifier id) + { + SiteHybridConnectionNamespaceRelayResource.ValidateResourceId(id); + return new SiteHybridConnectionNamespaceRelayResource(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 SiteSlotHybridConnectionNamespaceRelayResource GetSiteSlotHybridConnectionNamespaceRelayResource(ResourceIdentifier id) + { + SiteSlotHybridConnectionNamespaceRelayResource.ValidateResourceId(id); + return new SiteSlotHybridConnectionNamespaceRelayResource(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 HybridConnectionLimitResource GetHybridConnectionLimitResource(ResourceIdentifier id) + { + HybridConnectionLimitResource.ValidateResourceId(id); + return new HybridConnectionLimitResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServicePlanVirtualNetworkConnectionResource GetAppServicePlanVirtualNetworkConnectionResource(ResourceIdentifier id) + { + AppServicePlanVirtualNetworkConnectionResource.ValidateResourceId(id); + return new AppServicePlanVirtualNetworkConnectionResource(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 SiteSlotVirtualNetworkConnectionResource GetSiteSlotVirtualNetworkConnectionResource(ResourceIdentifier id) + { + SiteSlotVirtualNetworkConnectionResource.ValidateResourceId(id); + return new SiteSlotVirtualNetworkConnectionResource(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 SiteVirtualNetworkConnectionResource GetSiteVirtualNetworkConnectionResource(ResourceIdentifier id) + { + SiteVirtualNetworkConnectionResource.ValidateResourceId(id); + return new SiteVirtualNetworkConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServicePlanVirtualNetworkConnectionGatewayResource GetAppServicePlanVirtualNetworkConnectionGatewayResource(ResourceIdentifier id) + { + AppServicePlanVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); + return new AppServicePlanVirtualNetworkConnectionGatewayResource(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 SiteSlotVirtualNetworkConnectionGatewayResource GetSiteSlotVirtualNetworkConnectionGatewayResource(ResourceIdentifier id) + { + SiteSlotVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); + return new SiteSlotVirtualNetworkConnectionGatewayResource(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 SiteVirtualNetworkConnectionGatewayResource GetSiteVirtualNetworkConnectionGatewayResource(ResourceIdentifier id) + { + SiteVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); + return new SiteVirtualNetworkConnectionGatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppCertificateResource GetAppCertificateResource(ResourceIdentifier id) + { + AppCertificateResource.ValidateResourceId(id); + return new AppCertificateResource(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 SiteDiagnosticResource GetSiteDiagnosticResource(ResourceIdentifier id) + { + SiteDiagnosticResource.ValidateResourceId(id); + return new SiteDiagnosticResource(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 SiteSlotDiagnosticResource GetSiteSlotDiagnosticResource(ResourceIdentifier id) + { + SiteSlotDiagnosticResource.ValidateResourceId(id); + return new SiteSlotDiagnosticResource(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 SiteDiagnosticAnalysisResource GetSiteDiagnosticAnalysisResource(ResourceIdentifier id) + { + SiteDiagnosticAnalysisResource.ValidateResourceId(id); + return new SiteDiagnosticAnalysisResource(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 SiteSlotDiagnosticAnalysisResource GetSiteSlotDiagnosticAnalysisResource(ResourceIdentifier id) + { + SiteSlotDiagnosticAnalysisResource.ValidateResourceId(id); + return new SiteSlotDiagnosticAnalysisResource(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 SiteDiagnosticDetectorResource GetSiteDiagnosticDetectorResource(ResourceIdentifier id) + { + SiteDiagnosticDetectorResource.ValidateResourceId(id); + return new SiteDiagnosticDetectorResource(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 SiteSlotDiagnosticDetectorResource GetSiteSlotDiagnosticDetectorResource(ResourceIdentifier id) + { + SiteSlotDiagnosticDetectorResource.ValidateResourceId(id); + return new SiteSlotDiagnosticDetectorResource(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 DeletedSiteResource GetDeletedSiteResource(ResourceIdentifier id) + { + DeletedSiteResource.ValidateResourceId(id); + return new DeletedSiteResource(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 KubeEnvironmentResource GetKubeEnvironmentResource(ResourceIdentifier id) + { + KubeEnvironmentResource.ValidateResourceId(id); + return new KubeEnvironmentResource(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 HostingEnvironmentRecommendationResource GetHostingEnvironmentRecommendationResource(ResourceIdentifier id) + { + HostingEnvironmentRecommendationResource.ValidateResourceId(id); + return new HostingEnvironmentRecommendationResource(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 SiteRecommendationResource GetSiteRecommendationResource(ResourceIdentifier id) + { + SiteRecommendationResource.ValidateResourceId(id); + return new SiteRecommendationResource(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 WebSiteResourceHealthMetadataResource GetWebSiteResourceHealthMetadataResource(ResourceIdentifier id) + { + WebSiteResourceHealthMetadataResource.ValidateResourceId(id); + return new WebSiteResourceHealthMetadataResource(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 WebSiteSlotResourceHealthMetadataResource GetWebSiteSlotResourceHealthMetadataResource(ResourceIdentifier id) + { + WebSiteSlotResourceHealthMetadataResource.ValidateResourceId(id); + return new WebSiteSlotResourceHealthMetadataResource(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 PublishingUserResource GetPublishingUserResource(ResourceIdentifier id) + { + PublishingUserResource.ValidateResourceId(id); + return new PublishingUserResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AppServiceSourceControlResource GetAppServiceSourceControlResource(ResourceIdentifier id) + { + AppServiceSourceControlResource.ValidateResourceId(id); + return new AppServiceSourceControlResource(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 StaticSiteResource GetStaticSiteResource(ResourceIdentifier id) + { + StaticSiteResource.ValidateResourceId(id); + return new StaticSiteResource(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 StaticSiteBuildResource GetStaticSiteBuildResource(ResourceIdentifier id) + { + StaticSiteBuildResource.ValidateResourceId(id); + return new StaticSiteBuildResource(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 StaticSiteBuildUserProvidedFunctionAppResource GetStaticSiteBuildUserProvidedFunctionAppResource(ResourceIdentifier id) + { + StaticSiteBuildUserProvidedFunctionAppResource.ValidateResourceId(id); + return new StaticSiteBuildUserProvidedFunctionAppResource(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 StaticSiteUserProvidedFunctionAppResource GetStaticSiteUserProvidedFunctionAppResource(ResourceIdentifier id) + { + StaticSiteUserProvidedFunctionAppResource.ValidateResourceId(id); + return new StaticSiteUserProvidedFunctionAppResource(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 StaticSiteCustomDomainOverviewResource GetStaticSiteCustomDomainOverviewResource(ResourceIdentifier id) + { + StaticSiteCustomDomainOverviewResource.ValidateResourceId(id); + return new StaticSiteCustomDomainOverviewResource(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 WebSiteResource GetWebSiteResource(ResourceIdentifier id) + { + WebSiteResource.ValidateResourceId(id); + return new WebSiteResource(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 WebSiteSlotResource GetWebSiteSlotResource(ResourceIdentifier id) + { + WebSiteSlotResource.ValidateResourceId(id); + return new WebSiteSlotResource(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 SiteBackupResource GetSiteBackupResource(ResourceIdentifier id) + { + SiteBackupResource.ValidateResourceId(id); + return new SiteBackupResource(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 SiteSlotBackupResource GetSiteSlotBackupResource(ResourceIdentifier id) + { + SiteSlotBackupResource.ValidateResourceId(id); + return new SiteSlotBackupResource(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 WebSiteFtpPublishingCredentialsPolicyResource GetWebSiteFtpPublishingCredentialsPolicyResource(ResourceIdentifier id) + { + WebSiteFtpPublishingCredentialsPolicyResource.ValidateResourceId(id); + return new WebSiteFtpPublishingCredentialsPolicyResource(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 ScmSiteBasicPublishingCredentialsPolicyResource GetScmSiteBasicPublishingCredentialsPolicyResource(ResourceIdentifier id) + { + ScmSiteBasicPublishingCredentialsPolicyResource.ValidateResourceId(id); + return new ScmSiteBasicPublishingCredentialsPolicyResource(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 WebSiteSlotFtpPublishingCredentialsPolicyResource GetWebSiteSlotFtpPublishingCredentialsPolicyResource(ResourceIdentifier id) + { + WebSiteSlotFtpPublishingCredentialsPolicyResource.ValidateResourceId(id); + return new WebSiteSlotFtpPublishingCredentialsPolicyResource(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 ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlotBasicPublishingCredentialsPolicyResource(ResourceIdentifier id) + { + ScmSiteSlotBasicPublishingCredentialsPolicyResource.ValidateResourceId(id); + return new ScmSiteSlotBasicPublishingCredentialsPolicyResource(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 SiteConfigAppsettingResource GetSiteConfigAppsettingResource(ResourceIdentifier id) + { + SiteConfigAppsettingResource.ValidateResourceId(id); + return new SiteConfigAppsettingResource(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 WebSiteConfigConnectionStringResource GetWebSiteConfigConnectionStringResource(ResourceIdentifier id) + { + WebSiteConfigConnectionStringResource.ValidateResourceId(id); + return new WebSiteConfigConnectionStringResource(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 WebSiteSlotConfigAppSettingResource GetWebSiteSlotConfigAppSettingResource(ResourceIdentifier id) + { + WebSiteSlotConfigAppSettingResource.ValidateResourceId(id); + return new WebSiteSlotConfigAppSettingResource(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 WebSiteSlotConfigConnectionStringResource GetWebSiteSlotConfigConnectionStringResource(ResourceIdentifier id) + { + WebSiteSlotConfigConnectionStringResource.ValidateResourceId(id); + return new WebSiteSlotConfigConnectionStringResource(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 LogsSiteConfigResource GetLogsSiteConfigResource(ResourceIdentifier id) + { + LogsSiteConfigResource.ValidateResourceId(id); + return new LogsSiteConfigResource(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 LogsSiteSlotConfigResource GetLogsSiteSlotConfigResource(ResourceIdentifier id) + { + LogsSiteSlotConfigResource.ValidateResourceId(id); + return new LogsSiteSlotConfigResource(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 SlotConfigNamesResource GetSlotConfigNamesResource(ResourceIdentifier id) + { + SlotConfigNamesResource.ValidateResourceId(id); + return new SlotConfigNamesResource(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 WebSiteConfigResource GetWebSiteConfigResource(ResourceIdentifier id) + { + WebSiteConfigResource.ValidateResourceId(id); + return new WebSiteConfigResource(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 SiteConfigSnapshotResource GetSiteConfigSnapshotResource(ResourceIdentifier id) + { + SiteConfigSnapshotResource.ValidateResourceId(id); + return new SiteConfigSnapshotResource(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 WebSiteSlotConfigResource GetWebSiteSlotConfigResource(ResourceIdentifier id) + { + WebSiteSlotConfigResource.ValidateResourceId(id); + return new WebSiteSlotConfigResource(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 SiteSlotConfigSnapshotResource GetSiteSlotConfigSnapshotResource(ResourceIdentifier id) + { + SiteSlotConfigSnapshotResource.ValidateResourceId(id); + return new SiteSlotConfigSnapshotResource(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 WebSiteContinuousWebJobResource GetWebSiteContinuousWebJobResource(ResourceIdentifier id) + { + WebSiteContinuousWebJobResource.ValidateResourceId(id); + return new WebSiteContinuousWebJobResource(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 WebSiteSlotContinuousWebJobResource GetWebSiteSlotContinuousWebJobResource(ResourceIdentifier id) + { + WebSiteSlotContinuousWebJobResource.ValidateResourceId(id); + return new WebSiteSlotContinuousWebJobResource(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 SiteDeploymentResource GetSiteDeploymentResource(ResourceIdentifier id) + { + SiteDeploymentResource.ValidateResourceId(id); + return new SiteDeploymentResource(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 SiteSlotDeploymentResource GetSiteSlotDeploymentResource(ResourceIdentifier id) + { + SiteSlotDeploymentResource.ValidateResourceId(id); + return new SiteSlotDeploymentResource(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 SiteDomainOwnershipIdentifierResource GetSiteDomainOwnershipIdentifierResource(ResourceIdentifier id) + { + SiteDomainOwnershipIdentifierResource.ValidateResourceId(id); + return new SiteDomainOwnershipIdentifierResource(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 SiteSlotDomainOwnershipIdentifierResource GetSiteSlotDomainOwnershipIdentifierResource(ResourceIdentifier id) + { + SiteSlotDomainOwnershipIdentifierResource.ValidateResourceId(id); + return new SiteSlotDomainOwnershipIdentifierResource(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 SiteExtensionResource GetSiteExtensionResource(ResourceIdentifier id) + { + SiteExtensionResource.ValidateResourceId(id); + return new SiteExtensionResource(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 SiteInstanceExtensionResource GetSiteInstanceExtensionResource(ResourceIdentifier id) + { + SiteInstanceExtensionResource.ValidateResourceId(id); + return new SiteInstanceExtensionResource(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 SiteSlotExtensionResource GetSiteSlotExtensionResource(ResourceIdentifier id) + { + SiteSlotExtensionResource.ValidateResourceId(id); + return new SiteSlotExtensionResource(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 SiteSlotInstanceExtensionResource GetSiteSlotInstanceExtensionResource(ResourceIdentifier id) + { + SiteSlotInstanceExtensionResource.ValidateResourceId(id); + return new SiteSlotInstanceExtensionResource(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 SiteFunctionResource GetSiteFunctionResource(ResourceIdentifier id) + { + SiteFunctionResource.ValidateResourceId(id); + return new SiteFunctionResource(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 SiteSlotFunctionResource GetSiteSlotFunctionResource(ResourceIdentifier id) + { + SiteSlotFunctionResource.ValidateResourceId(id); + return new SiteSlotFunctionResource(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 SiteHostNameBindingResource GetSiteHostNameBindingResource(ResourceIdentifier id) + { + SiteHostNameBindingResource.ValidateResourceId(id); + return new SiteHostNameBindingResource(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 SiteSlotHostNameBindingResource GetSiteSlotHostNameBindingResource(ResourceIdentifier id) + { + SiteSlotHostNameBindingResource.ValidateResourceId(id); + return new SiteSlotHostNameBindingResource(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 WebSiteHybridConnectionResource GetWebSiteHybridConnectionResource(ResourceIdentifier id) + { + WebSiteHybridConnectionResource.ValidateResourceId(id); + return new WebSiteHybridConnectionResource(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 WebSiteSlotHybridConnectionResource GetWebSiteSlotHybridConnectionResource(ResourceIdentifier id) + { + WebSiteSlotHybridConnectionResource.ValidateResourceId(id); + return new WebSiteSlotHybridConnectionResource(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 SiteInstanceResource GetSiteInstanceResource(ResourceIdentifier id) + { + SiteInstanceResource.ValidateResourceId(id); + return new SiteInstanceResource(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 SiteSlotInstanceResource GetSiteSlotInstanceResource(ResourceIdentifier id) + { + SiteSlotInstanceResource.ValidateResourceId(id); + return new SiteSlotInstanceResource(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 SiteInstanceProcessResource GetSiteInstanceProcessResource(ResourceIdentifier id) + { + SiteInstanceProcessResource.ValidateResourceId(id); + return new SiteInstanceProcessResource(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 SiteProcessResource GetSiteProcessResource(ResourceIdentifier id) + { + SiteProcessResource.ValidateResourceId(id); + return new SiteProcessResource(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 SiteSlotInstanceProcessResource GetSiteSlotInstanceProcessResource(ResourceIdentifier id) + { + SiteSlotInstanceProcessResource.ValidateResourceId(id); + return new SiteSlotInstanceProcessResource(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 SiteSlotProcessResource GetSiteSlotProcessResource(ResourceIdentifier id) + { + SiteSlotProcessResource.ValidateResourceId(id); + return new SiteSlotProcessResource(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 SiteInstanceProcessModuleResource GetSiteInstanceProcessModuleResource(ResourceIdentifier id) + { + SiteInstanceProcessModuleResource.ValidateResourceId(id); + return new SiteInstanceProcessModuleResource(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 SiteProcessModuleResource GetSiteProcessModuleResource(ResourceIdentifier id) + { + SiteProcessModuleResource.ValidateResourceId(id); + return new SiteProcessModuleResource(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 SiteSlotInstanceProcessModuleResource GetSiteSlotInstanceProcessModuleResource(ResourceIdentifier id) + { + SiteSlotInstanceProcessModuleResource.ValidateResourceId(id); + return new SiteSlotInstanceProcessModuleResource(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 SiteSlotProcessModuleResource GetSiteSlotProcessModuleResource(ResourceIdentifier id) + { + SiteSlotProcessModuleResource.ValidateResourceId(id); + return new SiteSlotProcessModuleResource(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 SiteNetworkConfigResource GetSiteNetworkConfigResource(ResourceIdentifier id) + { + SiteNetworkConfigResource.ValidateResourceId(id); + return new SiteNetworkConfigResource(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 SiteSlotNetworkConfigResource GetSiteSlotNetworkConfigResource(ResourceIdentifier id) + { + SiteSlotNetworkConfigResource.ValidateResourceId(id); + return new SiteSlotNetworkConfigResource(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 WebSitePremierAddonResource GetWebSitePremierAddonResource(ResourceIdentifier id) + { + WebSitePremierAddonResource.ValidateResourceId(id); + return new WebSitePremierAddonResource(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 WebSiteSlotPremierAddOnResource GetWebSiteSlotPremierAddOnResource(ResourceIdentifier id) + { + WebSiteSlotPremierAddOnResource.ValidateResourceId(id); + return new WebSiteSlotPremierAddOnResource(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 WebSitePrivateAccessResource GetWebSitePrivateAccessResource(ResourceIdentifier id) + { + WebSitePrivateAccessResource.ValidateResourceId(id); + return new WebSitePrivateAccessResource(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 WebSiteSlotPrivateAccessResource GetWebSiteSlotPrivateAccessResource(ResourceIdentifier id) + { + WebSiteSlotPrivateAccessResource.ValidateResourceId(id); + return new WebSiteSlotPrivateAccessResource(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 SitePublicCertificateResource GetSitePublicCertificateResource(ResourceIdentifier id) + { + SitePublicCertificateResource.ValidateResourceId(id); + return new SitePublicCertificateResource(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 WebSiteSlotPublicCertificateResource GetWebSiteSlotPublicCertificateResource(ResourceIdentifier id) + { + WebSiteSlotPublicCertificateResource.ValidateResourceId(id); + return new WebSiteSlotPublicCertificateResource(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 WebSiteExtensionResource GetWebSiteExtensionResource(ResourceIdentifier id) + { + WebSiteExtensionResource.ValidateResourceId(id); + return new WebSiteExtensionResource(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 WebSiteSlotExtensionResource GetWebSiteSlotExtensionResource(ResourceIdentifier id) + { + WebSiteSlotExtensionResource.ValidateResourceId(id); + return new WebSiteSlotExtensionResource(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 MigrateMySqlStatusResource GetMigrateMySqlStatusResource(ResourceIdentifier id) + { + MigrateMySqlStatusResource.ValidateResourceId(id); + return new MigrateMySqlStatusResource(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 NetworkFeatureResource GetNetworkFeatureResource(ResourceIdentifier id) + { + NetworkFeatureResource.ValidateResourceId(id); + return new NetworkFeatureResource(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 WebSiteSlotSourceControlResource GetWebSiteSlotSourceControlResource(ResourceIdentifier id) + { + WebSiteSlotSourceControlResource.ValidateResourceId(id); + return new WebSiteSlotSourceControlResource(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 WebSiteSourceControlResource GetWebSiteSourceControlResource(ResourceIdentifier id) + { + WebSiteSourceControlResource.ValidateResourceId(id); + return new WebSiteSourceControlResource(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 WebSiteSlotTriggeredWebJobResource GetWebSiteSlotTriggeredWebJobResource(ResourceIdentifier id) + { + WebSiteSlotTriggeredWebJobResource.ValidateResourceId(id); + return new WebSiteSlotTriggeredWebJobResource(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 WebSiteTriggeredwebJobResource GetWebSiteTriggeredwebJobResource(ResourceIdentifier id) + { + WebSiteTriggeredwebJobResource.ValidateResourceId(id); + return new WebSiteTriggeredwebJobResource(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 WebSiteSlotTriggeredWebJobHistoryResource GetWebSiteSlotTriggeredWebJobHistoryResource(ResourceIdentifier id) + { + WebSiteSlotTriggeredWebJobHistoryResource.ValidateResourceId(id); + return new WebSiteSlotTriggeredWebJobHistoryResource(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 WebSiteTriggeredWebJobHistoryResource GetWebSiteTriggeredWebJobHistoryResource(ResourceIdentifier id) + { + WebSiteTriggeredWebJobHistoryResource.ValidateResourceId(id); + return new WebSiteTriggeredWebJobHistoryResource(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 WebSiteSlotWebJobResource GetWebSiteSlotWebJobResource(ResourceIdentifier id) + { + WebSiteSlotWebJobResource.ValidateResourceId(id); + return new WebSiteSlotWebJobResource(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 WebSiteWebJobResource GetWebSiteWebJobResource(ResourceIdentifier id) + { + WebSiteWebJobResource.ValidateResourceId(id); + return new WebSiteWebJobResource(Client, id); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs index daa9d5a45251..7d846075a4c1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AppService.Mocking; using Azure.ResourceManager.AppService.Models; using Azure.ResourceManager.Resources; @@ -19,2130 +20,1782 @@ namespace Azure.ResourceManager.AppService /// A class to add extension methods to Azure.ResourceManager.AppService. public static partial class AppServiceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AppServiceArmClientMockingExtension GetAppServiceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AppServiceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppServiceResourceGroupMockingExtension GetAppServiceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppServiceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AppServiceSubscriptionMockingExtension GetAppServiceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AppServiceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppServiceTenantMockingExtension GetAppServiceTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppServiceTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region AppServiceCertificateOrderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServiceCertificateOrderResource GetAppServiceCertificateOrderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServiceCertificateOrderResource.ValidateResourceId(id); - return new AppServiceCertificateOrderResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServiceCertificateOrderResource(id); } - #endregion - #region AppServiceCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServiceCertificateResource GetAppServiceCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServiceCertificateResource.ValidateResourceId(id); - return new AppServiceCertificateResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServiceCertificateResource(id); } - #endregion - #region CertificateOrderDetectorResource /// /// 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. /// Returns a object. public static CertificateOrderDetectorResource GetCertificateOrderDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CertificateOrderDetectorResource.ValidateResourceId(id); - return new CertificateOrderDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetCertificateOrderDetectorResource(id); } - #endregion - #region HostingEnvironmentDetectorResource /// /// 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. /// Returns a object. public static HostingEnvironmentDetectorResource GetHostingEnvironmentDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostingEnvironmentDetectorResource.ValidateResourceId(id); - return new HostingEnvironmentDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHostingEnvironmentDetectorResource(id); } - #endregion - #region SiteDetectorResource /// /// 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. /// Returns a object. public static SiteDetectorResource GetSiteDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDetectorResource.ValidateResourceId(id); - return new SiteDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDetectorResource(id); } - #endregion - #region SiteSlotDetectorResource /// /// 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. /// Returns a object. public static SiteSlotDetectorResource GetSiteSlotDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDetectorResource.ValidateResourceId(id); - return new SiteSlotDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDetectorResource(id); } - #endregion - #region AppServiceDomainResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServiceDomainResource GetAppServiceDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServiceDomainResource.ValidateResourceId(id); - return new AppServiceDomainResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServiceDomainResource(id); } - #endregion - #region DomainOwnershipIdentifierResource /// /// 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. /// Returns a object. public static DomainOwnershipIdentifierResource GetDomainOwnershipIdentifierResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DomainOwnershipIdentifierResource.ValidateResourceId(id); - return new DomainOwnershipIdentifierResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetDomainOwnershipIdentifierResource(id); } - #endregion - #region TopLevelDomainResource /// /// 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. /// Returns a object. public static TopLevelDomainResource GetTopLevelDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TopLevelDomainResource.ValidateResourceId(id); - return new TopLevelDomainResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetTopLevelDomainResource(id); } - #endregion - #region AppServiceEnvironmentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServiceEnvironmentResource GetAppServiceEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServiceEnvironmentResource.ValidateResourceId(id); - return new AppServiceEnvironmentResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServiceEnvironmentResource(id); } - #endregion - #region AseV3NetworkingConfigurationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AseV3NetworkingConfigurationResource GetAseV3NetworkingConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AseV3NetworkingConfigurationResource.ValidateResourceId(id); - return new AseV3NetworkingConfigurationResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAseV3NetworkingConfigurationResource(id); } - #endregion - #region HostingEnvironmentMultiRolePoolResource /// /// 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. /// Returns a object. public static HostingEnvironmentMultiRolePoolResource GetHostingEnvironmentMultiRolePoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostingEnvironmentMultiRolePoolResource.ValidateResourceId(id); - return new HostingEnvironmentMultiRolePoolResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHostingEnvironmentMultiRolePoolResource(id); } - #endregion - #region HostingEnvironmentWorkerPoolResource /// /// 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. /// Returns a object. public static HostingEnvironmentWorkerPoolResource GetHostingEnvironmentWorkerPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostingEnvironmentWorkerPoolResource.ValidateResourceId(id); - return new HostingEnvironmentWorkerPoolResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHostingEnvironmentWorkerPoolResource(id); } - #endregion - #region HostingEnvironmentPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HostingEnvironmentPrivateEndpointConnectionResource GetHostingEnvironmentPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostingEnvironmentPrivateEndpointConnectionResource.ValidateResourceId(id); - return new HostingEnvironmentPrivateEndpointConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHostingEnvironmentPrivateEndpointConnectionResource(id); } - #endregion - #region StaticSitePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static StaticSitePrivateEndpointConnectionResource GetStaticSitePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSitePrivateEndpointConnectionResource.ValidateResourceId(id); - return new StaticSitePrivateEndpointConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSitePrivateEndpointConnectionResource(id); } - #endregion - #region SitePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SitePrivateEndpointConnectionResource GetSitePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SitePrivateEndpointConnectionResource.ValidateResourceId(id); - return new SitePrivateEndpointConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSitePrivateEndpointConnectionResource(id); } - #endregion - #region SiteSlotPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SiteSlotPrivateEndpointConnectionResource GetSiteSlotPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotPrivateEndpointConnectionResource.ValidateResourceId(id); - return new SiteSlotPrivateEndpointConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotPrivateEndpointConnectionResource(id); } - #endregion - #region AppServicePlanResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServicePlanResource GetAppServicePlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServicePlanResource.ValidateResourceId(id); - return new AppServicePlanResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServicePlanResource(id); } - #endregion - #region AppServicePlanHybridConnectionNamespaceRelayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServicePlanHybridConnectionNamespaceRelayResource GetAppServicePlanHybridConnectionNamespaceRelayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServicePlanHybridConnectionNamespaceRelayResource.ValidateResourceId(id); - return new AppServicePlanHybridConnectionNamespaceRelayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServicePlanHybridConnectionNamespaceRelayResource(id); } - #endregion - #region SiteHybridConnectionNamespaceRelayResource /// /// 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. /// Returns a object. public static SiteHybridConnectionNamespaceRelayResource GetSiteHybridConnectionNamespaceRelayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteHybridConnectionNamespaceRelayResource.ValidateResourceId(id); - return new SiteHybridConnectionNamespaceRelayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteHybridConnectionNamespaceRelayResource(id); } - #endregion - #region SiteSlotHybridConnectionNamespaceRelayResource /// /// 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. /// Returns a object. public static SiteSlotHybridConnectionNamespaceRelayResource GetSiteSlotHybridConnectionNamespaceRelayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotHybridConnectionNamespaceRelayResource.ValidateResourceId(id); - return new SiteSlotHybridConnectionNamespaceRelayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotHybridConnectionNamespaceRelayResource(id); } - #endregion - #region HybridConnectionLimitResource /// /// 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. /// Returns a object. public static HybridConnectionLimitResource GetHybridConnectionLimitResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridConnectionLimitResource.ValidateResourceId(id); - return new HybridConnectionLimitResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHybridConnectionLimitResource(id); } - #endregion - #region AppServicePlanVirtualNetworkConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServicePlanVirtualNetworkConnectionResource GetAppServicePlanVirtualNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServicePlanVirtualNetworkConnectionResource.ValidateResourceId(id); - return new AppServicePlanVirtualNetworkConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServicePlanVirtualNetworkConnectionResource(id); } - #endregion - #region SiteSlotVirtualNetworkConnectionResource /// /// 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. /// Returns a object. public static SiteSlotVirtualNetworkConnectionResource GetSiteSlotVirtualNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotVirtualNetworkConnectionResource.ValidateResourceId(id); - return new SiteSlotVirtualNetworkConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotVirtualNetworkConnectionResource(id); } - #endregion - #region SiteVirtualNetworkConnectionResource /// /// 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. /// Returns a object. public static SiteVirtualNetworkConnectionResource GetSiteVirtualNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteVirtualNetworkConnectionResource.ValidateResourceId(id); - return new SiteVirtualNetworkConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteVirtualNetworkConnectionResource(id); } - #endregion - #region AppServicePlanVirtualNetworkConnectionGatewayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServicePlanVirtualNetworkConnectionGatewayResource GetAppServicePlanVirtualNetworkConnectionGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServicePlanVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); - return new AppServicePlanVirtualNetworkConnectionGatewayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServicePlanVirtualNetworkConnectionGatewayResource(id); } - #endregion - #region SiteSlotVirtualNetworkConnectionGatewayResource /// /// 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. /// Returns a object. public static SiteSlotVirtualNetworkConnectionGatewayResource GetSiteSlotVirtualNetworkConnectionGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); - return new SiteSlotVirtualNetworkConnectionGatewayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotVirtualNetworkConnectionGatewayResource(id); } - #endregion - #region SiteVirtualNetworkConnectionGatewayResource /// /// 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. /// Returns a object. public static SiteVirtualNetworkConnectionGatewayResource GetSiteVirtualNetworkConnectionGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteVirtualNetworkConnectionGatewayResource.ValidateResourceId(id); - return new SiteVirtualNetworkConnectionGatewayResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteVirtualNetworkConnectionGatewayResource(id); } - #endregion - #region AppCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppCertificateResource GetAppCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppCertificateResource.ValidateResourceId(id); - return new AppCertificateResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppCertificateResource(id); } - #endregion - #region SiteDiagnosticResource /// /// 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. /// Returns a object. public static SiteDiagnosticResource GetSiteDiagnosticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDiagnosticResource.ValidateResourceId(id); - return new SiteDiagnosticResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDiagnosticResource(id); } - #endregion - #region SiteSlotDiagnosticResource /// /// 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. /// Returns a object. public static SiteSlotDiagnosticResource GetSiteSlotDiagnosticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDiagnosticResource.ValidateResourceId(id); - return new SiteSlotDiagnosticResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDiagnosticResource(id); } - #endregion - #region SiteDiagnosticAnalysisResource /// /// 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. /// Returns a object. public static SiteDiagnosticAnalysisResource GetSiteDiagnosticAnalysisResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDiagnosticAnalysisResource.ValidateResourceId(id); - return new SiteDiagnosticAnalysisResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDiagnosticAnalysisResource(id); } - #endregion - #region SiteSlotDiagnosticAnalysisResource /// /// 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. /// Returns a object. public static SiteSlotDiagnosticAnalysisResource GetSiteSlotDiagnosticAnalysisResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDiagnosticAnalysisResource.ValidateResourceId(id); - return new SiteSlotDiagnosticAnalysisResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDiagnosticAnalysisResource(id); } - #endregion - #region SiteDiagnosticDetectorResource /// /// 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. /// Returns a object. public static SiteDiagnosticDetectorResource GetSiteDiagnosticDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDiagnosticDetectorResource.ValidateResourceId(id); - return new SiteDiagnosticDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDiagnosticDetectorResource(id); } - #endregion - #region SiteSlotDiagnosticDetectorResource /// /// 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. /// Returns a object. public static SiteSlotDiagnosticDetectorResource GetSiteSlotDiagnosticDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDiagnosticDetectorResource.ValidateResourceId(id); - return new SiteSlotDiagnosticDetectorResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDiagnosticDetectorResource(id); } - #endregion - #region DeletedSiteResource /// /// 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. /// Returns a object. public static DeletedSiteResource GetDeletedSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedSiteResource.ValidateResourceId(id); - return new DeletedSiteResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetDeletedSiteResource(id); } - #endregion - #region KubeEnvironmentResource /// /// 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. /// Returns a object. public static KubeEnvironmentResource GetKubeEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KubeEnvironmentResource.ValidateResourceId(id); - return new KubeEnvironmentResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetKubeEnvironmentResource(id); } - #endregion - #region HostingEnvironmentRecommendationResource /// /// 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. /// Returns a object. public static HostingEnvironmentRecommendationResource GetHostingEnvironmentRecommendationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostingEnvironmentRecommendationResource.ValidateResourceId(id); - return new HostingEnvironmentRecommendationResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetHostingEnvironmentRecommendationResource(id); } - #endregion - #region SiteRecommendationResource /// /// 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. /// Returns a object. public static SiteRecommendationResource GetSiteRecommendationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecommendationResource.ValidateResourceId(id); - return new SiteRecommendationResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteRecommendationResource(id); } - #endregion - #region WebSiteResourceHealthMetadataResource /// /// 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. /// Returns a object. public static WebSiteResourceHealthMetadataResource GetWebSiteResourceHealthMetadataResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteResourceHealthMetadataResource.ValidateResourceId(id); - return new WebSiteResourceHealthMetadataResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteResourceHealthMetadataResource(id); } - #endregion - #region WebSiteSlotResourceHealthMetadataResource /// /// 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. /// Returns a object. public static WebSiteSlotResourceHealthMetadataResource GetWebSiteSlotResourceHealthMetadataResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotResourceHealthMetadataResource.ValidateResourceId(id); - return new WebSiteSlotResourceHealthMetadataResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotResourceHealthMetadataResource(id); } - #endregion - #region PublishingUserResource /// /// 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. /// Returns a object. public static PublishingUserResource GetPublishingUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PublishingUserResource.ValidateResourceId(id); - return new PublishingUserResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetPublishingUserResource(id); } - #endregion - #region AppServiceSourceControlResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AppServiceSourceControlResource GetAppServiceSourceControlResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AppServiceSourceControlResource.ValidateResourceId(id); - return new AppServiceSourceControlResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetAppServiceSourceControlResource(id); } - #endregion - #region StaticSiteResource /// /// 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. /// Returns a object. public static StaticSiteResource GetStaticSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSiteResource.ValidateResourceId(id); - return new StaticSiteResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSiteResource(id); } - #endregion - #region StaticSiteBuildResource /// /// 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. /// Returns a object. public static StaticSiteBuildResource GetStaticSiteBuildResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSiteBuildResource.ValidateResourceId(id); - return new StaticSiteBuildResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSiteBuildResource(id); } - #endregion - #region StaticSiteBuildUserProvidedFunctionAppResource /// /// 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. /// Returns a object. public static StaticSiteBuildUserProvidedFunctionAppResource GetStaticSiteBuildUserProvidedFunctionAppResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSiteBuildUserProvidedFunctionAppResource.ValidateResourceId(id); - return new StaticSiteBuildUserProvidedFunctionAppResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSiteBuildUserProvidedFunctionAppResource(id); } - #endregion - #region StaticSiteUserProvidedFunctionAppResource /// /// 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. /// Returns a object. public static StaticSiteUserProvidedFunctionAppResource GetStaticSiteUserProvidedFunctionAppResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSiteUserProvidedFunctionAppResource.ValidateResourceId(id); - return new StaticSiteUserProvidedFunctionAppResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSiteUserProvidedFunctionAppResource(id); } - #endregion - #region StaticSiteCustomDomainOverviewResource /// /// 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. /// Returns a object. public static StaticSiteCustomDomainOverviewResource GetStaticSiteCustomDomainOverviewResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StaticSiteCustomDomainOverviewResource.ValidateResourceId(id); - return new StaticSiteCustomDomainOverviewResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetStaticSiteCustomDomainOverviewResource(id); } - #endregion - #region WebSiteResource /// /// 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. /// Returns a object. public static WebSiteResource GetWebSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteResource.ValidateResourceId(id); - return new WebSiteResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteResource(id); } - #endregion - #region WebSiteSlotResource /// /// 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. /// Returns a object. public static WebSiteSlotResource GetWebSiteSlotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotResource.ValidateResourceId(id); - return new WebSiteSlotResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotResource(id); } - #endregion - #region SiteBackupResource /// /// 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. /// Returns a object. public static SiteBackupResource GetSiteBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteBackupResource.ValidateResourceId(id); - return new SiteBackupResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteBackupResource(id); } - #endregion - #region SiteSlotBackupResource /// /// 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. /// Returns a object. public static SiteSlotBackupResource GetSiteSlotBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotBackupResource.ValidateResourceId(id); - return new SiteSlotBackupResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotBackupResource(id); } - #endregion - #region WebSiteFtpPublishingCredentialsPolicyResource /// /// 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. /// Returns a object. public static WebSiteFtpPublishingCredentialsPolicyResource GetWebSiteFtpPublishingCredentialsPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteFtpPublishingCredentialsPolicyResource.ValidateResourceId(id); - return new WebSiteFtpPublishingCredentialsPolicyResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteFtpPublishingCredentialsPolicyResource(id); } - #endregion - #region ScmSiteBasicPublishingCredentialsPolicyResource /// /// 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. /// Returns a object. public static ScmSiteBasicPublishingCredentialsPolicyResource GetScmSiteBasicPublishingCredentialsPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScmSiteBasicPublishingCredentialsPolicyResource.ValidateResourceId(id); - return new ScmSiteBasicPublishingCredentialsPolicyResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetScmSiteBasicPublishingCredentialsPolicyResource(id); } - #endregion - #region WebSiteSlotFtpPublishingCredentialsPolicyResource /// /// 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. /// Returns a object. public static WebSiteSlotFtpPublishingCredentialsPolicyResource GetWebSiteSlotFtpPublishingCredentialsPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotFtpPublishingCredentialsPolicyResource.ValidateResourceId(id); - return new WebSiteSlotFtpPublishingCredentialsPolicyResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotFtpPublishingCredentialsPolicyResource(id); } - #endregion - #region ScmSiteSlotBasicPublishingCredentialsPolicyResource /// /// 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. /// Returns a object. public static ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlotBasicPublishingCredentialsPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScmSiteSlotBasicPublishingCredentialsPolicyResource.ValidateResourceId(id); - return new ScmSiteSlotBasicPublishingCredentialsPolicyResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetScmSiteSlotBasicPublishingCredentialsPolicyResource(id); } - #endregion - #region SiteConfigAppsettingResource /// /// 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. /// Returns a object. public static SiteConfigAppsettingResource GetSiteConfigAppsettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteConfigAppsettingResource.ValidateResourceId(id); - return new SiteConfigAppsettingResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteConfigAppsettingResource(id); } - #endregion - #region WebSiteConfigConnectionStringResource /// /// 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. /// Returns a object. public static WebSiteConfigConnectionStringResource GetWebSiteConfigConnectionStringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteConfigConnectionStringResource.ValidateResourceId(id); - return new WebSiteConfigConnectionStringResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteConfigConnectionStringResource(id); } - #endregion - #region WebSiteSlotConfigAppSettingResource /// /// 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. /// Returns a object. public static WebSiteSlotConfigAppSettingResource GetWebSiteSlotConfigAppSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotConfigAppSettingResource.ValidateResourceId(id); - return new WebSiteSlotConfigAppSettingResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotConfigAppSettingResource(id); } - #endregion - #region WebSiteSlotConfigConnectionStringResource /// /// 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. /// Returns a object. public static WebSiteSlotConfigConnectionStringResource GetWebSiteSlotConfigConnectionStringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotConfigConnectionStringResource.ValidateResourceId(id); - return new WebSiteSlotConfigConnectionStringResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotConfigConnectionStringResource(id); } - #endregion - #region LogsSiteConfigResource /// /// 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. /// Returns a object. public static LogsSiteConfigResource GetLogsSiteConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogsSiteConfigResource.ValidateResourceId(id); - return new LogsSiteConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetLogsSiteConfigResource(id); } - #endregion - #region LogsSiteSlotConfigResource /// /// 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. /// Returns a object. public static LogsSiteSlotConfigResource GetLogsSiteSlotConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogsSiteSlotConfigResource.ValidateResourceId(id); - return new LogsSiteSlotConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetLogsSiteSlotConfigResource(id); } - #endregion - #region SlotConfigNamesResource /// /// 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. /// Returns a object. public static SlotConfigNamesResource GetSlotConfigNamesResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SlotConfigNamesResource.ValidateResourceId(id); - return new SlotConfigNamesResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSlotConfigNamesResource(id); } - #endregion - #region WebSiteConfigResource /// /// 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. /// Returns a object. public static WebSiteConfigResource GetWebSiteConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteConfigResource.ValidateResourceId(id); - return new WebSiteConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteConfigResource(id); } - #endregion - #region SiteConfigSnapshotResource /// /// 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. /// Returns a object. public static SiteConfigSnapshotResource GetSiteConfigSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteConfigSnapshotResource.ValidateResourceId(id); - return new SiteConfigSnapshotResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteConfigSnapshotResource(id); } - #endregion - #region WebSiteSlotConfigResource /// /// 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. /// Returns a object. public static WebSiteSlotConfigResource GetWebSiteSlotConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotConfigResource.ValidateResourceId(id); - return new WebSiteSlotConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotConfigResource(id); } - #endregion - #region SiteSlotConfigSnapshotResource /// /// 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. /// Returns a object. public static SiteSlotConfigSnapshotResource GetSiteSlotConfigSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotConfigSnapshotResource.ValidateResourceId(id); - return new SiteSlotConfigSnapshotResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotConfigSnapshotResource(id); } - #endregion - #region WebSiteContinuousWebJobResource /// /// 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. /// Returns a object. public static WebSiteContinuousWebJobResource GetWebSiteContinuousWebJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteContinuousWebJobResource.ValidateResourceId(id); - return new WebSiteContinuousWebJobResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteContinuousWebJobResource(id); } - #endregion - #region WebSiteSlotContinuousWebJobResource /// /// 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. /// Returns a object. public static WebSiteSlotContinuousWebJobResource GetWebSiteSlotContinuousWebJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotContinuousWebJobResource.ValidateResourceId(id); - return new WebSiteSlotContinuousWebJobResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotContinuousWebJobResource(id); } - #endregion - #region SiteDeploymentResource /// /// 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. /// Returns a object. public static SiteDeploymentResource GetSiteDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDeploymentResource.ValidateResourceId(id); - return new SiteDeploymentResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDeploymentResource(id); } - #endregion - #region SiteSlotDeploymentResource /// /// 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. /// Returns a object. public static SiteSlotDeploymentResource GetSiteSlotDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDeploymentResource.ValidateResourceId(id); - return new SiteSlotDeploymentResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDeploymentResource(id); } - #endregion - #region SiteDomainOwnershipIdentifierResource /// /// 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. /// Returns a object. public static SiteDomainOwnershipIdentifierResource GetSiteDomainOwnershipIdentifierResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteDomainOwnershipIdentifierResource.ValidateResourceId(id); - return new SiteDomainOwnershipIdentifierResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteDomainOwnershipIdentifierResource(id); } - #endregion - #region SiteSlotDomainOwnershipIdentifierResource /// /// 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. /// Returns a object. public static SiteSlotDomainOwnershipIdentifierResource GetSiteSlotDomainOwnershipIdentifierResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotDomainOwnershipIdentifierResource.ValidateResourceId(id); - return new SiteSlotDomainOwnershipIdentifierResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotDomainOwnershipIdentifierResource(id); } - #endregion - #region SiteExtensionResource /// /// 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. /// Returns a object. public static SiteExtensionResource GetSiteExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteExtensionResource.ValidateResourceId(id); - return new SiteExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteExtensionResource(id); } - #endregion - #region SiteInstanceExtensionResource /// /// 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. /// Returns a object. public static SiteInstanceExtensionResource GetSiteInstanceExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteInstanceExtensionResource.ValidateResourceId(id); - return new SiteInstanceExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteInstanceExtensionResource(id); } - #endregion - #region SiteSlotExtensionResource /// /// 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. /// Returns a object. public static SiteSlotExtensionResource GetSiteSlotExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotExtensionResource.ValidateResourceId(id); - return new SiteSlotExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotExtensionResource(id); } - #endregion - #region SiteSlotInstanceExtensionResource /// /// 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. /// Returns a object. public static SiteSlotInstanceExtensionResource GetSiteSlotInstanceExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotInstanceExtensionResource.ValidateResourceId(id); - return new SiteSlotInstanceExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotInstanceExtensionResource(id); } - #endregion - #region SiteFunctionResource /// /// 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. /// Returns a object. public static SiteFunctionResource GetSiteFunctionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteFunctionResource.ValidateResourceId(id); - return new SiteFunctionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteFunctionResource(id); } - #endregion - #region SiteSlotFunctionResource /// /// 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. /// Returns a object. public static SiteSlotFunctionResource GetSiteSlotFunctionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotFunctionResource.ValidateResourceId(id); - return new SiteSlotFunctionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotFunctionResource(id); } - #endregion - #region SiteHostNameBindingResource /// /// 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. /// Returns a object. public static SiteHostNameBindingResource GetSiteHostNameBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteHostNameBindingResource.ValidateResourceId(id); - return new SiteHostNameBindingResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteHostNameBindingResource(id); } - #endregion - #region SiteSlotHostNameBindingResource /// /// 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. /// Returns a object. public static SiteSlotHostNameBindingResource GetSiteSlotHostNameBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotHostNameBindingResource.ValidateResourceId(id); - return new SiteSlotHostNameBindingResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotHostNameBindingResource(id); } - #endregion - #region WebSiteHybridConnectionResource /// /// 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. /// Returns a object. public static WebSiteHybridConnectionResource GetWebSiteHybridConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteHybridConnectionResource.ValidateResourceId(id); - return new WebSiteHybridConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteHybridConnectionResource(id); } - #endregion - #region WebSiteSlotHybridConnectionResource /// /// 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. /// Returns a object. public static WebSiteSlotHybridConnectionResource GetWebSiteSlotHybridConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotHybridConnectionResource.ValidateResourceId(id); - return new WebSiteSlotHybridConnectionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotHybridConnectionResource(id); } - #endregion - #region SiteInstanceResource /// /// 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. /// Returns a object. public static SiteInstanceResource GetSiteInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteInstanceResource.ValidateResourceId(id); - return new SiteInstanceResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteInstanceResource(id); } - #endregion - #region SiteSlotInstanceResource /// /// 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. /// Returns a object. public static SiteSlotInstanceResource GetSiteSlotInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotInstanceResource.ValidateResourceId(id); - return new SiteSlotInstanceResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotInstanceResource(id); } - #endregion - #region SiteInstanceProcessResource /// /// 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. /// Returns a object. public static SiteInstanceProcessResource GetSiteInstanceProcessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteInstanceProcessResource.ValidateResourceId(id); - return new SiteInstanceProcessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteInstanceProcessResource(id); } - #endregion - #region SiteProcessResource /// /// 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. /// Returns a object. public static SiteProcessResource GetSiteProcessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteProcessResource.ValidateResourceId(id); - return new SiteProcessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteProcessResource(id); } - #endregion - #region SiteSlotInstanceProcessResource /// /// 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. /// Returns a object. public static SiteSlotInstanceProcessResource GetSiteSlotInstanceProcessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotInstanceProcessResource.ValidateResourceId(id); - return new SiteSlotInstanceProcessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotInstanceProcessResource(id); } - #endregion - #region SiteSlotProcessResource /// /// 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. /// Returns a object. public static SiteSlotProcessResource GetSiteSlotProcessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotProcessResource.ValidateResourceId(id); - return new SiteSlotProcessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotProcessResource(id); } - #endregion - #region SiteInstanceProcessModuleResource /// /// 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. /// Returns a object. public static SiteInstanceProcessModuleResource GetSiteInstanceProcessModuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteInstanceProcessModuleResource.ValidateResourceId(id); - return new SiteInstanceProcessModuleResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteInstanceProcessModuleResource(id); } - #endregion - #region SiteProcessModuleResource /// /// 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. /// Returns a object. public static SiteProcessModuleResource GetSiteProcessModuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteProcessModuleResource.ValidateResourceId(id); - return new SiteProcessModuleResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteProcessModuleResource(id); } - #endregion - #region SiteSlotInstanceProcessModuleResource /// /// 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. /// Returns a object. public static SiteSlotInstanceProcessModuleResource GetSiteSlotInstanceProcessModuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotInstanceProcessModuleResource.ValidateResourceId(id); - return new SiteSlotInstanceProcessModuleResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotInstanceProcessModuleResource(id); } - #endregion - #region SiteSlotProcessModuleResource /// /// 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. /// Returns a object. public static SiteSlotProcessModuleResource GetSiteSlotProcessModuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotProcessModuleResource.ValidateResourceId(id); - return new SiteSlotProcessModuleResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotProcessModuleResource(id); } - #endregion - #region SiteNetworkConfigResource /// /// 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. /// Returns a object. public static SiteNetworkConfigResource GetSiteNetworkConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteNetworkConfigResource.ValidateResourceId(id); - return new SiteNetworkConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteNetworkConfigResource(id); } - #endregion - #region SiteSlotNetworkConfigResource /// /// 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. /// Returns a object. public static SiteSlotNetworkConfigResource GetSiteSlotNetworkConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteSlotNetworkConfigResource.ValidateResourceId(id); - return new SiteSlotNetworkConfigResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSiteSlotNetworkConfigResource(id); } - #endregion - #region WebSitePremierAddonResource /// /// 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. /// Returns a object. public static WebSitePremierAddonResource GetWebSitePremierAddonResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSitePremierAddonResource.ValidateResourceId(id); - return new WebSitePremierAddonResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSitePremierAddonResource(id); } - #endregion - #region WebSiteSlotPremierAddOnResource /// /// 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. /// Returns a object. public static WebSiteSlotPremierAddOnResource GetWebSiteSlotPremierAddOnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotPremierAddOnResource.ValidateResourceId(id); - return new WebSiteSlotPremierAddOnResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotPremierAddOnResource(id); } - #endregion - #region WebSitePrivateAccessResource /// /// 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. /// Returns a object. public static WebSitePrivateAccessResource GetWebSitePrivateAccessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSitePrivateAccessResource.ValidateResourceId(id); - return new WebSitePrivateAccessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSitePrivateAccessResource(id); } - #endregion - #region WebSiteSlotPrivateAccessResource /// /// 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. /// Returns a object. public static WebSiteSlotPrivateAccessResource GetWebSiteSlotPrivateAccessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotPrivateAccessResource.ValidateResourceId(id); - return new WebSiteSlotPrivateAccessResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotPrivateAccessResource(id); } - #endregion - #region SitePublicCertificateResource /// /// 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. /// Returns a object. public static SitePublicCertificateResource GetSitePublicCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SitePublicCertificateResource.ValidateResourceId(id); - return new SitePublicCertificateResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetSitePublicCertificateResource(id); } - #endregion - #region WebSiteSlotPublicCertificateResource /// /// 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. /// Returns a object. public static WebSiteSlotPublicCertificateResource GetWebSiteSlotPublicCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotPublicCertificateResource.ValidateResourceId(id); - return new WebSiteSlotPublicCertificateResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotPublicCertificateResource(id); } - #endregion - #region WebSiteExtensionResource /// /// 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. /// Returns a object. public static WebSiteExtensionResource GetWebSiteExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteExtensionResource.ValidateResourceId(id); - return new WebSiteExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteExtensionResource(id); } - #endregion - #region WebSiteSlotExtensionResource /// /// 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. /// Returns a object. public static WebSiteSlotExtensionResource GetWebSiteSlotExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotExtensionResource.ValidateResourceId(id); - return new WebSiteSlotExtensionResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotExtensionResource(id); } - #endregion - #region MigrateMySqlStatusResource /// /// 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. /// Returns a object. public static MigrateMySqlStatusResource GetMigrateMySqlStatusResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MigrateMySqlStatusResource.ValidateResourceId(id); - return new MigrateMySqlStatusResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetMigrateMySqlStatusResource(id); } - #endregion - #region NetworkFeatureResource /// /// 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. /// Returns a object. public static NetworkFeatureResource GetNetworkFeatureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkFeatureResource.ValidateResourceId(id); - return new NetworkFeatureResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetNetworkFeatureResource(id); } - #endregion - #region WebSiteSlotSourceControlResource /// /// 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. /// Returns a object. public static WebSiteSlotSourceControlResource GetWebSiteSlotSourceControlResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotSourceControlResource.ValidateResourceId(id); - return new WebSiteSlotSourceControlResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotSourceControlResource(id); } - #endregion - #region WebSiteSourceControlResource /// /// 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. /// Returns a object. public static WebSiteSourceControlResource GetWebSiteSourceControlResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSourceControlResource.ValidateResourceId(id); - return new WebSiteSourceControlResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSourceControlResource(id); } - #endregion - #region WebSiteSlotWebJobResource /// /// 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. /// Returns a object. public static WebSiteSlotWebJobResource GetWebSiteSlotWebJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteSlotWebJobResource.ValidateResourceId(id); - return new WebSiteSlotWebJobResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteSlotWebJobResource(id); } - #endregion - #region WebSiteWebJobResource /// /// 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. /// Returns a object. public static WebSiteWebJobResource GetWebSiteWebJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebSiteWebJobResource.ValidateResourceId(id); - return new WebSiteWebJobResource(client, id); - } - ); + return GetAppServiceArmClientMockingExtension(client).GetWebSiteWebJobResource(id); } - #endregion - /// Gets a collection of AppServiceCertificateOrderResources in the ResourceGroupResource. + /// + /// Gets a collection of AppServiceCertificateOrderResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppServiceCertificateOrderResources and their operations over a AppServiceCertificateOrderResource. public static AppServiceCertificateOrderCollection GetAppServiceCertificateOrders(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppServiceCertificateOrders(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceCertificateOrders(); } /// @@ -2157,16 +1810,20 @@ public static AppServiceCertificateOrderCollection GetAppServiceCertificateOrder /// AppServiceCertificateOrders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the certificate order.. /// The cancellation token to use. - /// 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 static async Task> GetAppServiceCertificateOrderAsync(this ResourceGroupResource resourceGroupResource, string certificateOrderName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppServiceCertificateOrders().GetAsync(certificateOrderName, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceCertificateOrderAsync(certificateOrderName, cancellationToken).ConfigureAwait(false); } /// @@ -2181,24 +1838,34 @@ public static async Task> GetAppSer /// AppServiceCertificateOrders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the certificate order.. /// The cancellation token to use. - /// 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 static Response GetAppServiceCertificateOrder(this ResourceGroupResource resourceGroupResource, string certificateOrderName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppServiceCertificateOrders().Get(certificateOrderName, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceCertificateOrder(certificateOrderName, cancellationToken); } - /// Gets a collection of AppServiceDomainResources in the ResourceGroupResource. + /// + /// Gets a collection of AppServiceDomainResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppServiceDomainResources and their operations over a AppServiceDomainResource. public static AppServiceDomainCollection GetAppServiceDomains(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppServiceDomains(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceDomains(); } /// @@ -2213,16 +1880,20 @@ public static AppServiceDomainCollection GetAppServiceDomains(this ResourceGroup /// Domains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. /// The cancellation token to use. - /// 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 static async Task> GetAppServiceDomainAsync(this ResourceGroupResource resourceGroupResource, string domainName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppServiceDomains().GetAsync(domainName, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceDomainAsync(domainName, cancellationToken).ConfigureAwait(false); } /// @@ -2237,24 +1908,34 @@ public static async Task> GetAppServiceDomain /// Domains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. /// The cancellation token to use. - /// 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 static Response GetAppServiceDomain(this ResourceGroupResource resourceGroupResource, string domainName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppServiceDomains().Get(domainName, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceDomain(domainName, cancellationToken); } - /// Gets a collection of AppServiceEnvironmentResources in the ResourceGroupResource. + /// + /// Gets a collection of AppServiceEnvironmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppServiceEnvironmentResources and their operations over a AppServiceEnvironmentResource. public static AppServiceEnvironmentCollection GetAppServiceEnvironments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppServiceEnvironments(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceEnvironments(); } /// @@ -2269,16 +1950,20 @@ public static AppServiceEnvironmentCollection GetAppServiceEnvironments(this Res /// AppServiceEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the App Service Environment. /// The cancellation token to use. - /// 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 static async Task> GetAppServiceEnvironmentAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppServiceEnvironments().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceEnvironmentAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2293,24 +1978,34 @@ public static async Task> GetAppServiceE /// AppServiceEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the App Service Environment. /// The cancellation token to use. - /// 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 static Response GetAppServiceEnvironment(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppServiceEnvironments().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServiceEnvironment(name, cancellationToken); } - /// Gets a collection of AppServicePlanResources in the ResourceGroupResource. + /// + /// Gets a collection of AppServicePlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppServicePlanResources and their operations over a AppServicePlanResource. public static AppServicePlanCollection GetAppServicePlans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppServicePlans(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServicePlans(); } /// @@ -2325,16 +2020,20 @@ public static AppServicePlanCollection GetAppServicePlans(this ResourceGroupReso /// AppServicePlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the App Service plan. /// The cancellation token to use. - /// 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 static async Task> GetAppServicePlanAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppServicePlans().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServicePlanAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2349,24 +2048,34 @@ public static async Task> GetAppServicePlanAsyn /// AppServicePlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the App Service plan. /// The cancellation token to use. - /// 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 static Response GetAppServicePlan(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppServicePlans().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppServicePlan(name, cancellationToken); } - /// Gets a collection of AppCertificateResources in the ResourceGroupResource. + /// + /// Gets a collection of AppCertificateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppCertificateResources and their operations over a AppCertificateResource. public static AppCertificateCollection GetAppCertificates(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAppCertificates(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppCertificates(); } /// @@ -2381,16 +2090,20 @@ public static AppCertificateCollection GetAppCertificates(this ResourceGroupReso /// Certificates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the certificate. /// The cancellation token to use. - /// 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 static async Task> GetAppCertificateAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAppCertificates().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppCertificateAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2405,24 +2118,34 @@ public static async Task> GetAppCertificateAsyn /// Certificates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the certificate. /// The cancellation token to use. - /// 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 static Response GetAppCertificate(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAppCertificates().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetAppCertificate(name, cancellationToken); } - /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. + /// + /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. public static KubeEnvironmentCollection GetKubeEnvironments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetKubeEnvironments(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetKubeEnvironments(); } /// @@ -2437,16 +2160,20 @@ public static KubeEnvironmentCollection GetKubeEnvironments(this ResourceGroupRe /// KubeEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Kubernetes Environment. /// The cancellation token to use. - /// 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 static async Task> GetKubeEnvironmentAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetKubeEnvironments().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetKubeEnvironmentAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2461,24 +2188,34 @@ public static async Task> GetKubeEnvironmentAs /// KubeEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Kubernetes Environment. /// The cancellation token to use. - /// 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 static Response GetKubeEnvironment(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetKubeEnvironments().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetKubeEnvironment(name, cancellationToken); } - /// Gets a collection of StaticSiteResources in the ResourceGroupResource. + /// + /// Gets a collection of StaticSiteResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of StaticSiteResources and their operations over a StaticSiteResource. public static StaticSiteCollection GetStaticSites(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStaticSites(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetStaticSites(); } /// @@ -2493,16 +2230,20 @@ public static StaticSiteCollection GetStaticSites(this ResourceGroupResource res /// StaticSites_GetStaticSite /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the static site. /// The cancellation token to use. - /// 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 static async Task> GetStaticSiteAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetStaticSites().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetStaticSiteAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2517,24 +2258,34 @@ public static async Task> GetStaticSiteAsync(this R /// StaticSites_GetStaticSite /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the static site. /// The cancellation token to use. - /// 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 static Response GetStaticSite(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetStaticSites().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetStaticSite(name, cancellationToken); } - /// Gets a collection of WebSiteResources in the ResourceGroupResource. + /// + /// Gets a collection of WebSiteResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WebSiteResources and their operations over a WebSiteResource. public static WebSiteCollection GetWebSites(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWebSites(); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetWebSites(); } /// @@ -2549,16 +2300,20 @@ public static WebSiteCollection GetWebSites(this ResourceGroupResource resourceG /// WebApps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the app. /// The cancellation token to use. - /// 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 static async Task> GetWebSiteAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWebSites().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetWebSiteAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2573,16 +2328,20 @@ public static async Task> GetWebSiteAsync(this Resourc /// WebApps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the app. /// The cancellation token to use. - /// 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 static Response GetWebSite(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWebSites().Get(name, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).GetWebSite(name, cancellationToken); } /// @@ -2597,6 +2356,10 @@ public static Response GetWebSite(this ResourceGroupResource re /// Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request with the resources to validate. @@ -2604,9 +2367,7 @@ public static Response GetWebSite(this ResourceGroupResource re /// is null. public static async Task> ValidateAsync(this ResourceGroupResource resourceGroupResource, AppServiceValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateAsync(content, cancellationToken).ConfigureAwait(false); + return await GetAppServiceResourceGroupMockingExtension(resourceGroupResource).ValidateAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -2621,6 +2382,10 @@ public static async Task> ValidateAsync(this /// Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request with the resources to validate. @@ -2628,17 +2393,21 @@ public static async Task> ValidateAsync(this /// is null. public static Response Validate(this ResourceGroupResource resourceGroupResource, AppServiceValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).Validate(content, cancellationToken); + return GetAppServiceResourceGroupMockingExtension(resourceGroupResource).Validate(content, cancellationToken); } - /// Gets a collection of TopLevelDomainResources in the SubscriptionResource. + /// + /// Gets a collection of TopLevelDomainResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TopLevelDomainResources and their operations over a TopLevelDomainResource. public static TopLevelDomainCollection GetTopLevelDomains(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTopLevelDomains(); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetTopLevelDomains(); } /// @@ -2653,16 +2422,20 @@ public static TopLevelDomainCollection GetTopLevelDomains(this SubscriptionResou /// TopLevelDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the top-level domain. /// The cancellation token to use. - /// 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 static async Task> GetTopLevelDomainAsync(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetTopLevelDomains().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetTopLevelDomainAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -2677,24 +2450,34 @@ public static async Task> GetTopLevelDomainAsyn /// TopLevelDomains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the top-level domain. /// The cancellation token to use. - /// 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 static Response GetTopLevelDomain(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) { - return subscriptionResource.GetTopLevelDomains().Get(name, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetTopLevelDomain(name, cancellationToken); } - /// Gets a collection of DeletedSiteResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedSiteResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeletedSiteResources and their operations over a DeletedSiteResource. public static DeletedSiteCollection GetDeletedSites(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedSites(); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedSites(); } /// @@ -2709,16 +2492,20 @@ public static DeletedSiteCollection GetDeletedSites(this SubscriptionResource su /// Global_GetDeletedWebApp /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The numeric ID of the deleted app, e.g. 12345. /// The cancellation token to use. - /// 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 static async Task> GetDeletedSiteAsync(this SubscriptionResource subscriptionResource, string deletedSiteId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedSites().GetAsync(deletedSiteId, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedSiteAsync(deletedSiteId, cancellationToken).ConfigureAwait(false); } /// @@ -2733,16 +2520,20 @@ public static async Task> GetDeletedSiteAsync(this /// Global_GetDeletedWebApp /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The numeric ID of the deleted app, e.g. 12345. /// The cancellation token to use. - /// 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 static Response GetDeletedSite(this SubscriptionResource subscriptionResource, string deletedSiteId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedSites().Get(deletedSiteId, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedSite(deletedSiteId, cancellationToken); } /// @@ -2757,13 +2548,17 @@ public static Response GetDeletedSite(this SubscriptionReso /// AppServiceCertificateOrders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppServiceCertificateOrdersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceCertificateOrdersAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceCertificateOrdersAsync(cancellationToken); } /// @@ -2778,13 +2573,17 @@ public static AsyncPageable GetAppServiceCer /// AppServiceCertificateOrders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppServiceCertificateOrders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceCertificateOrders(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceCertificateOrders(cancellationToken); } /// @@ -2799,6 +2598,10 @@ public static Pageable GetAppServiceCertific /// AppServiceCertificateOrders_ValidatePurchaseInformation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information for a certificate order. @@ -2806,9 +2609,7 @@ public static Pageable GetAppServiceCertific /// is null. public static async Task ValidateAppServiceCertificateOrderPurchaseInformationAsync(this SubscriptionResource subscriptionResource, AppServiceCertificateOrderData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateAppServiceCertificateOrderPurchaseInformationAsync(data, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).ValidateAppServiceCertificateOrderPurchaseInformationAsync(data, cancellationToken).ConfigureAwait(false); } /// @@ -2823,6 +2624,10 @@ public static async Task ValidateAppServiceCertificateOrderPurchaseInf /// AppServiceCertificateOrders_ValidatePurchaseInformation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information for a certificate order. @@ -2830,9 +2635,7 @@ public static async Task ValidateAppServiceCertificateOrderPurchaseInf /// is null. public static Response ValidateAppServiceCertificateOrderPurchaseInformation(this SubscriptionResource subscriptionResource, AppServiceCertificateOrderData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateAppServiceCertificateOrderPurchaseInformation(data, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).ValidateAppServiceCertificateOrderPurchaseInformation(data, cancellationToken); } /// @@ -2847,6 +2650,10 @@ public static Response ValidateAppServiceCertificateOrderPurchaseInformation(thi /// Domains_CheckAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. @@ -2854,9 +2661,7 @@ public static Response ValidateAppServiceCertificateOrderPurchaseInformation(thi /// is null. public static async Task> CheckAppServiceDomainRegistrationAvailabilityAsync(this SubscriptionResource subscriptionResource, AppServiceDomainNameIdentifier identifier, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(identifier, nameof(identifier)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppServiceDomainRegistrationAvailabilityAsync(identifier, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).CheckAppServiceDomainRegistrationAvailabilityAsync(identifier, cancellationToken).ConfigureAwait(false); } /// @@ -2871,6 +2676,10 @@ public static async Task> CheckAppServic /// Domains_CheckAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. @@ -2878,9 +2687,7 @@ public static async Task> CheckAppServic /// is null. public static Response CheckAppServiceDomainRegistrationAvailability(this SubscriptionResource subscriptionResource, AppServiceDomainNameIdentifier identifier, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(identifier, nameof(identifier)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppServiceDomainRegistrationAvailability(identifier, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).CheckAppServiceDomainRegistrationAvailability(identifier, cancellationToken); } /// @@ -2895,13 +2702,17 @@ public static Response CheckAppServiceDomainRegis /// Domains_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppServiceDomainsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDomainsAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDomainsAsync(cancellationToken); } /// @@ -2916,13 +2727,17 @@ public static AsyncPageable GetAppServiceDomainsAsync( /// Domains_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppServiceDomains(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDomains(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDomains(cancellationToken); } /// @@ -2937,12 +2752,16 @@ public static Pageable GetAppServiceDomains(this Subsc /// Domains_GetControlCenterSsoRequest /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetControlCenterSsoRequestDomainAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetControlCenterSsoRequestDomainAsync(cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetControlCenterSsoRequestDomainAsync(cancellationToken).ConfigureAwait(false); } /// @@ -2957,12 +2776,16 @@ public static async Task> GetControl /// Domains_GetControlCenterSsoRequest /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetControlCenterSsoRequestDomain(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetControlCenterSsoRequestDomain(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetControlCenterSsoRequestDomain(cancellationToken); } /// @@ -2977,6 +2800,10 @@ public static Response GetControlCenterSsoReq /// Domains_ListRecommendations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Search parameters for domain name recommendations. @@ -2985,9 +2812,7 @@ public static Response GetControlCenterSsoReq /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppServiceDomainRecommendationsAsync(this SubscriptionResource subscriptionResource, DomainRecommendationSearchContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDomainRecommendationsAsync(content, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDomainRecommendationsAsync(content, cancellationToken); } /// @@ -3002,6 +2827,10 @@ public static AsyncPageable GetAppServiceDomainR /// Domains_ListRecommendations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Search parameters for domain name recommendations. @@ -3010,9 +2839,7 @@ public static AsyncPageable GetAppServiceDomainR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppServiceDomainRecommendations(this SubscriptionResource subscriptionResource, DomainRecommendationSearchContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDomainRecommendations(content, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDomainRecommendations(content, cancellationToken); } /// @@ -3027,13 +2854,17 @@ public static Pageable GetAppServiceDomainRecomm /// AppServiceEnvironments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppServiceEnvironmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceEnvironmentsAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceEnvironmentsAsync(cancellationToken); } /// @@ -3048,13 +2879,17 @@ public static AsyncPageable GetAppServiceEnvironm /// AppServiceEnvironments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppServiceEnvironments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceEnvironments(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceEnvironments(cancellationToken); } /// @@ -3069,6 +2904,10 @@ public static Pageable GetAppServiceEnvironments( /// AppServicePlans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// @@ -3079,7 +2918,7 @@ public static Pageable GetAppServiceEnvironments( /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppServicePlansAsync(this SubscriptionResource subscriptionResource, bool? detailed = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServicePlansAsync(detailed, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServicePlansAsync(detailed, cancellationToken); } /// @@ -3094,6 +2933,10 @@ public static AsyncPageable GetAppServicePlansAsync(this /// AppServicePlans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// @@ -3104,7 +2947,7 @@ public static AsyncPageable GetAppServicePlansAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppServicePlans(this SubscriptionResource subscriptionResource, bool? detailed = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServicePlans(detailed, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServicePlans(detailed, cancellationToken); } /// @@ -3119,6 +2962,10 @@ public static Pageable GetAppServicePlans(this Subscript /// Certificates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. @@ -3126,7 +2973,7 @@ public static Pageable GetAppServicePlans(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppCertificatesAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppCertificatesAsync(filter, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppCertificatesAsync(filter, cancellationToken); } /// @@ -3141,6 +2988,10 @@ public static AsyncPageable GetAppCertificatesAsync(this /// Certificates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId'. @@ -3148,7 +2999,7 @@ public static AsyncPageable GetAppCertificatesAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppCertificates(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppCertificates(filter, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppCertificates(filter, cancellationToken); } /// @@ -3163,6 +3014,10 @@ public static Pageable GetAppCertificates(this Subscript /// DeletedWebApps_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -3170,7 +3025,7 @@ public static Pageable GetAppCertificates(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedSitesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedSitesByLocationAsync(location, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedSitesByLocationAsync(location, cancellationToken); } /// @@ -3185,6 +3040,10 @@ public static AsyncPageable GetDeletedSitesByLocationAsync( /// DeletedWebApps_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -3192,7 +3051,7 @@ public static AsyncPageable GetDeletedSitesByLocationAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedSitesByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedSitesByLocation(location, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedSitesByLocation(location, cancellationToken); } /// @@ -3207,6 +3066,10 @@ public static Pageable GetDeletedSitesByLocation(this Subsc /// DeletedWebApps_GetDeletedWebAppByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -3216,9 +3079,7 @@ public static Pageable GetDeletedSitesByLocation(this Subsc /// is null. public static async Task> GetDeletedWebAppByLocationDeletedWebAppAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string deletedSiteId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(deletedSiteId, nameof(deletedSiteId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedWebAppByLocationDeletedWebAppAsync(location, deletedSiteId, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedWebAppByLocationDeletedWebAppAsync(location, deletedSiteId, cancellationToken).ConfigureAwait(false); } /// @@ -3233,6 +3094,10 @@ public static async Task> GetDeletedWebAppByLocati /// DeletedWebApps_GetDeletedWebAppByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -3242,9 +3107,7 @@ public static async Task> GetDeletedWebAppByLocati /// is null. public static Response GetDeletedWebAppByLocationDeletedWebApp(this SubscriptionResource subscriptionResource, AzureLocation location, string deletedSiteId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(deletedSiteId, nameof(deletedSiteId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedWebAppByLocationDeletedWebApp(location, deletedSiteId, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetDeletedWebAppByLocationDeletedWebApp(location, deletedSiteId, cancellationToken); } /// @@ -3259,13 +3122,17 @@ public static Response GetDeletedWebAppByLocationDeletedWeb /// KubeEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetKubeEnvironmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKubeEnvironmentsAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetKubeEnvironmentsAsync(cancellationToken); } /// @@ -3280,13 +3147,17 @@ public static AsyncPageable GetKubeEnvironmentsAsync(th /// KubeEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetKubeEnvironments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetKubeEnvironments(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetKubeEnvironments(cancellationToken); } /// @@ -3301,6 +3172,10 @@ public static Pageable GetKubeEnvironments(this Subscri /// Provider_GetAvailableStacksOnPrem /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ProviderOSTypeSelected to use. @@ -3308,7 +3183,7 @@ public static Pageable GetKubeEnvironments(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableStacksOnPremProvidersAsync(this SubscriptionResource subscriptionResource, ProviderOSTypeSelected? osTypeSelected = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableStacksOnPremProvidersAsync(osTypeSelected, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAvailableStacksOnPremProvidersAsync(osTypeSelected, cancellationToken); } /// @@ -3323,6 +3198,10 @@ public static AsyncPageable GetAvailableStacksOnPremPr /// Provider_GetAvailableStacksOnPrem /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ProviderOSTypeSelected to use. @@ -3330,7 +3209,7 @@ public static AsyncPageable GetAvailableStacksOnPremPr /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableStacksOnPremProviders(this SubscriptionResource subscriptionResource, ProviderOSTypeSelected? osTypeSelected = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableStacksOnPremProviders(osTypeSelected, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAvailableStacksOnPremProviders(osTypeSelected, cancellationToken); } /// @@ -3345,6 +3224,10 @@ public static Pageable GetAvailableStacksOnPremProvide /// Recommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. @@ -3353,7 +3236,7 @@ public static Pageable GetAvailableStacksOnPremProvide /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRecommendationsAsync(this SubscriptionResource subscriptionResource, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecommendationsAsync(featured, filter, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetRecommendationsAsync(featured, filter, cancellationToken); } /// @@ -3368,6 +3251,10 @@ public static AsyncPageable GetRecommendationsAsync(th /// Recommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. @@ -3376,7 +3263,7 @@ public static AsyncPageable GetRecommendationsAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRecommendations(this SubscriptionResource subscriptionResource, bool? featured = null, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecommendations(featured, filter, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetRecommendations(featured, filter, cancellationToken); } /// @@ -3391,12 +3278,16 @@ public static Pageable GetRecommendations(this Subscri /// Recommendations_ResetAllFilters /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task ResetAllRecommendationFiltersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ResetAllRecommendationFiltersAsync(cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).ResetAllRecommendationFiltersAsync(cancellationToken).ConfigureAwait(false); } /// @@ -3411,12 +3302,16 @@ public static async Task ResetAllRecommendationFiltersAsync(this Subsc /// Recommendations_ResetAllFilters /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response ResetAllRecommendationFilters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).ResetAllRecommendationFilters(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).ResetAllRecommendationFilters(cancellationToken); } /// @@ -3431,6 +3326,10 @@ public static Response ResetAllRecommendationFilters(this SubscriptionResource s /// Recommendations_DisableRecommendationForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Rule name. @@ -3439,9 +3338,7 @@ public static Response ResetAllRecommendationFilters(this SubscriptionResource s /// is null. public static async Task DisableAppServiceRecommendationAsync(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).DisableAppServiceRecommendationAsync(name, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).DisableAppServiceRecommendationAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -3456,6 +3353,10 @@ public static async Task DisableAppServiceRecommendationAsync(this Sub /// Recommendations_DisableRecommendationForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Rule name. @@ -3464,9 +3365,7 @@ public static async Task DisableAppServiceRecommendationAsync(this Sub /// is null. public static Response DisableAppServiceRecommendation(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).DisableAppServiceRecommendation(name, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).DisableAppServiceRecommendation(name, cancellationToken); } /// @@ -3481,13 +3380,17 @@ public static Response DisableAppServiceRecommendation(this SubscriptionResource /// ResourceHealthMetadata_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAllResourceHealthMetadataAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllResourceHealthMetadataAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAllResourceHealthMetadataAsync(cancellationToken); } /// @@ -3502,13 +3405,17 @@ public static AsyncPageable GetAllResourceHealthMeta /// ResourceHealthMetadata_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAllResourceHealthMetadata(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllResourceHealthMetadata(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAllResourceHealthMetadata(cancellationToken); } /// @@ -3523,6 +3430,10 @@ public static Pageable GetAllResourceHealthMetadata( /// ListBillingMeters /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure Location of billable resource. @@ -3531,7 +3442,7 @@ public static Pageable GetAllResourceHealthMetadata( /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBillingMetersAsync(this SubscriptionResource subscriptionResource, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBillingMetersAsync(billingLocation, osType, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetBillingMetersAsync(billingLocation, osType, cancellationToken); } /// @@ -3546,6 +3457,10 @@ public static AsyncPageable GetBillingMetersAsync(this S /// ListBillingMeters /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure Location of billable resource. @@ -3554,7 +3469,7 @@ public static AsyncPageable GetBillingMetersAsync(this S /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBillingMeters(this SubscriptionResource subscriptionResource, string billingLocation = null, string osType = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBillingMeters(billingLocation, osType, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetBillingMeters(billingLocation, osType, cancellationToken); } /// @@ -3569,6 +3484,10 @@ public static Pageable GetBillingMeters(this Subscriptio /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name availability request. @@ -3576,9 +3495,7 @@ public static Pageable GetBillingMeters(this Subscriptio /// is null. public static async Task> CheckAppServiceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ResourceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).CheckAppServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -3593,6 +3510,10 @@ public static async Task> CheckAppServiceName /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name availability request. @@ -3600,9 +3521,7 @@ public static async Task> CheckAppServiceName /// is null. public static Response CheckAppServiceNameAvailability(this SubscriptionResource subscriptionResource, ResourceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckAppServiceNameAvailability(content, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).CheckAppServiceNameAvailability(content, cancellationToken); } /// @@ -3617,12 +3536,16 @@ public static Response CheckAppServiceNameAvailability /// GetSubscriptionDeploymentLocations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetAppServiceDeploymentLocationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDeploymentLocationsAsync(cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDeploymentLocationsAsync(cancellationToken).ConfigureAwait(false); } /// @@ -3637,12 +3560,16 @@ public static async Task> GetAppServiceD /// GetSubscriptionDeploymentLocations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetAppServiceDeploymentLocations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppServiceDeploymentLocations(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetAppServiceDeploymentLocations(cancellationToken); } /// @@ -3657,6 +3584,10 @@ public static Response GetAppServiceDeploymentLoc /// ListGeoRegions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of SKU used to filter the regions. @@ -3667,7 +3598,7 @@ public static Response GetAppServiceDeploymentLoc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetGeoRegionsAsync(this SubscriptionResource subscriptionResource, AppServiceSkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGeoRegionsAsync(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetGeoRegionsAsync(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, cancellationToken); } /// @@ -3682,6 +3613,10 @@ public static AsyncPageable GetGeoRegionsAsync(this Subscri /// ListGeoRegions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of SKU used to filter the regions. @@ -3692,7 +3627,7 @@ public static AsyncPageable GetGeoRegionsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetGeoRegions(this SubscriptionResource subscriptionResource, AppServiceSkuName? sku = null, bool? linuxWorkersEnabled = null, bool? xenonWorkersEnabled = null, bool? linuxDynamicWorkersEnabled = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGeoRegions(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetGeoRegions(sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled, cancellationToken); } /// @@ -3707,13 +3642,17 @@ public static Pageable GetGeoRegions(this SubscriptionResou /// ListPremierAddOnOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPremierAddOnOffersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPremierAddOnOffersAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetPremierAddOnOffersAsync(cancellationToken); } /// @@ -3728,13 +3667,17 @@ public static AsyncPageable GetPremierAddOnOffersAsync(this S /// ListPremierAddOnOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPremierAddOnOffers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPremierAddOnOffers(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetPremierAddOnOffers(cancellationToken); } /// @@ -3749,12 +3692,16 @@ public static Pageable GetPremierAddOnOffers(this Subscriptio /// ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(cancellationToken).ConfigureAwait(false); } /// @@ -3769,12 +3716,16 @@ public static async Task> GetSkusAsync(this Subscr /// ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetSkus(cancellationToken); } /// @@ -3789,6 +3740,10 @@ public static Response GetSkus(this SubscriptionResource su /// VerifyHostingEnvironmentVnet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// VNET information. @@ -3796,9 +3751,7 @@ public static Response GetSkus(this SubscriptionResource su /// is null. public static async Task> VerifyHostingEnvironmentVnetAsync(this SubscriptionResource subscriptionResource, AppServiceVirtualNetworkValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).VerifyHostingEnvironmentVnetAsync(content, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).VerifyHostingEnvironmentVnetAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -3813,6 +3766,10 @@ public static async Task> Verif /// VerifyHostingEnvironmentVnet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// VNET information. @@ -3820,9 +3777,7 @@ public static async Task> Verif /// is null. public static Response VerifyHostingEnvironmentVnet(this SubscriptionResource subscriptionResource, AppServiceVirtualNetworkValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).VerifyHostingEnvironmentVnet(content, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).VerifyHostingEnvironmentVnet(content, cancellationToken); } /// @@ -3837,6 +3792,10 @@ public static Response VerifyHostingEnvi /// StaticSites_PreviewWorkflow /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location where you plan to create the static site. @@ -3845,9 +3804,7 @@ public static Response VerifyHostingEnvi /// is null. public static async Task> PreviewStaticSiteWorkflowAsync(this SubscriptionResource subscriptionResource, AzureLocation location, StaticSitesWorkflowPreviewContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).PreviewStaticSiteWorkflowAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetAppServiceSubscriptionMockingExtension(subscriptionResource).PreviewStaticSiteWorkflowAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -3862,6 +3819,10 @@ public static async Task> PreviewStaticSite /// StaticSites_PreviewWorkflow /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location where you plan to create the static site. @@ -3870,9 +3831,7 @@ public static async Task> PreviewStaticSite /// is null. public static Response PreviewStaticSiteWorkflow(this SubscriptionResource subscriptionResource, AzureLocation location, StaticSitesWorkflowPreviewContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).PreviewStaticSiteWorkflow(location, content, cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).PreviewStaticSiteWorkflow(location, content, cancellationToken); } /// @@ -3887,13 +3846,17 @@ public static Response PreviewStaticSiteWorkflow(thi /// StaticSites_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStaticSitesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStaticSitesAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetStaticSitesAsync(cancellationToken); } /// @@ -3908,13 +3871,17 @@ public static AsyncPageable GetStaticSitesAsync(this Subscri /// StaticSites_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStaticSites(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetStaticSites(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetStaticSites(cancellationToken); } /// @@ -3929,13 +3896,17 @@ public static Pageable GetStaticSites(this SubscriptionResou /// WebApps_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebSitesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebSitesAsync(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetWebSitesAsync(cancellationToken); } /// @@ -3950,29 +3921,45 @@ public static AsyncPageable GetWebSitesAsync(this SubscriptionR /// WebApps_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebSites(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebSites(cancellationToken); + return GetAppServiceSubscriptionMockingExtension(subscriptionResource).GetWebSites(cancellationToken); } - /// Gets an object representing a PublishingUserResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Gets an object representing a PublishingUserResource along with the instance operations that can be performed on it in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static PublishingUserResource GetPublishingUser(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetPublishingUser(); + return GetAppServiceTenantMockingExtension(tenantResource).GetPublishingUser(); } - /// Gets a collection of AppServiceSourceControlResources in the TenantResource. + /// + /// Gets a collection of AppServiceSourceControlResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AppServiceSourceControlResources and their operations over a AppServiceSourceControlResource. public static AppServiceSourceControlCollection GetAppServiceSourceControls(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAppServiceSourceControls(); + return GetAppServiceTenantMockingExtension(tenantResource).GetAppServiceSourceControls(); } /// @@ -3987,16 +3974,20 @@ public static AppServiceSourceControlCollection GetAppServiceSourceControls(this /// GetSourceControl /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Type of source control. /// The cancellation token to use. - /// 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 static async Task> GetAppServiceSourceControlAsync(this TenantResource tenantResource, string sourceControlType, CancellationToken cancellationToken = default) { - return await tenantResource.GetAppServiceSourceControls().GetAsync(sourceControlType, cancellationToken).ConfigureAwait(false); + return await GetAppServiceTenantMockingExtension(tenantResource).GetAppServiceSourceControlAsync(sourceControlType, cancellationToken).ConfigureAwait(false); } /// @@ -4011,16 +4002,20 @@ public static async Task> GetAppServic /// GetSourceControl /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Type of source control. /// The cancellation token to use. - /// 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 static Response GetAppServiceSourceControl(this TenantResource tenantResource, string sourceControlType, CancellationToken cancellationToken = default) { - return tenantResource.GetAppServiceSourceControls().Get(sourceControlType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetAppServiceSourceControl(sourceControlType, cancellationToken); } /// @@ -4035,13 +4030,17 @@ public static Response GetAppServiceSourceContr /// CertificateRegistrationProvider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationsCertificateRegistrationProvidersAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsCertificateRegistrationProvidersAsync(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsCertificateRegistrationProvidersAsync(cancellationToken); } /// @@ -4056,13 +4055,17 @@ public static AsyncPageable GetOperationsCertificateReg /// CertificateRegistrationProvider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationsCertificateRegistrationProviders(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsCertificateRegistrationProviders(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsCertificateRegistrationProviders(cancellationToken); } /// @@ -4077,13 +4080,17 @@ public static Pageable GetOperationsCertificateRegistra /// DomainRegistrationProvider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationsDomainRegistrationProvidersAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsDomainRegistrationProvidersAsync(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsDomainRegistrationProvidersAsync(cancellationToken); } /// @@ -4098,13 +4105,17 @@ public static AsyncPageable GetOperationsDomainRegistra /// DomainRegistrationProvider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationsDomainRegistrationProviders(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsDomainRegistrationProviders(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsDomainRegistrationProviders(cancellationToken); } /// @@ -4119,6 +4130,10 @@ public static Pageable GetOperationsDomainRegistrationP /// Provider_GetAvailableStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ProviderOSTypeSelected to use. @@ -4126,7 +4141,7 @@ public static Pageable GetOperationsDomainRegistrationP /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableStacksProvidersAsync(this TenantResource tenantResource, ProviderOSTypeSelected? osTypeSelected = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetAvailableStacksProvidersAsync(osTypeSelected, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetAvailableStacksProvidersAsync(osTypeSelected, cancellationToken); } /// @@ -4141,6 +4156,10 @@ public static AsyncPageable GetAvailableStacksProvider /// Provider_GetAvailableStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The ProviderOSTypeSelected to use. @@ -4148,7 +4167,7 @@ public static AsyncPageable GetAvailableStacksProvider /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableStacksProviders(this TenantResource tenantResource, ProviderOSTypeSelected? osTypeSelected = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetAvailableStacksProviders(osTypeSelected, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetAvailableStacksProviders(osTypeSelected, cancellationToken); } /// @@ -4163,6 +4182,10 @@ public static Pageable GetAvailableStacksProviders(thi /// Provider_GetFunctionAppStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Stack OS Type. @@ -4170,7 +4193,7 @@ public static Pageable GetAvailableStacksProviders(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFunctionAppStacksProvidersAsync(this TenantResource tenantResource, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetFunctionAppStacksProvidersAsync(stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetFunctionAppStacksProvidersAsync(stackOSType, cancellationToken); } /// @@ -4185,6 +4208,10 @@ public static AsyncPageable GetFunctionAppStacksProvidersAsync /// Provider_GetFunctionAppStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Stack OS Type. @@ -4192,7 +4219,7 @@ public static AsyncPageable GetFunctionAppStacksProvidersAsync /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFunctionAppStacksProviders(this TenantResource tenantResource, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetFunctionAppStacksProviders(stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetFunctionAppStacksProviders(stackOSType, cancellationToken); } /// @@ -4207,6 +4234,10 @@ public static Pageable GetFunctionAppStacksProviders(this Tena /// Provider_GetFunctionAppStacksForLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Function App stack location. @@ -4215,7 +4246,7 @@ public static Pageable GetFunctionAppStacksProviders(this Tena /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFunctionAppStacksForLocationProvidersAsync(this TenantResource tenantResource, AzureLocation location, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetFunctionAppStacksForLocationProvidersAsync(location, stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetFunctionAppStacksForLocationProvidersAsync(location, stackOSType, cancellationToken); } /// @@ -4230,6 +4261,10 @@ public static AsyncPageable GetFunctionAppStacksForLocationPro /// Provider_GetFunctionAppStacksForLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Function App stack location. @@ -4238,7 +4273,7 @@ public static AsyncPageable GetFunctionAppStacksForLocationPro /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFunctionAppStacksForLocationProviders(this TenantResource tenantResource, AzureLocation location, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetFunctionAppStacksForLocationProviders(location, stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetFunctionAppStacksForLocationProviders(location, stackOSType, cancellationToken); } /// @@ -4253,6 +4288,10 @@ public static Pageable GetFunctionAppStacksForLocationProvider /// Provider_GetWebAppStacksForLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Web App stack location. @@ -4261,7 +4300,7 @@ public static Pageable GetFunctionAppStacksForLocationProvider /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebAppStacksByLocationAsync(this TenantResource tenantResource, AzureLocation location, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetWebAppStacksByLocationAsync(location, stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetWebAppStacksByLocationAsync(location, stackOSType, cancellationToken); } /// @@ -4276,6 +4315,10 @@ public static AsyncPageable GetWebAppStacksByLocationAsync(this Ten /// Provider_GetWebAppStacksForLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Web App stack location. @@ -4284,7 +4327,7 @@ public static AsyncPageable GetWebAppStacksByLocationAsync(this Ten /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebAppStacksByLocation(this TenantResource tenantResource, AzureLocation location, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetWebAppStacksByLocation(location, stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetWebAppStacksByLocation(location, stackOSType, cancellationToken); } /// @@ -4299,13 +4342,17 @@ public static Pageable GetWebAppStacksByLocation(this TenantResourc /// Provider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationsProvidersAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsProvidersAsync(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsProvidersAsync(cancellationToken); } /// @@ -4320,13 +4367,17 @@ public static AsyncPageable GetOperationsProvidersAsync /// Provider_ListOperations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationsProviders(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsProviders(cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetOperationsProviders(cancellationToken); } /// @@ -4341,6 +4392,10 @@ public static Pageable GetOperationsProviders(this Tena /// Provider_GetWebAppStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Stack OS Type. @@ -4348,7 +4403,7 @@ public static Pageable GetOperationsProviders(this Tena /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebAppStacksProvidersAsync(this TenantResource tenantResource, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetWebAppStacksProvidersAsync(stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetWebAppStacksProvidersAsync(stackOSType, cancellationToken); } /// @@ -4363,6 +4418,10 @@ public static AsyncPageable GetWebAppStacksProvidersAsync(this Tena /// Provider_GetWebAppStacks /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Stack OS Type. @@ -4370,7 +4429,7 @@ public static AsyncPageable GetWebAppStacksProvidersAsync(this Tena /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebAppStacksProviders(this TenantResource tenantResource, ProviderStackOSType? stackOSType = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetWebAppStacksProviders(stackOSType, cancellationToken); + return GetAppServiceTenantMockingExtension(tenantResource).GetWebAppStacksProviders(stackOSType, cancellationToken); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceResourceGroupMockingExtension.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..21b062eec1bc --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceResourceGroupMockingExtension.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AppServiceResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _resourceHealthMetadataClientDiagnostics; + private ResourceHealthMetadataRestOperations _resourceHealthMetadataRestClient; + private ClientDiagnostics _defaultClientDiagnostics; + private WebSiteManagementRestOperations _defaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected AppServiceResourceGroupMockingExtension() + { + } + + /// 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 AppServiceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ResourceHealthMetadataClientDiagnostics => _resourceHealthMetadataClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ResourceHealthMetadataRestOperations ResourceHealthMetadataRestClient => _resourceHealthMetadataRestClient ??= new ResourceHealthMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private WebSiteManagementRestOperations DefaultRestClient => _defaultRestClient ??= new WebSiteManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AppServiceCertificateOrderResources in the ResourceGroupResource. + /// An object representing collection of AppServiceCertificateOrderResources and their operations over a AppServiceCertificateOrderResource. + public virtual AppServiceCertificateOrderCollection GetAppServiceCertificateOrders() + { + return GetCachedClient(client => new AppServiceCertificateOrderCollection(client, Id)); + } + + /// + /// Description for Get a certificate order. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName} + /// + /// + /// Operation Id + /// AppServiceCertificateOrders_Get + /// + /// + /// + /// Name of the certificate order.. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppServiceCertificateOrderAsync(string certificateOrderName, CancellationToken cancellationToken = default) + { + return await GetAppServiceCertificateOrders().GetAsync(certificateOrderName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get a certificate order. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName} + /// + /// + /// Operation Id + /// AppServiceCertificateOrders_Get + /// + /// + /// + /// Name of the certificate order.. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppServiceCertificateOrder(string certificateOrderName, CancellationToken cancellationToken = default) + { + return GetAppServiceCertificateOrders().Get(certificateOrderName, cancellationToken); + } + + /// Gets a collection of AppServiceDomainResources in the ResourceGroupResource. + /// An object representing collection of AppServiceDomainResources and their operations over a AppServiceDomainResource. + public virtual AppServiceDomainCollection GetAppServiceDomains() + { + return GetCachedClient(client => new AppServiceDomainCollection(client, Id)); + } + + /// + /// Description for Get a domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName} + /// + /// + /// Operation Id + /// Domains_Get + /// + /// + /// + /// Name of the domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppServiceDomainAsync(string domainName, CancellationToken cancellationToken = default) + { + return await GetAppServiceDomains().GetAsync(domainName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get a domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName} + /// + /// + /// Operation Id + /// Domains_Get + /// + /// + /// + /// Name of the domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppServiceDomain(string domainName, CancellationToken cancellationToken = default) + { + return GetAppServiceDomains().Get(domainName, cancellationToken); + } + + /// Gets a collection of AppServiceEnvironmentResources in the ResourceGroupResource. + /// An object representing collection of AppServiceEnvironmentResources and their operations over a AppServiceEnvironmentResource. + public virtual AppServiceEnvironmentCollection GetAppServiceEnvironments() + { + return GetCachedClient(client => new AppServiceEnvironmentCollection(client, Id)); + } + + /// + /// Description for Get the properties of an App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name} + /// + /// + /// Operation Id + /// AppServiceEnvironments_Get + /// + /// + /// + /// Name of the App Service Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppServiceEnvironmentAsync(string name, CancellationToken cancellationToken = default) + { + return await GetAppServiceEnvironments().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get the properties of an App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name} + /// + /// + /// Operation Id + /// AppServiceEnvironments_Get + /// + /// + /// + /// Name of the App Service Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppServiceEnvironment(string name, CancellationToken cancellationToken = default) + { + return GetAppServiceEnvironments().Get(name, cancellationToken); + } + + /// Gets a collection of AppServicePlanResources in the ResourceGroupResource. + /// An object representing collection of AppServicePlanResources and their operations over a AppServicePlanResource. + public virtual AppServicePlanCollection GetAppServicePlans() + { + return GetCachedClient(client => new AppServicePlanCollection(client, Id)); + } + + /// + /// Description for Get an App Service plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name} + /// + /// + /// Operation Id + /// AppServicePlans_Get + /// + /// + /// + /// Name of the App Service plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppServicePlanAsync(string name, CancellationToken cancellationToken = default) + { + return await GetAppServicePlans().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get an App Service plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name} + /// + /// + /// Operation Id + /// AppServicePlans_Get + /// + /// + /// + /// Name of the App Service plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppServicePlan(string name, CancellationToken cancellationToken = default) + { + return GetAppServicePlans().Get(name, cancellationToken); + } + + /// Gets a collection of AppCertificateResources in the ResourceGroupResource. + /// An object representing collection of AppCertificateResources and their operations over a AppCertificateResource. + public virtual AppCertificateCollection GetAppCertificates() + { + return GetCachedClient(client => new AppCertificateCollection(client, Id)); + } + + /// + /// Description for Get a certificate. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name} + /// + /// + /// Operation Id + /// Certificates_Get + /// + /// + /// + /// Name of the certificate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppCertificateAsync(string name, CancellationToken cancellationToken = default) + { + return await GetAppCertificates().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get a certificate. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name} + /// + /// + /// Operation Id + /// Certificates_Get + /// + /// + /// + /// Name of the certificate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppCertificate(string name, CancellationToken cancellationToken = default) + { + return GetAppCertificates().Get(name, cancellationToken); + } + + /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. + /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. + public virtual KubeEnvironmentCollection GetKubeEnvironments() + { + return GetCachedClient(client => new KubeEnvironmentCollection(client, Id)); + } + + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name} + /// + /// + /// Operation Id + /// KubeEnvironments_Get + /// + /// + /// + /// Name of the Kubernetes Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetKubeEnvironmentAsync(string name, CancellationToken cancellationToken = default) + { + return await GetKubeEnvironments().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get the properties of a Kubernetes Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name} + /// + /// + /// Operation Id + /// KubeEnvironments_Get + /// + /// + /// + /// Name of the Kubernetes Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetKubeEnvironment(string name, CancellationToken cancellationToken = default) + { + return GetKubeEnvironments().Get(name, cancellationToken); + } + + /// Gets a collection of StaticSiteResources in the ResourceGroupResource. + /// An object representing collection of StaticSiteResources and their operations over a StaticSiteResource. + public virtual StaticSiteCollection GetStaticSites() + { + return GetCachedClient(client => new StaticSiteCollection(client, Id)); + } + + /// + /// Description for Gets the details of a static site. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name} + /// + /// + /// Operation Id + /// StaticSites_GetStaticSite + /// + /// + /// + /// Name of the static site. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetStaticSiteAsync(string name, CancellationToken cancellationToken = default) + { + return await GetStaticSites().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Gets the details of a static site. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name} + /// + /// + /// Operation Id + /// StaticSites_GetStaticSite + /// + /// + /// + /// Name of the static site. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetStaticSite(string name, CancellationToken cancellationToken = default) + { + return GetStaticSites().Get(name, cancellationToken); + } + + /// Gets a collection of WebSiteResources in the ResourceGroupResource. + /// An object representing collection of WebSiteResources and their operations over a WebSiteResource. + public virtual WebSiteCollection GetWebSites() + { + return GetCachedClient(client => new WebSiteCollection(client, Id)); + } + + /// + /// Description for Gets the details of a web, mobile, or API app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name} + /// + /// + /// Operation Id + /// WebApps_Get + /// + /// + /// + /// Name of the app. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebSiteAsync(string name, CancellationToken cancellationToken = default) + { + return await GetWebSites().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Gets the details of a web, mobile, or API app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name} + /// + /// + /// Operation Id + /// WebApps_Get + /// + /// + /// + /// Name of the app. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebSite(string name, CancellationToken cancellationToken = default) + { + return GetWebSites().Get(name, cancellationToken); + } + + /// + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata + /// + /// + /// Operation Id + /// ResourceHealthMetadata_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllResourceHealthMetadataDataAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceHealthMetadataRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceHealthMetadataRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "AppServiceResourceGroupMockingExtension.GetAllResourceHealthMetadataData", "value", "nextLink", cancellationToken); + } + + /// + /// Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata + /// + /// + /// Operation Id + /// ResourceHealthMetadata_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllResourceHealthMetadataData(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceHealthMetadataRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceHealthMetadataRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "AppServiceResourceGroupMockingExtension.GetAllResourceHealthMetadataData", "value", "nextLink", cancellationToken); + } + + /// + /// Description for Validate if a resource can be created. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate + /// + /// + /// Operation Id + /// Validate + /// + /// + /// + /// Request with the resources to validate. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateAsync(AppServiceValidateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceResourceGroupMockingExtension.Validate"); + scope.Start(); + try + { + var response = await DefaultRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Validate if a resource can be created. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate + /// + /// + /// Operation Id + /// Validate + /// + /// + /// + /// Request with the resources to validate. + /// The cancellation token to use. + /// is null. + public virtual Response Validate(AppServiceValidateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceResourceGroupMockingExtension.Validate"); + scope.Start(); + try + { + var response = DefaultRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceSubscriptionMockingExtension.cs similarity index 82% rename from sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceSubscriptionMockingExtension.cs index 46d254760391..94cebb8a1d88 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.AppService.Models; -namespace Azure.ResourceManager.AppService +namespace Azure.ResourceManager.AppService.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AppServiceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _appServiceCertificateOrderClientDiagnostics; private AppServiceCertificateOrdersRestOperations _appServiceCertificateOrderRestClient; @@ -53,15 +54,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _webSiteWebAppsClientDiagnostics; private WebAppsRestOperations _webSiteWebAppsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppServiceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppServiceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -108,14 +109,106 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of TopLevelDomainResources and their operations over a TopLevelDomainResource. public virtual TopLevelDomainCollection GetTopLevelDomains() { - return GetCachedClient(Client => new TopLevelDomainCollection(Client, Id)); + return GetCachedClient(client => new TopLevelDomainCollection(client, Id)); + } + + /// + /// Description for Get details of a top-level domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name} + /// + /// + /// Operation Id + /// TopLevelDomains_Get + /// + /// + /// + /// Name of the top-level domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTopLevelDomainAsync(string name, CancellationToken cancellationToken = default) + { + return await GetTopLevelDomains().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get details of a top-level domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name} + /// + /// + /// Operation Id + /// TopLevelDomains_Get + /// + /// + /// + /// Name of the top-level domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTopLevelDomain(string name, CancellationToken cancellationToken = default) + { + return GetTopLevelDomains().Get(name, cancellationToken); } /// Gets a collection of DeletedSiteResources in the SubscriptionResource. /// An object representing collection of DeletedSiteResources and their operations over a DeletedSiteResource. public virtual DeletedSiteCollection GetDeletedSites() { - return GetCachedClient(Client => new DeletedSiteCollection(Client, Id)); + return GetCachedClient(client => new DeletedSiteCollection(client, Id)); + } + + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + /// + /// + /// Operation Id + /// Global_GetDeletedWebApp + /// + /// + /// + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedSiteAsync(string deletedSiteId, CancellationToken cancellationToken = default) + { + return await GetDeletedSites().GetAsync(deletedSiteId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Get deleted app for a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + /// + /// + /// Operation Id + /// Global_GetDeletedWebApp + /// + /// + /// + /// The numeric ID of the deleted app, e.g. 12345. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedSite(string deletedSiteId, CancellationToken cancellationToken = default) + { + return GetDeletedSites().Get(deletedSiteId, cancellationToken); } /// @@ -137,7 +230,7 @@ public virtual AsyncPageable GetAppServiceCe { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceCertificateOrderRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceCertificateOrderRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceCertificateOrderResource(Client, AppServiceCertificateOrderData.DeserializeAppServiceCertificateOrderData(e)), AppServiceCertificateOrderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceCertificateOrders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceCertificateOrderResource(Client, AppServiceCertificateOrderData.DeserializeAppServiceCertificateOrderData(e)), AppServiceCertificateOrderClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceCertificateOrders", "value", "nextLink", cancellationToken); } /// @@ -159,7 +252,7 @@ public virtual Pageable GetAppServiceCertifi { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceCertificateOrderRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceCertificateOrderRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceCertificateOrderResource(Client, AppServiceCertificateOrderData.DeserializeAppServiceCertificateOrderData(e)), AppServiceCertificateOrderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceCertificateOrders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceCertificateOrderResource(Client, AppServiceCertificateOrderData.DeserializeAppServiceCertificateOrderData(e)), AppServiceCertificateOrderClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceCertificateOrders", "value", "nextLink", cancellationToken); } /// @@ -177,9 +270,12 @@ public virtual Pageable GetAppServiceCertifi /// /// Information for a certificate order. /// The cancellation token to use. + /// is null. public virtual async Task ValidateAppServiceCertificateOrderPurchaseInformationAsync(AppServiceCertificateOrderData data, CancellationToken cancellationToken = default) { - using var scope = AppServiceCertificateOrdersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateAppServiceCertificateOrderPurchaseInformation"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = AppServiceCertificateOrdersClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.ValidateAppServiceCertificateOrderPurchaseInformation"); scope.Start(); try { @@ -208,9 +304,12 @@ public virtual async Task ValidateAppServiceCertificateOrderPurchaseIn /// /// Information for a certificate order. /// The cancellation token to use. + /// is null. public virtual Response ValidateAppServiceCertificateOrderPurchaseInformation(AppServiceCertificateOrderData data, CancellationToken cancellationToken = default) { - using var scope = AppServiceCertificateOrdersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateAppServiceCertificateOrderPurchaseInformation"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = AppServiceCertificateOrdersClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.ValidateAppServiceCertificateOrderPurchaseInformation"); scope.Start(); try { @@ -239,9 +338,12 @@ public virtual Response ValidateAppServiceCertificateOrderPurchaseInformation(Ap /// /// Name of the domain. /// The cancellation token to use. + /// is null. public virtual async Task> CheckAppServiceDomainRegistrationAvailabilityAsync(AppServiceDomainNameIdentifier identifier, CancellationToken cancellationToken = default) { - using var scope = DomainsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppServiceDomainRegistrationAvailability"); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = DomainsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.CheckAppServiceDomainRegistrationAvailability"); scope.Start(); try { @@ -270,9 +372,12 @@ public virtual async Task> CheckAppServi /// /// Name of the domain. /// The cancellation token to use. + /// is null. public virtual Response CheckAppServiceDomainRegistrationAvailability(AppServiceDomainNameIdentifier identifier, CancellationToken cancellationToken = default) { - using var scope = DomainsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppServiceDomainRegistrationAvailability"); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = DomainsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.CheckAppServiceDomainRegistrationAvailability"); scope.Start(); try { @@ -305,7 +410,7 @@ public virtual AsyncPageable GetAppServiceDomainsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceDomainDomainsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceDomainDomainsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceDomainResource(Client, AppServiceDomainData.DeserializeAppServiceDomainData(e)), AppServiceDomainDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceDomainResource(Client, AppServiceDomainData.DeserializeAppServiceDomainData(e)), AppServiceDomainDomainsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceDomains", "value", "nextLink", cancellationToken); } /// @@ -327,7 +432,7 @@ public virtual Pageable GetAppServiceDomains(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceDomainDomainsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceDomainDomainsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceDomainResource(Client, AppServiceDomainData.DeserializeAppServiceDomainData(e)), AppServiceDomainDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceDomainResource(Client, AppServiceDomainData.DeserializeAppServiceDomainData(e)), AppServiceDomainDomainsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceDomains", "value", "nextLink", cancellationToken); } /// @@ -346,7 +451,7 @@ public virtual Pageable GetAppServiceDomains(Cancellat /// The cancellation token to use. public virtual async Task> GetControlCenterSsoRequestDomainAsync(CancellationToken cancellationToken = default) { - using var scope = DomainsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetControlCenterSsoRequestDomain"); + using var scope = DomainsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetControlCenterSsoRequestDomain"); scope.Start(); try { @@ -376,7 +481,7 @@ public virtual async Task> GetContro /// The cancellation token to use. public virtual Response GetControlCenterSsoRequestDomain(CancellationToken cancellationToken = default) { - using var scope = DomainsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetControlCenterSsoRequestDomain"); + using var scope = DomainsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetControlCenterSsoRequestDomain"); scope.Start(); try { @@ -405,12 +510,15 @@ public virtual Response GetControlCenterSsoRe /// /// Search parameters for domain name recommendations. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAppServiceDomainRecommendationsAsync(DomainRecommendationSearchContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DomainsRestClient.CreateListRecommendationsRequest(Id.SubscriptionId, content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DomainsRestClient.CreateListRecommendationsNextPageRequest(nextLink, Id.SubscriptionId, content); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceDomainNameIdentifier.DeserializeAppServiceDomainNameIdentifier, DomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceDomainRecommendations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceDomainNameIdentifier.DeserializeAppServiceDomainNameIdentifier, DomainsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceDomainRecommendations", "value", "nextLink", cancellationToken); } /// @@ -428,12 +536,15 @@ public virtual AsyncPageable GetAppServiceDomain /// /// Search parameters for domain name recommendations. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAppServiceDomainRecommendations(DomainRecommendationSearchContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DomainsRestClient.CreateListRecommendationsRequest(Id.SubscriptionId, content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DomainsRestClient.CreateListRecommendationsNextPageRequest(nextLink, Id.SubscriptionId, content); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceDomainNameIdentifier.DeserializeAppServiceDomainNameIdentifier, DomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceDomainRecommendations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceDomainNameIdentifier.DeserializeAppServiceDomainNameIdentifier, DomainsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceDomainRecommendations", "value", "nextLink", cancellationToken); } /// @@ -455,7 +566,7 @@ public virtual AsyncPageable GetAppServiceEnviron { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceEnvironmentRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceEnvironmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceEnvironmentResource(Client, AppServiceEnvironmentData.DeserializeAppServiceEnvironmentData(e)), AppServiceEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServiceEnvironmentResource(Client, AppServiceEnvironmentData.DeserializeAppServiceEnvironmentData(e)), AppServiceEnvironmentClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceEnvironments", "value", "nextLink", cancellationToken); } /// @@ -477,7 +588,7 @@ public virtual Pageable GetAppServiceEnvironments { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServiceEnvironmentRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServiceEnvironmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceEnvironmentResource(Client, AppServiceEnvironmentData.DeserializeAppServiceEnvironmentData(e)), AppServiceEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServiceEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServiceEnvironmentResource(Client, AppServiceEnvironmentData.DeserializeAppServiceEnvironmentData(e)), AppServiceEnvironmentClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServiceEnvironments", "value", "nextLink", cancellationToken); } /// @@ -503,7 +614,7 @@ public virtual AsyncPageable GetAppServicePlansAsync(boo { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServicePlanRestClient.CreateListRequest(Id.SubscriptionId, detailed); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServicePlanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, detailed); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServicePlanResource(Client, AppServicePlanData.DeserializeAppServicePlanData(e)), AppServicePlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServicePlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppServicePlanResource(Client, AppServicePlanData.DeserializeAppServicePlanData(e)), AppServicePlanClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServicePlans", "value", "nextLink", cancellationToken); } /// @@ -529,7 +640,7 @@ public virtual Pageable GetAppServicePlans(bool? detaile { HttpMessage FirstPageRequest(int? pageSizeHint) => AppServicePlanRestClient.CreateListRequest(Id.SubscriptionId, detailed); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppServicePlanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, detailed); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServicePlanResource(Client, AppServicePlanData.DeserializeAppServicePlanData(e)), AppServicePlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppServicePlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppServicePlanResource(Client, AppServicePlanData.DeserializeAppServicePlanData(e)), AppServicePlanClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppServicePlans", "value", "nextLink", cancellationToken); } /// @@ -552,7 +663,7 @@ public virtual AsyncPageable GetAppCertificatesAsync(str { HttpMessage FirstPageRequest(int? pageSizeHint) => AppCertificateCertificatesRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppCertificateCertificatesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppCertificates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppCertificates", "value", "nextLink", cancellationToken); } /// @@ -575,7 +686,7 @@ public virtual Pageable GetAppCertificates(string filter { HttpMessage FirstPageRequest(int? pageSizeHint) => AppCertificateCertificatesRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AppCertificateCertificatesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppCertificates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAppCertificates", "value", "nextLink", cancellationToken); } /// @@ -598,7 +709,7 @@ public virtual AsyncPageable GetDeletedSitesByLocationAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedSiteDeletedWebAppsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedSiteDeletedWebAppsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedSiteResource(Client, DeletedSiteData.DeserializeDeletedSiteData(e)), DeletedSiteDeletedWebAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedSitesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedSiteResource(Client, DeletedSiteData.DeserializeDeletedSiteData(e)), DeletedSiteDeletedWebAppsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetDeletedSitesByLocation", "value", "nextLink", cancellationToken); } /// @@ -621,7 +732,7 @@ public virtual Pageable GetDeletedSitesByLocation(AzureLoca { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedSiteDeletedWebAppsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedSiteDeletedWebAppsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedSiteResource(Client, DeletedSiteData.DeserializeDeletedSiteData(e)), DeletedSiteDeletedWebAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedSitesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedSiteResource(Client, DeletedSiteData.DeserializeDeletedSiteData(e)), DeletedSiteDeletedWebAppsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetDeletedSitesByLocation", "value", "nextLink", cancellationToken); } /// @@ -640,9 +751,13 @@ public virtual Pageable GetDeletedSitesByLocation(AzureLoca /// The String to use. /// The numeric ID of the deleted app, e.g. 12345. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetDeletedWebAppByLocationDeletedWebAppAsync(AzureLocation location, string deletedSiteId, CancellationToken cancellationToken = default) { - using var scope = DeletedSiteDeletedWebAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedWebAppByLocationDeletedWebApp"); + Argument.AssertNotNullOrEmpty(deletedSiteId, nameof(deletedSiteId)); + + using var scope = DeletedSiteDeletedWebAppsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetDeletedWebAppByLocationDeletedWebApp"); scope.Start(); try { @@ -672,9 +787,13 @@ public virtual async Task> GetDeletedWebAppByLocat /// The String to use. /// The numeric ID of the deleted app, e.g. 12345. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetDeletedWebAppByLocationDeletedWebApp(AzureLocation location, string deletedSiteId, CancellationToken cancellationToken = default) { - using var scope = DeletedSiteDeletedWebAppsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDeletedWebAppByLocationDeletedWebApp"); + Argument.AssertNotNullOrEmpty(deletedSiteId, nameof(deletedSiteId)); + + using var scope = DeletedSiteDeletedWebAppsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetDeletedWebAppByLocationDeletedWebApp"); scope.Start(); try { @@ -707,7 +826,7 @@ public virtual AsyncPageable GetKubeEnvironmentsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => KubeEnvironmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => KubeEnvironmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new KubeEnvironmentResource(Client, KubeEnvironmentData.DeserializeKubeEnvironmentData(e)), KubeEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKubeEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new KubeEnvironmentResource(Client, KubeEnvironmentData.DeserializeKubeEnvironmentData(e)), KubeEnvironmentClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetKubeEnvironments", "value", "nextLink", cancellationToken); } /// @@ -729,7 +848,7 @@ public virtual Pageable GetKubeEnvironments(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => KubeEnvironmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => KubeEnvironmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new KubeEnvironmentResource(Client, KubeEnvironmentData.DeserializeKubeEnvironmentData(e)), KubeEnvironmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetKubeEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new KubeEnvironmentResource(Client, KubeEnvironmentData.DeserializeKubeEnvironmentData(e)), KubeEnvironmentClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetKubeEnvironments", "value", "nextLink", cancellationToken); } /// @@ -752,7 +871,7 @@ public virtual AsyncPageable GetAvailableStacksOnPremP { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetAvailableStacksOnPremRequest(Id.SubscriptionId, osTypeSelected); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetAvailableStacksOnPremNextPageRequest(nextLink, Id.SubscriptionId, osTypeSelected); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableStacksOnPremProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAvailableStacksOnPremProviders", "value", "nextLink", cancellationToken); } /// @@ -775,7 +894,7 @@ public virtual Pageable GetAvailableStacksOnPremProvid { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetAvailableStacksOnPremRequest(Id.SubscriptionId, osTypeSelected); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetAvailableStacksOnPremNextPageRequest(nextLink, Id.SubscriptionId, osTypeSelected); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableStacksOnPremProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAvailableStacksOnPremProviders", "value", "nextLink", cancellationToken); } /// @@ -799,7 +918,7 @@ public virtual AsyncPageable GetRecommendationsAsync(b { HttpMessage FirstPageRequest(int? pageSizeHint) => RecommendationsRestClient.CreateListRequest(Id.SubscriptionId, featured, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RecommendationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, featured, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceRecommendation.DeserializeAppServiceRecommendation, RecommendationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRecommendations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceRecommendation.DeserializeAppServiceRecommendation, RecommendationsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetRecommendations", "value", "nextLink", cancellationToken); } /// @@ -823,7 +942,7 @@ public virtual Pageable GetRecommendations(bool? featu { HttpMessage FirstPageRequest(int? pageSizeHint) => RecommendationsRestClient.CreateListRequest(Id.SubscriptionId, featured, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RecommendationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, featured, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceRecommendation.DeserializeAppServiceRecommendation, RecommendationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRecommendations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceRecommendation.DeserializeAppServiceRecommendation, RecommendationsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetRecommendations", "value", "nextLink", cancellationToken); } /// @@ -842,7 +961,7 @@ public virtual Pageable GetRecommendations(bool? featu /// The cancellation token to use. public virtual async Task ResetAllRecommendationFiltersAsync(CancellationToken cancellationToken = default) { - using var scope = RecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ResetAllRecommendationFilters"); + using var scope = RecommendationsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.ResetAllRecommendationFilters"); scope.Start(); try { @@ -872,7 +991,7 @@ public virtual async Task ResetAllRecommendationFiltersAsync(Cancellat /// The cancellation token to use. public virtual Response ResetAllRecommendationFilters(CancellationToken cancellationToken = default) { - using var scope = RecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ResetAllRecommendationFilters"); + using var scope = RecommendationsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.ResetAllRecommendationFilters"); scope.Start(); try { @@ -901,9 +1020,13 @@ public virtual Response ResetAllRecommendationFilters(CancellationToken cancella /// /// Rule name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task DisableAppServiceRecommendationAsync(string name, CancellationToken cancellationToken = default) { - using var scope = RecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DisableAppServiceRecommendation"); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = RecommendationsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.DisableAppServiceRecommendation"); scope.Start(); try { @@ -932,9 +1055,13 @@ public virtual async Task DisableAppServiceRecommendationAsync(string /// /// Rule name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response DisableAppServiceRecommendation(string name, CancellationToken cancellationToken = default) { - using var scope = RecommendationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.DisableAppServiceRecommendation"); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = RecommendationsClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.DisableAppServiceRecommendation"); scope.Start(); try { @@ -967,7 +1094,7 @@ public virtual AsyncPageable GetAllResourceHealthMet { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceHealthMetadataRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceHealthMetadataRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllResourceHealthMetadata", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAllResourceHealthMetadata", "value", "nextLink", cancellationToken); } /// @@ -989,7 +1116,7 @@ public virtual Pageable GetAllResourceHealthMetadata { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceHealthMetadataRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceHealthMetadataRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllResourceHealthMetadata", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthMetadataData.DeserializeResourceHealthMetadataData, ResourceHealthMetadataClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAllResourceHealthMetadata", "value", "nextLink", cancellationToken); } /// @@ -1013,7 +1140,7 @@ public virtual AsyncPageable GetBillingMetersAsync(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListBillingMetersRequest(Id.SubscriptionId, billingLocation, osType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListBillingMetersNextPageRequest(nextLink, Id.SubscriptionId, billingLocation, osType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceBillingMeter.DeserializeAppServiceBillingMeter, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBillingMeters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceBillingMeter.DeserializeAppServiceBillingMeter, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetBillingMeters", "value", "nextLink", cancellationToken); } /// @@ -1037,7 +1164,7 @@ public virtual Pageable GetBillingMeters(string billingL { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListBillingMetersRequest(Id.SubscriptionId, billingLocation, osType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListBillingMetersNextPageRequest(nextLink, Id.SubscriptionId, billingLocation, osType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceBillingMeter.DeserializeAppServiceBillingMeter, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBillingMeters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceBillingMeter.DeserializeAppServiceBillingMeter, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetBillingMeters", "value", "nextLink", cancellationToken); } /// @@ -1055,9 +1182,12 @@ public virtual Pageable GetBillingMeters(string billingL /// /// Name availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckAppServiceNameAvailabilityAsync(ResourceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.CheckAppServiceNameAvailability"); scope.Start(); try { @@ -1086,9 +1216,12 @@ public virtual async Task> CheckAppServiceNam /// /// Name availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckAppServiceNameAvailability(ResourceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckAppServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.CheckAppServiceNameAvailability"); scope.Start(); try { @@ -1118,7 +1251,7 @@ public virtual Response CheckAppServiceNameAvailabilit /// The cancellation token to use. public virtual async Task> GetAppServiceDeploymentLocationsAsync(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAppServiceDeploymentLocations"); + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetAppServiceDeploymentLocations"); scope.Start(); try { @@ -1148,7 +1281,7 @@ public virtual async Task> GetAppService /// The cancellation token to use. public virtual Response GetAppServiceDeploymentLocations(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAppServiceDeploymentLocations"); + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetAppServiceDeploymentLocations"); scope.Start(); try { @@ -1185,7 +1318,7 @@ public virtual AsyncPageable GetGeoRegionsAsync(AppServiceS { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListGeoRegionsRequest(Id.SubscriptionId, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListGeoRegionsNextPageRequest(nextLink, Id.SubscriptionId, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceGeoRegion.DeserializeAppServiceGeoRegion, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGeoRegions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceGeoRegion.DeserializeAppServiceGeoRegion, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetGeoRegions", "value", "nextLink", cancellationToken); } /// @@ -1211,7 +1344,59 @@ public virtual Pageable GetGeoRegions(AppServiceSkuName? sk { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListGeoRegionsRequest(Id.SubscriptionId, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListGeoRegionsNextPageRequest(nextLink, Id.SubscriptionId, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceGeoRegion.DeserializeAppServiceGeoRegion, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGeoRegions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceGeoRegion.DeserializeAppServiceGeoRegion, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetGeoRegions", "value", "nextLink", cancellationToken); + } + + /// + /// Description for List all apps that are assigned to a hostname. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName + /// + /// + /// Operation Id + /// ListSiteIdentifiersAssignedToHostName + /// + /// + /// + /// Hostname information. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllSiteIdentifierDataAsync(AppServiceDomainNameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nameIdentifier, nameof(nameIdentifier)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListSiteIdentifiersAssignedToHostNameRequest(Id.SubscriptionId, nameIdentifier); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, Id.SubscriptionId, nameIdentifier); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AppServiceIdentifierData.DeserializeAppServiceIdentifierData, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAllSiteIdentifierData", "value", "nextLink", cancellationToken); + } + + /// + /// Description for List all apps that are assigned to a hostname. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName + /// + /// + /// Operation Id + /// ListSiteIdentifiersAssignedToHostName + /// + /// + /// + /// Hostname information. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllSiteIdentifierData(AppServiceDomainNameIdentifier nameIdentifier, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nameIdentifier, nameof(nameIdentifier)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListSiteIdentifiersAssignedToHostNameRequest(Id.SubscriptionId, nameIdentifier); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListSiteIdentifiersAssignedToHostNameNextPageRequest(nextLink, Id.SubscriptionId, nameIdentifier); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AppServiceIdentifierData.DeserializeAppServiceIdentifierData, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetAllSiteIdentifierData", "value", "nextLink", cancellationToken); } /// @@ -1233,7 +1418,7 @@ public virtual AsyncPageable GetPremierAddOnOffersAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListPremierAddOnOffersRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListPremierAddOnOffersNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PremierAddOnOffer.DeserializePremierAddOnOffer, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPremierAddOnOffers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PremierAddOnOffer.DeserializePremierAddOnOffer, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetPremierAddOnOffers", "value", "nextLink", cancellationToken); } /// @@ -1255,7 +1440,7 @@ public virtual Pageable GetPremierAddOnOffers(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListPremierAddOnOffersRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListPremierAddOnOffersNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PremierAddOnOffer.DeserializePremierAddOnOffer, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPremierAddOnOffers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PremierAddOnOffer.DeserializePremierAddOnOffer, DefaultClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetPremierAddOnOffers", "value", "nextLink", cancellationToken); } /// @@ -1274,7 +1459,7 @@ public virtual Pageable GetPremierAddOnOffers(CancellationTok /// The cancellation token to use. public virtual async Task> GetSkusAsync(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetSkus"); + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetSkus"); scope.Start(); try { @@ -1304,7 +1489,7 @@ public virtual async Task> GetSkusAsync(Cancellati /// The cancellation token to use. public virtual Response GetSkus(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetSkus"); + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.GetSkus"); scope.Start(); try { @@ -1333,9 +1518,12 @@ public virtual Response GetSkus(CancellationToken cancellat /// /// VNET information. /// The cancellation token to use. + /// is null. public virtual async Task> VerifyHostingEnvironmentVnetAsync(AppServiceVirtualNetworkValidationContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.VerifyHostingEnvironmentVnet"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.VerifyHostingEnvironmentVnet"); scope.Start(); try { @@ -1364,9 +1552,12 @@ public virtual async Task> Veri /// /// VNET information. /// The cancellation token to use. + /// is null. public virtual Response VerifyHostingEnvironmentVnet(AppServiceVirtualNetworkValidationContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.VerifyHostingEnvironmentVnet"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.VerifyHostingEnvironmentVnet"); scope.Start(); try { @@ -1396,9 +1587,12 @@ public virtual Response VerifyHostingEnv /// Location where you plan to create the static site. /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. /// The cancellation token to use. + /// is null. public virtual async Task> PreviewStaticSiteWorkflowAsync(AzureLocation location, StaticSitesWorkflowPreviewContent content, CancellationToken cancellationToken = default) { - using var scope = StaticSitesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.PreviewStaticSiteWorkflow"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StaticSitesClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.PreviewStaticSiteWorkflow"); scope.Start(); try { @@ -1428,9 +1622,12 @@ public virtual async Task> PreviewStaticSit /// Location where you plan to create the static site. /// A JSON representation of the StaticSitesWorkflowPreviewRequest properties. See example. /// The cancellation token to use. + /// is null. public virtual Response PreviewStaticSiteWorkflow(AzureLocation location, StaticSitesWorkflowPreviewContent content, CancellationToken cancellationToken = default) { - using var scope = StaticSitesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.PreviewStaticSiteWorkflow"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = StaticSitesClientDiagnostics.CreateScope("AppServiceSubscriptionMockingExtension.PreviewStaticSiteWorkflow"); scope.Start(); try { @@ -1463,7 +1660,7 @@ public virtual AsyncPageable GetStaticSitesAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => StaticSiteRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StaticSiteRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StaticSiteResource(Client, StaticSiteData.DeserializeStaticSiteData(e)), StaticSiteClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStaticSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StaticSiteResource(Client, StaticSiteData.DeserializeStaticSiteData(e)), StaticSiteClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetStaticSites", "value", "nextLink", cancellationToken); } /// @@ -1485,7 +1682,7 @@ public virtual Pageable GetStaticSites(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => StaticSiteRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StaticSiteRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StaticSiteResource(Client, StaticSiteData.DeserializeStaticSiteData(e)), StaticSiteClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStaticSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StaticSiteResource(Client, StaticSiteData.DeserializeStaticSiteData(e)), StaticSiteClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetStaticSites", "value", "nextLink", cancellationToken); } /// @@ -1507,7 +1704,7 @@ public virtual AsyncPageable GetWebSitesAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => WebSiteWebAppsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebSiteWebAppsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebSiteResource(Client, WebSiteData.DeserializeWebSiteData(e)), WebSiteWebAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebSiteResource(Client, WebSiteData.DeserializeWebSiteData(e)), WebSiteWebAppsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetWebSites", "value", "nextLink", cancellationToken); } /// @@ -1529,7 +1726,7 @@ public virtual Pageable GetWebSites(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => WebSiteWebAppsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebSiteWebAppsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebSiteResource(Client, WebSiteData.DeserializeWebSiteData(e)), WebSiteWebAppsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebSiteResource(Client, WebSiteData.DeserializeWebSiteData(e)), WebSiteWebAppsClientDiagnostics, Pipeline, "AppServiceSubscriptionMockingExtension.GetWebSites", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceTenantMockingExtension.cs similarity index 84% rename from sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceTenantMockingExtension.cs index 8cf7bd48db70..db12381ea609 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceTenantMockingExtension.cs @@ -5,18 +5,21 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.AppService.Models; -namespace Azure.ResourceManager.AppService +namespace Azure.ResourceManager.AppService.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class AppServiceTenantMockingExtension : ArmResource { private ClientDiagnostics _certificateRegistrationProviderClientDiagnostics; private CertificateRegistrationProviderRestOperations _certificateRegistrationProviderRestClient; @@ -25,15 +28,15 @@ internal partial class TenantResourceExtensionClient : ArmResource private ClientDiagnostics _providerClientDiagnostics; private ProviderRestOperations _providerRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppServiceTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppServiceTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +64,53 @@ public virtual PublishingUserResource GetPublishingUser() /// An object representing collection of AppServiceSourceControlResources and their operations over a AppServiceSourceControlResource. public virtual AppServiceSourceControlCollection GetAppServiceSourceControls() { - return GetCachedClient(Client => new AppServiceSourceControlCollection(Client, Id)); + return GetCachedClient(client => new AppServiceSourceControlCollection(client, Id)); + } + + /// + /// Description for Gets source control token + /// + /// + /// Request Path + /// /providers/Microsoft.Web/sourcecontrols/{sourceControlType} + /// + /// + /// Operation Id + /// GetSourceControl + /// + /// + /// + /// Type of source control. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppServiceSourceControlAsync(string sourceControlType, CancellationToken cancellationToken = default) + { + return await GetAppServiceSourceControls().GetAsync(sourceControlType, cancellationToken).ConfigureAwait(false); + } + + /// + /// Description for Gets source control token + /// + /// + /// Request Path + /// /providers/Microsoft.Web/sourcecontrols/{sourceControlType} + /// + /// + /// Operation Id + /// GetSourceControl + /// + /// + /// + /// Type of source control. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppServiceSourceControl(string sourceControlType, CancellationToken cancellationToken = default) + { + return GetAppServiceSourceControls().Get(sourceControlType, cancellationToken); } /// @@ -83,7 +132,7 @@ public virtual AsyncPageable GetOperationsCertificateRe { HttpMessage FirstPageRequest(int? pageSizeHint) => CertificateRegistrationProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CertificateRegistrationProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, CertificateRegistrationProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsCertificateRegistrationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, CertificateRegistrationProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsCertificateRegistrationProviders", "value", "nextLink", cancellationToken); } /// @@ -105,7 +154,7 @@ public virtual Pageable GetOperationsCertificateRegistr { HttpMessage FirstPageRequest(int? pageSizeHint) => CertificateRegistrationProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CertificateRegistrationProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, CertificateRegistrationProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsCertificateRegistrationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, CertificateRegistrationProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsCertificateRegistrationProviders", "value", "nextLink", cancellationToken); } /// @@ -127,7 +176,7 @@ public virtual AsyncPageable GetOperationsDomainRegistr { HttpMessage FirstPageRequest(int? pageSizeHint) => DomainRegistrationProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DomainRegistrationProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, DomainRegistrationProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsDomainRegistrationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, DomainRegistrationProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsDomainRegistrationProviders", "value", "nextLink", cancellationToken); } /// @@ -149,7 +198,7 @@ public virtual Pageable GetOperationsDomainRegistration { HttpMessage FirstPageRequest(int? pageSizeHint) => DomainRegistrationProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DomainRegistrationProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, DomainRegistrationProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsDomainRegistrationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, DomainRegistrationProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsDomainRegistrationProviders", "value", "nextLink", cancellationToken); } /// @@ -172,7 +221,7 @@ public virtual AsyncPageable GetAvailableStacksProvide { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetAvailableStacksRequest(osTypeSelected); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetAvailableStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetAvailableStacksProviders", "value", "nextLink", cancellationToken); } /// @@ -195,7 +244,7 @@ public virtual Pageable GetAvailableStacksProviders(Pr { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetAvailableStacksRequest(osTypeSelected); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetAvailableStacksNextPageRequest(nextLink, osTypeSelected); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetAvailableStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationStackResource.DeserializeApplicationStackResource, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetAvailableStacksProviders", "value", "nextLink", cancellationToken); } /// @@ -218,7 +267,7 @@ public virtual AsyncPageable GetFunctionAppStacksProvidersAsyn { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetFunctionAppStacksRequest(stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOSType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetFunctionAppStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetFunctionAppStacksProviders", "value", "nextLink", cancellationToken); } /// @@ -241,7 +290,7 @@ public virtual Pageable GetFunctionAppStacksProviders(Provider { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetFunctionAppStacksRequest(stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetFunctionAppStacksNextPageRequest(nextLink, stackOSType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetFunctionAppStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetFunctionAppStacksProviders", "value", "nextLink", cancellationToken); } /// @@ -265,7 +314,7 @@ public virtual AsyncPageable GetFunctionAppStacksForLocationPr { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetFunctionAppStacksForLocationRequest(location, stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOSType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetFunctionAppStacksForLocationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetFunctionAppStacksForLocationProviders", "value", "nextLink", cancellationToken); } /// @@ -289,7 +338,7 @@ public virtual Pageable GetFunctionAppStacksForLocationProvide { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetFunctionAppStacksForLocationRequest(location, stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetFunctionAppStacksForLocationNextPageRequest(nextLink, location, stackOSType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetFunctionAppStacksForLocationProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, FunctionAppStack.DeserializeFunctionAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetFunctionAppStacksForLocationProviders", "value", "nextLink", cancellationToken); } /// @@ -313,7 +362,7 @@ public virtual AsyncPageable GetWebAppStacksByLocationAsync(AzureLo { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetWebAppStacksForLocationRequest(location, stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOSType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetWebAppStacksByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetWebAppStacksByLocation", "value", "nextLink", cancellationToken); } /// @@ -337,7 +386,7 @@ public virtual Pageable GetWebAppStacksByLocation(AzureLocation loc { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetWebAppStacksForLocationRequest(location, stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetWebAppStacksForLocationNextPageRequest(nextLink, location, stackOSType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetWebAppStacksByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetWebAppStacksByLocation", "value", "nextLink", cancellationToken); } /// @@ -359,7 +408,7 @@ public virtual AsyncPageable GetOperationsProvidersAsyn { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsProviders", "value", "nextLink", cancellationToken); } /// @@ -381,7 +430,7 @@ public virtual Pageable GetOperationsProviders(Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateListOperationsRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateListOperationsNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmOperationDescription.DeserializeCsmOperationDescription, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetOperationsProviders", "value", "nextLink", cancellationToken); } /// @@ -404,7 +453,7 @@ public virtual AsyncPageable GetWebAppStacksProvidersAsync(Provider { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetWebAppStacksRequest(stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetWebAppStacksNextPageRequest(nextLink, stackOSType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetWebAppStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetWebAppStacksProviders", "value", "nextLink", cancellationToken); } /// @@ -427,7 +476,7 @@ public virtual Pageable GetWebAppStacksProviders(ProviderStackOSTyp { HttpMessage FirstPageRequest(int? pageSizeHint) => ProviderRestClient.CreateGetWebAppStacksRequest(stackOSType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProviderRestClient.CreateGetWebAppStacksNextPageRequest(nextLink, stackOSType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetWebAppStacksProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WebAppStack.DeserializeWebAppStack, ProviderClientDiagnostics, Pipeline, "AppServiceTenantMockingExtension.GetWebAppStacksProviders", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index b27c064647b3..000000000000 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.AppService.Models; - -namespace Azure.ResourceManager.AppService -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _resourceHealthMetadataClientDiagnostics; - private ResourceHealthMetadataRestOperations _resourceHealthMetadataRestClient; - private ClientDiagnostics _defaultClientDiagnostics; - private WebSiteManagementRestOperations _defaultRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics ResourceHealthMetadataClientDiagnostics => _resourceHealthMetadataClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ResourceHealthMetadataRestOperations ResourceHealthMetadataRestClient => _resourceHealthMetadataRestClient ??= new ResourceHealthMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private WebSiteManagementRestOperations DefaultRestClient => _defaultRestClient ??= new WebSiteManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AppServiceCertificateOrderResources in the ResourceGroupResource. - /// An object representing collection of AppServiceCertificateOrderResources and their operations over a AppServiceCertificateOrderResource. - public virtual AppServiceCertificateOrderCollection GetAppServiceCertificateOrders() - { - return GetCachedClient(Client => new AppServiceCertificateOrderCollection(Client, Id)); - } - - /// Gets a collection of AppServiceDomainResources in the ResourceGroupResource. - /// An object representing collection of AppServiceDomainResources and their operations over a AppServiceDomainResource. - public virtual AppServiceDomainCollection GetAppServiceDomains() - { - return GetCachedClient(Client => new AppServiceDomainCollection(Client, Id)); - } - - /// Gets a collection of AppServiceEnvironmentResources in the ResourceGroupResource. - /// An object representing collection of AppServiceEnvironmentResources and their operations over a AppServiceEnvironmentResource. - public virtual AppServiceEnvironmentCollection GetAppServiceEnvironments() - { - return GetCachedClient(Client => new AppServiceEnvironmentCollection(Client, Id)); - } - - /// Gets a collection of AppServicePlanResources in the ResourceGroupResource. - /// An object representing collection of AppServicePlanResources and their operations over a AppServicePlanResource. - public virtual AppServicePlanCollection GetAppServicePlans() - { - return GetCachedClient(Client => new AppServicePlanCollection(Client, Id)); - } - - /// Gets a collection of AppCertificateResources in the ResourceGroupResource. - /// An object representing collection of AppCertificateResources and their operations over a AppCertificateResource. - public virtual AppCertificateCollection GetAppCertificates() - { - return GetCachedClient(Client => new AppCertificateCollection(Client, Id)); - } - - /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. - /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. - public virtual KubeEnvironmentCollection GetKubeEnvironments() - { - return GetCachedClient(Client => new KubeEnvironmentCollection(Client, Id)); - } - - /// Gets a collection of StaticSiteResources in the ResourceGroupResource. - /// An object representing collection of StaticSiteResources and their operations over a StaticSiteResource. - public virtual StaticSiteCollection GetStaticSites() - { - return GetCachedClient(Client => new StaticSiteCollection(Client, Id)); - } - - /// Gets a collection of WebSiteResources in the ResourceGroupResource. - /// An object representing collection of WebSiteResources and their operations over a WebSiteResource. - public virtual WebSiteCollection GetWebSites() - { - return GetCachedClient(Client => new WebSiteCollection(Client, Id)); - } - - /// - /// Description for Validate if a resource can be created. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate - /// - /// - /// Operation Id - /// Validate - /// - /// - /// - /// Request with the resources to validate. - /// The cancellation token to use. - public virtual async Task> ValidateAsync(AppServiceValidateContent content, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.Validate"); - scope.Start(); - try - { - var response = await DefaultRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Description for Validate if a resource can be created. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate - /// - /// - /// Operation Id - /// Validate - /// - /// - /// - /// Request with the resources to validate. - /// The cancellation token to use. - public virtual Response Validate(AppServiceValidateContent content, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.Validate"); - scope.Start(); - try - { - var response = DefaultRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDiagnosticResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDiagnosticResource.cs index 83a5ee8749a7..34ff716d1303 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDiagnosticResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDiagnosticResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteDiagnosticAnalysisResources and their operations over a SiteDiagnosticAnalysisResource. public virtual SiteDiagnosticAnalysisCollection GetSiteDiagnosticAnalyses() { - return GetCachedClient(Client => new SiteDiagnosticAnalysisCollection(Client, Id)); + return GetCachedClient(client => new SiteDiagnosticAnalysisCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SiteDiagnosticAnalysisCollection GetSiteDiagnosticAnalyses() /// /// Analysis Name. /// The cancellation token to use. - /// 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> GetSiteDiagnosticAnalysisAsync(string analysisName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSiteDiagn /// /// Analysis Name. /// The cancellation token to use. - /// 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 GetSiteDiagnosticAnalysis(string analysisName, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetSiteDiagnosticAnalysi /// An object representing collection of SiteDiagnosticDetectorResources and their operations over a SiteDiagnosticDetectorResource. public virtual SiteDiagnosticDetectorCollection GetSiteDiagnosticDetectors() { - return GetCachedClient(Client => new SiteDiagnosticDetectorCollection(Client, Id)); + return GetCachedClient(client => new SiteDiagnosticDetectorCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual SiteDiagnosticDetectorCollection GetSiteDiagnosticDetectors() /// /// Detector Name. /// The cancellation token to use. - /// 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> GetSiteDiagnosticDetectorAsync(string detectorName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> GetSiteDiagn /// /// Detector Name. /// The cancellation token to use. - /// 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 GetSiteDiagnosticDetector(string detectorName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceProcessResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceProcessResource.cs index 6ab4188a698a..dbf1892ee3c3 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceProcessResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceProcessResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteInstanceProcessModuleResources and their operations over a SiteInstanceProcessModuleResource. public virtual SiteInstanceProcessModuleCollection GetSiteInstanceProcessModules() { - return GetCachedClient(Client => new SiteInstanceProcessModuleCollection(Client, Id)); + return GetCachedClient(client => new SiteInstanceProcessModuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SiteInstanceProcessModuleCollection GetSiteInstanceProcessModules /// /// Module base address. /// The cancellation token to use. - /// 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> GetSiteInstanceProcessModuleAsync(string baseAddress, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSiteIn /// /// Module base address. /// The cancellation token to use. - /// 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 GetSiteInstanceProcessModule(string baseAddress, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceResource.cs index fad9077a07a3..4bb5ade6e3c6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteInstanceResource.cs @@ -97,7 +97,7 @@ public virtual SiteInstanceExtensionResource GetSiteInstanceExtension() /// An object representing collection of SiteInstanceProcessResources and their operations over a SiteInstanceProcessResource. public virtual SiteInstanceProcessCollection GetSiteInstanceProcesses() { - return GetCachedClient(Client => new SiteInstanceProcessCollection(Client, Id)); + return GetCachedClient(client => new SiteInstanceProcessCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SiteInstanceProcessCollection GetSiteInstanceProcesses() /// /// PID. /// The cancellation token to use. - /// 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> GetSiteInstanceProcessAsync(string processId, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetSiteInstance /// /// PID. /// The cancellation token to use. - /// 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 GetSiteInstanceProcess(string processId, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteProcessResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteProcessResource.cs index af893bff5e45..aeec5559d17a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteProcessResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteProcessResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteProcessModuleResources and their operations over a SiteProcessModuleResource. public virtual SiteProcessModuleCollection GetSiteProcessModules() { - return GetCachedClient(Client => new SiteProcessModuleCollection(Client, Id)); + return GetCachedClient(client => new SiteProcessModuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SiteProcessModuleCollection GetSiteProcessModules() /// /// Module base address. /// The cancellation token to use. - /// 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> GetSiteProcessModuleAsync(string baseAddress, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSiteProcessMod /// /// Module base address. /// The cancellation token to use. - /// 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 GetSiteProcessModule(string baseAddress, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDiagnosticResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDiagnosticResource.cs index ffe76c7d42cb..21823b4b6449 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDiagnosticResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDiagnosticResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotDiagnosticAnalysisResources and their operations over a SiteSlotDiagnosticAnalysisResource. public virtual SiteSlotDiagnosticAnalysisCollection GetSiteSlotDiagnosticAnalyses() { - return GetCachedClient(Client => new SiteSlotDiagnosticAnalysisCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDiagnosticAnalysisCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SiteSlotDiagnosticAnalysisCollection GetSiteSlotDiagnosticAnalyse /// /// Analysis Name. /// The cancellation token to use. - /// 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> GetSiteSlotDiagnosticAnalysisAsync(string analysisName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSiteS /// /// Analysis Name. /// The cancellation token to use. - /// 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 GetSiteSlotDiagnosticAnalysis(string analysisName, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetSiteSlotDiagnosti /// An object representing collection of SiteSlotDiagnosticDetectorResources and their operations over a SiteSlotDiagnosticDetectorResource. public virtual SiteSlotDiagnosticDetectorCollection GetSiteSlotDiagnosticDetectors() { - return GetCachedClient(Client => new SiteSlotDiagnosticDetectorCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDiagnosticDetectorCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual SiteSlotDiagnosticDetectorCollection GetSiteSlotDiagnosticDetecto /// /// Detector Name. /// The cancellation token to use. - /// 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> GetSiteSlotDiagnosticDetectorAsync(string detectorName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> GetSiteS /// /// Detector Name. /// The cancellation token to use. - /// 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 GetSiteSlotDiagnosticDetector(string detectorName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceProcessResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceProcessResource.cs index 482c68c2a347..f30296607b1d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceProcessResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceProcessResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotInstanceProcessModuleResources and their operations over a SiteSlotInstanceProcessModuleResource. public virtual SiteSlotInstanceProcessModuleCollection GetSiteSlotInstanceProcessModules() { - return GetCachedClient(Client => new SiteSlotInstanceProcessModuleCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotInstanceProcessModuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SiteSlotInstanceProcessModuleCollection GetSiteSlotInstanceProces /// /// Module base address. /// The cancellation token to use. - /// 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> GetSiteSlotInstanceProcessModuleAsync(string baseAddress, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSi /// /// Module base address. /// The cancellation token to use. - /// 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 GetSiteSlotInstanceProcessModule(string baseAddress, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceResource.cs index d37c9cfc51b4..cde66a3174aa 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotInstanceResource.cs @@ -97,7 +97,7 @@ public virtual SiteSlotInstanceExtensionResource GetSiteSlotInstanceExtension() /// An object representing collection of SiteSlotInstanceProcessResources and their operations over a SiteSlotInstanceProcessResource. public virtual SiteSlotInstanceProcessCollection GetSiteSlotInstanceProcesses() { - return GetCachedClient(Client => new SiteSlotInstanceProcessCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotInstanceProcessCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SiteSlotInstanceProcessCollection GetSiteSlotInstanceProcesses() /// /// PID. /// The cancellation token to use. - /// 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> GetSiteSlotInstanceProcessAsync(string processId, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetSiteSlot /// /// PID. /// The cancellation token to use. - /// 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 GetSiteSlotInstanceProcess(string processId, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotProcessResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotProcessResource.cs index 8ae47c3d5a70..3dc5f691a29b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotProcessResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotProcessResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotProcessModuleResources and their operations over a SiteSlotProcessModuleResource. public virtual SiteSlotProcessModuleCollection GetSiteSlotProcessModules() { - return GetCachedClient(Client => new SiteSlotProcessModuleCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotProcessModuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SiteSlotProcessModuleCollection GetSiteSlotProcessModules() /// /// Module base address. /// The cancellation token to use. - /// 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> GetSiteSlotProcessModuleAsync(string baseAddress, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSiteSlotPr /// /// Module base address. /// The cancellation token to use. - /// 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 GetSiteSlotProcessModule(string baseAddress, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotVirtualNetworkConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotVirtualNetworkConnectionResource.cs index 90f17472bbf3..803cc96e3722 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotVirtualNetworkConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotVirtualNetworkConnectionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotVirtualNetworkConnectionGatewayResources and their operations over a SiteSlotVirtualNetworkConnectionGatewayResource. public virtual SiteSlotVirtualNetworkConnectionGatewayCollection GetSiteSlotVirtualNetworkConnectionGateways() { - return GetCachedClient(Client => new SiteSlotVirtualNetworkConnectionGatewayCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotVirtualNetworkConnectionGatewayCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SiteSlotVirtualNetworkConnectionGatewayCollection GetSiteSlotVirt /// /// Name of the gateway. Currently, the only supported string is "primary". /// The cancellation token to use. - /// 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> GetSiteSlotVirtualNetworkConnectionGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// Name of the gateway. Currently, the only supported string is "primary". /// The cancellation token to use. - /// 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 GetSiteSlotVirtualNetworkConnectionGateway(string gatewayName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteVirtualNetworkConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteVirtualNetworkConnectionResource.cs index 70be53ed3356..720d8861aa4c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteVirtualNetworkConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteVirtualNetworkConnectionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteVirtualNetworkConnectionGatewayResources and their operations over a SiteVirtualNetworkConnectionGatewayResource. public virtual SiteVirtualNetworkConnectionGatewayCollection GetSiteVirtualNetworkConnectionGateways() { - return GetCachedClient(Client => new SiteVirtualNetworkConnectionGatewayCollection(Client, Id)); + return GetCachedClient(client => new SiteVirtualNetworkConnectionGatewayCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SiteVirtualNetworkConnectionGatewayCollection GetSiteVirtualNetwo /// /// Name of the gateway. Currently, the only supported string is "primary". /// The cancellation token to use. - /// 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> GetSiteVirtualNetworkConnectionGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> /// /// Name of the gateway. Currently, the only supported string is "primary". /// The cancellation token to use. - /// 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 GetSiteVirtualNetworkConnectionGateway(string gatewayName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildResource.cs index 602fdaff1407..8f3a3fc487cc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StaticSiteBuildUserProvidedFunctionAppResources and their operations over a StaticSiteBuildUserProvidedFunctionAppResource. public virtual StaticSiteBuildUserProvidedFunctionAppCollection GetStaticSiteBuildUserProvidedFunctionApps() { - return GetCachedClient(Client => new StaticSiteBuildUserProvidedFunctionAppCollection(Client, Id)); + return GetCachedClient(client => new StaticSiteBuildUserProvidedFunctionAppCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual StaticSiteBuildUserProvidedFunctionAppCollection GetStaticSiteBui /// /// Name of the function app registered with the static site build. /// The cancellation token to use. - /// 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> GetStaticSiteBuildUserProvidedFunctionAppAsync(string functionAppName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task /// Name of the function app registered with the static site build. /// The cancellation token to use. - /// 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 GetStaticSiteBuildUserProvidedFunctionApp(string functionAppName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteResource.cs index 24ab5e43332c..fec1c126ad6e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StaticSitePrivateEndpointConnectionResources and their operations over a StaticSitePrivateEndpointConnectionResource. public virtual StaticSitePrivateEndpointConnectionCollection GetStaticSitePrivateEndpointConnections() { - return GetCachedClient(Client => new StaticSitePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new StaticSitePrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual StaticSitePrivateEndpointConnectionCollection GetStaticSitePrivat /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetStaticSitePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetStaticSitePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetStaticSi /// An object representing collection of StaticSiteBuildResources and their operations over a StaticSiteBuildResource. public virtual StaticSiteBuildCollection GetStaticSiteBuilds() { - return GetCachedClient(Client => new StaticSiteBuildCollection(Client, Id)); + return GetCachedClient(client => new StaticSiteBuildCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual StaticSiteBuildCollection GetStaticSiteBuilds() /// /// The stage site identifier. /// The cancellation token to use. - /// 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> GetStaticSiteBuildAsync(string environmentName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetStaticSiteBuildA /// /// The stage site identifier. /// The cancellation token to use. - /// 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 GetStaticSiteBuild(string environmentName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetStaticSiteBuild(string envir /// An object representing collection of StaticSiteUserProvidedFunctionAppResources and their operations over a StaticSiteUserProvidedFunctionAppResource. public virtual StaticSiteUserProvidedFunctionAppCollection GetStaticSiteUserProvidedFunctionApps() { - return GetCachedClient(Client => new StaticSiteUserProvidedFunctionAppCollection(Client, Id)); + return GetCachedClient(client => new StaticSiteUserProvidedFunctionAppCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual StaticSiteUserProvidedFunctionAppCollection GetStaticSiteUserProv /// /// Name of the function app registered with the static site. /// The cancellation token to use. - /// 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> GetStaticSiteUserProvidedFunctionAppAsync(string functionAppName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> G /// /// Name of the function app registered with the static site. /// The cancellation token to use. - /// 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 GetStaticSiteUserProvidedFunctionApp(string functionAppName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetStaticSite /// An object representing collection of StaticSiteCustomDomainOverviewResources and their operations over a StaticSiteCustomDomainOverviewResource. public virtual StaticSiteCustomDomainOverviewCollection GetStaticSiteCustomDomainOverviews() { - return GetCachedClient(Client => new StaticSiteCustomDomainOverviewCollection(Client, Id)); + return GetCachedClient(client => new StaticSiteCustomDomainOverviewCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual StaticSiteCustomDomainOverviewCollection GetStaticSiteCustomDomai /// /// The custom domain name. /// The cancellation token to use. - /// 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> GetStaticSiteCustomDomainOverviewAsync(string domainName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetS /// /// The custom domain name. /// The cancellation token to use. - /// 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 GetStaticSiteCustomDomainOverview(string domainName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteConfigResource.cs index e4423518ae4c..6d7fc66cd32b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteConfigResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteConfigResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteConfigSnapshotResources and their operations over a SiteConfigSnapshotResource. public virtual SiteConfigSnapshotCollection GetSiteConfigSnapshots() { - return GetCachedClient(Client => new SiteConfigSnapshotCollection(Client, Id)); + return GetCachedClient(client => new SiteConfigSnapshotCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SiteConfigSnapshotCollection GetSiteConfigSnapshots() /// /// The ID of the snapshot to read. /// The cancellation token to use. - /// 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> GetSiteConfigSnapshotAsync(string snapshotId, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetSiteConfigSna /// /// The ID of the snapshot to read. /// The cancellation token to use. - /// 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 GetSiteConfigSnapshot(string snapshotId, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs index 31ef4b70e113..662274054da4 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteDetectorResources and their operations over a SiteDetectorResource. public virtual SiteDetectorCollection GetSiteDetectors() { - return GetCachedClient(Client => new SiteDetectorCollection(Client, Id)); + return GetCachedClient(client => new SiteDetectorCollection(client, Id)); } /// @@ -125,8 +125,8 @@ public virtual SiteDetectorCollection GetSiteDetectors() /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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> GetSiteDetectorAsync(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task> GetSiteDetectorAsync(s /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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 GetSiteDetector(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -163,7 +163,7 @@ public virtual Response GetSiteDetector(string detectorNam /// An object representing collection of SitePrivateEndpointConnectionResources and their operations over a SitePrivateEndpointConnectionResource. public virtual SitePrivateEndpointConnectionCollection GetSitePrivateEndpointConnections() { - return GetCachedClient(Client => new SitePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SitePrivateEndpointConnectionCollection(client, Id)); } /// @@ -181,8 +181,8 @@ public virtual SitePrivateEndpointConnectionCollection GetSitePrivateEndpointCon /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetSitePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetSi /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetSitePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -216,7 +216,7 @@ public virtual Response GetSitePrivateEnd /// An object representing collection of SiteHybridConnectionNamespaceRelayResources and their operations over a SiteHybridConnectionNamespaceRelayResource. public virtual SiteHybridConnectionNamespaceRelayCollection GetSiteHybridConnectionNamespaceRelays() { - return GetCachedClient(Client => new SiteHybridConnectionNamespaceRelayCollection(Client, Id)); + return GetCachedClient(client => new SiteHybridConnectionNamespaceRelayCollection(client, Id)); } /// @@ -235,8 +235,8 @@ public virtual SiteHybridConnectionNamespaceRelayCollection GetSiteHybridConnect /// The namespace for this hybrid connection. /// The relay name for this hybrid connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetSiteHybridConnectionNamespaceRelayAsync(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -259,8 +259,8 @@ public virtual async Task> /// The namespace for this hybrid connection. /// The relay name for this hybrid connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetSiteHybridConnectionNamespaceRelay(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -271,7 +271,7 @@ public virtual Response GetSiteHybri /// An object representing collection of SiteVirtualNetworkConnectionResources and their operations over a SiteVirtualNetworkConnectionResource. public virtual SiteVirtualNetworkConnectionCollection GetSiteVirtualNetworkConnections() { - return GetCachedClient(Client => new SiteVirtualNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new SiteVirtualNetworkConnectionCollection(client, Id)); } /// @@ -289,8 +289,8 @@ public virtual SiteVirtualNetworkConnectionCollection GetSiteVirtualNetworkConne /// /// Name of the virtual network. /// The cancellation token to use. - /// 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> GetSiteVirtualNetworkConnectionAsync(string vnetName, CancellationToken cancellationToken = default) { @@ -312,8 +312,8 @@ public virtual async Task> GetSit /// /// Name of the virtual network. /// The cancellation token to use. - /// 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 GetSiteVirtualNetworkConnection(string vnetName, CancellationToken cancellationToken = default) { @@ -324,7 +324,7 @@ public virtual Response GetSiteVirtualNetw /// An object representing collection of SiteDiagnosticResources and their operations over a SiteDiagnosticResource. public virtual SiteDiagnosticCollection GetSiteDiagnostics() { - return GetCachedClient(Client => new SiteDiagnosticCollection(Client, Id)); + return GetCachedClient(client => new SiteDiagnosticCollection(client, Id)); } /// @@ -342,8 +342,8 @@ public virtual SiteDiagnosticCollection GetSiteDiagnostics() /// /// Diagnostic Category. /// The cancellation token to use. - /// 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> GetSiteDiagnosticAsync(string diagnosticCategory, CancellationToken cancellationToken = default) { @@ -365,8 +365,8 @@ public virtual async Task> GetSiteDiagnosticAsy /// /// Diagnostic Category. /// The cancellation token to use. - /// 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 GetSiteDiagnostic(string diagnosticCategory, CancellationToken cancellationToken = default) { @@ -377,7 +377,7 @@ public virtual Response GetSiteDiagnostic(string diagnos /// An object representing collection of SiteRecommendationResources and their operations over a SiteRecommendationResource. public virtual SiteRecommendationCollection GetSiteRecommendations() { - return GetCachedClient(Client => new SiteRecommendationCollection(Client, Id)); + return GetCachedClient(client => new SiteRecommendationCollection(client, Id)); } /// @@ -397,8 +397,8 @@ public virtual SiteRecommendationCollection GetSiteRecommendations() /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. /// The cancellation token to use. - /// 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> GetSiteRecommendationAsync(string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) { @@ -422,8 +422,8 @@ public virtual async Task> GetSiteRecommend /// Specify <code>true</code> to update the last-seen timestamp of the recommendation object. /// The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. /// The cancellation token to use. - /// 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 GetSiteRecommendation(string name, bool? updateSeen = null, string recommendationId = null, CancellationToken cancellationToken = default) { @@ -441,7 +441,7 @@ public virtual WebSiteResourceHealthMetadataResource GetWebSiteResourceHealthMet /// An object representing collection of WebSiteSlotResources and their operations over a WebSiteSlotResource. public virtual WebSiteSlotCollection GetWebSiteSlots() { - return GetCachedClient(Client => new WebSiteSlotCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotCollection(client, Id)); } /// @@ -459,8 +459,8 @@ public virtual WebSiteSlotCollection GetWebSiteSlots() /// /// Name of the deployment slot. By default, this API returns the production slot. /// The cancellation token to use. - /// 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> GetWebSiteSlotAsync(string slot, CancellationToken cancellationToken = default) { @@ -482,8 +482,8 @@ public virtual async Task> GetWebSiteSlotAsync(str /// /// Name of the deployment slot. By default, this API returns the production slot. /// The cancellation token to use. - /// 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 GetWebSiteSlot(string slot, CancellationToken cancellationToken = default) { @@ -494,7 +494,7 @@ public virtual Response GetWebSiteSlot(string slot, Cancell /// An object representing collection of SiteBackupResources and their operations over a SiteBackupResource. public virtual SiteBackupCollection GetSiteBackups() { - return GetCachedClient(Client => new SiteBackupCollection(Client, Id)); + return GetCachedClient(client => new SiteBackupCollection(client, Id)); } /// @@ -512,8 +512,8 @@ public virtual SiteBackupCollection GetSiteBackups() /// /// ID of the backup. /// The cancellation token to use. - /// 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> GetSiteBackupAsync(string backupId, CancellationToken cancellationToken = default) { @@ -535,8 +535,8 @@ public virtual async Task> GetSiteBackupAsync(strin /// /// ID of the backup. /// The cancellation token to use. - /// 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 GetSiteBackup(string backupId, CancellationToken cancellationToken = default) { @@ -561,7 +561,7 @@ public virtual ScmSiteBasicPublishingCredentialsPolicyResource GetScmSiteBasicPu /// An object representing collection of SiteConfigAppsettingResources and their operations over a SiteConfigAppsettingResource. public virtual SiteConfigAppsettingCollection GetSiteConfigAppsettings() { - return GetCachedClient(Client => new SiteConfigAppsettingCollection(Client, Id)); + return GetCachedClient(client => new SiteConfigAppsettingCollection(client, Id)); } /// @@ -579,8 +579,8 @@ public virtual SiteConfigAppsettingCollection GetSiteConfigAppsettings() /// /// App Setting key name. /// The cancellation token to use. - /// 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> GetSiteConfigAppsettingAsync(string appSettingKey, CancellationToken cancellationToken = default) { @@ -602,8 +602,8 @@ public virtual async Task> GetSiteConfigA /// /// App Setting key name. /// The cancellation token to use. - /// 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 GetSiteConfigAppsetting(string appSettingKey, CancellationToken cancellationToken = default) { @@ -614,7 +614,7 @@ public virtual Response GetSiteConfigAppsetting(st /// An object representing collection of WebSiteConfigConnectionStringResources and their operations over a WebSiteConfigConnectionStringResource. public virtual WebSiteConfigConnectionStringCollection GetWebSiteConfigConnectionStrings() { - return GetCachedClient(Client => new WebSiteConfigConnectionStringCollection(Client, Id)); + return GetCachedClient(client => new WebSiteConfigConnectionStringCollection(client, Id)); } /// @@ -632,8 +632,8 @@ public virtual WebSiteConfigConnectionStringCollection GetWebSiteConfigConnectio /// /// The String to use. /// The cancellation token to use. - /// 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> GetWebSiteConfigConnectionStringAsync(string connectionStringKey, CancellationToken cancellationToken = default) { @@ -655,8 +655,8 @@ public virtual async Task> GetWe /// /// The String to use. /// The cancellation token to use. - /// 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 GetWebSiteConfigConnectionString(string connectionStringKey, CancellationToken cancellationToken = default) { @@ -688,7 +688,7 @@ public virtual WebSiteConfigResource GetWebSiteConfig() /// An object representing collection of WebSiteContinuousWebJobResources and their operations over a WebSiteContinuousWebJobResource. public virtual WebSiteContinuousWebJobCollection GetWebSiteContinuousWebJobs() { - return GetCachedClient(Client => new WebSiteContinuousWebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteContinuousWebJobCollection(client, Id)); } /// @@ -706,8 +706,8 @@ public virtual WebSiteContinuousWebJobCollection GetWebSiteContinuousWebJobs() /// /// Name of Web Job. /// The cancellation token to use. - /// 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> GetWebSiteContinuousWebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -729,8 +729,8 @@ public virtual async Task> GetWebSiteC /// /// Name of Web Job. /// The cancellation token to use. - /// 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 GetWebSiteContinuousWebJob(string webJobName, CancellationToken cancellationToken = default) { @@ -741,7 +741,7 @@ public virtual Response GetWebSiteContinuousWeb /// An object representing collection of SiteDeploymentResources and their operations over a SiteDeploymentResource. public virtual SiteDeploymentCollection GetSiteDeployments() { - return GetCachedClient(Client => new SiteDeploymentCollection(Client, Id)); + return GetCachedClient(client => new SiteDeploymentCollection(client, Id)); } /// @@ -759,8 +759,8 @@ public virtual SiteDeploymentCollection GetSiteDeployments() /// /// Deployment ID. /// The cancellation token to use. - /// 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> GetSiteDeploymentAsync(string id, CancellationToken cancellationToken = default) { @@ -782,8 +782,8 @@ public virtual async Task> GetSiteDeploymentAsy /// /// Deployment ID. /// The cancellation token to use. - /// 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 GetSiteDeployment(string id, CancellationToken cancellationToken = default) { @@ -794,7 +794,7 @@ public virtual Response GetSiteDeployment(string id, Can /// An object representing collection of SiteDomainOwnershipIdentifierResources and their operations over a SiteDomainOwnershipIdentifierResource. public virtual SiteDomainOwnershipIdentifierCollection GetSiteDomainOwnershipIdentifiers() { - return GetCachedClient(Client => new SiteDomainOwnershipIdentifierCollection(Client, Id)); + return GetCachedClient(client => new SiteDomainOwnershipIdentifierCollection(client, Id)); } /// @@ -812,8 +812,8 @@ public virtual SiteDomainOwnershipIdentifierCollection GetSiteDomainOwnershipIde /// /// Name of domain ownership identifier. /// The cancellation token to use. - /// 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> GetSiteDomainOwnershipIdentifierAsync(string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) { @@ -835,8 +835,8 @@ public virtual async Task> GetSi /// /// Name of domain ownership identifier. /// The cancellation token to use. - /// 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 GetSiteDomainOwnershipIdentifier(string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) { @@ -854,7 +854,7 @@ public virtual SiteExtensionResource GetSiteExtension() /// An object representing collection of SiteFunctionResources and their operations over a SiteFunctionResource. public virtual SiteFunctionCollection GetSiteFunctions() { - return GetCachedClient(Client => new SiteFunctionCollection(Client, Id)); + return GetCachedClient(client => new SiteFunctionCollection(client, Id)); } /// @@ -872,8 +872,8 @@ public virtual SiteFunctionCollection GetSiteFunctions() /// /// Function name. /// The cancellation token to use. - /// 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> GetSiteFunctionAsync(string functionName, CancellationToken cancellationToken = default) { @@ -895,8 +895,8 @@ public virtual async Task> GetSiteFunctionAsync(s /// /// Function name. /// The cancellation token to use. - /// 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 GetSiteFunction(string functionName, CancellationToken cancellationToken = default) { @@ -907,7 +907,7 @@ public virtual Response GetSiteFunction(string functionNam /// An object representing collection of SiteHostNameBindingResources and their operations over a SiteHostNameBindingResource. public virtual SiteHostNameBindingCollection GetSiteHostNameBindings() { - return GetCachedClient(Client => new SiteHostNameBindingCollection(Client, Id)); + return GetCachedClient(client => new SiteHostNameBindingCollection(client, Id)); } /// @@ -925,8 +925,8 @@ public virtual SiteHostNameBindingCollection GetSiteHostNameBindings() /// /// Hostname in the hostname binding. /// The cancellation token to use. - /// 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> GetSiteHostNameBindingAsync(string hostName, CancellationToken cancellationToken = default) { @@ -948,8 +948,8 @@ public virtual async Task> GetSiteHostName /// /// Hostname in the hostname binding. /// The cancellation token to use. - /// 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 GetSiteHostNameBinding(string hostName, CancellationToken cancellationToken = default) { @@ -960,7 +960,7 @@ public virtual Response GetSiteHostNameBinding(stri /// An object representing collection of WebSiteHybridConnectionResources and their operations over a WebSiteHybridConnectionResource. public virtual WebSiteHybridConnectionCollection GetWebSiteHybridConnections() { - return GetCachedClient(Client => new WebSiteHybridConnectionCollection(Client, Id)); + return GetCachedClient(client => new WebSiteHybridConnectionCollection(client, Id)); } /// @@ -978,8 +978,8 @@ public virtual WebSiteHybridConnectionCollection GetWebSiteHybridConnections() /// /// Name of the hybrid connection. /// The cancellation token to use. - /// 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> GetWebSiteHybridConnectionAsync(string entityName, CancellationToken cancellationToken = default) { @@ -1001,8 +1001,8 @@ public virtual async Task> GetWebSiteH /// /// Name of the hybrid connection. /// The cancellation token to use. - /// 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 GetWebSiteHybridConnection(string entityName, CancellationToken cancellationToken = default) { @@ -1013,7 +1013,7 @@ public virtual Response GetWebSiteHybridConnect /// An object representing collection of SiteInstanceResources and their operations over a SiteInstanceResource. public virtual SiteInstanceCollection GetSiteInstances() { - return GetCachedClient(Client => new SiteInstanceCollection(Client, Id)); + return GetCachedClient(client => new SiteInstanceCollection(client, Id)); } /// @@ -1031,8 +1031,8 @@ public virtual SiteInstanceCollection GetSiteInstances() /// /// The String to use. /// The cancellation token to use. - /// 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> GetSiteInstanceAsync(string instanceId, CancellationToken cancellationToken = default) { @@ -1054,8 +1054,8 @@ public virtual async Task> GetSiteInstanceAsync(s /// /// The String to use. /// The cancellation token to use. - /// 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 GetSiteInstance(string instanceId, CancellationToken cancellationToken = default) { @@ -1066,7 +1066,7 @@ public virtual Response GetSiteInstance(string instanceId, /// An object representing collection of SiteProcessResources and their operations over a SiteProcessResource. public virtual SiteProcessCollection GetSiteProcesses() { - return GetCachedClient(Client => new SiteProcessCollection(Client, Id)); + return GetCachedClient(client => new SiteProcessCollection(client, Id)); } /// @@ -1084,8 +1084,8 @@ public virtual SiteProcessCollection GetSiteProcesses() /// /// PID. /// The cancellation token to use. - /// 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> GetSiteProcessAsync(string processId, CancellationToken cancellationToken = default) { @@ -1107,8 +1107,8 @@ public virtual async Task> GetSiteProcessAsync(str /// /// PID. /// The cancellation token to use. - /// 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 GetSiteProcess(string processId, CancellationToken cancellationToken = default) { @@ -1126,7 +1126,7 @@ public virtual SiteNetworkConfigResource GetSiteNetworkConfig() /// An object representing collection of WebSitePremierAddonResources and their operations over a WebSitePremierAddonResource. public virtual WebSitePremierAddonCollection GetWebSitePremierAddons() { - return GetCachedClient(Client => new WebSitePremierAddonCollection(Client, Id)); + return GetCachedClient(client => new WebSitePremierAddonCollection(client, Id)); } /// @@ -1144,8 +1144,8 @@ public virtual WebSitePremierAddonCollection GetWebSitePremierAddons() /// /// Add-on name. /// The cancellation token to use. - /// 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> GetWebSitePremierAddonAsync(string premierAddOnName, CancellationToken cancellationToken = default) { @@ -1167,8 +1167,8 @@ public virtual async Task> GetWebSitePremi /// /// Add-on name. /// The cancellation token to use. - /// 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 GetWebSitePremierAddon(string premierAddOnName, CancellationToken cancellationToken = default) { @@ -1186,7 +1186,7 @@ public virtual WebSitePrivateAccessResource GetWebSitePrivateAccess() /// An object representing collection of SitePublicCertificateResources and their operations over a SitePublicCertificateResource. public virtual SitePublicCertificateCollection GetSitePublicCertificates() { - return GetCachedClient(Client => new SitePublicCertificateCollection(Client, Id)); + return GetCachedClient(client => new SitePublicCertificateCollection(client, Id)); } /// @@ -1204,8 +1204,8 @@ public virtual SitePublicCertificateCollection GetSitePublicCertificates() /// /// Public certificate name. /// The cancellation token to use. - /// 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> GetSitePublicCertificateAsync(string publicCertificateName, CancellationToken cancellationToken = default) { @@ -1227,8 +1227,8 @@ public virtual async Task> GetSitePublic /// /// Public certificate name. /// The cancellation token to use. - /// 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 GetSitePublicCertificate(string publicCertificateName, CancellationToken cancellationToken = default) { @@ -1239,7 +1239,7 @@ public virtual Response GetSitePublicCertificate( /// An object representing collection of WebSiteExtensionResources and their operations over a WebSiteExtensionResource. public virtual WebSiteExtensionCollection GetWebSiteExtensions() { - return GetCachedClient(Client => new WebSiteExtensionCollection(Client, Id)); + return GetCachedClient(client => new WebSiteExtensionCollection(client, Id)); } /// @@ -1257,8 +1257,8 @@ public virtual WebSiteExtensionCollection GetWebSiteExtensions() /// /// Site extension name. /// The cancellation token to use. - /// 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> GetWebSiteExtensionAsync(string siteExtensionId, CancellationToken cancellationToken = default) { @@ -1280,8 +1280,8 @@ public virtual async Task> GetWebSiteExtensio /// /// Site extension name. /// The cancellation token to use. - /// 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 GetWebSiteExtension(string siteExtensionId, CancellationToken cancellationToken = default) { @@ -1299,7 +1299,7 @@ public virtual WebSiteSourceControlResource GetWebSiteSourceControl() /// An object representing collection of WebSiteTriggeredwebJobResources and their operations over a WebSiteTriggeredwebJobResource. public virtual WebSiteTriggeredwebJobCollection GetWebSiteTriggeredwebJobs() { - return GetCachedClient(Client => new WebSiteTriggeredwebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteTriggeredwebJobCollection(client, Id)); } /// @@ -1317,8 +1317,8 @@ public virtual WebSiteTriggeredwebJobCollection GetWebSiteTriggeredwebJobs() /// /// Name of Web Job. /// The cancellation token to use. - /// 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> GetWebSiteTriggeredwebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -1340,8 +1340,8 @@ public virtual async Task> GetWebSiteTr /// /// Name of Web Job. /// The cancellation token to use. - /// 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 GetWebSiteTriggeredwebJob(string webJobName, CancellationToken cancellationToken = default) { @@ -1352,7 +1352,7 @@ public virtual Response GetWebSiteTriggeredwebJo /// An object representing collection of WebSiteWebJobResources and their operations over a WebSiteWebJobResource. public virtual WebSiteWebJobCollection GetWebSiteWebJobs() { - return GetCachedClient(Client => new WebSiteWebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteWebJobCollection(client, Id)); } /// @@ -1370,8 +1370,8 @@ public virtual WebSiteWebJobCollection GetWebSiteWebJobs() /// /// Name of the web job. /// The cancellation token to use. - /// 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> GetWebSiteWebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -1393,8 +1393,8 @@ public virtual async Task> GetWebSiteWebJobAsync /// /// Name of the web job. /// The cancellation token to use. - /// 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 GetWebSiteWebJob(string webJobName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotConfigResource.cs index 17426bbe3caf..45c7e05d168f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotConfigResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotConfigResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotConfigSnapshotResources and their operations over a SiteSlotConfigSnapshotResource. public virtual SiteSlotConfigSnapshotCollection GetSiteSlotConfigSnapshots() { - return GetCachedClient(Client => new SiteSlotConfigSnapshotCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotConfigSnapshotCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SiteSlotConfigSnapshotCollection GetSiteSlotConfigSnapshots() /// /// The ID of the snapshot to read. /// The cancellation token to use. - /// 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> GetSiteSlotConfigSnapshotAsync(string snapshotId, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetSiteSlotC /// /// The ID of the snapshot to read. /// The cancellation token to use. - /// 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 GetSiteSlotConfigSnapshot(string snapshotId, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs index 39ecd472b57c..aa46616076fb 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteSlotDetectorResources and their operations over a SiteSlotDetectorResource. public virtual SiteSlotDetectorCollection GetSiteSlotDetectors() { - return GetCachedClient(Client => new SiteSlotDetectorCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDetectorCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual SiteSlotDetectorCollection GetSiteSlotDetectors() /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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> GetSiteSlotDetectorAsync(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -141,8 +141,8 @@ public virtual async Task> GetSiteSlotDetecto /// End Time. /// Time Grain. /// The cancellation token to use. - /// 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 GetSiteSlotDetector(string detectorName, DateTimeOffset? startTime = null, DateTimeOffset? endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { @@ -153,7 +153,7 @@ public virtual Response GetSiteSlotDetector(string det /// An object representing collection of SiteSlotPrivateEndpointConnectionResources and their operations over a SiteSlotPrivateEndpointConnectionResource. public virtual SiteSlotPrivateEndpointConnectionCollection GetSiteSlotPrivateEndpointConnections() { - return GetCachedClient(Client => new SiteSlotPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotPrivateEndpointConnectionCollection(client, Id)); } /// @@ -171,8 +171,8 @@ public virtual SiteSlotPrivateEndpointConnectionCollection GetSiteSlotPrivateEnd /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetSiteSlotPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -194,8 +194,8 @@ public virtual async Task> G /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetSiteSlotPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -206,7 +206,7 @@ public virtual Response GetSiteSlotPr /// An object representing collection of SiteSlotHybridConnectionNamespaceRelayResources and their operations over a SiteSlotHybridConnectionNamespaceRelayResource. public virtual SiteSlotHybridConnectionNamespaceRelayCollection GetSiteSlotHybridConnectionNamespaceRelays() { - return GetCachedClient(Client => new SiteSlotHybridConnectionNamespaceRelayCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotHybridConnectionNamespaceRelayCollection(client, Id)); } /// @@ -225,8 +225,8 @@ public virtual SiteSlotHybridConnectionNamespaceRelayCollection GetSiteSlotHybri /// The namespace for this hybrid connection. /// The relay name for this hybrid connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetSiteSlotHybridConnectionNamespaceRelayAsync(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -249,8 +249,8 @@ public virtual async Task The namespace for this hybrid connection. /// The relay name for this hybrid connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetSiteSlotHybridConnectionNamespaceRelay(string namespaceName, string relayName, CancellationToken cancellationToken = default) { @@ -261,7 +261,7 @@ public virtual Response GetSiteS /// An object representing collection of SiteSlotVirtualNetworkConnectionResources and their operations over a SiteSlotVirtualNetworkConnectionResource. public virtual SiteSlotVirtualNetworkConnectionCollection GetSiteSlotVirtualNetworkConnections() { - return GetCachedClient(Client => new SiteSlotVirtualNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotVirtualNetworkConnectionCollection(client, Id)); } /// @@ -279,8 +279,8 @@ public virtual SiteSlotVirtualNetworkConnectionCollection GetSiteSlotVirtualNetw /// /// Name of the virtual network. /// The cancellation token to use. - /// 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> GetSiteSlotVirtualNetworkConnectionAsync(string vnetName, CancellationToken cancellationToken = default) { @@ -302,8 +302,8 @@ public virtual async Task> Ge /// /// Name of the virtual network. /// The cancellation token to use. - /// 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 GetSiteSlotVirtualNetworkConnection(string vnetName, CancellationToken cancellationToken = default) { @@ -314,7 +314,7 @@ public virtual Response GetSiteSlotVir /// An object representing collection of SiteSlotDiagnosticResources and their operations over a SiteSlotDiagnosticResource. public virtual SiteSlotDiagnosticCollection GetSiteSlotDiagnostics() { - return GetCachedClient(Client => new SiteSlotDiagnosticCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDiagnosticCollection(client, Id)); } /// @@ -332,8 +332,8 @@ public virtual SiteSlotDiagnosticCollection GetSiteSlotDiagnostics() /// /// Diagnostic Category. /// The cancellation token to use. - /// 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> GetSiteSlotDiagnosticAsync(string diagnosticCategory, CancellationToken cancellationToken = default) { @@ -355,8 +355,8 @@ public virtual async Task> GetSiteSlotDiagn /// /// Diagnostic Category. /// The cancellation token to use. - /// 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 GetSiteSlotDiagnostic(string diagnosticCategory, CancellationToken cancellationToken = default) { @@ -374,7 +374,7 @@ public virtual WebSiteSlotResourceHealthMetadataResource GetWebSiteSlotResourceH /// An object representing collection of SiteSlotBackupResources and their operations over a SiteSlotBackupResource. public virtual SiteSlotBackupCollection GetSiteSlotBackups() { - return GetCachedClient(Client => new SiteSlotBackupCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotBackupCollection(client, Id)); } /// @@ -392,8 +392,8 @@ public virtual SiteSlotBackupCollection GetSiteSlotBackups() /// /// ID of the backup. /// The cancellation token to use. - /// 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> GetSiteSlotBackupAsync(string backupId, CancellationToken cancellationToken = default) { @@ -415,8 +415,8 @@ public virtual async Task> GetSiteSlotBackupAsy /// /// ID of the backup. /// The cancellation token to use. - /// 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 GetSiteSlotBackup(string backupId, CancellationToken cancellationToken = default) { @@ -441,7 +441,7 @@ public virtual ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlo /// An object representing collection of WebSiteSlotConfigAppSettingResources and their operations over a WebSiteSlotConfigAppSettingResource. public virtual WebSiteSlotConfigAppSettingCollection GetWebSiteSlotConfigAppSettings() { - return GetCachedClient(Client => new WebSiteSlotConfigAppSettingCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotConfigAppSettingCollection(client, Id)); } /// @@ -459,8 +459,8 @@ public virtual WebSiteSlotConfigAppSettingCollection GetWebSiteSlotConfigAppSett /// /// App Setting key name. /// The cancellation token to use. - /// 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> GetWebSiteSlotConfigAppSettingAsync(string appSettingKey, CancellationToken cancellationToken = default) { @@ -482,8 +482,8 @@ public virtual async Task> GetWebS /// /// App Setting key name. /// The cancellation token to use. - /// 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 GetWebSiteSlotConfigAppSetting(string appSettingKey, CancellationToken cancellationToken = default) { @@ -494,7 +494,7 @@ public virtual Response GetWebSiteSlotConfi /// An object representing collection of WebSiteSlotConfigConnectionStringResources and their operations over a WebSiteSlotConfigConnectionStringResource. public virtual WebSiteSlotConfigConnectionStringCollection GetWebSiteSlotConfigConnectionStrings() { - return GetCachedClient(Client => new WebSiteSlotConfigConnectionStringCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotConfigConnectionStringCollection(client, Id)); } /// @@ -512,8 +512,8 @@ public virtual WebSiteSlotConfigConnectionStringCollection GetWebSiteSlotConfigC /// /// The String to use. /// The cancellation token to use. - /// 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> GetWebSiteSlotConfigConnectionStringAsync(string connectionStringKey, CancellationToken cancellationToken = default) { @@ -535,8 +535,8 @@ public virtual async Task> G /// /// The String to use. /// The cancellation token to use. - /// 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 GetWebSiteSlotConfigConnectionString(string connectionStringKey, CancellationToken cancellationToken = default) { @@ -561,7 +561,7 @@ public virtual WebSiteSlotConfigResource GetWebSiteSlotConfig() /// An object representing collection of WebSiteSlotContinuousWebJobResources and their operations over a WebSiteSlotContinuousWebJobResource. public virtual WebSiteSlotContinuousWebJobCollection GetWebSiteSlotContinuousWebJobs() { - return GetCachedClient(Client => new WebSiteSlotContinuousWebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotContinuousWebJobCollection(client, Id)); } /// @@ -579,8 +579,8 @@ public virtual WebSiteSlotContinuousWebJobCollection GetWebSiteSlotContinuousWeb /// /// Name of Web Job. /// The cancellation token to use. - /// 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> GetWebSiteSlotContinuousWebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -602,8 +602,8 @@ public virtual async Task> GetWebS /// /// Name of Web Job. /// The cancellation token to use. - /// 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 GetWebSiteSlotContinuousWebJob(string webJobName, CancellationToken cancellationToken = default) { @@ -614,7 +614,7 @@ public virtual Response GetWebSiteSlotConti /// An object representing collection of SiteSlotDeploymentResources and their operations over a SiteSlotDeploymentResource. public virtual SiteSlotDeploymentCollection GetSiteSlotDeployments() { - return GetCachedClient(Client => new SiteSlotDeploymentCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDeploymentCollection(client, Id)); } /// @@ -632,8 +632,8 @@ public virtual SiteSlotDeploymentCollection GetSiteSlotDeployments() /// /// Deployment ID. /// The cancellation token to use. - /// 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> GetSiteSlotDeploymentAsync(string id, CancellationToken cancellationToken = default) { @@ -655,8 +655,8 @@ public virtual async Task> GetSiteSlotDeplo /// /// Deployment ID. /// The cancellation token to use. - /// 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 GetSiteSlotDeployment(string id, CancellationToken cancellationToken = default) { @@ -667,7 +667,7 @@ public virtual Response GetSiteSlotDeployment(string /// An object representing collection of SiteSlotDomainOwnershipIdentifierResources and their operations over a SiteSlotDomainOwnershipIdentifierResource. public virtual SiteSlotDomainOwnershipIdentifierCollection GetSiteSlotDomainOwnershipIdentifiers() { - return GetCachedClient(Client => new SiteSlotDomainOwnershipIdentifierCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotDomainOwnershipIdentifierCollection(client, Id)); } /// @@ -685,8 +685,8 @@ public virtual SiteSlotDomainOwnershipIdentifierCollection GetSiteSlotDomainOwne /// /// Name of domain ownership identifier. /// The cancellation token to use. - /// 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> GetSiteSlotDomainOwnershipIdentifierAsync(string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) { @@ -708,8 +708,8 @@ public virtual async Task> G /// /// Name of domain ownership identifier. /// The cancellation token to use. - /// 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 GetSiteSlotDomainOwnershipIdentifier(string domainOwnershipIdentifierName, CancellationToken cancellationToken = default) { @@ -727,7 +727,7 @@ public virtual SiteSlotExtensionResource GetSiteSlotExtension() /// An object representing collection of SiteSlotFunctionResources and their operations over a SiteSlotFunctionResource. public virtual SiteSlotFunctionCollection GetSiteSlotFunctions() { - return GetCachedClient(Client => new SiteSlotFunctionCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotFunctionCollection(client, Id)); } /// @@ -745,8 +745,8 @@ public virtual SiteSlotFunctionCollection GetSiteSlotFunctions() /// /// Function name. /// The cancellation token to use. - /// 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> GetSiteSlotFunctionAsync(string functionName, CancellationToken cancellationToken = default) { @@ -768,8 +768,8 @@ public virtual async Task> GetSiteSlotFunctio /// /// Function name. /// The cancellation token to use. - /// 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 GetSiteSlotFunction(string functionName, CancellationToken cancellationToken = default) { @@ -780,7 +780,7 @@ public virtual Response GetSiteSlotFunction(string fun /// An object representing collection of SiteSlotHostNameBindingResources and their operations over a SiteSlotHostNameBindingResource. public virtual SiteSlotHostNameBindingCollection GetSiteSlotHostNameBindings() { - return GetCachedClient(Client => new SiteSlotHostNameBindingCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotHostNameBindingCollection(client, Id)); } /// @@ -798,8 +798,8 @@ public virtual SiteSlotHostNameBindingCollection GetSiteSlotHostNameBindings() /// /// Hostname in the hostname binding. /// The cancellation token to use. - /// 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> GetSiteSlotHostNameBindingAsync(string hostName, CancellationToken cancellationToken = default) { @@ -821,8 +821,8 @@ public virtual async Task> GetSiteSlot /// /// Hostname in the hostname binding. /// The cancellation token to use. - /// 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 GetSiteSlotHostNameBinding(string hostName, CancellationToken cancellationToken = default) { @@ -833,7 +833,7 @@ public virtual Response GetSiteSlotHostNameBind /// An object representing collection of WebSiteSlotHybridConnectionResources and their operations over a WebSiteSlotHybridConnectionResource. public virtual WebSiteSlotHybridConnectionCollection GetWebSiteSlotHybridConnections() { - return GetCachedClient(Client => new WebSiteSlotHybridConnectionCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotHybridConnectionCollection(client, Id)); } /// @@ -851,8 +851,8 @@ public virtual WebSiteSlotHybridConnectionCollection GetWebSiteSlotHybridConnect /// /// Name of the hybrid connection. /// The cancellation token to use. - /// 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> GetWebSiteSlotHybridConnectionAsync(string entityName, CancellationToken cancellationToken = default) { @@ -874,8 +874,8 @@ public virtual async Task> GetWebS /// /// Name of the hybrid connection. /// The cancellation token to use. - /// 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 GetWebSiteSlotHybridConnection(string entityName, CancellationToken cancellationToken = default) { @@ -886,7 +886,7 @@ public virtual Response GetWebSiteSlotHybri /// An object representing collection of SiteSlotInstanceResources and their operations over a SiteSlotInstanceResource. public virtual SiteSlotInstanceCollection GetSiteSlotInstances() { - return GetCachedClient(Client => new SiteSlotInstanceCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotInstanceCollection(client, Id)); } /// @@ -904,8 +904,8 @@ public virtual SiteSlotInstanceCollection GetSiteSlotInstances() /// /// The String to use. /// The cancellation token to use. - /// 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> GetSiteSlotInstanceAsync(string instanceId, CancellationToken cancellationToken = default) { @@ -927,8 +927,8 @@ public virtual async Task> GetSiteSlotInstanc /// /// The String to use. /// The cancellation token to use. - /// 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 GetSiteSlotInstance(string instanceId, CancellationToken cancellationToken = default) { @@ -939,7 +939,7 @@ public virtual Response GetSiteSlotInstance(string ins /// An object representing collection of SiteSlotProcessResources and their operations over a SiteSlotProcessResource. public virtual SiteSlotProcessCollection GetSiteSlotProcesses() { - return GetCachedClient(Client => new SiteSlotProcessCollection(Client, Id)); + return GetCachedClient(client => new SiteSlotProcessCollection(client, Id)); } /// @@ -957,8 +957,8 @@ public virtual SiteSlotProcessCollection GetSiteSlotProcesses() /// /// PID. /// The cancellation token to use. - /// 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> GetSiteSlotProcessAsync(string processId, CancellationToken cancellationToken = default) { @@ -980,8 +980,8 @@ public virtual async Task> GetSiteSlotProcessA /// /// PID. /// The cancellation token to use. - /// 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 GetSiteSlotProcess(string processId, CancellationToken cancellationToken = default) { @@ -999,7 +999,7 @@ public virtual SiteSlotNetworkConfigResource GetSiteSlotNetworkConfig() /// An object representing collection of WebSiteSlotPremierAddOnResources and their operations over a WebSiteSlotPremierAddOnResource. public virtual WebSiteSlotPremierAddOnCollection GetWebSiteSlotPremierAddOns() { - return GetCachedClient(Client => new WebSiteSlotPremierAddOnCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotPremierAddOnCollection(client, Id)); } /// @@ -1017,8 +1017,8 @@ public virtual WebSiteSlotPremierAddOnCollection GetWebSiteSlotPremierAddOns() /// /// Add-on name. /// The cancellation token to use. - /// 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> GetWebSiteSlotPremierAddOnAsync(string premierAddOnName, CancellationToken cancellationToken = default) { @@ -1040,8 +1040,8 @@ public virtual async Task> GetWebSiteS /// /// Add-on name. /// The cancellation token to use. - /// 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 GetWebSiteSlotPremierAddOn(string premierAddOnName, CancellationToken cancellationToken = default) { @@ -1059,7 +1059,7 @@ public virtual WebSiteSlotPrivateAccessResource GetWebSiteSlotPrivateAccess() /// An object representing collection of WebSiteSlotPublicCertificateResources and their operations over a WebSiteSlotPublicCertificateResource. public virtual WebSiteSlotPublicCertificateCollection GetWebSiteSlotPublicCertificates() { - return GetCachedClient(Client => new WebSiteSlotPublicCertificateCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotPublicCertificateCollection(client, Id)); } /// @@ -1077,8 +1077,8 @@ public virtual WebSiteSlotPublicCertificateCollection GetWebSiteSlotPublicCertif /// /// Public certificate name. /// The cancellation token to use. - /// 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> GetWebSiteSlotPublicCertificateAsync(string publicCertificateName, CancellationToken cancellationToken = default) { @@ -1100,8 +1100,8 @@ public virtual async Task> GetWeb /// /// Public certificate name. /// The cancellation token to use. - /// 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 GetWebSiteSlotPublicCertificate(string publicCertificateName, CancellationToken cancellationToken = default) { @@ -1112,7 +1112,7 @@ public virtual Response GetWebSiteSlotPubl /// An object representing collection of WebSiteSlotExtensionResources and their operations over a WebSiteSlotExtensionResource. public virtual WebSiteSlotExtensionCollection GetWebSiteSlotExtensions() { - return GetCachedClient(Client => new WebSiteSlotExtensionCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotExtensionCollection(client, Id)); } /// @@ -1130,8 +1130,8 @@ public virtual WebSiteSlotExtensionCollection GetWebSiteSlotExtensions() /// /// Site extension name. /// The cancellation token to use. - /// 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> GetWebSiteSlotExtensionAsync(string siteExtensionId, CancellationToken cancellationToken = default) { @@ -1153,8 +1153,8 @@ public virtual async Task> GetWebSiteSlot /// /// Site extension name. /// The cancellation token to use. - /// 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 GetWebSiteSlotExtension(string siteExtensionId, CancellationToken cancellationToken = default) { @@ -1172,7 +1172,7 @@ public virtual MigrateMySqlStatusResource GetMigrateMySqlStatus() /// An object representing collection of NetworkFeatureResources and their operations over a NetworkFeatureResource. public virtual NetworkFeatureCollection GetNetworkFeatures() { - return GetCachedClient(Client => new NetworkFeatureCollection(Client, Id)); + return GetCachedClient(client => new NetworkFeatureCollection(client, Id)); } /// @@ -1190,8 +1190,8 @@ public virtual NetworkFeatureCollection GetNetworkFeatures() /// /// The type of view. Only "summary" is supported at this time. /// The cancellation token to use. - /// 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> GetNetworkFeatureAsync(string view, CancellationToken cancellationToken = default) { @@ -1213,8 +1213,8 @@ public virtual async Task> GetNetworkFeatureAsy /// /// The type of view. Only "summary" is supported at this time. /// The cancellation token to use. - /// 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 GetNetworkFeature(string view, CancellationToken cancellationToken = default) { @@ -1232,7 +1232,7 @@ public virtual WebSiteSlotSourceControlResource GetWebSiteSlotSourceControl() /// An object representing collection of WebSiteSlotTriggeredWebJobResources and their operations over a WebSiteSlotTriggeredWebJobResource. public virtual WebSiteSlotTriggeredWebJobCollection GetWebSiteSlotTriggeredWebJobs() { - return GetCachedClient(Client => new WebSiteSlotTriggeredWebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotTriggeredWebJobCollection(client, Id)); } /// @@ -1250,8 +1250,8 @@ public virtual WebSiteSlotTriggeredWebJobCollection GetWebSiteSlotTriggeredWebJo /// /// Name of Web Job. /// The cancellation token to use. - /// 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> GetWebSiteSlotTriggeredWebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -1273,8 +1273,8 @@ public virtual async Task> GetWebSi /// /// Name of Web Job. /// The cancellation token to use. - /// 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 GetWebSiteSlotTriggeredWebJob(string webJobName, CancellationToken cancellationToken = default) { @@ -1285,7 +1285,7 @@ public virtual Response GetWebSiteSlotTrigge /// An object representing collection of WebSiteSlotWebJobResources and their operations over a WebSiteSlotWebJobResource. public virtual WebSiteSlotWebJobCollection GetWebSiteSlotWebJobs() { - return GetCachedClient(Client => new WebSiteSlotWebJobCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotWebJobCollection(client, Id)); } /// @@ -1303,8 +1303,8 @@ public virtual WebSiteSlotWebJobCollection GetWebSiteSlotWebJobs() /// /// Name of the web job. /// The cancellation token to use. - /// 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> GetWebSiteSlotWebJobAsync(string webJobName, CancellationToken cancellationToken = default) { @@ -1326,8 +1326,8 @@ public virtual async Task> GetWebSiteSlotWeb /// /// Name of the web job. /// The cancellation token to use. - /// 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 GetWebSiteSlotWebJob(string webJobName, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotTriggeredWebJobResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotTriggeredWebJobResource.cs index fa0ee8f4c2cb..ddeb152ff680 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotTriggeredWebJobResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotTriggeredWebJobResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WebSiteSlotTriggeredWebJobHistoryResources and their operations over a WebSiteSlotTriggeredWebJobHistoryResource. public virtual WebSiteSlotTriggeredWebJobHistoryCollection GetWebSiteSlotTriggeredWebJobHistories() { - return GetCachedClient(Client => new WebSiteSlotTriggeredWebJobHistoryCollection(Client, Id)); + return GetCachedClient(client => new WebSiteSlotTriggeredWebJobHistoryCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual WebSiteSlotTriggeredWebJobHistoryCollection GetWebSiteSlotTrigger /// /// History ID. /// The cancellation token to use. - /// 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> GetWebSiteSlotTriggeredWebJobHistoryAsync(string id, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> G /// /// History ID. /// The cancellation token to use. - /// 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 GetWebSiteSlotTriggeredWebJobHistory(string id, CancellationToken cancellationToken = default) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteTriggeredwebJobResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteTriggeredwebJobResource.cs index 5c32bee20bb0..7e3e2f14d124 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteTriggeredwebJobResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteTriggeredwebJobResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WebSiteTriggeredWebJobHistoryResources and their operations over a WebSiteTriggeredWebJobHistoryResource. public virtual WebSiteTriggeredWebJobHistoryCollection GetWebSiteTriggeredWebJobHistories() { - return GetCachedClient(Client => new WebSiteTriggeredWebJobHistoryCollection(Client, Id)); + return GetCachedClient(client => new WebSiteTriggeredWebJobHistoryCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual WebSiteTriggeredWebJobHistoryCollection GetWebSiteTriggeredWebJob /// /// History ID. /// The cancellation token to use. - /// 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> GetWebSiteTriggeredWebJobHistoryAsync(string id, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetWe /// /// History ID. /// The cancellation token to use. - /// 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 GetWebSiteTriggeredWebJobHistory(string id, CancellationToken cancellationToken = default) { diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 123e4331487e..000000000000 --- a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.WorkloadMonitor -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HealthMonitorResources in the ResourceGroupResource. - /// The provider name (ex: Microsoft.Compute for virtual machines). - /// The resource collection name (ex: virtualMachines for virtual machines). - /// The name of the virtual machine. - /// An object representing collection of HealthMonitorResources and their operations over a HealthMonitorResource. - public virtual HealthMonitorCollection GetHealthMonitors(string providerName, string resourceCollectionName, string resourceName) - { - return new HealthMonitorCollection(Client, Id, providerName, resourceCollectionName, resourceName); - } - } -} diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorArmClientMockingExtension.cs b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorArmClientMockingExtension.cs new file mode 100644 index 000000000000..d65c7a25e3f6 --- /dev/null +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.WorkloadMonitor; + +namespace Azure.ResourceManager.WorkloadMonitor.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class WorkloadMonitorArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WorkloadMonitorArmClientMockingExtension() + { + } + + /// 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 WorkloadMonitorArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal WorkloadMonitorArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HealthMonitorResource GetHealthMonitorResource(ResourceIdentifier id) + { + HealthMonitorResource.ValidateResourceId(id); + return new HealthMonitorResource(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 HealthMonitorStateChangeResource GetHealthMonitorStateChangeResource(ResourceIdentifier id) + { + HealthMonitorStateChangeResource.ValidateResourceId(id); + return new HealthMonitorStateChangeResource(Client, id); + } + } +} diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorExtensions.cs b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorExtensions.cs index f4ca2693506f..6ca3ebcabe93 100644 --- a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorExtensions.cs +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorExtensions.cs @@ -12,80 +12,72 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.WorkloadMonitor.Mocking; namespace Azure.ResourceManager.WorkloadMonitor { /// A class to add extension methods to Azure.ResourceManager.WorkloadMonitor. public static partial class WorkloadMonitorExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static WorkloadMonitorArmClientMockingExtension GetWorkloadMonitorArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new WorkloadMonitorArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static WorkloadMonitorResourceGroupMockingExtension GetWorkloadMonitorResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new WorkloadMonitorResourceGroupMockingExtension(client, resource.Id)); } - #region HealthMonitorResource + /// /// 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. /// Returns a object. public static HealthMonitorResource GetHealthMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthMonitorResource.ValidateResourceId(id); - return new HealthMonitorResource(client, id); - } - ); + return GetWorkloadMonitorArmClientMockingExtension(client).GetHealthMonitorResource(id); } - #endregion - #region HealthMonitorStateChangeResource /// /// 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. /// Returns a object. public static HealthMonitorStateChangeResource GetHealthMonitorStateChangeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthMonitorStateChangeResource.ValidateResourceId(id); - return new HealthMonitorStateChangeResource(client, id); - } - ); + return GetWorkloadMonitorArmClientMockingExtension(client).GetHealthMonitorStateChangeResource(id); } - #endregion - /// Gets a collection of HealthMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of HealthMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The provider name (ex: Microsoft.Compute for virtual machines). /// The resource collection name (ex: virtualMachines for virtual machines). /// The name of the virtual machine. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of HealthMonitorResources and their operations over a HealthMonitorResource. public static HealthMonitorCollection GetHealthMonitors(this ResourceGroupResource resourceGroupResource, string providerName, string resourceCollectionName, string resourceName) { - Argument.AssertNotNullOrEmpty(providerName, nameof(providerName)); - Argument.AssertNotNullOrEmpty(resourceCollectionName, nameof(resourceCollectionName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHealthMonitors(providerName, resourceCollectionName, resourceName); + return GetWorkloadMonitorResourceGroupMockingExtension(resourceGroupResource).GetHealthMonitors(providerName, resourceCollectionName, resourceName); } /// @@ -100,6 +92,10 @@ public static HealthMonitorCollection GetHealthMonitors(this ResourceGroupResour /// HealthMonitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The provider name (ex: Microsoft.Compute for virtual machines). @@ -108,12 +104,12 @@ public static HealthMonitorCollection GetHealthMonitors(this ResourceGroupResour /// The monitor Id of the virtual machine. /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetHealthMonitorAsync(this ResourceGroupResource resourceGroupResource, string providerName, string resourceCollectionName, string resourceName, string monitorId, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHealthMonitors(providerName, resourceCollectionName, resourceName).GetAsync(monitorId, expand, cancellationToken).ConfigureAwait(false); + return await GetWorkloadMonitorResourceGroupMockingExtension(resourceGroupResource).GetHealthMonitorAsync(providerName, resourceCollectionName, resourceName, monitorId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -128,6 +124,10 @@ public static async Task> GetHealthMonitorAsync( /// HealthMonitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The provider name (ex: Microsoft.Compute for virtual machines). @@ -136,12 +136,12 @@ public static async Task> GetHealthMonitorAsync( /// The monitor Id of the virtual machine. /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetHealthMonitor(this ResourceGroupResource resourceGroupResource, string providerName, string resourceCollectionName, string resourceName, string monitorId, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHealthMonitors(providerName, resourceCollectionName, resourceName).Get(monitorId, expand, cancellationToken); + return GetWorkloadMonitorResourceGroupMockingExtension(resourceGroupResource).GetHealthMonitor(providerName, resourceCollectionName, resourceName, monitorId, expand, cancellationToken); } } } diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorResourceGroupMockingExtension.cs b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..eeb68657098f --- /dev/null +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/Extensions/WorkloadMonitorResourceGroupMockingExtension.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.WorkloadMonitor; + +namespace Azure.ResourceManager.WorkloadMonitor.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class WorkloadMonitorResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WorkloadMonitorResourceGroupMockingExtension() + { + } + + /// 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 WorkloadMonitorResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HealthMonitorResources in the ResourceGroupResource. + /// The provider name (ex: Microsoft.Compute for virtual machines). + /// The resource collection name (ex: virtualMachines for virtual machines). + /// The name of the virtual machine. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of HealthMonitorResources and their operations over a HealthMonitorResource. + public virtual HealthMonitorCollection GetHealthMonitors(string providerName, string resourceCollectionName, string resourceName) + { + return new HealthMonitorCollection(Client, Id, providerName, resourceCollectionName, resourceName); + } + + /// + /// Get the current health status of a monitor of a virtual machine. Optional parameter: $expand (retrieve the monitor's evidence and configuration). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceCollectionName}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId} + /// + /// + /// Operation Id + /// HealthMonitors_Get + /// + /// + /// + /// The provider name (ex: Microsoft.Compute for virtual machines). + /// The resource collection name (ex: virtualMachines for virtual machines). + /// The name of the virtual machine. + /// The monitor Id of the virtual machine. + /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHealthMonitorAsync(string providerName, string resourceCollectionName, string resourceName, string monitorId, string expand = null, CancellationToken cancellationToken = default) + { + return await GetHealthMonitors(providerName, resourceCollectionName, resourceName).GetAsync(monitorId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the current health status of a monitor of a virtual machine. Optional parameter: $expand (retrieve the monitor's evidence and configuration). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceCollectionName}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId} + /// + /// + /// Operation Id + /// HealthMonitors_Get + /// + /// + /// + /// The provider name (ex: Microsoft.Compute for virtual machines). + /// The resource collection name (ex: virtualMachines for virtual machines). + /// The name of the virtual machine. + /// The monitor Id of the virtual machine. + /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHealthMonitor(string providerName, string resourceCollectionName, string resourceName, string monitorId, string expand = null, CancellationToken cancellationToken = default) + { + return GetHealthMonitors(providerName, resourceCollectionName, resourceName).Get(monitorId, expand, cancellationToken); + } + } +} diff --git a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/HealthMonitorResource.cs b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/HealthMonitorResource.cs index f73d7c4fd9fa..7aabe58a6e3d 100644 --- a/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/HealthMonitorResource.cs +++ b/sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/src/Generated/HealthMonitorResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HealthMonitorStateChangeResources and their operations over a HealthMonitorStateChangeResource. public virtual HealthMonitorStateChangeCollection GetHealthMonitorStateChanges() { - return GetCachedClient(Client => new HealthMonitorStateChangeCollection(Client, Id)); + return GetCachedClient(client => new HealthMonitorStateChangeCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HealthMonitorStateChangeCollection GetHealthMonitorStateChanges() /// The timestamp of the state change (unix format). /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. /// The cancellation token to use. - /// 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> GetHealthMonitorStateChangeAsync(string timestampUnix, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetHealthM /// The timestamp of the state change (unix format). /// Optionally expand the monitor’s evidence and/or configuration. Example: $expand=evidence,configuration. /// The cancellation token to use. - /// 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 GetHealthMonitorStateChange(string timestampUnix, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 2a4a6b730ed1..000000000000 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Workloads -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. - /// An object representing collection of SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. - public virtual SapVirtualInstanceCollection GetSapVirtualInstances() - { - return GetCachedClient(Client => new SapVirtualInstanceCollection(Client, Id)); - } - - /// Gets a collection of SapMonitorResources in the ResourceGroupResource. - /// An object representing collection of SapMonitorResources and their operations over a SapMonitorResource. - public virtual SapMonitorCollection GetSapMonitors() - { - return GetCachedClient(Client => new SapMonitorCollection(Client, Id)); - } - } -} diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsArmClientMockingExtension.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsArmClientMockingExtension.cs new file mode 100644 index 000000000000..cc0c9fc273f9 --- /dev/null +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Workloads; + +namespace Azure.ResourceManager.Workloads.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class WorkloadsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WorkloadsArmClientMockingExtension() + { + } + + /// 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 WorkloadsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal WorkloadsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SapVirtualInstanceResource GetSapVirtualInstanceResource(ResourceIdentifier id) + { + SapVirtualInstanceResource.ValidateResourceId(id); + return new SapVirtualInstanceResource(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 SapCentralServerInstanceResource GetSapCentralServerInstanceResource(ResourceIdentifier id) + { + SapCentralServerInstanceResource.ValidateResourceId(id); + return new SapCentralServerInstanceResource(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 SapDatabaseInstanceResource GetSapDatabaseInstanceResource(ResourceIdentifier id) + { + SapDatabaseInstanceResource.ValidateResourceId(id); + return new SapDatabaseInstanceResource(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 SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(ResourceIdentifier id) + { + SapApplicationServerInstanceResource.ValidateResourceId(id); + return new SapApplicationServerInstanceResource(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 SapMonitorResource GetSapMonitorResource(ResourceIdentifier id) + { + SapMonitorResource.ValidateResourceId(id); + return new SapMonitorResource(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 SapProviderInstanceResource GetSapProviderInstanceResource(ResourceIdentifier id) + { + SapProviderInstanceResource.ValidateResourceId(id); + return new SapProviderInstanceResource(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 SapLandscapeMonitorResource GetSapLandscapeMonitorResource(ResourceIdentifier id) + { + SapLandscapeMonitorResource.ValidateResourceId(id); + return new SapLandscapeMonitorResource(Client, id); + } + } +} diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsExtensions.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsExtensions.cs index 951403ed3a57..78b38805cbd2 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsExtensions.cs +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Workloads.Mocking; using Azure.ResourceManager.Workloads.Models; namespace Azure.ResourceManager.Workloads @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.Workloads /// A class to add extension methods to Azure.ResourceManager.Workloads. public static partial class WorkloadsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static WorkloadsArmClientMockingExtension GetWorkloadsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new WorkloadsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static WorkloadsResourceGroupMockingExtension GetWorkloadsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new WorkloadsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static WorkloadsSubscriptionMockingExtension GetWorkloadsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new WorkloadsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SapVirtualInstanceResource /// /// 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. /// Returns a object. public static SapVirtualInstanceResource GetSapVirtualInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapVirtualInstanceResource.ValidateResourceId(id); - return new SapVirtualInstanceResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapVirtualInstanceResource(id); } - #endregion - #region SapCentralServerInstanceResource /// /// 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. /// Returns a object. public static SapCentralServerInstanceResource GetSapCentralServerInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapCentralServerInstanceResource.ValidateResourceId(id); - return new SapCentralServerInstanceResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapCentralServerInstanceResource(id); } - #endregion - #region SapDatabaseInstanceResource /// /// 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. /// Returns a object. public static SapDatabaseInstanceResource GetSapDatabaseInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapDatabaseInstanceResource.ValidateResourceId(id); - return new SapDatabaseInstanceResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapDatabaseInstanceResource(id); } - #endregion - #region SapApplicationServerInstanceResource /// /// 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. /// Returns a object. public static SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapApplicationServerInstanceResource.ValidateResourceId(id); - return new SapApplicationServerInstanceResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapApplicationServerInstanceResource(id); } - #endregion - #region SapMonitorResource /// /// 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. /// Returns a object. public static SapMonitorResource GetSapMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapMonitorResource.ValidateResourceId(id); - return new SapMonitorResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapMonitorResource(id); } - #endregion - #region SapProviderInstanceResource /// /// 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. /// Returns a object. public static SapProviderInstanceResource GetSapProviderInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapProviderInstanceResource.ValidateResourceId(id); - return new SapProviderInstanceResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapProviderInstanceResource(id); } - #endregion - #region SapLandscapeMonitorResource /// /// 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. /// Returns a object. public static SapLandscapeMonitorResource GetSapLandscapeMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SapLandscapeMonitorResource.ValidateResourceId(id); - return new SapLandscapeMonitorResource(client, id); - } - ); + return GetWorkloadsArmClientMockingExtension(client).GetSapLandscapeMonitorResource(id); } - #endregion - /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. + /// + /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. public static SapVirtualInstanceCollection GetSapVirtualInstances(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSapVirtualInstances(); + return GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapVirtualInstances(); } /// @@ -203,16 +173,20 @@ public static SapVirtualInstanceCollection GetSapVirtualInstances(this ResourceG /// SAPVirtualInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Virtual Instances for SAP solutions resource. /// The cancellation token to use. - /// 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 static async Task> GetSapVirtualInstanceAsync(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSapVirtualInstances().GetAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapVirtualInstanceAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); } /// @@ -227,24 +201,34 @@ public static async Task> GetSapVirtualInst /// SAPVirtualInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Virtual Instances for SAP solutions resource. /// The cancellation token to use. - /// 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 static Response GetSapVirtualInstance(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSapVirtualInstances().Get(sapVirtualInstanceName, cancellationToken); + return GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapVirtualInstance(sapVirtualInstanceName, cancellationToken); } - /// Gets a collection of SapMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of SapMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SapMonitorResources and their operations over a SapMonitorResource. public static SapMonitorCollection GetSapMonitors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSapMonitors(); + return GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapMonitors(); } /// @@ -259,16 +243,20 @@ public static SapMonitorCollection GetSapMonitors(this ResourceGroupResource res /// monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SAP monitor resource. /// The cancellation token to use. - /// 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 static async Task> GetSapMonitorAsync(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSapMonitors().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapMonitorAsync(monitorName, cancellationToken).ConfigureAwait(false); } /// @@ -283,16 +271,20 @@ public static async Task> GetSapMonitorAsync(this R /// monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SAP monitor resource. /// The cancellation token to use. - /// 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 static Response GetSapMonitor(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSapMonitors().Get(monitorName, cancellationToken); + return GetWorkloadsResourceGroupMockingExtension(resourceGroupResource).GetSapMonitor(monitorName, cancellationToken); } /// @@ -307,6 +299,10 @@ public static Response GetSapMonitor(this ResourceGroupResou /// SAPSizingRecommendations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -314,7 +310,7 @@ public static Response GetSapMonitor(this ResourceGroupResou /// The cancellation token to use. public static async Task> SapSizingRecommendationsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SapSizingRecommendationsAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapSizingRecommendationsAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -329,6 +325,10 @@ public static async Task> SapSizingRecom /// SAPSizingRecommendations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -336,7 +336,7 @@ public static async Task> SapSizingRecom /// The cancellation token to use. public static Response SapSizingRecommendations(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SapSizingRecommendations(location, content, cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapSizingRecommendations(location, content, cancellationToken); } /// @@ -351,6 +351,10 @@ public static Response SapSizingRecommendations(t /// SAPSupportedSku /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -358,7 +362,7 @@ public static Response SapSizingRecommendations(t /// The cancellation token to use. public static async Task> SapSupportedSkuAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SapSupportedSkuAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapSupportedSkuAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -373,6 +377,10 @@ public static async Task> SapSupportedS /// SAPSupportedSku /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -380,7 +388,7 @@ public static async Task> SapSupportedS /// The cancellation token to use. public static Response SapSupportedSku(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SapSupportedSku(location, content, cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapSupportedSku(location, content, cancellationToken); } /// @@ -395,6 +403,10 @@ public static Response SapSupportedSku(this Subs /// SAPDiskConfigurations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -402,7 +414,7 @@ public static Response SapSupportedSku(this Subs /// The cancellation token to use. public static async Task> SapDiskConfigurationsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SapDiskConfigurationsAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapDiskConfigurationsAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -417,6 +429,10 @@ public static async Task> SapDiskConfigura /// SAPDiskConfigurations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -424,7 +440,7 @@ public static async Task> SapDiskConfigura /// The cancellation token to use. public static Response SapDiskConfigurations(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SapDiskConfigurations(location, content, cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapDiskConfigurations(location, content, cancellationToken); } /// @@ -439,6 +455,10 @@ public static Response SapDiskConfigurations(this S /// SAPAvailabilityZoneDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -446,7 +466,7 @@ public static Response SapDiskConfigurations(this S /// The cancellation token to use. public static async Task> SapAvailabilityZoneDetailsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SapAvailabilityZoneDetailsAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapAvailabilityZoneDetailsAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -461,6 +481,10 @@ public static async Task> SapAvailabi /// SAPAvailabilityZoneDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -468,7 +492,7 @@ public static async Task> SapAvailabi /// The cancellation token to use. public static Response SapAvailabilityZoneDetails(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SapAvailabilityZoneDetails(location, content, cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).SapAvailabilityZoneDetails(location, content, cancellationToken); } /// @@ -483,13 +507,17 @@ public static Response SapAvailabilityZoneDeta /// SAPVirtualInstances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSapVirtualInstancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSapVirtualInstancesAsync(cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).GetSapVirtualInstancesAsync(cancellationToken); } /// @@ -504,13 +532,17 @@ public static AsyncPageable GetSapVirtualInstancesAs /// SAPVirtualInstances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSapVirtualInstances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSapVirtualInstances(cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).GetSapVirtualInstances(cancellationToken); } /// @@ -525,13 +557,17 @@ public static Pageable GetSapVirtualInstances(this S /// monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSapMonitorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSapMonitorsAsync(cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).GetSapMonitorsAsync(cancellationToken); } /// @@ -546,13 +582,17 @@ public static AsyncPageable GetSapMonitorsAsync(this Subscri /// monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSapMonitors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSapMonitors(cancellationToken); + return GetWorkloadsSubscriptionMockingExtension(subscriptionResource).GetSapMonitors(cancellationToken); } } } diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsResourceGroupMockingExtension.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c873d36c6b09 --- /dev/null +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Workloads; + +namespace Azure.ResourceManager.Workloads.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class WorkloadsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected WorkloadsResourceGroupMockingExtension() + { + } + + /// 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 WorkloadsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. + /// An object representing collection of SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. + public virtual SapVirtualInstanceCollection GetSapVirtualInstances() + { + return GetCachedClient(client => new SapVirtualInstanceCollection(client, Id)); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstances_Get + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapVirtualInstanceAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapVirtualInstances().GetAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstances_Get + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapVirtualInstance(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return GetSapVirtualInstances().Get(sapVirtualInstanceName, cancellationToken); + } + + /// Gets a collection of SapMonitorResources in the ResourceGroupResource. + /// An object representing collection of SapMonitorResources and their operations over a SapMonitorResource. + public virtual SapMonitorCollection GetSapMonitors() + { + return GetCachedClient(client => new SapMonitorCollection(client, Id)); + } + + /// + /// Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName} + /// + /// + /// Operation Id + /// monitors_Get + /// + /// + /// + /// Name of the SAP monitor resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapMonitorAsync(string monitorName, CancellationToken cancellationToken = default) + { + return await GetSapMonitors().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName} + /// + /// + /// Operation Id + /// monitors_Get + /// + /// + /// + /// Name of the SAP monitor resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapMonitor(string monitorName, CancellationToken cancellationToken = default) + { + return GetSapMonitors().Get(monitorName, cancellationToken); + } + } +} diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsSubscriptionMockingExtension.cs similarity index 93% rename from sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsSubscriptionMockingExtension.cs index 10ec8a07075a..aad177ed7c2c 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/Extensions/WorkloadsSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Workloads; using Azure.ResourceManager.Workloads.Models; -namespace Azure.ResourceManager.Workloads +namespace Azure.ResourceManager.Workloads.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class WorkloadsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private WorkloadsRestOperations _defaultRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _sapMonitormonitorsClientDiagnostics; private MonitorsRestOperations _sapMonitormonitorsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected WorkloadsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal WorkloadsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,7 +71,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> SapSizingRecommendationsAsync(AzureLocation location, SapSizingRecommendationContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapSizingRecommendations"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapSizingRecommendations"); scope.Start(); try { @@ -102,7 +103,7 @@ public virtual async Task> SapSizingReco /// The cancellation token to use. public virtual Response SapSizingRecommendations(AzureLocation location, SapSizingRecommendationContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapSizingRecommendations"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapSizingRecommendations"); scope.Start(); try { @@ -134,7 +135,7 @@ public virtual Response SapSizingRecommendations( /// The cancellation token to use. public virtual async Task> SapSupportedSkuAsync(AzureLocation location, SapSupportedSkusContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapSupportedSku"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapSupportedSku"); scope.Start(); try { @@ -166,7 +167,7 @@ public virtual async Task> SapSupported /// The cancellation token to use. public virtual Response SapSupportedSku(AzureLocation location, SapSupportedSkusContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapSupportedSku"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapSupportedSku"); scope.Start(); try { @@ -198,7 +199,7 @@ public virtual Response SapSupportedSku(AzureLoc /// The cancellation token to use. public virtual async Task> SapDiskConfigurationsAsync(AzureLocation location, SapDiskConfigurationsContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapDiskConfigurations"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapDiskConfigurations"); scope.Start(); try { @@ -230,7 +231,7 @@ public virtual async Task> SapDiskConfigur /// The cancellation token to use. public virtual Response SapDiskConfigurations(AzureLocation location, SapDiskConfigurationsContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapDiskConfigurations"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapDiskConfigurations"); scope.Start(); try { @@ -262,7 +263,7 @@ public virtual Response SapDiskConfigurations(Azure /// The cancellation token to use. public virtual async Task> SapAvailabilityZoneDetailsAsync(AzureLocation location, SapAvailabilityZoneDetailsContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapAvailabilityZoneDetails"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapAvailabilityZoneDetails"); scope.Start(); try { @@ -294,7 +295,7 @@ public virtual async Task> SapAvailab /// The cancellation token to use. public virtual Response SapAvailabilityZoneDetails(AzureLocation location, SapAvailabilityZoneDetailsContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SapAvailabilityZoneDetails"); + using var scope = DefaultClientDiagnostics.CreateScope("WorkloadsSubscriptionMockingExtension.SapAvailabilityZoneDetails"); scope.Start(); try { @@ -327,7 +328,7 @@ public virtual AsyncPageable GetSapVirtualInstancesA { HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceSAPVirtualInstancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceSAPVirtualInstancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceSAPVirtualInstancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceSAPVirtualInstancesClientDiagnostics, Pipeline, "WorkloadsSubscriptionMockingExtension.GetSapVirtualInstances", "value", "nextLink", cancellationToken); } /// @@ -349,7 +350,7 @@ public virtual Pageable GetSapVirtualInstances(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceSAPVirtualInstancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceSAPVirtualInstancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceSAPVirtualInstancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceSAPVirtualInstancesClientDiagnostics, Pipeline, "WorkloadsSubscriptionMockingExtension.GetSapVirtualInstances", "value", "nextLink", cancellationToken); } /// @@ -371,7 +372,7 @@ public virtual AsyncPageable GetSapMonitorsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => SapMonitormonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapMonitormonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapMonitorResource(Client, SapMonitorData.DeserializeSapMonitorData(e)), SapMonitormonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSapMonitors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapMonitorResource(Client, SapMonitorData.DeserializeSapMonitorData(e)), SapMonitormonitorsClientDiagnostics, Pipeline, "WorkloadsSubscriptionMockingExtension.GetSapMonitors", "value", "nextLink", cancellationToken); } /// @@ -393,7 +394,7 @@ public virtual Pageable GetSapMonitors(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => SapMonitormonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapMonitormonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapMonitorResource(Client, SapMonitorData.DeserializeSapMonitorData(e)), SapMonitormonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSapMonitors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapMonitorResource(Client, SapMonitorData.DeserializeSapMonitorData(e)), SapMonitormonitorsClientDiagnostics, Pipeline, "WorkloadsSubscriptionMockingExtension.GetSapMonitors", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapMonitorResource.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapMonitorResource.cs index 931e734039af..2f1aeaf0e654 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapMonitorResource.cs +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapMonitorResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SapProviderInstanceResources and their operations over a SapProviderInstanceResource. public virtual SapProviderInstanceCollection GetSapProviderInstances() { - return GetCachedClient(Client => new SapProviderInstanceCollection(Client, Id)); + return GetCachedClient(client => new SapProviderInstanceCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual SapProviderInstanceCollection GetSapProviderInstances() /// /// Name of the provider instance. /// The cancellation token to use. - /// 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> GetSapProviderInstanceAsync(string providerInstanceName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetSapProviderI /// /// Name of the provider instance. /// The cancellation token to use. - /// 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 GetSapProviderInstance(string providerInstanceName, CancellationToken cancellationToken = default) { diff --git a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapVirtualInstanceResource.cs b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapVirtualInstanceResource.cs index 898ef6de1223..c6633d87ee17 100644 --- a/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapVirtualInstanceResource.cs +++ b/sdk/workloads/Azure.ResourceManager.Workloads/src/Generated/SapVirtualInstanceResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SapCentralServerInstanceResources and their operations over a SapCentralServerInstanceResource. public virtual SapCentralServerInstanceCollection GetSapCentralServerInstances() { - return GetCachedClient(Client => new SapCentralServerInstanceCollection(Client, Id)); + return GetCachedClient(client => new SapCentralServerInstanceCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual SapCentralServerInstanceCollection GetSapCentralServerInstances() /// /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. - /// 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> GetSapCentralServerInstanceAsync(string centralInstanceName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetSapCent /// /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. - /// 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 GetSapCentralServerInstance(string centralInstanceName, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetSapCentralServerIns /// An object representing collection of SapDatabaseInstanceResources and their operations over a SapDatabaseInstanceResource. public virtual SapDatabaseInstanceCollection GetSapDatabaseInstances() { - return GetCachedClient(Client => new SapDatabaseInstanceCollection(Client, Id)); + return GetCachedClient(client => new SapDatabaseInstanceCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual SapDatabaseInstanceCollection GetSapDatabaseInstances() /// /// Database resource name string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. - /// 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> GetSapDatabaseInstanceAsync(string databaseInstanceName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetSapDatabaseI /// /// Database resource name string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. - /// 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 GetSapDatabaseInstance(string databaseInstanceName, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetSapDatabaseInstance(stri /// An object representing collection of SapApplicationServerInstanceResources and their operations over a SapApplicationServerInstanceResource. public virtual SapApplicationServerInstanceCollection GetSapApplicationServerInstances() { - return GetCachedClient(Client => new SapApplicationServerInstanceCollection(Client, Id)); + return GetCachedClient(client => new SapApplicationServerInstanceCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual SapApplicationServerInstanceCollection GetSapApplicationServerIns /// /// The name of SAP Application Server instance resource. /// The cancellation token to use. - /// 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> GetSapApplicationServerInstanceAsync(string applicationInstanceName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetSap /// /// The name of SAP Application Server instance resource. /// The cancellation token to use. - /// 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 GetSapApplicationServerInstance(string applicationInstanceName, CancellationToken cancellationToken = default) { From 9d4c9783562475f27bcea626604f2c2a7622b3bd Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:24:56 +0000 Subject: [PATCH 5/8] Update SDK codes me_pu_4 --- .../MediaArmClientMockingExtension.cs | 219 + .../Generated/Extensions/MediaExtensions.cs | 278 +- .../MediaResourceGroupMockingExtension.cs | 92 + ...s => MediaSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/MediaAssetResource.cs | 12 +- .../src/Generated/MediaLiveEventResource.cs | 6 +- .../Generated/MediaServicesAccountResource.cs | 60 +- .../src/Generated/MediaTransformResource.cs | 6 +- .../MixedRealityArmClientMockingExtension.cs | 63 + .../Extensions/MixedRealityExtensions.cs | 147 +- ...xedRealityResourceGroupMockingExtension.cs | 145 + ...xedRealitySubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../MobileNetworkArmClientMockingExtension.cs | 219 + .../Extensions/MobileNetworkExtensions.cs | 405 +- ...ileNetworkResourceGroupMockingExtension.cs | 198 + ...ileNetworkSubscriptionMockingExtension.cs} | 75 +- .../MobileNetworkTenantMockingExtension.cs | 92 + .../ResourceGroupResourceExtensionClient.cs | 55 - .../TenantResourceExtensionClient.cs | 41 - .../src/Generated/MobileNetworkResource.cs | 30 +- .../MobileNetworkSimGroupResource.cs | 6 +- .../PacketCoreControlPlaneResource.cs | 18 +- .../Generated/PacketCoreDataPlaneResource.cs | 6 +- .../Extensions/ArmResourceExtensionClient.cs | 261 -- .../MonitorArmClientMockingExtension.cs | 647 +++ .../Generated/Extensions/MonitorExtensions.cs | 1392 ++++--- .../MonitorResourceGroupMockingExtension.cs | 647 +++ ...=> MonitorSubscriptionMockingExtension.cs} | 133 +- ...nt.cs => MonitorTenantMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 178 - .../MonitorPrivateLinkScopeResource.cs | 18 +- .../MySqlArmClientMockingExtension.cs | 219 + .../Generated/Extensions/MySqlExtensions.cs | 290 +- .../MySqlResourceGroupMockingExtension.cs | 92 + ...s => MySqlSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../MySql/Generated/MySqlAdvisorResource.cs | 6 +- .../MySql/Generated/MySqlServerResource.cs | 68 +- .../Extensions/FlexibleServersExtensions.cs | 232 +- ...lexibleServersArmClientMockingExtension.cs | 111 + ...bleServersResourceGroupMockingExtension.cs | 92 + ...bleServersSubscriptionMockingExtension.cs} | 51 +- ...lFlexibleServersTenantMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/MySqlFlexibleServerResource.cs | 26 +- .../src/Generated/CapacityPoolResource.cs | 6 +- .../NetAppArmClientMockingExtension.cs | 147 + .../Generated/Extensions/NetAppExtensions.cs | 304 +- .../NetAppResourceGroupMockingExtension.cs | 92 + ... => NetAppSubscriptionMockingExtension.cs} | 87 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/NetAppAccountResource.cs | 24 +- .../src/Generated/NetAppVolumeResource.cs | 18 +- .../src/Generated/AdminRuleGroupResource.cs | 6 +- .../Generated/ApplicationGatewayResource.cs | 6 +- .../ExpressRouteCircuitPeeringResource.cs | 12 +- .../Generated/ExpressRouteCircuitResource.cs | 12 +- .../ExpressRouteCrossConnectionResource.cs | 6 +- .../Generated/ExpressRouteGatewayResource.cs | 6 +- .../src/Generated/ExpressRoutePortResource.cs | 12 +- .../ManagementGroupResourceExtensionClient.cs | 41 - .../NetworkArmClientMockingExtension.cs | 1335 ++++++ .../Generated/Extensions/NetworkExtensions.cs | 3612 ++++++++++------- .../NetworkManagementGroupMockingExtension.cs | 92 + .../NetworkResourceGroupMockingExtension.cs | 2748 +++++++++++++ ...=> NetworkSubscriptionMockingExtension.cs} | 567 ++- .../ResourceGroupResourceExtensionClient.cs | 631 --- .../src/Generated/FirewallPolicyResource.cs | 6 +- .../src/Generated/LoadBalancerResource.cs | 36 +- .../src/Generated/NetworkGroupResource.cs | 6 +- .../src/Generated/NetworkInterfaceResource.cs | 12 +- .../src/Generated/NetworkManagerResource.cs | 24 +- .../Generated/NetworkSecurityGroupResource.cs | 12 +- .../NetworkVirtualApplianceResource.cs | 12 +- .../src/Generated/NetworkWatcherResource.cs | 18 +- .../src/Generated/PrivateEndpointResource.cs | 6 +- .../Generated/PrivateLinkServiceResource.cs | 6 +- .../src/Generated/RouteFilterResource.cs | 6 +- .../src/Generated/RouteTableResource.cs | 6 +- .../SecurityAdminConfigurationResource.cs | 6 +- .../ServiceEndpointPolicyResource.cs | 6 +- .../src/Generated/VirtualHubResource.cs | 42 +- .../VirtualNetworkGatewayResource.cs | 6 +- .../src/Generated/VirtualNetworkResource.cs | 12 +- .../src/Generated/VirtualRouterResource.cs | 6 +- .../src/Generated/VpnConnectionResource.cs | 6 +- .../src/Generated/VpnGatewayResource.cs | 12 +- .../VpnServerConfigurationResource.cs | 6 +- .../src/Generated/VpnSiteResource.cs | 6 +- .../NetworkCloudArmClientMockingExtension.cs | 255 ++ .../Extensions/NetworkCloudExtensions.cs | 745 ++-- ...tworkCloudResourceGroupMockingExtension.cs | 675 +++ ...tworkCloudSubscriptionMockingExtension.cs} | 111 +- .../ResourceGroupResourceExtensionClient.cs | 118 - .../Generated/NetworkCloudClusterResource.cs | 18 +- .../NetworkCloudKubernetesClusterResource.cs | 6 +- .../NetworkCloudVirtualMachineResource.cs | 6 +- .../AzureTrafficCollectorResource.cs | 6 +- ...etworkFunctionArmClientMockingExtension.cs | 63 + .../Extensions/NetworkFunctionExtensions.cs | 93 +- ...rkFunctionResourceGroupMockingExtension.cs | 92 + ...rkFunctionSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...cObservabilityArmClientMockingExtension.cs | 63 + .../NewRelicObservabilityExtensions.cs | 137 +- ...ervabilityResourceGroupMockingExtension.cs | 92 + ...ervabilitySubscriptionMockingExtension.cs} | 42 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/NewRelicMonitorResource.cs | 6 +- .../NginxArmClientMockingExtension.cs | 75 + .../Generated/Extensions/NginxExtensions.cs | 106 +- .../NginxResourceGroupMockingExtension.cs | 92 + ...s => NginxSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/NginxDeploymentResource.cs | 12 +- ...tificationHubsArmClientMockingExtension.cs | 87 + .../Extensions/NotificationHubsExtensions.cs | 135 +- ...cationHubsResourceGroupMockingExtension.cs | 92 + ...cationHubsSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../NotificationHubNamespaceResource.cs | 12 +- .../src/Generated/NotificationHubResource.cs | 6 +- ...EnergyServicesArmClientMockingExtension.cs | 51 + .../Extensions/EnergyServicesExtensions.cs | 96 +- ...gyServicesResourceGroupMockingExtension.cs | 92 + ...gyServicesSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...tionalInsightsArmClientMockingExtension.cs | 171 + .../OperationalInsightsExtensions.cs | 326 +- ...lInsightsResourceGroupMockingExtension.cs} | 171 +- ...alInsightsSubscriptionMockingExtension.cs} | 29 +- .../LogAnalyticsQueryPackResource.cs | 6 +- .../OperationalInsightsWorkspaceResource.cs | 38 +- .../OrbitalArmClientMockingExtension.cs | 87 + .../Generated/Extensions/OrbitalExtensions.cs | 183 +- .../OrbitalResourceGroupMockingExtension.cs | 145 + ...=> OrbitalSubscriptionMockingExtension.cs} | 71 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../Generated/OrbitalSpacecraftResource.cs | 6 +- .../Generated/Extensions/NgfwExtensions.cs | 315 +- ...toNetworksNgfwArmClientMockingExtension.cs | 195 + ...tworksNgfwResourceGroupMockingExtension.cs | 145 + ...tworksNgfwSubscriptionMockingExtension.cs} | 21 +- ...oAltoNetworksNgfwTenantMockingExtension.cs | 92 + .../ResourceGroupResourceExtensionClient.cs | 48 - .../TenantResourceExtensionClient.cs | 41 - .../src/Generated/GlobalRulestackResource.cs | 30 +- .../src/Generated/LocalRulestackResource.cs | 24 +- .../PeeringArmClientMockingExtension.cs | 123 + .../Generated/Extensions/PeeringExtensions.cs | 348 +- .../PeeringResourceGroupMockingExtension.cs | 145 + ...=> PeeringSubscriptionMockingExtension.cs} | 131 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../src/Generated/PeeringResource.cs | 12 +- .../src/Generated/PeeringServiceResource.cs | 12 +- ...olicyInsightsArmClientMockingExtension.cs} | 234 +- .../Extensions/PolicyInsightsExtensions.cs | 514 ++- ...nsightsManagementGroupMockingExtension.cs} | 39 +- ...yInsightsResourceGroupMockingExtension.cs} | 215 +- ...icyInsightsSubscriptionMockingExtension.cs | 902 ++++ .../PolicyInsightsTenantMockingExtension.cs | 90 + .../SubscriptionResourceExtensionClient.cs | 379 -- .../TenantResourceExtensionClient.cs | 41 - .../PostgreSqlArmClientMockingExtension.cs | 159 + .../Extensions/PostgreSqlExtensions.cs | 225 +- ...PostgreSqlResourceGroupMockingExtension.cs | 92 + ...PostgreSqlSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/PostgreSqlServerResource.cs | 44 +- .../Extensions/FlexibleServersExtensions.cs | 258 +- ...lexibleServersArmClientMockingExtension.cs | 135 + ...bleServersResourceGroupMockingExtension.cs | 92 + ...bleServersSubscriptionMockingExtension.cs} | 51 +- ...lFlexibleServersTenantMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../PostgreSqlFlexibleServerResource.cs | 42 +- ...werBIDedicatedArmClientMockingExtension.cs | 63 + .../Extensions/PowerBIDedicatedExtensions.cs | 159 +- ...IDedicatedResourceGroupMockingExtension.cs | 145 + ...IDedicatedSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../PrivateDnsArmClientMockingExtension.cs | 159 + .../Extensions/PrivateDnsExtensions.cs | 197 +- ...PrivateDnsResourceGroupMockingExtension.cs | 92 + ...PrivateDnsSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ProviderHubArmClientMockingExtension.cs | 147 + .../Extensions/ProviderHubExtensions.cs | 159 +- ...ProviderHubSubscriptionMockingExtension.cs | 92 + .../SubscriptionResourceExtensionClient.cs | 41 - .../Generated/ProviderRegistrationResource.cs | 24 +- .../ResourceTypeRegistrationResource.cs | 33 +- 194 files changed, 20654 insertions(+), 8125 deletions(-) create mode 100644 sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaArmClientMockingExtension.cs create mode 100644 sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaResourceGroupMockingExtension.cs rename sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MediaSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityArmClientMockingExtension.cs create mode 100644 sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityResourceGroupMockingExtension.cs rename sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MixedRealitySubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkArmClientMockingExtension.cs create mode 100644 sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkResourceGroupMockingExtension.cs rename sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MobileNetworkSubscriptionMockingExtension.cs} (74%) create mode 100644 sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkTenantMockingExtension.cs delete mode 100644 sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/TenantResourceExtensionClient.cs delete mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorArmClientMockingExtension.cs create mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorResourceGroupMockingExtension.cs rename sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MonitorSubscriptionMockingExtension.cs} (88%) rename sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/{TenantResourceExtensionClient.cs => MonitorTenantMockingExtension.cs} (93%) delete mode 100644 sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlArmClientMockingExtension.cs create mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlResourceGroupMockingExtension.cs rename sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MySqlSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersArmClientMockingExtension.cs create mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersResourceGroupMockingExtension.cs rename sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => MySqlFlexibleServersSubscriptionMockingExtension.cs} (86%) rename sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/{TenantResourceExtensionClient.cs => MySqlFlexibleServersTenantMockingExtension.cs} (84%) delete mode 100644 sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppArmClientMockingExtension.cs create mode 100644 sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppResourceGroupMockingExtension.cs rename sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NetAppSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs create mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkArmClientMockingExtension.cs create mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkManagementGroupMockingExtension.cs create mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkResourceGroupMockingExtension.cs rename sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NetworkSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudArmClientMockingExtension.cs create mode 100644 sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudResourceGroupMockingExtension.cs rename sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NetworkCloudSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionArmClientMockingExtension.cs create mode 100644 sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionResourceGroupMockingExtension.cs rename sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NetworkFunctionSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityArmClientMockingExtension.cs create mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityResourceGroupMockingExtension.cs rename sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NewRelicObservabilitySubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxArmClientMockingExtension.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxResourceGroupMockingExtension.cs rename sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NginxSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsArmClientMockingExtension.cs create mode 100644 sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsResourceGroupMockingExtension.cs rename sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => NotificationHubsSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesArmClientMockingExtension.cs create mode 100644 sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesResourceGroupMockingExtension.cs rename sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => EnergyServicesSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsArmClientMockingExtension.cs rename sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => OperationalInsightsResourceGroupMockingExtension.cs} (50%) rename sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => OperationalInsightsSubscriptionMockingExtension.cs} (90%) create mode 100644 sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalArmClientMockingExtension.cs create mode 100644 sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalResourceGroupMockingExtension.cs rename sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => OrbitalSubscriptionMockingExtension.cs} (75%) delete mode 100644 sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwArmClientMockingExtension.cs create mode 100644 sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwResourceGroupMockingExtension.cs rename sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PaloAltoNetworksNgfwSubscriptionMockingExtension.cs} (87%) create mode 100644 sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwTenantMockingExtension.cs delete mode 100644 sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringArmClientMockingExtension.cs create mode 100644 sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringResourceGroupMockingExtension.cs rename sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PeeringSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/{ArmResourceExtensionClient.cs => PolicyInsightsArmClientMockingExtension.cs} (51%) rename sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/{ManagementGroupResourceExtensionClient.cs => PolicyInsightsManagementGroupMockingExtension.cs} (90%) rename sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => PolicyInsightsResourceGroupMockingExtension.cs} (58%) create mode 100644 sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsSubscriptionMockingExtension.cs create mode 100644 sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsTenantMockingExtension.cs delete mode 100644 sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs delete mode 100644 sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlArmClientMockingExtension.cs create mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlResourceGroupMockingExtension.cs rename sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PostgreSqlSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersArmClientMockingExtension.cs create mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersResourceGroupMockingExtension.cs rename sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PostgreSqlFlexibleServersSubscriptionMockingExtension.cs} (85%) rename sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/{TenantResourceExtensionClient.cs => PostgreSqlFlexibleServersTenantMockingExtension.cs} (83%) delete mode 100644 sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedArmClientMockingExtension.cs create mode 100644 sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedResourceGroupMockingExtension.cs rename sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PowerBIDedicatedSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsArmClientMockingExtension.cs create mode 100644 sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsResourceGroupMockingExtension.cs rename sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PrivateDnsSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubArmClientMockingExtension.cs create mode 100644 sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubSubscriptionMockingExtension.cs delete mode 100644 sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaArmClientMockingExtension.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaArmClientMockingExtension.cs new file mode 100644 index 000000000000..ad244c18c6a7 --- /dev/null +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaArmClientMockingExtension.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Media; + +namespace Azure.ResourceManager.Media.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MediaArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MediaArmClientMockingExtension() + { + } + + /// 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 MediaArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MediaArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MediaServicesAccountFilterResource GetMediaServicesAccountFilterResource(ResourceIdentifier id) + { + MediaServicesAccountFilterResource.ValidateResourceId(id); + return new MediaServicesAccountFilterResource(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 MediaServicesAccountResource GetMediaServicesAccountResource(ResourceIdentifier id) + { + MediaServicesAccountResource.ValidateResourceId(id); + return new MediaServicesAccountResource(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 MediaServicesPrivateLinkResource GetMediaServicesPrivateLinkResource(ResourceIdentifier id) + { + MediaServicesPrivateLinkResource.ValidateResourceId(id); + return new MediaServicesPrivateLinkResource(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 MediaServicesPrivateEndpointConnectionResource GetMediaServicesPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MediaServicesPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MediaServicesPrivateEndpointConnectionResource(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 MediaAssetResource GetMediaAssetResource(ResourceIdentifier id) + { + MediaAssetResource.ValidateResourceId(id); + return new MediaAssetResource(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 MediaAssetFilterResource GetMediaAssetFilterResource(ResourceIdentifier id) + { + MediaAssetFilterResource.ValidateResourceId(id); + return new MediaAssetFilterResource(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 MediaAssetTrackResource GetMediaAssetTrackResource(ResourceIdentifier id) + { + MediaAssetTrackResource.ValidateResourceId(id); + return new MediaAssetTrackResource(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 ContentKeyPolicyResource GetContentKeyPolicyResource(ResourceIdentifier id) + { + ContentKeyPolicyResource.ValidateResourceId(id); + return new ContentKeyPolicyResource(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 MediaTransformResource GetMediaTransformResource(ResourceIdentifier id) + { + MediaTransformResource.ValidateResourceId(id); + return new MediaTransformResource(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 MediaJobResource GetMediaJobResource(ResourceIdentifier id) + { + MediaJobResource.ValidateResourceId(id); + return new MediaJobResource(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 StreamingPolicyResource GetStreamingPolicyResource(ResourceIdentifier id) + { + StreamingPolicyResource.ValidateResourceId(id); + return new StreamingPolicyResource(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 StreamingLocatorResource GetStreamingLocatorResource(ResourceIdentifier id) + { + StreamingLocatorResource.ValidateResourceId(id); + return new StreamingLocatorResource(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 MediaLiveEventResource GetMediaLiveEventResource(ResourceIdentifier id) + { + MediaLiveEventResource.ValidateResourceId(id); + return new MediaLiveEventResource(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 MediaLiveOutputResource GetMediaLiveOutputResource(ResourceIdentifier id) + { + MediaLiveOutputResource.ValidateResourceId(id); + return new MediaLiveOutputResource(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 StreamingEndpointResource GetStreamingEndpointResource(ResourceIdentifier id) + { + StreamingEndpointResource.ValidateResourceId(id); + return new StreamingEndpointResource(Client, id); + } + } +} diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaExtensions.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaExtensions.cs index 6d2b78914843..797ed49c82f5 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaExtensions.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Media.Mocking; using Azure.ResourceManager.Media.Models; using Azure.ResourceManager.Resources; @@ -19,328 +20,273 @@ namespace Azure.ResourceManager.Media /// A class to add extension methods to Azure.ResourceManager.Media. public static partial class MediaExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MediaArmClientMockingExtension GetMediaArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MediaArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MediaResourceGroupMockingExtension GetMediaResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MediaResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MediaSubscriptionMockingExtension GetMediaSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MediaSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region MediaServicesAccountFilterResource /// /// 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. /// Returns a object. public static MediaServicesAccountFilterResource GetMediaServicesAccountFilterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaServicesAccountFilterResource.ValidateResourceId(id); - return new MediaServicesAccountFilterResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaServicesAccountFilterResource(id); } - #endregion - #region MediaServicesAccountResource /// /// 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. /// Returns a object. public static MediaServicesAccountResource GetMediaServicesAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaServicesAccountResource.ValidateResourceId(id); - return new MediaServicesAccountResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaServicesAccountResource(id); } - #endregion - #region MediaServicesPrivateLinkResource /// /// 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. /// Returns a object. public static MediaServicesPrivateLinkResource GetMediaServicesPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaServicesPrivateLinkResource.ValidateResourceId(id); - return new MediaServicesPrivateLinkResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaServicesPrivateLinkResource(id); } - #endregion - #region MediaServicesPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static MediaServicesPrivateEndpointConnectionResource GetMediaServicesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaServicesPrivateEndpointConnectionResource.ValidateResourceId(id); - return new MediaServicesPrivateEndpointConnectionResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaServicesPrivateEndpointConnectionResource(id); } - #endregion - #region MediaAssetResource /// /// 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. /// Returns a object. public static MediaAssetResource GetMediaAssetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaAssetResource.ValidateResourceId(id); - return new MediaAssetResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaAssetResource(id); } - #endregion - #region MediaAssetFilterResource /// /// 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. /// Returns a object. public static MediaAssetFilterResource GetMediaAssetFilterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaAssetFilterResource.ValidateResourceId(id); - return new MediaAssetFilterResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaAssetFilterResource(id); } - #endregion - #region MediaAssetTrackResource /// /// 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. /// Returns a object. public static MediaAssetTrackResource GetMediaAssetTrackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaAssetTrackResource.ValidateResourceId(id); - return new MediaAssetTrackResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaAssetTrackResource(id); } - #endregion - #region ContentKeyPolicyResource /// /// 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. /// Returns a object. public static ContentKeyPolicyResource GetContentKeyPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContentKeyPolicyResource.ValidateResourceId(id); - return new ContentKeyPolicyResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetContentKeyPolicyResource(id); } - #endregion - #region MediaTransformResource /// /// 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. /// Returns a object. public static MediaTransformResource GetMediaTransformResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaTransformResource.ValidateResourceId(id); - return new MediaTransformResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaTransformResource(id); } - #endregion - #region MediaJobResource /// /// 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. /// Returns a object. public static MediaJobResource GetMediaJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaJobResource.ValidateResourceId(id); - return new MediaJobResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaJobResource(id); } - #endregion - #region StreamingPolicyResource /// /// 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. /// Returns a object. public static StreamingPolicyResource GetStreamingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingPolicyResource.ValidateResourceId(id); - return new StreamingPolicyResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetStreamingPolicyResource(id); } - #endregion - #region StreamingLocatorResource /// /// 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. /// Returns a object. public static StreamingLocatorResource GetStreamingLocatorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingLocatorResource.ValidateResourceId(id); - return new StreamingLocatorResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetStreamingLocatorResource(id); } - #endregion - #region MediaLiveEventResource /// /// 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. /// Returns a object. public static MediaLiveEventResource GetMediaLiveEventResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaLiveEventResource.ValidateResourceId(id); - return new MediaLiveEventResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaLiveEventResource(id); } - #endregion - #region MediaLiveOutputResource /// /// 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. /// Returns a object. public static MediaLiveOutputResource GetMediaLiveOutputResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MediaLiveOutputResource.ValidateResourceId(id); - return new MediaLiveOutputResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetMediaLiveOutputResource(id); } - #endregion - #region StreamingEndpointResource /// /// 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. /// Returns a object. public static StreamingEndpointResource GetStreamingEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StreamingEndpointResource.ValidateResourceId(id); - return new StreamingEndpointResource(client, id); - } - ); + return GetMediaArmClientMockingExtension(client).GetStreamingEndpointResource(id); } - #endregion - /// Gets a collection of MediaServicesAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of MediaServicesAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MediaServicesAccountResources and their operations over a MediaServicesAccountResource. public static MediaServicesAccountCollection GetMediaServicesAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMediaServicesAccounts(); + return GetMediaResourceGroupMockingExtension(resourceGroupResource).GetMediaServicesAccounts(); } /// @@ -355,16 +301,20 @@ public static MediaServicesAccountCollection GetMediaServicesAccounts(this Resou /// Mediaservices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Media Services account name. /// The cancellation token to use. - /// 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 static async Task> GetMediaServicesAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMediaServicesAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetMediaResourceGroupMockingExtension(resourceGroupResource).GetMediaServicesAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -379,16 +329,20 @@ public static async Task> GetMediaService /// Mediaservices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Media Services account name. /// The cancellation token to use. - /// 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 static Response GetMediaServicesAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMediaServicesAccounts().Get(accountName, cancellationToken); + return GetMediaResourceGroupMockingExtension(resourceGroupResource).GetMediaServicesAccount(accountName, cancellationToken); } /// @@ -403,13 +357,17 @@ public static Response GetMediaServicesAccount(thi /// Mediaservices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMediaServicesAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMediaServicesAccountsAsync(cancellationToken); + return GetMediaSubscriptionMockingExtension(subscriptionResource).GetMediaServicesAccountsAsync(cancellationToken); } /// @@ -424,13 +382,17 @@ public static AsyncPageable GetMediaServicesAccoun /// Mediaservices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMediaServicesAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMediaServicesAccounts(cancellationToken); + return GetMediaSubscriptionMockingExtension(subscriptionResource).GetMediaServicesAccounts(cancellationToken); } /// @@ -445,6 +407,10 @@ public static Pageable GetMediaServicesAccounts(th /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location name. @@ -453,9 +419,7 @@ public static Pageable GetMediaServicesAccounts(th /// is null. public static async Task> CheckMediaServicesNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, MediaServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMediaServicesNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetMediaSubscriptionMockingExtension(subscriptionResource).CheckMediaServicesNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -470,6 +434,10 @@ public static async Task> CheckMed /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location name. @@ -478,9 +446,7 @@ public static async Task> CheckMed /// is null. public static Response CheckMediaServicesNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation locationName, MediaServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMediaServicesNameAvailability(locationName, content, cancellationToken); + return GetMediaSubscriptionMockingExtension(subscriptionResource).CheckMediaServicesNameAvailability(locationName, content, cancellationToken); } } } diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaResourceGroupMockingExtension.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..ece711aded43 --- /dev/null +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Media; + +namespace Azure.ResourceManager.Media.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MediaResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MediaResourceGroupMockingExtension() + { + } + + /// 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 MediaResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MediaServicesAccountResources in the ResourceGroupResource. + /// An object representing collection of MediaServicesAccountResources and their operations over a MediaServicesAccountResource. + public virtual MediaServicesAccountCollection GetMediaServicesAccounts() + { + return GetCachedClient(client => new MediaServicesAccountCollection(client, Id)); + } + + /// + /// Get the details of a Media Services account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName} + /// + /// + /// Operation Id + /// Mediaservices_Get + /// + /// + /// + /// The Media Services account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMediaServicesAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetMediaServicesAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details of a Media Services account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName} + /// + /// + /// Operation Id + /// Mediaservices_Get + /// + /// + /// + /// The Media Services account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMediaServicesAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetMediaServicesAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaSubscriptionMockingExtension.cs similarity index 87% rename from sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaSubscriptionMockingExtension.cs index 1890146ad745..f930d0971e54 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/MediaSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Media; using Azure.ResourceManager.Media.Models; -namespace Azure.ResourceManager.Media +namespace Azure.ResourceManager.Media.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MediaSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mediaServicesAccountMediaservicesClientDiagnostics; private MediaservicesRestOperations _mediaServicesAccountMediaservicesRestClient; private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MediaSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MediaSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetMediaServicesAccou { HttpMessage FirstPageRequest(int? pageSizeHint) => MediaServicesAccountMediaservicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MediaServicesAccountMediaservicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MediaServicesAccountResource(Client, MediaServicesAccountData.DeserializeMediaServicesAccountData(e)), MediaServicesAccountMediaservicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMediaServicesAccounts", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MediaServicesAccountResource(Client, MediaServicesAccountData.DeserializeMediaServicesAccountData(e)), MediaServicesAccountMediaservicesClientDiagnostics, Pipeline, "MediaSubscriptionMockingExtension.GetMediaServicesAccounts", "value", "@odata.nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetMediaServicesAccounts(C { HttpMessage FirstPageRequest(int? pageSizeHint) => MediaServicesAccountMediaservicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MediaServicesAccountMediaservicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MediaServicesAccountResource(Client, MediaServicesAccountData.DeserializeMediaServicesAccountData(e)), MediaServicesAccountMediaservicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMediaServicesAccounts", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MediaServicesAccountResource(Client, MediaServicesAccountData.DeserializeMediaServicesAccountData(e)), MediaServicesAccountMediaservicesClientDiagnostics, Pipeline, "MediaSubscriptionMockingExtension.GetMediaServicesAccounts", "value", "@odata.nextLink", cancellationToken); } /// @@ -108,9 +109,12 @@ public virtual Pageable GetMediaServicesAccounts(C /// Location name. /// The request parameters. /// The cancellation token to use. + /// is null. public virtual async Task> CheckMediaServicesNameAvailabilityAsync(AzureLocation locationName, MediaServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMediaServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("MediaSubscriptionMockingExtension.CheckMediaServicesNameAvailability"); scope.Start(); try { @@ -140,9 +144,12 @@ public virtual async Task> CheckMe /// Location name. /// The request parameters. /// The cancellation token to use. + /// is null. public virtual Response CheckMediaServicesNameAvailability(AzureLocation locationName, MediaServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMediaServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("MediaSubscriptionMockingExtension.CheckMediaServicesNameAvailability"); scope.Start(); try { diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3159e44e4066..000000000000 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Media -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MediaServicesAccountResources in the ResourceGroupResource. - /// An object representing collection of MediaServicesAccountResources and their operations over a MediaServicesAccountResource. - public virtual MediaServicesAccountCollection GetMediaServicesAccounts() - { - return GetCachedClient(Client => new MediaServicesAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaAssetResource.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaAssetResource.cs index ef8b10cb6932..9a0a45a60050 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaAssetResource.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaAssetResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MediaAssetFilterResources and their operations over a MediaAssetFilterResource. public virtual MediaAssetFilterCollection GetMediaAssetFilters() { - return GetCachedClient(Client => new MediaAssetFilterCollection(Client, Id)); + return GetCachedClient(client => new MediaAssetFilterCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MediaAssetFilterCollection GetMediaAssetFilters() /// /// The Asset Filter name. /// The cancellation token to use. - /// 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> GetMediaAssetFilterAsync(string filterName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetMediaAssetFilte /// /// The Asset Filter name. /// The cancellation token to use. - /// 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 GetMediaAssetFilter(string filterName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetMediaAssetFilter(string fil /// An object representing collection of MediaAssetTrackResources and their operations over a MediaAssetTrackResource. public virtual MediaAssetTrackCollection GetMediaAssetTracks() { - return GetCachedClient(Client => new MediaAssetTrackCollection(Client, Id)); + return GetCachedClient(client => new MediaAssetTrackCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual MediaAssetTrackCollection GetMediaAssetTracks() /// /// The Asset Track name. /// The cancellation token to use. - /// 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> GetMediaAssetTrackAsync(string trackName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> GetMediaAssetTrackA /// /// The Asset Track name. /// The cancellation token to use. - /// 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 GetMediaAssetTrack(string trackName, CancellationToken cancellationToken = default) { diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaLiveEventResource.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaLiveEventResource.cs index 049f2100db44..3589ee8e0d1d 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaLiveEventResource.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaLiveEventResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MediaLiveOutputResources and their operations over a MediaLiveOutputResource. public virtual MediaLiveOutputCollection GetMediaLiveOutputs() { - return GetCachedClient(Client => new MediaLiveOutputCollection(Client, Id)); + return GetCachedClient(client => new MediaLiveOutputCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MediaLiveOutputCollection GetMediaLiveOutputs() /// /// The name of the live output. /// The cancellation token to use. - /// 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> GetMediaLiveOutputAsync(string liveOutputName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetMediaLiveOutputA /// /// The name of the live output. /// The cancellation token to use. - /// 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 GetMediaLiveOutput(string liveOutputName, CancellationToken cancellationToken = default) { diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaServicesAccountResource.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaServicesAccountResource.cs index a66678adf322..b49fdcf210bf 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaServicesAccountResource.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaServicesAccountResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MediaServicesAccountFilterResources and their operations over a MediaServicesAccountFilterResource. public virtual MediaServicesAccountFilterCollection GetMediaServicesAccountFilters() { - return GetCachedClient(Client => new MediaServicesAccountFilterCollection(Client, Id)); + return GetCachedClient(client => new MediaServicesAccountFilterCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MediaServicesAccountFilterCollection GetMediaServicesAccountFilte /// /// The Account Filter name. /// The cancellation token to use. - /// 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> GetMediaServicesAccountFilterAsync(string filterName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetMedia /// /// The Account Filter name. /// The cancellation token to use. - /// 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 GetMediaServicesAccountFilter(string filterName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetMediaServicesAcco /// An object representing collection of MediaServicesPrivateLinkResources and their operations over a MediaServicesPrivateLinkResource. public virtual MediaServicesPrivateLinkResourceCollection GetMediaServicesPrivateLinkResources() { - return GetCachedClient(Client => new MediaServicesPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new MediaServicesPrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MediaServicesPrivateLinkResourceCollection GetMediaServicesPrivat /// /// The String to use. /// The cancellation token to use. - /// 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> GetMediaServicesPrivateLinkResourceAsync(string name, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetMediaSe /// /// The String to use. /// The cancellation token to use. - /// 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 GetMediaServicesPrivateLinkResource(string name, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMediaServicesPrivat /// An object representing collection of MediaServicesPrivateEndpointConnectionResources and their operations over a MediaServicesPrivateEndpointConnectionResource. public virtual MediaServicesPrivateEndpointConnectionCollection GetMediaServicesPrivateEndpointConnections() { - return GetCachedClient(Client => new MediaServicesPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new MediaServicesPrivateEndpointConnectionCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual MediaServicesPrivateEndpointConnectionCollection GetMediaServices /// /// The String to use. /// The cancellation token to use. - /// 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> GetMediaServicesPrivateEndpointConnectionAsync(string name, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// The String to use. /// The cancellation token to use. - /// 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 GetMediaServicesPrivateEndpointConnection(string name, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetMedia /// An object representing collection of MediaAssetResources and their operations over a MediaAssetResource. public virtual MediaAssetCollection GetMediaAssets() { - return GetCachedClient(Client => new MediaAssetCollection(Client, Id)); + return GetCachedClient(client => new MediaAssetCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual MediaAssetCollection GetMediaAssets() /// /// The Asset name. /// The cancellation token to use. - /// 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> GetMediaAssetAsync(string assetName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetMediaAssetAsync(strin /// /// The Asset name. /// The cancellation token to use. - /// 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 GetMediaAsset(string assetName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetMediaAsset(string assetName, Canc /// An object representing collection of ContentKeyPolicyResources and their operations over a ContentKeyPolicyResource. public virtual ContentKeyPolicyCollection GetContentKeyPolicies() { - return GetCachedClient(Client => new ContentKeyPolicyCollection(Client, Id)); + return GetCachedClient(client => new ContentKeyPolicyCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual ContentKeyPolicyCollection GetContentKeyPolicies() /// /// The Content Key Policy name. /// The cancellation token to use. - /// 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> GetContentKeyPolicyAsync(string contentKeyPolicyName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetContentKeyPolic /// /// The Content Key Policy name. /// The cancellation token to use. - /// 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 GetContentKeyPolicy(string contentKeyPolicyName, CancellationToken cancellationToken = default) { @@ -358,7 +358,7 @@ public virtual Response GetContentKeyPolicy(string con /// An object representing collection of MediaTransformResources and their operations over a MediaTransformResource. public virtual MediaTransformCollection GetMediaTransforms() { - return GetCachedClient(Client => new MediaTransformCollection(Client, Id)); + return GetCachedClient(client => new MediaTransformCollection(client, Id)); } /// @@ -376,8 +376,8 @@ public virtual MediaTransformCollection GetMediaTransforms() /// /// The Transform name. /// The cancellation token to use. - /// 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> GetMediaTransformAsync(string transformName, CancellationToken cancellationToken = default) { @@ -399,8 +399,8 @@ public virtual async Task> GetMediaTransformAsy /// /// The Transform name. /// The cancellation token to use. - /// 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 GetMediaTransform(string transformName, CancellationToken cancellationToken = default) { @@ -411,7 +411,7 @@ public virtual Response GetMediaTransform(string transfo /// An object representing collection of StreamingPolicyResources and their operations over a StreamingPolicyResource. public virtual StreamingPolicyCollection GetStreamingPolicies() { - return GetCachedClient(Client => new StreamingPolicyCollection(Client, Id)); + return GetCachedClient(client => new StreamingPolicyCollection(client, Id)); } /// @@ -429,8 +429,8 @@ public virtual StreamingPolicyCollection GetStreamingPolicies() /// /// The Streaming Policy name. /// The cancellation token to use. - /// 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> GetStreamingPolicyAsync(string streamingPolicyName, CancellationToken cancellationToken = default) { @@ -452,8 +452,8 @@ public virtual async Task> GetStreamingPolicyA /// /// The Streaming Policy name. /// The cancellation token to use. - /// 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 GetStreamingPolicy(string streamingPolicyName, CancellationToken cancellationToken = default) { @@ -464,7 +464,7 @@ public virtual Response GetStreamingPolicy(string strea /// An object representing collection of StreamingLocatorResources and their operations over a StreamingLocatorResource. public virtual StreamingLocatorCollection GetStreamingLocators() { - return GetCachedClient(Client => new StreamingLocatorCollection(Client, Id)); + return GetCachedClient(client => new StreamingLocatorCollection(client, Id)); } /// @@ -482,8 +482,8 @@ public virtual StreamingLocatorCollection GetStreamingLocators() /// /// The Streaming Locator name. /// The cancellation token to use. - /// 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> GetStreamingLocatorAsync(string streamingLocatorName, CancellationToken cancellationToken = default) { @@ -505,8 +505,8 @@ public virtual async Task> GetStreamingLocato /// /// The Streaming Locator name. /// The cancellation token to use. - /// 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 GetStreamingLocator(string streamingLocatorName, CancellationToken cancellationToken = default) { @@ -517,7 +517,7 @@ public virtual Response GetStreamingLocator(string str /// An object representing collection of MediaLiveEventResources and their operations over a MediaLiveEventResource. public virtual MediaLiveEventCollection GetMediaLiveEvents() { - return GetCachedClient(Client => new MediaLiveEventCollection(Client, Id)); + return GetCachedClient(client => new MediaLiveEventCollection(client, Id)); } /// @@ -535,8 +535,8 @@ public virtual MediaLiveEventCollection GetMediaLiveEvents() /// /// The name of the live event, maximum length is 32. /// The cancellation token to use. - /// 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> GetMediaLiveEventAsync(string liveEventName, CancellationToken cancellationToken = default) { @@ -558,8 +558,8 @@ public virtual async Task> GetMediaLiveEventAsy /// /// The name of the live event, maximum length is 32. /// The cancellation token to use. - /// 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 GetMediaLiveEvent(string liveEventName, CancellationToken cancellationToken = default) { @@ -570,7 +570,7 @@ public virtual Response GetMediaLiveEvent(string liveEve /// An object representing collection of StreamingEndpointResources and their operations over a StreamingEndpointResource. public virtual StreamingEndpointCollection GetStreamingEndpoints() { - return GetCachedClient(Client => new StreamingEndpointCollection(Client, Id)); + return GetCachedClient(client => new StreamingEndpointCollection(client, Id)); } /// @@ -588,8 +588,8 @@ public virtual StreamingEndpointCollection GetStreamingEndpoints() /// /// The name of the streaming endpoint, maximum length is 24. /// The cancellation token to use. - /// 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> GetStreamingEndpointAsync(string streamingEndpointName, CancellationToken cancellationToken = default) { @@ -611,8 +611,8 @@ public virtual async Task> GetStreamingEndpo /// /// The name of the streaming endpoint, maximum length is 24. /// The cancellation token to use. - /// 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 GetStreamingEndpoint(string streamingEndpointName, CancellationToken cancellationToken = default) { diff --git a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaTransformResource.cs b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaTransformResource.cs index d5fdf5331544..b7f20301fc6c 100644 --- a/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaTransformResource.cs +++ b/sdk/mediaservices/Azure.ResourceManager.Media/src/Generated/MediaTransformResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MediaJobResources and their operations over a MediaJobResource. public virtual MediaJobCollection GetMediaJobs() { - return GetCachedClient(Client => new MediaJobCollection(Client, Id)); + return GetCachedClient(client => new MediaJobCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual MediaJobCollection GetMediaJobs() /// /// The Job name. /// The cancellation token to use. - /// 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> GetMediaJobAsync(string jobName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetMediaJobAsync(string jo /// /// The Job name. /// The cancellation token to use. - /// 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 GetMediaJob(string jobName, CancellationToken cancellationToken = default) { diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityArmClientMockingExtension.cs b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityArmClientMockingExtension.cs new file mode 100644 index 000000000000..f7f38d4ec58f --- /dev/null +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MixedReality; + +namespace Azure.ResourceManager.MixedReality.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MixedRealityArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MixedRealityArmClientMockingExtension() + { + } + + /// 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 MixedRealityArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MixedRealityArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SpatialAnchorsAccountResource GetSpatialAnchorsAccountResource(ResourceIdentifier id) + { + SpatialAnchorsAccountResource.ValidateResourceId(id); + return new SpatialAnchorsAccountResource(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 RemoteRenderingAccountResource GetRemoteRenderingAccountResource(ResourceIdentifier id) + { + RemoteRenderingAccountResource.ValidateResourceId(id); + return new RemoteRenderingAccountResource(Client, id); + } + } +} diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityExtensions.cs b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityExtensions.cs index 8a9da3fe5499..fe1bfffdf83b 100644 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityExtensions.cs +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MixedReality.Mocking; using Azure.ResourceManager.MixedReality.Models; using Azure.ResourceManager.Resources; @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.MixedReality /// A class to add extension methods to Azure.ResourceManager.MixedReality. public static partial class MixedRealityExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MixedRealityArmClientMockingExtension GetMixedRealityArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MixedRealityArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MixedRealityResourceGroupMockingExtension GetMixedRealityResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MixedRealityResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MixedRealitySubscriptionMockingExtension GetMixedRealitySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MixedRealitySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SpatialAnchorsAccountResource /// /// 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. /// Returns a object. public static SpatialAnchorsAccountResource GetSpatialAnchorsAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SpatialAnchorsAccountResource.ValidateResourceId(id); - return new SpatialAnchorsAccountResource(client, id); - } - ); + return GetMixedRealityArmClientMockingExtension(client).GetSpatialAnchorsAccountResource(id); } - #endregion - #region RemoteRenderingAccountResource /// /// 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. /// Returns a object. public static RemoteRenderingAccountResource GetRemoteRenderingAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RemoteRenderingAccountResource.ValidateResourceId(id); - return new RemoteRenderingAccountResource(client, id); - } - ); + return GetMixedRealityArmClientMockingExtension(client).GetRemoteRenderingAccountResource(id); } - #endregion - /// Gets a collection of SpatialAnchorsAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of SpatialAnchorsAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SpatialAnchorsAccountResources and their operations over a SpatialAnchorsAccountResource. public static SpatialAnchorsAccountCollection GetSpatialAnchorsAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSpatialAnchorsAccounts(); + return GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetSpatialAnchorsAccounts(); } /// @@ -108,16 +93,20 @@ public static SpatialAnchorsAccountCollection GetSpatialAnchorsAccounts(this Res /// SpatialAnchorsAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of an Mixed Reality Account. /// The cancellation token to use. - /// 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 static async Task> GetSpatialAnchorsAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSpatialAnchorsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetSpatialAnchorsAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -132,24 +121,34 @@ public static async Task> GetSpatialAnch /// SpatialAnchorsAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of an Mixed Reality Account. /// The cancellation token to use. - /// 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 static Response GetSpatialAnchorsAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSpatialAnchorsAccounts().Get(accountName, cancellationToken); + return GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetSpatialAnchorsAccount(accountName, cancellationToken); } - /// Gets a collection of RemoteRenderingAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of RemoteRenderingAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RemoteRenderingAccountResources and their operations over a RemoteRenderingAccountResource. public static RemoteRenderingAccountCollection GetRemoteRenderingAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRemoteRenderingAccounts(); + return GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetRemoteRenderingAccounts(); } /// @@ -164,16 +163,20 @@ public static RemoteRenderingAccountCollection GetRemoteRenderingAccounts(this R /// RemoteRenderingAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of an Mixed Reality Account. /// The cancellation token to use. - /// 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 static async Task> GetRemoteRenderingAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRemoteRenderingAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetRemoteRenderingAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -188,16 +191,20 @@ public static async Task> GetRemoteRend /// RemoteRenderingAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of an Mixed Reality Account. /// The cancellation token to use. - /// 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 static Response GetRemoteRenderingAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRemoteRenderingAccounts().Get(accountName, cancellationToken); + return GetMixedRealityResourceGroupMockingExtension(resourceGroupResource).GetRemoteRenderingAccount(accountName, cancellationToken); } /// @@ -212,6 +219,10 @@ public static Response GetRemoteRenderingAccount /// CheckNameAvailabilityLocal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -220,9 +231,7 @@ public static Response GetRemoteRenderingAccount /// is null. public static async Task> CheckMixedRealityNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, MixedRealityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMixedRealityNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetMixedRealitySubscriptionMockingExtension(subscriptionResource).CheckMixedRealityNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -237,6 +246,10 @@ public static async Task> CheckMixe /// CheckNameAvailabilityLocal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -245,9 +258,7 @@ public static async Task> CheckMixe /// is null. public static Response CheckMixedRealityNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, MixedRealityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMixedRealityNameAvailability(location, content, cancellationToken); + return GetMixedRealitySubscriptionMockingExtension(subscriptionResource).CheckMixedRealityNameAvailability(location, content, cancellationToken); } /// @@ -262,13 +273,17 @@ public static Response CheckMixedRealityName /// SpatialAnchorsAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSpatialAnchorsAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSpatialAnchorsAccountsAsync(cancellationToken); + return GetMixedRealitySubscriptionMockingExtension(subscriptionResource).GetSpatialAnchorsAccountsAsync(cancellationToken); } /// @@ -283,13 +298,17 @@ public static AsyncPageable GetSpatialAnchorsAcco /// SpatialAnchorsAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSpatialAnchorsAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSpatialAnchorsAccounts(cancellationToken); + return GetMixedRealitySubscriptionMockingExtension(subscriptionResource).GetSpatialAnchorsAccounts(cancellationToken); } /// @@ -304,13 +323,17 @@ public static Pageable GetSpatialAnchorsAccounts( /// RemoteRenderingAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRemoteRenderingAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRemoteRenderingAccountsAsync(cancellationToken); + return GetMixedRealitySubscriptionMockingExtension(subscriptionResource).GetRemoteRenderingAccountsAsync(cancellationToken); } /// @@ -325,13 +348,17 @@ public static AsyncPageable GetRemoteRenderingAc /// RemoteRenderingAccounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRemoteRenderingAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRemoteRenderingAccounts(cancellationToken); + return GetMixedRealitySubscriptionMockingExtension(subscriptionResource).GetRemoteRenderingAccounts(cancellationToken); } } } diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityResourceGroupMockingExtension.cs b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..416fe3fae595 --- /dev/null +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealityResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MixedReality; + +namespace Azure.ResourceManager.MixedReality.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MixedRealityResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MixedRealityResourceGroupMockingExtension() + { + } + + /// 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 MixedRealityResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SpatialAnchorsAccountResources in the ResourceGroupResource. + /// An object representing collection of SpatialAnchorsAccountResources and their operations over a SpatialAnchorsAccountResource. + public virtual SpatialAnchorsAccountCollection GetSpatialAnchorsAccounts() + { + return GetCachedClient(client => new SpatialAnchorsAccountCollection(client, Id)); + } + + /// + /// Retrieve a Spatial Anchors Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName} + /// + /// + /// Operation Id + /// SpatialAnchorsAccounts_Get + /// + /// + /// + /// Name of an Mixed Reality Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSpatialAnchorsAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetSpatialAnchorsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve a Spatial Anchors Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName} + /// + /// + /// Operation Id + /// SpatialAnchorsAccounts_Get + /// + /// + /// + /// Name of an Mixed Reality Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSpatialAnchorsAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetSpatialAnchorsAccounts().Get(accountName, cancellationToken); + } + + /// Gets a collection of RemoteRenderingAccountResources in the ResourceGroupResource. + /// An object representing collection of RemoteRenderingAccountResources and their operations over a RemoteRenderingAccountResource. + public virtual RemoteRenderingAccountCollection GetRemoteRenderingAccounts() + { + return GetCachedClient(client => new RemoteRenderingAccountCollection(client, Id)); + } + + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName} + /// + /// + /// Operation Id + /// RemoteRenderingAccounts_Get + /// + /// + /// + /// Name of an Mixed Reality Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRemoteRenderingAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetRemoteRenderingAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName} + /// + /// + /// Operation Id + /// RemoteRenderingAccounts_Get + /// + /// + /// + /// Name of an Mixed Reality Account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRemoteRenderingAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetRemoteRenderingAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealitySubscriptionMockingExtension.cs similarity index 89% rename from sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealitySubscriptionMockingExtension.cs index bfec960a9a2b..d441b0da18dc 100644 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/MixedRealitySubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MixedReality; using Azure.ResourceManager.MixedReality.Models; -namespace Azure.ResourceManager.MixedReality +namespace Azure.ResourceManager.MixedReality.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MixedRealitySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private MixedRealityRestOperations _defaultRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _remoteRenderingAccountClientDiagnostics; private RemoteRenderingAccountsRestOperations _remoteRenderingAccountRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MixedRealitySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MixedRealitySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,9 +69,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The location in which uniqueness will be verified. /// Check Name Availability Request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckMixedRealityNameAvailabilityAsync(AzureLocation location, MixedRealityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMixedRealityNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("MixedRealitySubscriptionMockingExtension.CheckMixedRealityNameAvailability"); scope.Start(); try { @@ -100,9 +104,12 @@ public virtual async Task> CheckMix /// The location in which uniqueness will be verified. /// Check Name Availability Request. /// The cancellation token to use. + /// is null. public virtual Response CheckMixedRealityNameAvailability(AzureLocation location, MixedRealityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMixedRealityNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("MixedRealitySubscriptionMockingExtension.CheckMixedRealityNameAvailability"); scope.Start(); try { @@ -135,7 +142,7 @@ public virtual AsyncPageable GetSpatialAnchorsAcc { HttpMessage FirstPageRequest(int? pageSizeHint) => SpatialAnchorsAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SpatialAnchorsAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SpatialAnchorsAccountResource(Client, SpatialAnchorsAccountData.DeserializeSpatialAnchorsAccountData(e)), SpatialAnchorsAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSpatialAnchorsAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SpatialAnchorsAccountResource(Client, SpatialAnchorsAccountData.DeserializeSpatialAnchorsAccountData(e)), SpatialAnchorsAccountClientDiagnostics, Pipeline, "MixedRealitySubscriptionMockingExtension.GetSpatialAnchorsAccounts", "value", "nextLink", cancellationToken); } /// @@ -157,7 +164,7 @@ public virtual Pageable GetSpatialAnchorsAccounts { HttpMessage FirstPageRequest(int? pageSizeHint) => SpatialAnchorsAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SpatialAnchorsAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SpatialAnchorsAccountResource(Client, SpatialAnchorsAccountData.DeserializeSpatialAnchorsAccountData(e)), SpatialAnchorsAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSpatialAnchorsAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SpatialAnchorsAccountResource(Client, SpatialAnchorsAccountData.DeserializeSpatialAnchorsAccountData(e)), SpatialAnchorsAccountClientDiagnostics, Pipeline, "MixedRealitySubscriptionMockingExtension.GetSpatialAnchorsAccounts", "value", "nextLink", cancellationToken); } /// @@ -179,7 +186,7 @@ public virtual AsyncPageable GetRemoteRenderingA { HttpMessage FirstPageRequest(int? pageSizeHint) => RemoteRenderingAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RemoteRenderingAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RemoteRenderingAccountResource(Client, RemoteRenderingAccountData.DeserializeRemoteRenderingAccountData(e)), RemoteRenderingAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRemoteRenderingAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RemoteRenderingAccountResource(Client, RemoteRenderingAccountData.DeserializeRemoteRenderingAccountData(e)), RemoteRenderingAccountClientDiagnostics, Pipeline, "MixedRealitySubscriptionMockingExtension.GetRemoteRenderingAccounts", "value", "nextLink", cancellationToken); } /// @@ -201,7 +208,7 @@ public virtual Pageable GetRemoteRenderingAccoun { HttpMessage FirstPageRequest(int? pageSizeHint) => RemoteRenderingAccountRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RemoteRenderingAccountRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RemoteRenderingAccountResource(Client, RemoteRenderingAccountData.DeserializeRemoteRenderingAccountData(e)), RemoteRenderingAccountClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRemoteRenderingAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RemoteRenderingAccountResource(Client, RemoteRenderingAccountData.DeserializeRemoteRenderingAccountData(e)), RemoteRenderingAccountClientDiagnostics, Pipeline, "MixedRealitySubscriptionMockingExtension.GetRemoteRenderingAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 19e16f03c073..000000000000 --- a/sdk/mixedreality/Azure.ResourceManager.MixedReality/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MixedReality -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SpatialAnchorsAccountResources in the ResourceGroupResource. - /// An object representing collection of SpatialAnchorsAccountResources and their operations over a SpatialAnchorsAccountResource. - public virtual SpatialAnchorsAccountCollection GetSpatialAnchorsAccounts() - { - return GetCachedClient(Client => new SpatialAnchorsAccountCollection(Client, Id)); - } - - /// Gets a collection of RemoteRenderingAccountResources in the ResourceGroupResource. - /// An object representing collection of RemoteRenderingAccountResources and their operations over a RemoteRenderingAccountResource. - public virtual RemoteRenderingAccountCollection GetRemoteRenderingAccounts() - { - return GetCachedClient(Client => new RemoteRenderingAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkArmClientMockingExtension.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkArmClientMockingExtension.cs new file mode 100644 index 000000000000..2bd1ff6a6843 --- /dev/null +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkArmClientMockingExtension.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MobileNetwork; + +namespace Azure.ResourceManager.MobileNetwork.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MobileNetworkArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MobileNetworkArmClientMockingExtension() + { + } + + /// 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 MobileNetworkArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MobileNetworkArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MobileAttachedDataNetworkResource GetMobileAttachedDataNetworkResource(ResourceIdentifier id) + { + MobileAttachedDataNetworkResource.ValidateResourceId(id); + return new MobileAttachedDataNetworkResource(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 MobileDataNetworkResource GetMobileDataNetworkResource(ResourceIdentifier id) + { + MobileDataNetworkResource.ValidateResourceId(id); + return new MobileDataNetworkResource(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 MobileNetworkDiagnosticsPackageResource GetMobileNetworkDiagnosticsPackageResource(ResourceIdentifier id) + { + MobileNetworkDiagnosticsPackageResource.ValidateResourceId(id); + return new MobileNetworkDiagnosticsPackageResource(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 MobileNetworkResource GetMobileNetworkResource(ResourceIdentifier id) + { + MobileNetworkResource.ValidateResourceId(id); + return new MobileNetworkResource(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 MobileNetworkPacketCaptureResource GetMobileNetworkPacketCaptureResource(ResourceIdentifier id) + { + MobileNetworkPacketCaptureResource.ValidateResourceId(id); + return new MobileNetworkPacketCaptureResource(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 PacketCoreControlPlaneResource GetPacketCoreControlPlaneResource(ResourceIdentifier id) + { + PacketCoreControlPlaneResource.ValidateResourceId(id); + return new PacketCoreControlPlaneResource(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 TenantPacketCoreControlPlaneVersionResource GetTenantPacketCoreControlPlaneVersionResource(ResourceIdentifier id) + { + TenantPacketCoreControlPlaneVersionResource.ValidateResourceId(id); + return new TenantPacketCoreControlPlaneVersionResource(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 SubscriptionPacketCoreControlPlaneVersionResource GetSubscriptionPacketCoreControlPlaneVersionResource(ResourceIdentifier id) + { + SubscriptionPacketCoreControlPlaneVersionResource.ValidateResourceId(id); + return new SubscriptionPacketCoreControlPlaneVersionResource(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 PacketCoreDataPlaneResource GetPacketCoreDataPlaneResource(ResourceIdentifier id) + { + PacketCoreDataPlaneResource.ValidateResourceId(id); + return new PacketCoreDataPlaneResource(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 MobileNetworkServiceResource GetMobileNetworkServiceResource(ResourceIdentifier id) + { + MobileNetworkServiceResource.ValidateResourceId(id); + return new MobileNetworkServiceResource(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 MobileNetworkSimResource GetMobileNetworkSimResource(ResourceIdentifier id) + { + MobileNetworkSimResource.ValidateResourceId(id); + return new MobileNetworkSimResource(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 MobileNetworkSimGroupResource GetMobileNetworkSimGroupResource(ResourceIdentifier id) + { + MobileNetworkSimGroupResource.ValidateResourceId(id); + return new MobileNetworkSimGroupResource(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 MobileNetworkSimPolicyResource GetMobileNetworkSimPolicyResource(ResourceIdentifier id) + { + MobileNetworkSimPolicyResource.ValidateResourceId(id); + return new MobileNetworkSimPolicyResource(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 MobileNetworkSiteResource GetMobileNetworkSiteResource(ResourceIdentifier id) + { + MobileNetworkSiteResource.ValidateResourceId(id); + return new MobileNetworkSiteResource(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 MobileNetworkSliceResource GetMobileNetworkSliceResource(ResourceIdentifier id) + { + MobileNetworkSliceResource.ValidateResourceId(id); + return new MobileNetworkSliceResource(Client, id); + } + } +} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkExtensions.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkExtensions.cs index 72039f51f172..663007a0b7f5 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkExtensions.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MobileNetwork.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.MobileNetwork @@ -18,344 +19,278 @@ namespace Azure.ResourceManager.MobileNetwork /// A class to add extension methods to Azure.ResourceManager.MobileNetwork. public static partial class MobileNetworkExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MobileNetworkArmClientMockingExtension GetMobileNetworkArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MobileNetworkArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MobileNetworkResourceGroupMockingExtension GetMobileNetworkResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MobileNetworkResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MobileNetworkSubscriptionMockingExtension GetMobileNetworkSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MobileNetworkSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MobileNetworkTenantMockingExtension GetMobileNetworkTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MobileNetworkTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region MobileAttachedDataNetworkResource /// /// 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. /// Returns a object. public static MobileAttachedDataNetworkResource GetMobileAttachedDataNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileAttachedDataNetworkResource.ValidateResourceId(id); - return new MobileAttachedDataNetworkResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileAttachedDataNetworkResource(id); } - #endregion - #region MobileDataNetworkResource /// /// 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. /// Returns a object. public static MobileDataNetworkResource GetMobileDataNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileDataNetworkResource.ValidateResourceId(id); - return new MobileDataNetworkResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileDataNetworkResource(id); } - #endregion - #region MobileNetworkDiagnosticsPackageResource /// /// 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. /// Returns a object. public static MobileNetworkDiagnosticsPackageResource GetMobileNetworkDiagnosticsPackageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkDiagnosticsPackageResource.ValidateResourceId(id); - return new MobileNetworkDiagnosticsPackageResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkDiagnosticsPackageResource(id); } - #endregion - #region MobileNetworkResource /// /// 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. /// Returns a object. public static MobileNetworkResource GetMobileNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkResource.ValidateResourceId(id); - return new MobileNetworkResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkResource(id); } - #endregion - #region MobileNetworkPacketCaptureResource /// /// 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. /// Returns a object. public static MobileNetworkPacketCaptureResource GetMobileNetworkPacketCaptureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkPacketCaptureResource.ValidateResourceId(id); - return new MobileNetworkPacketCaptureResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkPacketCaptureResource(id); } - #endregion - #region PacketCoreControlPlaneResource /// /// 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. /// Returns a object. public static PacketCoreControlPlaneResource GetPacketCoreControlPlaneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PacketCoreControlPlaneResource.ValidateResourceId(id); - return new PacketCoreControlPlaneResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetPacketCoreControlPlaneResource(id); } - #endregion - #region TenantPacketCoreControlPlaneVersionResource /// /// 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. /// Returns a object. public static TenantPacketCoreControlPlaneVersionResource GetTenantPacketCoreControlPlaneVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TenantPacketCoreControlPlaneVersionResource.ValidateResourceId(id); - return new TenantPacketCoreControlPlaneVersionResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetTenantPacketCoreControlPlaneVersionResource(id); } - #endregion - #region SubscriptionPacketCoreControlPlaneVersionResource /// /// 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. /// Returns a object. public static SubscriptionPacketCoreControlPlaneVersionResource GetSubscriptionPacketCoreControlPlaneVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionPacketCoreControlPlaneVersionResource.ValidateResourceId(id); - return new SubscriptionPacketCoreControlPlaneVersionResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetSubscriptionPacketCoreControlPlaneVersionResource(id); } - #endregion - #region PacketCoreDataPlaneResource /// /// 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. /// Returns a object. public static PacketCoreDataPlaneResource GetPacketCoreDataPlaneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PacketCoreDataPlaneResource.ValidateResourceId(id); - return new PacketCoreDataPlaneResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetPacketCoreDataPlaneResource(id); } - #endregion - #region MobileNetworkServiceResource /// /// 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. /// Returns a object. public static MobileNetworkServiceResource GetMobileNetworkServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkServiceResource.ValidateResourceId(id); - return new MobileNetworkServiceResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkServiceResource(id); } - #endregion - #region MobileNetworkSimResource /// /// 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. /// Returns a object. public static MobileNetworkSimResource GetMobileNetworkSimResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkSimResource.ValidateResourceId(id); - return new MobileNetworkSimResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkSimResource(id); } - #endregion - #region MobileNetworkSimGroupResource /// /// 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. /// Returns a object. public static MobileNetworkSimGroupResource GetMobileNetworkSimGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkSimGroupResource.ValidateResourceId(id); - return new MobileNetworkSimGroupResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkSimGroupResource(id); } - #endregion - #region MobileNetworkSimPolicyResource /// /// 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. /// Returns a object. public static MobileNetworkSimPolicyResource GetMobileNetworkSimPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkSimPolicyResource.ValidateResourceId(id); - return new MobileNetworkSimPolicyResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkSimPolicyResource(id); } - #endregion - #region MobileNetworkSiteResource /// /// 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. /// Returns a object. public static MobileNetworkSiteResource GetMobileNetworkSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkSiteResource.ValidateResourceId(id); - return new MobileNetworkSiteResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkSiteResource(id); } - #endregion - #region MobileNetworkSliceResource /// /// 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. /// Returns a object. public static MobileNetworkSliceResource GetMobileNetworkSliceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MobileNetworkSliceResource.ValidateResourceId(id); - return new MobileNetworkSliceResource(client, id); - } - ); + return GetMobileNetworkArmClientMockingExtension(client).GetMobileNetworkSliceResource(id); } - #endregion - /// Gets a collection of MobileNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of MobileNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MobileNetworkResources and their operations over a MobileNetworkResource. public static MobileNetworkCollection GetMobileNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMobileNetworks(); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetworks(); } /// @@ -370,16 +305,20 @@ public static MobileNetworkCollection GetMobileNetworks(this ResourceGroupResour /// MobileNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the mobile network. /// The cancellation token to use. - /// 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 static async Task> GetMobileNetworkAsync(this ResourceGroupResource resourceGroupResource, string mobileNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMobileNetworks().GetAsync(mobileNetworkName, cancellationToken).ConfigureAwait(false); + return await GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetworkAsync(mobileNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -394,24 +333,34 @@ public static async Task> GetMobileNetworkAsync( /// MobileNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the mobile network. /// The cancellation token to use. - /// 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 static Response GetMobileNetwork(this ResourceGroupResource resourceGroupResource, string mobileNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMobileNetworks().Get(mobileNetworkName, cancellationToken); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetwork(mobileNetworkName, cancellationToken); } - /// Gets a collection of PacketCoreControlPlaneResources in the ResourceGroupResource. + /// + /// Gets a collection of PacketCoreControlPlaneResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PacketCoreControlPlaneResources and their operations over a PacketCoreControlPlaneResource. public static PacketCoreControlPlaneCollection GetPacketCoreControlPlanes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPacketCoreControlPlanes(); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetPacketCoreControlPlanes(); } /// @@ -426,16 +375,20 @@ public static PacketCoreControlPlaneCollection GetPacketCoreControlPlanes(this R /// PacketCoreControlPlanes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane. /// The cancellation token to use. - /// 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 static async Task> GetPacketCoreControlPlaneAsync(this ResourceGroupResource resourceGroupResource, string packetCoreControlPlaneName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPacketCoreControlPlanes().GetAsync(packetCoreControlPlaneName, cancellationToken).ConfigureAwait(false); + return await GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetPacketCoreControlPlaneAsync(packetCoreControlPlaneName, cancellationToken).ConfigureAwait(false); } /// @@ -450,24 +403,34 @@ public static async Task> GetPacketCore /// PacketCoreControlPlanes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane. /// The cancellation token to use. - /// 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 static Response GetPacketCoreControlPlane(this ResourceGroupResource resourceGroupResource, string packetCoreControlPlaneName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPacketCoreControlPlanes().Get(packetCoreControlPlaneName, cancellationToken); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetPacketCoreControlPlane(packetCoreControlPlaneName, cancellationToken); } - /// Gets a collection of MobileNetworkSimGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of MobileNetworkSimGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MobileNetworkSimGroupResources and their operations over a MobileNetworkSimGroupResource. public static MobileNetworkSimGroupCollection GetMobileNetworkSimGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMobileNetworkSimGroups(); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetworkSimGroups(); } /// @@ -482,16 +445,20 @@ public static MobileNetworkSimGroupCollection GetMobileNetworkSimGroups(this Res /// SimGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the SIM Group. /// The cancellation token to use. - /// 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 static async Task> GetMobileNetworkSimGroupAsync(this ResourceGroupResource resourceGroupResource, string simGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMobileNetworkSimGroups().GetAsync(simGroupName, cancellationToken).ConfigureAwait(false); + return await GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetworkSimGroupAsync(simGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -506,24 +473,34 @@ public static async Task> GetMobileNetwo /// SimGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the SIM Group. /// The cancellation token to use. - /// 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 static Response GetMobileNetworkSimGroup(this ResourceGroupResource resourceGroupResource, string simGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMobileNetworkSimGroups().Get(simGroupName, cancellationToken); + return GetMobileNetworkResourceGroupMockingExtension(resourceGroupResource).GetMobileNetworkSimGroup(simGroupName, cancellationToken); } - /// Gets a collection of SubscriptionPacketCoreControlPlaneVersionResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionPacketCoreControlPlaneVersionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SubscriptionPacketCoreControlPlaneVersionResources and their operations over a SubscriptionPacketCoreControlPlaneVersionResource. public static SubscriptionPacketCoreControlPlaneVersionCollection GetSubscriptionPacketCoreControlPlaneVersions(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionPacketCoreControlPlaneVersions(); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionPacketCoreControlPlaneVersions(); } /// @@ -538,16 +515,20 @@ public static SubscriptionPacketCoreControlPlaneVersionCollection GetSubscriptio /// PacketCoreControlPlaneVersions_GetBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane version. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionPacketCoreControlPlaneVersionAsync(this SubscriptionResource subscriptionResource, string versionName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionPacketCoreControlPlaneVersions().GetAsync(versionName, cancellationToken).ConfigureAwait(false); + return await GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionPacketCoreControlPlaneVersionAsync(versionName, cancellationToken).ConfigureAwait(false); } /// @@ -562,16 +543,20 @@ public static async TaskPacketCoreControlPlaneVersions_GetBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane version. /// The cancellation token to use. - /// 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 static Response GetSubscriptionPacketCoreControlPlaneVersion(this SubscriptionResource subscriptionResource, string versionName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionPacketCoreControlPlaneVersions().Get(versionName, cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionPacketCoreControlPlaneVersion(versionName, cancellationToken); } /// @@ -586,13 +571,17 @@ public static Response GetSub /// MobileNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMobileNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMobileNetworksAsync(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetMobileNetworksAsync(cancellationToken); } /// @@ -607,13 +596,17 @@ public static AsyncPageable GetMobileNetworksAsync(this S /// MobileNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMobileNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMobileNetworks(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetMobileNetworks(cancellationToken); } /// @@ -628,13 +621,17 @@ public static Pageable GetMobileNetworks(this Subscriptio /// PacketCoreControlPlanes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPacketCoreControlPlanesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPacketCoreControlPlanesAsync(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetPacketCoreControlPlanesAsync(cancellationToken); } /// @@ -649,13 +646,17 @@ public static AsyncPageable GetPacketCoreControl /// PacketCoreControlPlanes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPacketCoreControlPlanes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPacketCoreControlPlanes(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetPacketCoreControlPlanes(cancellationToken); } /// @@ -670,13 +671,17 @@ public static Pageable GetPacketCoreControlPlane /// SimGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMobileNetworkSimGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMobileNetworkSimGroupsAsync(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetMobileNetworkSimGroupsAsync(cancellationToken); } /// @@ -691,21 +696,31 @@ public static AsyncPageable GetMobileNetworkSimGr /// SimGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMobileNetworkSimGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMobileNetworkSimGroups(cancellationToken); + return GetMobileNetworkSubscriptionMockingExtension(subscriptionResource).GetMobileNetworkSimGroups(cancellationToken); } - /// Gets a collection of TenantPacketCoreControlPlaneVersionResources in the TenantResource. + /// + /// Gets a collection of TenantPacketCoreControlPlaneVersionResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TenantPacketCoreControlPlaneVersionResources and their operations over a TenantPacketCoreControlPlaneVersionResource. public static TenantPacketCoreControlPlaneVersionCollection GetTenantPacketCoreControlPlaneVersions(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantPacketCoreControlPlaneVersions(); + return GetMobileNetworkTenantMockingExtension(tenantResource).GetTenantPacketCoreControlPlaneVersions(); } /// @@ -720,16 +735,20 @@ public static TenantPacketCoreControlPlaneVersionCollection GetTenantPacketCoreC /// PacketCoreControlPlaneVersions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane version. /// The cancellation token to use. - /// 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 static async Task> GetTenantPacketCoreControlPlaneVersionAsync(this TenantResource tenantResource, string versionName, CancellationToken cancellationToken = default) { - return await tenantResource.GetTenantPacketCoreControlPlaneVersions().GetAsync(versionName, cancellationToken).ConfigureAwait(false); + return await GetMobileNetworkTenantMockingExtension(tenantResource).GetTenantPacketCoreControlPlaneVersionAsync(versionName, cancellationToken).ConfigureAwait(false); } /// @@ -744,16 +763,20 @@ public static async Task> /// PacketCoreControlPlaneVersions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the packet core control plane version. /// The cancellation token to use. - /// 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 static Response GetTenantPacketCoreControlPlaneVersion(this TenantResource tenantResource, string versionName, CancellationToken cancellationToken = default) { - return tenantResource.GetTenantPacketCoreControlPlaneVersions().Get(versionName, cancellationToken); + return GetMobileNetworkTenantMockingExtension(tenantResource).GetTenantPacketCoreControlPlaneVersion(versionName, cancellationToken); } } } diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkResourceGroupMockingExtension.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..eabd942bec6b --- /dev/null +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkResourceGroupMockingExtension.cs @@ -0,0 +1,198 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MobileNetwork; + +namespace Azure.ResourceManager.MobileNetwork.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MobileNetworkResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MobileNetworkResourceGroupMockingExtension() + { + } + + /// 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 MobileNetworkResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MobileNetworkResources in the ResourceGroupResource. + /// An object representing collection of MobileNetworkResources and their operations over a MobileNetworkResource. + public virtual MobileNetworkCollection GetMobileNetworks() + { + return GetCachedClient(client => new MobileNetworkCollection(client, Id)); + } + + /// + /// Gets information about the specified mobile network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName} + /// + /// + /// Operation Id + /// MobileNetworks_Get + /// + /// + /// + /// The name of the mobile network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMobileNetworkAsync(string mobileNetworkName, CancellationToken cancellationToken = default) + { + return await GetMobileNetworks().GetAsync(mobileNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified mobile network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName} + /// + /// + /// Operation Id + /// MobileNetworks_Get + /// + /// + /// + /// The name of the mobile network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMobileNetwork(string mobileNetworkName, CancellationToken cancellationToken = default) + { + return GetMobileNetworks().Get(mobileNetworkName, cancellationToken); + } + + /// Gets a collection of PacketCoreControlPlaneResources in the ResourceGroupResource. + /// An object representing collection of PacketCoreControlPlaneResources and their operations over a PacketCoreControlPlaneResource. + public virtual PacketCoreControlPlaneCollection GetPacketCoreControlPlanes() + { + return GetCachedClient(client => new PacketCoreControlPlaneCollection(client, Id)); + } + + /// + /// Gets information about the specified packet core control plane. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName} + /// + /// + /// Operation Id + /// PacketCoreControlPlanes_Get + /// + /// + /// + /// The name of the packet core control plane. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPacketCoreControlPlaneAsync(string packetCoreControlPlaneName, CancellationToken cancellationToken = default) + { + return await GetPacketCoreControlPlanes().GetAsync(packetCoreControlPlaneName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified packet core control plane. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName} + /// + /// + /// Operation Id + /// PacketCoreControlPlanes_Get + /// + /// + /// + /// The name of the packet core control plane. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPacketCoreControlPlane(string packetCoreControlPlaneName, CancellationToken cancellationToken = default) + { + return GetPacketCoreControlPlanes().Get(packetCoreControlPlaneName, cancellationToken); + } + + /// Gets a collection of MobileNetworkSimGroupResources in the ResourceGroupResource. + /// An object representing collection of MobileNetworkSimGroupResources and their operations over a MobileNetworkSimGroupResource. + public virtual MobileNetworkSimGroupCollection GetMobileNetworkSimGroups() + { + return GetCachedClient(client => new MobileNetworkSimGroupCollection(client, Id)); + } + + /// + /// Gets information about the specified SIM group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName} + /// + /// + /// Operation Id + /// SimGroups_Get + /// + /// + /// + /// The name of the SIM Group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMobileNetworkSimGroupAsync(string simGroupName, CancellationToken cancellationToken = default) + { + return await GetMobileNetworkSimGroups().GetAsync(simGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified SIM group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName} + /// + /// + /// Operation Id + /// SimGroups_Get + /// + /// + /// + /// The name of the SIM Group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMobileNetworkSimGroup(string simGroupName, CancellationToken cancellationToken = default) + { + return GetMobileNetworkSimGroups().Get(simGroupName, cancellationToken); + } + } +} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkSubscriptionMockingExtension.cs similarity index 74% rename from sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkSubscriptionMockingExtension.cs index c3888b94fe58..2a1171bac5aa 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkSubscriptionMockingExtension.cs @@ -5,17 +5,20 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MobileNetwork; -namespace Azure.ResourceManager.MobileNetwork +namespace Azure.ResourceManager.MobileNetwork.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MobileNetworkSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mobileNetworkClientDiagnostics; private MobileNetworksRestOperations _mobileNetworkRestClient; @@ -24,15 +27,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _mobileNetworkSimGroupSimGroupsClientDiagnostics; private SimGroupsRestOperations _mobileNetworkSimGroupSimGroupsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MobileNetworkSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MobileNetworkSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -53,7 +56,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of SubscriptionPacketCoreControlPlaneVersionResources and their operations over a SubscriptionPacketCoreControlPlaneVersionResource. public virtual SubscriptionPacketCoreControlPlaneVersionCollection GetSubscriptionPacketCoreControlPlaneVersions() { - return GetCachedClient(Client => new SubscriptionPacketCoreControlPlaneVersionCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionPacketCoreControlPlaneVersionCollection(client, Id)); + } + + /// + /// Gets information about the specified packet core control plane version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName} + /// + /// + /// Operation Id + /// PacketCoreControlPlaneVersions_GetBySubscription + /// + /// + /// + /// The name of the packet core control plane version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionPacketCoreControlPlaneVersionAsync(string versionName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionPacketCoreControlPlaneVersions().GetAsync(versionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified packet core control plane version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName} + /// + /// + /// Operation Id + /// PacketCoreControlPlaneVersions_GetBySubscription + /// + /// + /// + /// The name of the packet core control plane version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionPacketCoreControlPlaneVersion(string versionName, CancellationToken cancellationToken = default) + { + return GetSubscriptionPacketCoreControlPlaneVersions().Get(versionName, cancellationToken); } /// @@ -75,7 +124,7 @@ public virtual AsyncPageable GetMobileNetworksAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => MobileNetworkRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MobileNetworkRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkResource(Client, MobileNetworkData.DeserializeMobileNetworkData(e)), MobileNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMobileNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkResource(Client, MobileNetworkData.DeserializeMobileNetworkData(e)), MobileNetworkClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetMobileNetworks", "value", "nextLink", cancellationToken); } /// @@ -97,7 +146,7 @@ public virtual Pageable GetMobileNetworks(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => MobileNetworkRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MobileNetworkRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkResource(Client, MobileNetworkData.DeserializeMobileNetworkData(e)), MobileNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMobileNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkResource(Client, MobileNetworkData.DeserializeMobileNetworkData(e)), MobileNetworkClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetMobileNetworks", "value", "nextLink", cancellationToken); } /// @@ -119,7 +168,7 @@ public virtual AsyncPageable GetPacketCoreContro { HttpMessage FirstPageRequest(int? pageSizeHint) => PacketCoreControlPlaneRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PacketCoreControlPlaneRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PacketCoreControlPlaneResource(Client, PacketCoreControlPlaneData.DeserializePacketCoreControlPlaneData(e)), PacketCoreControlPlaneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPacketCoreControlPlanes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PacketCoreControlPlaneResource(Client, PacketCoreControlPlaneData.DeserializePacketCoreControlPlaneData(e)), PacketCoreControlPlaneClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetPacketCoreControlPlanes", "value", "nextLink", cancellationToken); } /// @@ -141,7 +190,7 @@ public virtual Pageable GetPacketCoreControlPlan { HttpMessage FirstPageRequest(int? pageSizeHint) => PacketCoreControlPlaneRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PacketCoreControlPlaneRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PacketCoreControlPlaneResource(Client, PacketCoreControlPlaneData.DeserializePacketCoreControlPlaneData(e)), PacketCoreControlPlaneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPacketCoreControlPlanes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PacketCoreControlPlaneResource(Client, PacketCoreControlPlaneData.DeserializePacketCoreControlPlaneData(e)), PacketCoreControlPlaneClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetPacketCoreControlPlanes", "value", "nextLink", cancellationToken); } /// @@ -163,7 +212,7 @@ public virtual AsyncPageable GetMobileNetworkSimG { HttpMessage FirstPageRequest(int? pageSizeHint) => MobileNetworkSimGroupSimGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MobileNetworkSimGroupSimGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkSimGroupResource(Client, MobileNetworkSimGroupData.DeserializeMobileNetworkSimGroupData(e)), MobileNetworkSimGroupSimGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMobileNetworkSimGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkSimGroupResource(Client, MobileNetworkSimGroupData.DeserializeMobileNetworkSimGroupData(e)), MobileNetworkSimGroupSimGroupsClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetMobileNetworkSimGroups", "value", "nextLink", cancellationToken); } /// @@ -185,7 +234,7 @@ public virtual Pageable GetMobileNetworkSimGroups { HttpMessage FirstPageRequest(int? pageSizeHint) => MobileNetworkSimGroupSimGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MobileNetworkSimGroupSimGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkSimGroupResource(Client, MobileNetworkSimGroupData.DeserializeMobileNetworkSimGroupData(e)), MobileNetworkSimGroupSimGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMobileNetworkSimGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MobileNetworkSimGroupResource(Client, MobileNetworkSimGroupData.DeserializeMobileNetworkSimGroupData(e)), MobileNetworkSimGroupSimGroupsClientDiagnostics, Pipeline, "MobileNetworkSubscriptionMockingExtension.GetMobileNetworkSimGroups", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkTenantMockingExtension.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkTenantMockingExtension.cs new file mode 100644 index 000000000000..a7dfe869ace7 --- /dev/null +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/MobileNetworkTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MobileNetwork; + +namespace Azure.ResourceManager.MobileNetwork.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MobileNetworkTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MobileNetworkTenantMockingExtension() + { + } + + /// 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 MobileNetworkTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of TenantPacketCoreControlPlaneVersionResources in the TenantResource. + /// An object representing collection of TenantPacketCoreControlPlaneVersionResources and their operations over a TenantPacketCoreControlPlaneVersionResource. + public virtual TenantPacketCoreControlPlaneVersionCollection GetTenantPacketCoreControlPlaneVersions() + { + return GetCachedClient(client => new TenantPacketCoreControlPlaneVersionCollection(client, Id)); + } + + /// + /// Gets information about the specified packet core control plane version. + /// + /// + /// Request Path + /// /providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName} + /// + /// + /// Operation Id + /// PacketCoreControlPlaneVersions_Get + /// + /// + /// + /// The name of the packet core control plane version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTenantPacketCoreControlPlaneVersionAsync(string versionName, CancellationToken cancellationToken = default) + { + return await GetTenantPacketCoreControlPlaneVersions().GetAsync(versionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified packet core control plane version. + /// + /// + /// Request Path + /// /providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName} + /// + /// + /// Operation Id + /// PacketCoreControlPlaneVersions_Get + /// + /// + /// + /// The name of the packet core control plane version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTenantPacketCoreControlPlaneVersion(string versionName, CancellationToken cancellationToken = default) + { + return GetTenantPacketCoreControlPlaneVersions().Get(versionName, cancellationToken); + } + } +} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ae9df5309c89..000000000000 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MobileNetwork -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MobileNetworkResources in the ResourceGroupResource. - /// An object representing collection of MobileNetworkResources and their operations over a MobileNetworkResource. - public virtual MobileNetworkCollection GetMobileNetworks() - { - return GetCachedClient(Client => new MobileNetworkCollection(Client, Id)); - } - - /// Gets a collection of PacketCoreControlPlaneResources in the ResourceGroupResource. - /// An object representing collection of PacketCoreControlPlaneResources and their operations over a PacketCoreControlPlaneResource. - public virtual PacketCoreControlPlaneCollection GetPacketCoreControlPlanes() - { - return GetCachedClient(Client => new PacketCoreControlPlaneCollection(Client, Id)); - } - - /// Gets a collection of MobileNetworkSimGroupResources in the ResourceGroupResource. - /// An object representing collection of MobileNetworkSimGroupResources and their operations over a MobileNetworkSimGroupResource. - public virtual MobileNetworkSimGroupCollection GetMobileNetworkSimGroups() - { - return GetCachedClient(Client => new MobileNetworkSimGroupCollection(Client, Id)); - } - } -} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index e614c49faba6..000000000000 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MobileNetwork -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of TenantPacketCoreControlPlaneVersionResources in the TenantResource. - /// An object representing collection of TenantPacketCoreControlPlaneVersionResources and their operations over a TenantPacketCoreControlPlaneVersionResource. - public virtual TenantPacketCoreControlPlaneVersionCollection GetTenantPacketCoreControlPlaneVersions() - { - return GetCachedClient(Client => new TenantPacketCoreControlPlaneVersionCollection(Client, Id)); - } - } -} diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkResource.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkResource.cs index 30f83f497361..31b87eaeadba 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkResource.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MobileDataNetworkResources and their operations over a MobileDataNetworkResource. public virtual MobileDataNetworkCollection GetMobileDataNetworks() { - return GetCachedClient(Client => new MobileDataNetworkCollection(Client, Id)); + return GetCachedClient(client => new MobileDataNetworkCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MobileDataNetworkCollection GetMobileDataNetworks() /// /// The name of the data network. /// The cancellation token to use. - /// 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> GetMobileDataNetworkAsync(string dataNetworkName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetMobileDataNetw /// /// The name of the data network. /// The cancellation token to use. - /// 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 GetMobileDataNetwork(string dataNetworkName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetMobileDataNetwork(string d /// An object representing collection of MobileNetworkServiceResources and their operations over a MobileNetworkServiceResource. public virtual MobileNetworkServiceCollection GetMobileNetworkServices() { - return GetCachedClient(Client => new MobileNetworkServiceCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkServiceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MobileNetworkServiceCollection GetMobileNetworkServices() /// /// The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`. /// The cancellation token to use. - /// 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> GetMobileNetworkServiceAsync(string serviceName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetMobileNetwo /// /// The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`. /// The cancellation token to use. - /// 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 GetMobileNetworkService(string serviceName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMobileNetworkService(st /// An object representing collection of MobileNetworkSimPolicyResources and their operations over a MobileNetworkSimPolicyResource. public virtual MobileNetworkSimPolicyCollection GetMobileNetworkSimPolicies() { - return GetCachedClient(Client => new MobileNetworkSimPolicyCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkSimPolicyCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual MobileNetworkSimPolicyCollection GetMobileNetworkSimPolicies() /// /// The name of the SIM policy. /// The cancellation token to use. - /// 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> GetMobileNetworkSimPolicyAsync(string simPolicyName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetMobileNet /// /// The name of the SIM policy. /// The cancellation token to use. - /// 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 GetMobileNetworkSimPolicy(string simPolicyName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetMobileNetworkSimPolic /// An object representing collection of MobileNetworkSiteResources and their operations over a MobileNetworkSiteResource. public virtual MobileNetworkSiteCollection GetMobileNetworkSites() { - return GetCachedClient(Client => new MobileNetworkSiteCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkSiteCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual MobileNetworkSiteCollection GetMobileNetworkSites() /// /// The name of the mobile network site. /// The cancellation token to use. - /// 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> GetMobileNetworkSiteAsync(string siteName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetMobileNetworkS /// /// The name of the mobile network site. /// The cancellation token to use. - /// 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 GetMobileNetworkSite(string siteName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetMobileNetworkSite(string s /// An object representing collection of MobileNetworkSliceResources and their operations over a MobileNetworkSliceResource. public virtual MobileNetworkSliceCollection GetMobileNetworkSlices() { - return GetCachedClient(Client => new MobileNetworkSliceCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkSliceCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual MobileNetworkSliceCollection GetMobileNetworkSlices() /// /// The name of the network slice. /// The cancellation token to use. - /// 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> GetMobileNetworkSliceAsync(string sliceName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetMobileNetwork /// /// The name of the network slice. /// The cancellation token to use. - /// 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 GetMobileNetworkSlice(string sliceName, CancellationToken cancellationToken = default) { diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkSimGroupResource.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkSimGroupResource.cs index b9964b32858e..af7dc724a1c0 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkSimGroupResource.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/MobileNetworkSimGroupResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MobileNetworkSimResources and their operations over a MobileNetworkSimResource. public virtual MobileNetworkSimCollection GetMobileNetworkSims() { - return GetCachedClient(Client => new MobileNetworkSimCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkSimCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual MobileNetworkSimCollection GetMobileNetworkSims() /// /// The name of the SIM. /// The cancellation token to use. - /// 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> GetMobileNetworkSimAsync(string simName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetMobileNetworkSi /// /// The name of the SIM. /// The cancellation token to use. - /// 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 GetMobileNetworkSim(string simName, CancellationToken cancellationToken = default) { diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreControlPlaneResource.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreControlPlaneResource.cs index b46d3497179a..e2dc5939e1de 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreControlPlaneResource.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreControlPlaneResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MobileNetworkDiagnosticsPackageResources and their operations over a MobileNetworkDiagnosticsPackageResource. public virtual MobileNetworkDiagnosticsPackageCollection GetMobileNetworkDiagnosticsPackages() { - return GetCachedClient(Client => new MobileNetworkDiagnosticsPackageCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkDiagnosticsPackageCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MobileNetworkDiagnosticsPackageCollection GetMobileNetworkDiagnos /// /// The name of the diagnostics package. /// The cancellation token to use. - /// 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> GetMobileNetworkDiagnosticsPackageAsync(string diagnosticsPackageName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Get /// /// The name of the diagnostics package. /// The cancellation token to use. - /// 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 GetMobileNetworkDiagnosticsPackage(string diagnosticsPackageName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetMobileNetwor /// An object representing collection of MobileNetworkPacketCaptureResources and their operations over a MobileNetworkPacketCaptureResource. public virtual MobileNetworkPacketCaptureCollection GetMobileNetworkPacketCaptures() { - return GetCachedClient(Client => new MobileNetworkPacketCaptureCollection(Client, Id)); + return GetCachedClient(client => new MobileNetworkPacketCaptureCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MobileNetworkPacketCaptureCollection GetMobileNetworkPacketCaptur /// /// The name of the packet capture session. /// The cancellation token to use. - /// 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> GetMobileNetworkPacketCaptureAsync(string packetCaptureName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetMobil /// /// The name of the packet capture session. /// The cancellation token to use. - /// 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 GetMobileNetworkPacketCapture(string packetCaptureName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMobileNetworkPack /// An object representing collection of PacketCoreDataPlaneResources and their operations over a PacketCoreDataPlaneResource. public virtual PacketCoreDataPlaneCollection GetPacketCoreDataPlanes() { - return GetCachedClient(Client => new PacketCoreDataPlaneCollection(Client, Id)); + return GetCachedClient(client => new PacketCoreDataPlaneCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual PacketCoreDataPlaneCollection GetPacketCoreDataPlanes() /// /// The name of the packet core data plane. /// The cancellation token to use. - /// 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> GetPacketCoreDataPlaneAsync(string packetCoreDataPlaneName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetPacketCoreDa /// /// The name of the packet core data plane. /// The cancellation token to use. - /// 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 GetPacketCoreDataPlane(string packetCoreDataPlaneName, CancellationToken cancellationToken = default) { diff --git a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreDataPlaneResource.cs b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreDataPlaneResource.cs index a36a93d37bc2..2e83f74bec9c 100644 --- a/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreDataPlaneResource.cs +++ b/sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/src/Generated/PacketCoreDataPlaneResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MobileAttachedDataNetworkResources and their operations over a MobileAttachedDataNetworkResource. public virtual MobileAttachedDataNetworkCollection GetMobileAttachedDataNetworks() { - return GetCachedClient(Client => new MobileAttachedDataNetworkCollection(Client, Id)); + return GetCachedClient(client => new MobileAttachedDataNetworkCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual MobileAttachedDataNetworkCollection GetMobileAttachedDataNetworks /// /// The name of the attached data network. /// The cancellation token to use. - /// 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> GetMobileAttachedDataNetworkAsync(string attachedDataNetworkName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetMobile /// /// The name of the attached data network. /// The cancellation token to use. - /// 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 GetMobileAttachedDataNetwork(string attachedDataNetworkName, CancellationToken cancellationToken = default) { diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 376d1af6787c..000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Monitor.Models; - -namespace Azure.ResourceManager.Monitor -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _metricDefinitionsClientDiagnostics; - private MetricDefinitionsRestOperations _metricDefinitionsRestClient; - private ClientDiagnostics _metricsClientDiagnostics; - private MetricsRestOperations _metricsRestClient; - private ClientDiagnostics _baselinesClientDiagnostics; - private BaselinesRestOperations _baselinesRestClient; - private ClientDiagnostics _metricNamespacesClientDiagnostics; - private MetricNamespacesRestOperations _metricNamespacesRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics MetricDefinitionsClientDiagnostics => _metricDefinitionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private MetricDefinitionsRestOperations MetricDefinitionsRestClient => _metricDefinitionsRestClient ??= new MetricDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics MetricsClientDiagnostics => _metricsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private MetricsRestOperations MetricsRestClient => _metricsRestClient ??= new MetricsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics BaselinesClientDiagnostics => _baselinesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private BaselinesRestOperations BaselinesRestClient => _baselinesRestClient ??= new BaselinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics MetricNamespacesClientDiagnostics => _metricNamespacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private MetricNamespacesRestOperations MetricNamespacesRestClient => _metricNamespacesRestClient ??= new MetricNamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DiagnosticSettingResources in the ArmResource. - /// An object representing collection of DiagnosticSettingResources and their operations over a DiagnosticSettingResource. - public virtual DiagnosticSettingCollection GetDiagnosticSettings() - { - return GetCachedClient(Client => new DiagnosticSettingCollection(Client, Id)); - } - - /// Gets a collection of DiagnosticSettingsCategoryResources in the ArmResource. - /// An object representing collection of DiagnosticSettingsCategoryResources and their operations over a DiagnosticSettingsCategoryResource. - public virtual DiagnosticSettingsCategoryCollection GetDiagnosticSettingsCategories() - { - return GetCachedClient(Client => new DiagnosticSettingsCategoryCollection(Client, Id)); - } - - /// Gets an object representing a VmInsightsOnboardingStatusResource along with the instance operations that can be performed on it in the ArmResource. - /// Returns a object. - public virtual VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatus() - { - return new VmInsightsOnboardingStatusResource(Client, Id.AppendProviderResource("Microsoft.Insights", "vmInsightsOnboardingStatuses", "default")); - } - - /// Gets a collection of DataCollectionRuleAssociationResources in the ArmResource. - /// An object representing collection of DataCollectionRuleAssociationResources and their operations over a DataCollectionRuleAssociationResource. - public virtual DataCollectionRuleAssociationCollection GetDataCollectionRuleAssociations() - { - return GetCachedClient(Client => new DataCollectionRuleAssociationCollection(Client, Id)); - } - - /// - /// Lists the metric definitions for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metricDefinitions - /// - /// - /// Operation Id - /// MetricDefinitions_List - /// - /// - /// - /// Metric namespace to query metric definitions for. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMonitorMetricDefinitionsAsync(string metricnamespace = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricDefinitionsRestClient.CreateListRequest(Id, metricnamespace); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetricDefinition.DeserializeMonitorMetricDefinition, MetricDefinitionsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricDefinitions", "value", null, cancellationToken); - } - - /// - /// Lists the metric definitions for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metricDefinitions - /// - /// - /// Operation Id - /// MetricDefinitions_List - /// - /// - /// - /// Metric namespace to query metric definitions for. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMonitorMetricDefinitions(string metricnamespace = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricDefinitionsRestClient.CreateListRequest(Id, metricnamespace); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetricDefinition.DeserializeMonitorMetricDefinition, MetricDefinitionsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricDefinitions", "value", null, cancellationToken); - } - - /// - /// **Lists the metric values for a resource**. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metrics - /// - /// - /// Operation Id - /// Metrics_List - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMonitorMetricsAsync(ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListRequest(Id, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetric.DeserializeMonitorMetric, MetricsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetrics", "value", null, cancellationToken); - } - - /// - /// **Lists the metric values for a resource**. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metrics - /// - /// - /// Operation Id - /// Metrics_List - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMonitorMetrics(ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListRequest(Id, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetric.DeserializeMonitorMetric, MetricsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetrics", "value", null, cancellationToken); - } - - /// - /// **Lists the metric baseline values for a resource**. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metricBaselines - /// - /// - /// Operation Id - /// Baselines_List - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMonitorMetricBaselinesAsync(ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => BaselinesRestClient.CreateListRequest(Id, options.Metricnames, options.Metricnamespace, options.Timespan, options.Interval, options.Aggregation, options.Sensitivities, options.Filter, options.ResultType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorSingleMetricBaseline.DeserializeMonitorSingleMetricBaseline, BaselinesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricBaselines", "value", null, cancellationToken); - } - - /// - /// **Lists the metric baseline values for a resource**. - /// - /// - /// Request Path - /// /{resourceUri}/providers/Microsoft.Insights/metricBaselines - /// - /// - /// Operation Id - /// Baselines_List - /// - /// - /// - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMonitorMetricBaselines(ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => BaselinesRestClient.CreateListRequest(Id, options.Metricnames, options.Metricnamespace, options.Timespan, options.Interval, options.Aggregation, options.Sensitivities, options.Filter, options.ResultType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorSingleMetricBaseline.DeserializeMonitorSingleMetricBaseline, BaselinesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricBaselines", "value", null, cancellationToken); - } - - /// - /// Lists the metric namespaces for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/microsoft.insights/metricNamespaces - /// - /// - /// Operation Id - /// MetricNamespaces_List - /// - /// - /// - /// The ISO 8601 conform Date start time from which to query for metric namespaces. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMonitorMetricNamespacesAsync(string startTime = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricNamespacesRestClient.CreateListRequest(Id, startTime); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetricNamespace.DeserializeMonitorMetricNamespace, MetricNamespacesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricNamespaces", "value", null, cancellationToken); - } - - /// - /// Lists the metric namespaces for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/microsoft.insights/metricNamespaces - /// - /// - /// Operation Id - /// MetricNamespaces_List - /// - /// - /// - /// The ISO 8601 conform Date start time from which to query for metric namespaces. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMonitorMetricNamespaces(string startTime = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MetricNamespacesRestClient.CreateListRequest(Id, startTime); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetricNamespace.DeserializeMonitorMetricNamespace, MetricNamespacesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetMonitorMetricNamespaces", "value", null, cancellationToken); - } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorArmClientMockingExtension.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorArmClientMockingExtension.cs new file mode 100644 index 000000000000..90ecdbf1f82e --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorArmClientMockingExtension.cs @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Monitor; +using Azure.ResourceManager.Monitor.Models; + +namespace Azure.ResourceManager.Monitor.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MonitorArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _metricDefinitionsClientDiagnostics; + private MetricDefinitionsRestOperations _metricDefinitionsRestClient; + private ClientDiagnostics _metricsClientDiagnostics; + private MetricsRestOperations _metricsRestClient; + private ClientDiagnostics _baselinesClientDiagnostics; + private BaselinesRestOperations _baselinesRestClient; + private ClientDiagnostics _metricNamespacesClientDiagnostics; + private MetricNamespacesRestOperations _metricNamespacesRestClient; + + /// Initializes a new instance of the class for mocking. + protected MonitorArmClientMockingExtension() + { + } + + /// 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 MonitorArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MonitorArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics MetricDefinitionsClientDiagnostics => _metricDefinitionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private MetricDefinitionsRestOperations MetricDefinitionsRestClient => _metricDefinitionsRestClient ??= new MetricDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics MetricsClientDiagnostics => _metricsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private MetricsRestOperations MetricsRestClient => _metricsRestClient ??= new MetricsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics BaselinesClientDiagnostics => _baselinesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private BaselinesRestOperations BaselinesRestClient => _baselinesRestClient ??= new BaselinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics MetricNamespacesClientDiagnostics => _metricNamespacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private MetricNamespacesRestOperations MetricNamespacesRestClient => _metricNamespacesRestClient ??= new MetricNamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DiagnosticSettingResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DiagnosticSettingResources and their operations over a DiagnosticSettingResource. + public virtual DiagnosticSettingCollection GetDiagnosticSettings(ResourceIdentifier scope) + { + return new DiagnosticSettingCollection(Client, scope); + } + + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name} + /// + /// + /// Operation Id + /// DiagnosticSettings_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the diagnostic setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiagnosticSettingAsync(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return await GetDiagnosticSettings(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name} + /// + /// + /// Operation Id + /// DiagnosticSettings_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the diagnostic setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiagnosticSetting(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return GetDiagnosticSettings(scope).Get(name, cancellationToken); + } + + /// Gets a collection of DiagnosticSettingsCategoryResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DiagnosticSettingsCategoryResources and their operations over a DiagnosticSettingsCategoryResource. + public virtual DiagnosticSettingsCategoryCollection GetDiagnosticSettingsCategories(ResourceIdentifier scope) + { + return new DiagnosticSettingsCategoryCollection(Client, scope); + } + + /// + /// Gets the diagnostic settings category for the specified resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name} + /// + /// + /// Operation Id + /// DiagnosticSettingsCategory_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the diagnostic setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiagnosticSettingsCategoryAsync(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return await GetDiagnosticSettingsCategories(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the diagnostic settings category for the specified resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name} + /// + /// + /// Operation Id + /// DiagnosticSettingsCategory_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the diagnostic setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiagnosticSettingsCategory(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return GetDiagnosticSettingsCategories(scope).Get(name, cancellationToken); + } + + /// Gets an object representing a VmInsightsOnboardingStatusResource along with the instance operations that can be performed on it in the ArmClient. + /// The scope that the resource will apply against. + /// Returns a object. + public virtual VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatus(ResourceIdentifier scope) + { + return new VmInsightsOnboardingStatusResource(Client, scope.AppendProviderResource("Microsoft.Insights", "vmInsightsOnboardingStatuses", "default")); + } + + /// Gets a collection of DataCollectionRuleAssociationResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DataCollectionRuleAssociationResources and their operations over a DataCollectionRuleAssociationResource. + public virtual DataCollectionRuleAssociationCollection GetDataCollectionRuleAssociations(ResourceIdentifier scope) + { + return new DataCollectionRuleAssociationCollection(Client, scope); + } + + /// + /// Returns the specified association. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName} + /// + /// + /// Operation Id + /// DataCollectionRuleAssociations_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the association. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataCollectionRuleAssociationAsync(ResourceIdentifier scope, string associationName, CancellationToken cancellationToken = default) + { + return await GetDataCollectionRuleAssociations(scope).GetAsync(associationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specified association. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName} + /// + /// + /// Operation Id + /// DataCollectionRuleAssociations_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the association. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataCollectionRuleAssociation(ResourceIdentifier scope, string associationName, CancellationToken cancellationToken = default) + { + return GetDataCollectionRuleAssociations(scope).Get(associationName, cancellationToken); + } + + /// + /// Lists the metric definitions for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metricDefinitions + /// + /// + /// Operation Id + /// MetricDefinitions_List + /// + /// + /// + /// The scope to use. + /// Metric namespace to query metric definitions for. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMonitorMetricDefinitionsAsync(ResourceIdentifier scope, string metricnamespace = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricDefinitionsRestClient.CreateListRequest(scope, metricnamespace); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetricDefinition.DeserializeMonitorMetricDefinition, MetricDefinitionsClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricDefinitions", "value", null, cancellationToken); + } + + /// + /// Lists the metric definitions for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metricDefinitions + /// + /// + /// Operation Id + /// MetricDefinitions_List + /// + /// + /// + /// The scope to use. + /// Metric namespace to query metric definitions for. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMonitorMetricDefinitions(ResourceIdentifier scope, string metricnamespace = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricDefinitionsRestClient.CreateListRequest(scope, metricnamespace); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetricDefinition.DeserializeMonitorMetricDefinition, MetricDefinitionsClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricDefinitions", "value", null, cancellationToken); + } + + /// + /// **Lists the metric values for a resource**. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metrics + /// + /// + /// Operation Id + /// Metrics_List + /// + /// + /// + /// The scope to use. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMonitorMetricsAsync(ResourceIdentifier scope, ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) + { + options ??= new ArmResourceGetMonitorMetricsOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListRequest(scope, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetric.DeserializeMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetrics", "value", null, cancellationToken); + } + + /// + /// **Lists the metric values for a resource**. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metrics + /// + /// + /// Operation Id + /// Metrics_List + /// + /// + /// + /// The scope to use. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMonitorMetrics(ResourceIdentifier scope, ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) + { + options ??= new ArmResourceGetMonitorMetricsOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListRequest(scope, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetric.DeserializeMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetrics", "value", null, cancellationToken); + } + + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metricBaselines + /// + /// + /// Operation Id + /// Baselines_List + /// + /// + /// + /// The scope to use. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMonitorMetricBaselinesAsync(ResourceIdentifier scope, ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) + { + options ??= new ArmResourceGetMonitorMetricBaselinesOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => BaselinesRestClient.CreateListRequest(scope, options.Metricnames, options.Metricnamespace, options.Timespan, options.Interval, options.Aggregation, options.Sensitivities, options.Filter, options.ResultType); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorSingleMetricBaseline.DeserializeMonitorSingleMetricBaseline, BaselinesClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricBaselines", "value", null, cancellationToken); + } + + /// + /// **Lists the metric baseline values for a resource**. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.Insights/metricBaselines + /// + /// + /// Operation Id + /// Baselines_List + /// + /// + /// + /// The scope to use. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMonitorMetricBaselines(ResourceIdentifier scope, ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) + { + options ??= new ArmResourceGetMonitorMetricBaselinesOptions(); + + HttpMessage FirstPageRequest(int? pageSizeHint) => BaselinesRestClient.CreateListRequest(scope, options.Metricnames, options.Metricnamespace, options.Timespan, options.Interval, options.Aggregation, options.Sensitivities, options.Filter, options.ResultType); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorSingleMetricBaseline.DeserializeMonitorSingleMetricBaseline, BaselinesClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricBaselines", "value", null, cancellationToken); + } + + /// + /// Lists the metric namespaces for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/microsoft.insights/metricNamespaces + /// + /// + /// Operation Id + /// MetricNamespaces_List + /// + /// + /// + /// The scope to use. + /// The ISO 8601 conform Date start time from which to query for metric namespaces. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMonitorMetricNamespacesAsync(ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricNamespacesRestClient.CreateListRequest(scope, startTime); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorMetricNamespace.DeserializeMonitorMetricNamespace, MetricNamespacesClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricNamespaces", "value", null, cancellationToken); + } + + /// + /// Lists the metric namespaces for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/microsoft.insights/metricNamespaces + /// + /// + /// Operation Id + /// MetricNamespaces_List + /// + /// + /// + /// The scope to use. + /// The ISO 8601 conform Date start time from which to query for metric namespaces. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMonitorMetricNamespaces(ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricNamespacesRestClient.CreateListRequest(scope, startTime); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorMetricNamespace.DeserializeMonitorMetricNamespace, MetricNamespacesClientDiagnostics, Pipeline, "MonitorArmClientMockingExtension.GetMonitorMetricNamespaces", "value", null, cancellationToken); + } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutoscaleSettingResource GetAutoscaleSettingResource(ResourceIdentifier id) + { + AutoscaleSettingResource.ValidateResourceId(id); + return new AutoscaleSettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AlertRuleResource GetAlertRuleResource(ResourceIdentifier id) + { + AlertRuleResource.ValidateResourceId(id); + return new AlertRuleResource(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 LogProfileResource GetLogProfileResource(ResourceIdentifier id) + { + LogProfileResource.ValidateResourceId(id); + return new LogProfileResource(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 DiagnosticSettingResource GetDiagnosticSettingResource(ResourceIdentifier id) + { + DiagnosticSettingResource.ValidateResourceId(id); + return new DiagnosticSettingResource(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 DiagnosticSettingsCategoryResource GetDiagnosticSettingsCategoryResource(ResourceIdentifier id) + { + DiagnosticSettingsCategoryResource.ValidateResourceId(id); + return new DiagnosticSettingsCategoryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ActionGroupResource GetActionGroupResource(ResourceIdentifier id) + { + ActionGroupResource.ValidateResourceId(id); + return new ActionGroupResource(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 MetricAlertResource GetMetricAlertResource(ResourceIdentifier id) + { + MetricAlertResource.ValidateResourceId(id); + return new MetricAlertResource(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 ScheduledQueryRuleResource GetScheduledQueryRuleResource(ResourceIdentifier id) + { + ScheduledQueryRuleResource.ValidateResourceId(id); + return new ScheduledQueryRuleResource(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 VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatusResource(ResourceIdentifier id) + { + VmInsightsOnboardingStatusResource.ValidateResourceId(id); + return new VmInsightsOnboardingStatusResource(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 MonitorPrivateLinkScopeResource GetMonitorPrivateLinkScopeResource(ResourceIdentifier id) + { + MonitorPrivateLinkScopeResource.ValidateResourceId(id); + return new MonitorPrivateLinkScopeResource(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 MonitorPrivateLinkResource GetMonitorPrivateLinkResource(ResourceIdentifier id) + { + MonitorPrivateLinkResource.ValidateResourceId(id); + return new MonitorPrivateLinkResource(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 MonitorPrivateEndpointConnectionResource GetMonitorPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MonitorPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MonitorPrivateEndpointConnectionResource(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 MonitorPrivateLinkScopedResource GetMonitorPrivateLinkScopedResource(ResourceIdentifier id) + { + MonitorPrivateLinkScopedResource.ValidateResourceId(id); + return new MonitorPrivateLinkScopedResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ActivityLogAlertResource GetActivityLogAlertResource(ResourceIdentifier id) + { + ActivityLogAlertResource.ValidateResourceId(id); + return new ActivityLogAlertResource(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 DataCollectionEndpointResource GetDataCollectionEndpointResource(ResourceIdentifier id) + { + DataCollectionEndpointResource.ValidateResourceId(id); + return new DataCollectionEndpointResource(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 DataCollectionRuleAssociationResource GetDataCollectionRuleAssociationResource(ResourceIdentifier id) + { + DataCollectionRuleAssociationResource.ValidateResourceId(id); + return new DataCollectionRuleAssociationResource(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 DataCollectionRuleResource GetDataCollectionRuleResource(ResourceIdentifier id) + { + DataCollectionRuleResource.ValidateResourceId(id); + return new DataCollectionRuleResource(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 MonitorWorkspaceResource GetMonitorWorkspaceResource(ResourceIdentifier id) + { + MonitorWorkspaceResource.ValidateResourceId(id); + return new MonitorWorkspaceResource(Client, id); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs index c8cdea4dd007..12176237bbe1 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Monitor.Mocking; using Azure.ResourceManager.Monitor.Models; using Azure.ResourceManager.Resources; @@ -19,418 +20,39 @@ namespace Azure.ResourceManager.Monitor /// A class to add extension methods to Azure.ResourceManager.Monitor. public static partial class MonitorExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static MonitorArmClientMockingExtension GetMonitorArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MonitorArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MonitorResourceGroupMockingExtension GetMonitorResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MonitorResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MonitorSubscriptionMockingExtension GetMonitorSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MonitorSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MonitorTenantMockingExtension GetMonitorTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MonitorTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region AutoscaleSettingResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutoscaleSettingResource GetAutoscaleSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutoscaleSettingResource.ValidateResourceId(id); - return new AutoscaleSettingResource(client, id); - } - ); - } - #endregion - - #region AlertRuleResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AlertRuleResource GetAlertRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AlertRuleResource.ValidateResourceId(id); - return new AlertRuleResource(client, id); - } - ); - } - #endregion - - #region LogProfileResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static LogProfileResource GetLogProfileResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - LogProfileResource.ValidateResourceId(id); - return new LogProfileResource(client, id); - } - ); - } - #endregion - - #region DiagnosticSettingResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DiagnosticSettingResource GetDiagnosticSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DiagnosticSettingResource.ValidateResourceId(id); - return new DiagnosticSettingResource(client, id); - } - ); - } - #endregion - - #region DiagnosticSettingsCategoryResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DiagnosticSettingsCategoryResource GetDiagnosticSettingsCategoryResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DiagnosticSettingsCategoryResource.ValidateResourceId(id); - return new DiagnosticSettingsCategoryResource(client, id); - } - ); - } - #endregion - - #region ActionGroupResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ActionGroupResource GetActionGroupResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ActionGroupResource.ValidateResourceId(id); - return new ActionGroupResource(client, id); - } - ); - } - #endregion - - #region MetricAlertResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MetricAlertResource GetMetricAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MetricAlertResource.ValidateResourceId(id); - return new MetricAlertResource(client, id); - } - ); - } - #endregion - - #region ScheduledQueryRuleResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ScheduledQueryRuleResource GetScheduledQueryRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ScheduledQueryRuleResource.ValidateResourceId(id); - return new ScheduledQueryRuleResource(client, id); - } - ); - } - #endregion - - #region VmInsightsOnboardingStatusResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatusResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - VmInsightsOnboardingStatusResource.ValidateResourceId(id); - return new VmInsightsOnboardingStatusResource(client, id); - } - ); - } - #endregion - - #region MonitorPrivateLinkScopeResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MonitorPrivateLinkScopeResource GetMonitorPrivateLinkScopeResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MonitorPrivateLinkScopeResource.ValidateResourceId(id); - return new MonitorPrivateLinkScopeResource(client, id); - } - ); - } - #endregion - - #region MonitorPrivateLinkResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MonitorPrivateLinkResource GetMonitorPrivateLinkResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MonitorPrivateLinkResource.ValidateResourceId(id); - return new MonitorPrivateLinkResource(client, id); - } - ); - } - #endregion - - #region MonitorPrivateEndpointConnectionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MonitorPrivateEndpointConnectionResource GetMonitorPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MonitorPrivateEndpointConnectionResource.ValidateResourceId(id); - return new MonitorPrivateEndpointConnectionResource(client, id); - } - ); - } - #endregion - - #region MonitorPrivateLinkScopedResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MonitorPrivateLinkScopedResource GetMonitorPrivateLinkScopedResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MonitorPrivateLinkScopedResource.ValidateResourceId(id); - return new MonitorPrivateLinkScopedResource(client, id); - } - ); - } - #endregion - - #region ActivityLogAlertResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ActivityLogAlertResource GetActivityLogAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ActivityLogAlertResource.ValidateResourceId(id); - return new ActivityLogAlertResource(client, id); - } - ); - } - #endregion - - #region DataCollectionEndpointResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DataCollectionEndpointResource GetDataCollectionEndpointResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DataCollectionEndpointResource.ValidateResourceId(id); - return new DataCollectionEndpointResource(client, id); - } - ); - } - #endregion - - #region DataCollectionRuleAssociationResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DataCollectionRuleAssociationResource GetDataCollectionRuleAssociationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DataCollectionRuleAssociationResource.ValidateResourceId(id); - return new DataCollectionRuleAssociationResource(client, id); - } - ); - } - #endregion - - #region DataCollectionRuleResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DataCollectionRuleResource GetDataCollectionRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DataCollectionRuleResource.ValidateResourceId(id); - return new DataCollectionRuleResource(client, id); - } - ); - } - #endregion - - #region MonitorWorkspaceResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of DiagnosticSettingResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static MonitorWorkspaceResource GetMonitorWorkspaceResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - MonitorWorkspaceResource.ValidateResourceId(id); - return new MonitorWorkspaceResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of DiagnosticSettingResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of DiagnosticSettingResources and their operations over a DiagnosticSettingResource. public static DiagnosticSettingCollection GetDiagnosticSettings(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetDiagnosticSettings(); + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSettings(scope); } /// @@ -445,17 +67,21 @@ public static DiagnosticSettingCollection GetDiagnosticSettings(this ArmClient c /// DiagnosticSettings_Get /// /// + /// + /// 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 diagnostic setting. /// The cancellation token to use. - /// 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 static async Task> GetDiagnosticSettingAsync(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return await client.GetDiagnosticSettings(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingAsync(scope, name, cancellationToken).ConfigureAwait(false); } /// @@ -470,26 +96,36 @@ public static async Task> GetDiagnosticSetti /// DiagnosticSettings_Get /// /// + /// + /// 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 diagnostic setting. /// The cancellation token to use. - /// 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 static Response GetDiagnosticSetting(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return client.GetDiagnosticSettings(scope).Get(name, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSetting(scope, name, cancellationToken); } - /// Gets a collection of DiagnosticSettingsCategoryResources in the ArmResource. + /// + /// Gets a collection of DiagnosticSettingsCategoryResources 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. /// An object representing collection of DiagnosticSettingsCategoryResources and their operations over a DiagnosticSettingsCategoryResource. public static DiagnosticSettingsCategoryCollection GetDiagnosticSettingsCategories(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetDiagnosticSettingsCategories(); + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingsCategories(scope); } /// @@ -504,17 +140,21 @@ public static DiagnosticSettingsCategoryCollection GetDiagnosticSettingsCategori /// DiagnosticSettingsCategory_Get /// /// + /// + /// 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 diagnostic setting. /// The cancellation token to use. - /// 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 static async Task> GetDiagnosticSettingsCategoryAsync(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return await client.GetDiagnosticSettingsCategories(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingsCategoryAsync(scope, name, cancellationToken).ConfigureAwait(false); } /// @@ -529,35 +169,51 @@ public static async Task> GetDiagno /// DiagnosticSettingsCategory_Get /// /// + /// + /// 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 diagnostic setting. /// The cancellation token to use. - /// 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 static Response GetDiagnosticSettingsCategory(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return client.GetDiagnosticSettingsCategories(scope).Get(name, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingsCategory(scope, name, cancellationToken); } - /// Gets an object representing a VmInsightsOnboardingStatusResource along with the instance operations that can be performed on it in the ArmResource. + /// + /// Gets an object representing a VmInsightsOnboardingStatusResource along with the instance operations that can be performed on it 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. /// Returns a object. public static VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatus(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetVmInsightsOnboardingStatus(); + return GetMonitorArmClientMockingExtension(client).GetVmInsightsOnboardingStatus(scope); } - /// Gets a collection of DataCollectionRuleAssociationResources in the ArmResource. + /// + /// Gets a collection of DataCollectionRuleAssociationResources 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. /// An object representing collection of DataCollectionRuleAssociationResources and their operations over a DataCollectionRuleAssociationResource. public static DataCollectionRuleAssociationCollection GetDataCollectionRuleAssociations(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetDataCollectionRuleAssociations(); + return GetMonitorArmClientMockingExtension(client).GetDataCollectionRuleAssociations(scope); } /// @@ -572,17 +228,21 @@ public static DataCollectionRuleAssociationCollection GetDataCollectionRuleAssoc /// DataCollectionRuleAssociations_Get /// /// + /// + /// 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 association. The name is case insensitive. /// The cancellation token to use. - /// 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 static async Task> GetDataCollectionRuleAssociationAsync(this ArmClient client, ResourceIdentifier scope, string associationName, CancellationToken cancellationToken = default) { - return await client.GetDataCollectionRuleAssociations(scope).GetAsync(associationName, cancellationToken).ConfigureAwait(false); + return await GetMonitorArmClientMockingExtension(client).GetDataCollectionRuleAssociationAsync(scope, associationName, cancellationToken).ConfigureAwait(false); } /// @@ -597,17 +257,21 @@ public static async Task> GetDat /// DataCollectionRuleAssociations_Get /// /// + /// + /// 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 association. The name is case insensitive. /// The cancellation token to use. - /// 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 static Response GetDataCollectionRuleAssociation(this ArmClient client, ResourceIdentifier scope, string associationName, CancellationToken cancellationToken = default) { - return client.GetDataCollectionRuleAssociations(scope).Get(associationName, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetDataCollectionRuleAssociation(scope, associationName, cancellationToken); } /// @@ -622,6 +286,10 @@ public static Response GetDataCollectionR /// MetricDefinitions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -629,7 +297,7 @@ public static Response GetDataCollectionR /// The cancellation token to use. public static AsyncPageable GetMonitorMetricDefinitionsAsync(this ArmClient client, ResourceIdentifier scope, string metricnamespace = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricDefinitionsAsync(metricnamespace, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricDefinitionsAsync(scope, metricnamespace, cancellationToken); } /// @@ -644,6 +312,10 @@ public static AsyncPageable GetMonitorMetricDefinitions /// MetricDefinitions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -651,7 +323,7 @@ public static AsyncPageable GetMonitorMetricDefinitions /// The cancellation token to use. public static Pageable GetMonitorMetricDefinitions(this ArmClient client, ResourceIdentifier scope, string metricnamespace = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricDefinitions(metricnamespace, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricDefinitions(scope, metricnamespace, cancellationToken); } /// @@ -666,6 +338,10 @@ public static Pageable GetMonitorMetricDefinitions(this /// Metrics_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -673,9 +349,7 @@ public static Pageable GetMonitorMetricDefinitions(this /// The cancellation token to use. public static AsyncPageable GetMonitorMetricsAsync(this ArmClient client, ResourceIdentifier scope, ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { - options ??= new ArmResourceGetMonitorMetricsOptions(); - - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricsAsync(options, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricsAsync(scope, options, cancellationToken); } /// @@ -690,6 +364,10 @@ public static AsyncPageable GetMonitorMetricsAsync(this ArmClient /// Metrics_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -697,9 +375,7 @@ public static AsyncPageable GetMonitorMetricsAsync(this ArmClient /// The cancellation token to use. public static Pageable GetMonitorMetrics(this ArmClient client, ResourceIdentifier scope, ArmResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { - options ??= new ArmResourceGetMonitorMetricsOptions(); - - return GetArmResourceExtensionClient(client, scope).GetMonitorMetrics(options, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorMetrics(scope, options, cancellationToken); } /// @@ -714,16 +390,18 @@ public static Pageable GetMonitorMetrics(this ArmClient client, R /// Baselines_List /// /// - /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. public static AsyncPageable GetMonitorMetricBaselinesAsync(this ArmClient client, ResourceIdentifier scope, ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) { - options ??= new ArmResourceGetMonitorMetricBaselinesOptions(); - - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricBaselinesAsync(options, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricBaselinesAsync(scope, options, cancellationToken); } /// @@ -734,72 +412,376 @@ public static AsyncPageable GetMonitorMetricBaselin /// /{resourceUri}/providers/Microsoft.Insights/metricBaselines /// /// - /// Operation Id - /// Baselines_List + /// Operation Id + /// Baselines_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. + /// The cancellation token to use. + public static Pageable GetMonitorMetricBaselines(this ArmClient client, ResourceIdentifier scope, ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricBaselines(scope, options, cancellationToken); + } + + /// + /// Lists the metric namespaces for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/microsoft.insights/metricNamespaces + /// + /// + /// Operation Id + /// MetricNamespaces_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ISO 8601 conform Date start time from which to query for metric namespaces. + /// The cancellation token to use. + public static AsyncPageable GetMonitorMetricNamespacesAsync(this ArmClient client, ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricNamespacesAsync(scope, startTime, cancellationToken); + } + + /// + /// Lists the metric namespaces for the resource. + /// + /// + /// Request Path + /// /{resourceUri}/providers/microsoft.insights/metricNamespaces + /// + /// + /// Operation Id + /// MetricNamespaces_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// The ISO 8601 conform Date start time from which to query for metric namespaces. + /// The cancellation token to use. + public static Pageable GetMonitorMetricNamespaces(this ArmClient client, ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorMetricNamespaces(scope, startTime, cancellationToken); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AutoscaleSettingResource GetAutoscaleSettingResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetAutoscaleSettingResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AlertRuleResource GetAlertRuleResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetAlertRuleResource(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. + /// Returns a object. + public static LogProfileResource GetLogProfileResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetLogProfileResource(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. + /// Returns a object. + public static DiagnosticSettingResource GetDiagnosticSettingResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingResource(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. + /// Returns a object. + public static DiagnosticSettingsCategoryResource GetDiagnosticSettingsCategoryResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetDiagnosticSettingsCategoryResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ActionGroupResource GetActionGroupResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetActionGroupResource(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. + /// Returns a object. + public static MetricAlertResource GetMetricAlertResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetMetricAlertResource(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. + /// Returns a object. + public static ScheduledQueryRuleResource GetScheduledQueryRuleResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetScheduledQueryRuleResource(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. + /// Returns a object. + public static VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatusResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetVmInsightsOnboardingStatusResource(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. + /// Returns a object. + public static MonitorPrivateLinkScopeResource GetMonitorPrivateLinkScopeResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorPrivateLinkScopeResource(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. + /// Returns a object. + public static MonitorPrivateLinkResource GetMonitorPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorPrivateLinkResource(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. + /// Returns a object. + public static MonitorPrivateEndpointConnectionResource GetMonitorPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorPrivateEndpointConnectionResource(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. + /// Returns a object. + public static MonitorPrivateLinkScopedResource GetMonitorPrivateLinkScopedResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetMonitorPrivateLinkScopedResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ActivityLogAlertResource GetActivityLogAlertResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetActivityLogAlertResource(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. + /// Returns a object. + public static DataCollectionEndpointResource GetDataCollectionEndpointResource(this ArmClient client, ResourceIdentifier id) + { + return GetMonitorArmClientMockingExtension(client).GetDataCollectionEndpointResource(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 scope that the resource will apply against. - /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. - /// The cancellation token to use. - public static Pageable GetMonitorMetricBaselines(this ArmClient client, ResourceIdentifier scope, ArmResourceGetMonitorMetricBaselinesOptions options, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static DataCollectionRuleAssociationResource GetDataCollectionRuleAssociationResource(this ArmClient client, ResourceIdentifier id) { - options ??= new ArmResourceGetMonitorMetricBaselinesOptions(); - - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricBaselines(options, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetDataCollectionRuleAssociationResource(id); } /// - /// Lists the metric namespaces for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/microsoft.insights/metricNamespaces - /// + /// 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. /// - /// Operation Id - /// MetricNamespaces_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ISO 8601 conform Date start time from which to query for metric namespaces. - /// The cancellation token to use. - public static AsyncPageable GetMonitorMetricNamespacesAsync(this ArmClient client, ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static DataCollectionRuleResource GetDataCollectionRuleResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricNamespacesAsync(startTime, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetDataCollectionRuleResource(id); } /// - /// Lists the metric namespaces for the resource. - /// - /// - /// Request Path - /// /{resourceUri}/providers/microsoft.insights/metricNamespaces - /// + /// 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. /// - /// Operation Id - /// MetricNamespaces_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The ISO 8601 conform Date start time from which to query for metric namespaces. - /// The cancellation token to use. - public static Pageable GetMonitorMetricNamespaces(this ArmClient client, ResourceIdentifier scope, string startTime = null, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static MonitorWorkspaceResource GetMonitorWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetMonitorMetricNamespaces(startTime, cancellationToken); + return GetMonitorArmClientMockingExtension(client).GetMonitorWorkspaceResource(id); } - /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. + /// + /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutoscaleSettingResources and their operations over a AutoscaleSettingResource. public static AutoscaleSettingCollection GetAutoscaleSettings(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutoscaleSettings(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAutoscaleSettings(); } /// @@ -814,16 +796,20 @@ public static AutoscaleSettingCollection GetAutoscaleSettings(this ResourceGroup /// AutoscaleSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The autoscale setting name. /// The cancellation token to use. - /// 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 static async Task> GetAutoscaleSettingAsync(this ResourceGroupResource resourceGroupResource, string autoscaleSettingName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAutoscaleSettings().GetAsync(autoscaleSettingName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAutoscaleSettingAsync(autoscaleSettingName, cancellationToken).ConfigureAwait(false); } /// @@ -838,24 +824,34 @@ public static async Task> GetAutoscaleSetting /// AutoscaleSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The autoscale setting name. /// The cancellation token to use. - /// 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 static Response GetAutoscaleSetting(this ResourceGroupResource resourceGroupResource, string autoscaleSettingName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAutoscaleSettings().Get(autoscaleSettingName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAutoscaleSetting(autoscaleSettingName, cancellationToken); } - /// Gets a collection of AlertRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of AlertRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AlertRuleResources and their operations over a AlertRuleResource. public static AlertRuleCollection GetAlertRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAlertRules(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAlertRules(); } /// @@ -870,16 +866,20 @@ public static AlertRuleCollection GetAlertRules(this ResourceGroupResource resou /// AlertRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static async Task> GetAlertRuleAsync(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAlertRules().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAlertRuleAsync(ruleName, cancellationToken).ConfigureAwait(false); } /// @@ -894,24 +894,34 @@ public static async Task> GetAlertRuleAsync(this Res /// AlertRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static Response GetAlertRule(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAlertRules().Get(ruleName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetAlertRule(ruleName, cancellationToken); } - /// Gets a collection of ActionGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of ActionGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ActionGroupResources and their operations over a ActionGroupResource. public static ActionGroupCollection GetActionGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetActionGroups(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActionGroups(); } /// @@ -926,16 +936,20 @@ public static ActionGroupCollection GetActionGroups(this ResourceGroupResource r /// ActionGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the action group. /// The cancellation token to use. - /// 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 static async Task> GetActionGroupAsync(this ResourceGroupResource resourceGroupResource, string actionGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetActionGroups().GetAsync(actionGroupName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActionGroupAsync(actionGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -950,24 +964,34 @@ public static async Task> GetActionGroupAsync(this /// ActionGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the action group. /// The cancellation token to use. - /// 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 static Response GetActionGroup(this ResourceGroupResource resourceGroupResource, string actionGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetActionGroups().Get(actionGroupName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActionGroup(actionGroupName, cancellationToken); } - /// Gets a collection of MetricAlertResources in the ResourceGroupResource. + /// + /// Gets a collection of MetricAlertResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MetricAlertResources and their operations over a MetricAlertResource. public static MetricAlertCollection GetMetricAlerts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMetricAlerts(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMetricAlerts(); } /// @@ -982,16 +1006,20 @@ public static MetricAlertCollection GetMetricAlerts(this ResourceGroupResource r /// MetricAlerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static async Task> GetMetricAlertAsync(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMetricAlerts().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMetricAlertAsync(ruleName, cancellationToken).ConfigureAwait(false); } /// @@ -1006,24 +1034,34 @@ public static async Task> GetMetricAlertAsync(this /// MetricAlerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static Response GetMetricAlert(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMetricAlerts().Get(ruleName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMetricAlert(ruleName, cancellationToken); } - /// Gets a collection of ScheduledQueryRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of ScheduledQueryRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScheduledQueryRuleResources and their operations over a ScheduledQueryRuleResource. public static ScheduledQueryRuleCollection GetScheduledQueryRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScheduledQueryRules(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetScheduledQueryRules(); } /// @@ -1038,16 +1076,20 @@ public static ScheduledQueryRuleCollection GetScheduledQueryRules(this ResourceG /// ScheduledQueryRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static async Task> GetScheduledQueryRuleAsync(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScheduledQueryRules().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetScheduledQueryRuleAsync(ruleName, cancellationToken).ConfigureAwait(false); } /// @@ -1062,24 +1104,34 @@ public static async Task> GetScheduledQuery /// ScheduledQueryRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rule. /// The cancellation token to use. - /// 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 static Response GetScheduledQueryRule(this ResourceGroupResource resourceGroupResource, string ruleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScheduledQueryRules().Get(ruleName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetScheduledQueryRule(ruleName, cancellationToken); } - /// Gets a collection of MonitorPrivateLinkScopeResources in the ResourceGroupResource. + /// + /// Gets a collection of MonitorPrivateLinkScopeResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MonitorPrivateLinkScopeResources and their operations over a MonitorPrivateLinkScopeResource. public static MonitorPrivateLinkScopeCollection GetMonitorPrivateLinkScopes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMonitorPrivateLinkScopes(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorPrivateLinkScopes(); } /// @@ -1094,16 +1146,20 @@ public static MonitorPrivateLinkScopeCollection GetMonitorPrivateLinkScopes(this /// PrivateLinkScopes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Monitor PrivateLinkScope resource. /// The cancellation token to use. - /// 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 static async Task> GetMonitorPrivateLinkScopeAsync(this ResourceGroupResource resourceGroupResource, string scopeName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMonitorPrivateLinkScopes().GetAsync(scopeName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorPrivateLinkScopeAsync(scopeName, cancellationToken).ConfigureAwait(false); } /// @@ -1118,24 +1174,34 @@ public static async Task> GetMonitorPr /// PrivateLinkScopes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Monitor PrivateLinkScope resource. /// The cancellation token to use. - /// 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 static Response GetMonitorPrivateLinkScope(this ResourceGroupResource resourceGroupResource, string scopeName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMonitorPrivateLinkScopes().Get(scopeName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorPrivateLinkScope(scopeName, cancellationToken); } - /// Gets a collection of ActivityLogAlertResources in the ResourceGroupResource. + /// + /// Gets a collection of ActivityLogAlertResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ActivityLogAlertResources and their operations over a ActivityLogAlertResource. public static ActivityLogAlertCollection GetActivityLogAlerts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetActivityLogAlerts(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActivityLogAlerts(); } /// @@ -1150,16 +1216,20 @@ public static ActivityLogAlertCollection GetActivityLogAlerts(this ResourceGroup /// ActivityLogAlerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Activity Log Alert rule. /// The cancellation token to use. - /// 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 static async Task> GetActivityLogAlertAsync(this ResourceGroupResource resourceGroupResource, string activityLogAlertName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetActivityLogAlerts().GetAsync(activityLogAlertName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActivityLogAlertAsync(activityLogAlertName, cancellationToken).ConfigureAwait(false); } /// @@ -1174,24 +1244,34 @@ public static async Task> GetActivityLogAlert /// ActivityLogAlerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Activity Log Alert rule. /// The cancellation token to use. - /// 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 static Response GetActivityLogAlert(this ResourceGroupResource resourceGroupResource, string activityLogAlertName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetActivityLogAlerts().Get(activityLogAlertName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetActivityLogAlert(activityLogAlertName, cancellationToken); } - /// Gets a collection of DataCollectionEndpointResources in the ResourceGroupResource. + /// + /// Gets a collection of DataCollectionEndpointResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataCollectionEndpointResources and their operations over a DataCollectionEndpointResource. public static DataCollectionEndpointCollection GetDataCollectionEndpoints(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataCollectionEndpoints(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionEndpoints(); } /// @@ -1206,16 +1286,20 @@ public static DataCollectionEndpointCollection GetDataCollectionEndpoints(this R /// DataCollectionEndpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the data collection endpoint. The name is case insensitive. /// The cancellation token to use. - /// 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 static async Task> GetDataCollectionEndpointAsync(this ResourceGroupResource resourceGroupResource, string dataCollectionEndpointName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataCollectionEndpoints().GetAsync(dataCollectionEndpointName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionEndpointAsync(dataCollectionEndpointName, cancellationToken).ConfigureAwait(false); } /// @@ -1230,24 +1314,34 @@ public static async Task> GetDataCollec /// DataCollectionEndpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the data collection endpoint. The name is case insensitive. /// The cancellation token to use. - /// 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 static Response GetDataCollectionEndpoint(this ResourceGroupResource resourceGroupResource, string dataCollectionEndpointName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataCollectionEndpoints().Get(dataCollectionEndpointName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionEndpoint(dataCollectionEndpointName, cancellationToken); } - /// Gets a collection of DataCollectionRuleResources in the ResourceGroupResource. + /// + /// Gets a collection of DataCollectionRuleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataCollectionRuleResources and their operations over a DataCollectionRuleResource. public static DataCollectionRuleCollection GetDataCollectionRules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataCollectionRules(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionRules(); } /// @@ -1262,16 +1356,20 @@ public static DataCollectionRuleCollection GetDataCollectionRules(this ResourceG /// DataCollectionRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the data collection rule. The name is case insensitive. /// The cancellation token to use. - /// 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 static async Task> GetDataCollectionRuleAsync(this ResourceGroupResource resourceGroupResource, string dataCollectionRuleName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataCollectionRules().GetAsync(dataCollectionRuleName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionRuleAsync(dataCollectionRuleName, cancellationToken).ConfigureAwait(false); } /// @@ -1286,24 +1384,34 @@ public static async Task> GetDataCollection /// DataCollectionRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the data collection rule. The name is case insensitive. /// The cancellation token to use. - /// 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 static Response GetDataCollectionRule(this ResourceGroupResource resourceGroupResource, string dataCollectionRuleName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataCollectionRules().Get(dataCollectionRuleName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetDataCollectionRule(dataCollectionRuleName, cancellationToken); } - /// Gets a collection of MonitorWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of MonitorWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MonitorWorkspaceResources and their operations over a MonitorWorkspaceResource. public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMonitorWorkspaceResources(); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorWorkspaceResources(); } /// @@ -1318,16 +1426,20 @@ public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(th /// AzureMonitorWorkspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. - /// 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 static async Task> GetMonitorWorkspaceResourceAsync(this ResourceGroupResource resourceGroupResource, string azureMonitorWorkspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMonitorWorkspaceResources().GetAsync(azureMonitorWorkspaceName, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorWorkspaceResourceAsync(azureMonitorWorkspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -1342,16 +1454,20 @@ public static async Task> GetMonitorWorkspace /// AzureMonitorWorkspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. - /// 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 static Response GetMonitorWorkspaceResource(this ResourceGroupResource resourceGroupResource, string azureMonitorWorkspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMonitorWorkspaceResources().Get(azureMonitorWorkspaceName, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetMonitorWorkspaceResource(azureMonitorWorkspaceName, cancellationToken); } /// @@ -1366,6 +1482,10 @@ public static Response GetMonitorWorkspaceResource(thi /// PrivateLinkScopeOperationStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The operation Id. @@ -1374,9 +1494,7 @@ public static Response GetMonitorWorkspaceResource(thi /// is null. public static async Task> GetPrivateLinkScopeOperationStatusAsync(this ResourceGroupResource resourceGroupResource, string asyncOperationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(asyncOperationId, nameof(asyncOperationId)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPrivateLinkScopeOperationStatusAsync(asyncOperationId, cancellationToken).ConfigureAwait(false); + return await GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetPrivateLinkScopeOperationStatusAsync(asyncOperationId, cancellationToken).ConfigureAwait(false); } /// @@ -1391,6 +1509,10 @@ public static async Task> GetPr /// PrivateLinkScopeOperationStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The operation Id. @@ -1399,17 +1521,21 @@ public static async Task> GetPr /// is null. public static Response GetPrivateLinkScopeOperationStatus(this ResourceGroupResource resourceGroupResource, string asyncOperationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(asyncOperationId, nameof(asyncOperationId)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPrivateLinkScopeOperationStatus(asyncOperationId, cancellationToken); + return GetMonitorResourceGroupMockingExtension(resourceGroupResource).GetPrivateLinkScopeOperationStatus(asyncOperationId, cancellationToken); } - /// Gets a collection of LogProfileResources in the SubscriptionResource. + /// + /// Gets a collection of LogProfileResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LogProfileResources and their operations over a LogProfileResource. public static LogProfileCollection GetLogProfiles(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLogProfiles(); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetLogProfiles(); } /// @@ -1424,16 +1550,20 @@ public static LogProfileCollection GetLogProfiles(this SubscriptionResource subs /// LogProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the log profile. /// The cancellation token to use. - /// 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 static async Task> GetLogProfileAsync(this SubscriptionResource subscriptionResource, string logProfileName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetLogProfiles().GetAsync(logProfileName, cancellationToken).ConfigureAwait(false); + return await GetMonitorSubscriptionMockingExtension(subscriptionResource).GetLogProfileAsync(logProfileName, cancellationToken).ConfigureAwait(false); } /// @@ -1448,16 +1578,20 @@ public static async Task> GetLogProfileAsync(this S /// LogProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the log profile. /// The cancellation token to use. - /// 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 static Response GetLogProfile(this SubscriptionResource subscriptionResource, string logProfileName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetLogProfiles().Get(logProfileName, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetLogProfile(logProfileName, cancellationToken); } /// @@ -1472,13 +1606,17 @@ public static Response GetLogProfile(this SubscriptionResour /// AutoscaleSettings_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutoscaleSettingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoscaleSettingsAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetAutoscaleSettingsAsync(cancellationToken); } /// @@ -1493,13 +1631,17 @@ public static AsyncPageable GetAutoscaleSettingsAsync( /// AutoscaleSettings_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutoscaleSettings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoscaleSettings(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetAutoscaleSettings(cancellationToken); } /// @@ -1514,13 +1656,17 @@ public static Pageable GetAutoscaleSettings(this Subsc /// AlertRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAlertRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlertRulesAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetAlertRulesAsync(cancellationToken); } /// @@ -1535,13 +1681,17 @@ public static AsyncPageable GetAlertRulesAsync(this Subscript /// AlertRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAlertRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlertRules(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetAlertRules(cancellationToken); } /// @@ -1556,13 +1706,17 @@ public static Pageable GetAlertRules(this SubscriptionResourc /// ActionGroups_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetActionGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActionGroupsAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActionGroupsAsync(cancellationToken); } /// @@ -1577,13 +1731,17 @@ public static AsyncPageable GetActionGroupsAsync(this Subsc /// ActionGroups_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetActionGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActionGroups(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActionGroups(cancellationToken); } /// @@ -1598,6 +1756,10 @@ public static Pageable GetActionGroups(this SubscriptionRes /// ActivityLogs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Reduces the set of data collected.<br>This argument is required and it also requires at least the start date/time.<br>The **$filter** argument is very restricted and allows only the following patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other syntax is allowed. @@ -1607,9 +1769,7 @@ public static Pageable GetActionGroups(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetActivityLogsAsync(this SubscriptionResource subscriptionResource, string filter, string select = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(filter, nameof(filter)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActivityLogsAsync(filter, select, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActivityLogsAsync(filter, select, cancellationToken); } /// @@ -1624,6 +1784,10 @@ public static AsyncPageable GetActivityLogsAsync(this Subscriptio /// ActivityLogs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Reduces the set of data collected.<br>This argument is required and it also requires at least the start date/time.<br>The **$filter** argument is very restricted and allows only the following patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other syntax is allowed. @@ -1633,9 +1797,7 @@ public static AsyncPageable GetActivityLogsAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetActivityLogs(this SubscriptionResource subscriptionResource, string filter, string select = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(filter, nameof(filter)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActivityLogs(filter, select, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActivityLogs(filter, select, cancellationToken); } /// @@ -1650,6 +1812,10 @@ public static Pageable GetActivityLogs(this SubscriptionResource /// Metrics_ListAtSubscriptionScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1658,9 +1824,7 @@ public static Pageable GetActivityLogs(this SubscriptionResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMonitorMetricsAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorMetricsAsync(options, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorMetricsAsync(options, cancellationToken); } /// @@ -1675,6 +1839,10 @@ public static AsyncPageable GetMonitorMetricsAsync(th /// Metrics_ListAtSubscriptionScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1683,9 +1851,7 @@ public static AsyncPageable GetMonitorMetricsAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMonitorMetrics(this SubscriptionResource subscriptionResource, SubscriptionResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorMetrics(options, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorMetrics(options, cancellationToken); } /// @@ -1700,6 +1866,10 @@ public static Pageable GetMonitorMetrics(this Subscri /// Metrics_ListAtSubscriptionScopePost /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1708,9 +1878,7 @@ public static Pageable GetMonitorMetrics(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMonitorMetricsWithPostAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetMonitorMetricsWithPostOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorMetricsWithPostAsync(options, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorMetricsWithPostAsync(options, cancellationToken); } /// @@ -1725,6 +1893,10 @@ public static AsyncPageable GetMonitorMetricsWithPost /// Metrics_ListAtSubscriptionScopePost /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1733,9 +1905,7 @@ public static AsyncPageable GetMonitorMetricsWithPost /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMonitorMetricsWithPost(this SubscriptionResource subscriptionResource, SubscriptionResourceGetMonitorMetricsWithPostOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorMetricsWithPost(options, cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorMetricsWithPost(options, cancellationToken); } /// @@ -1750,13 +1920,17 @@ public static Pageable GetMonitorMetricsWithPost(this /// MetricAlerts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMetricAlertsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMetricAlertsAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMetricAlertsAsync(cancellationToken); } /// @@ -1771,13 +1945,17 @@ public static AsyncPageable GetMetricAlertsAsync(this Subsc /// MetricAlerts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMetricAlerts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMetricAlerts(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMetricAlerts(cancellationToken); } /// @@ -1792,13 +1970,17 @@ public static Pageable GetMetricAlerts(this SubscriptionRes /// ScheduledQueryRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScheduledQueryRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScheduledQueryRulesAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetScheduledQueryRulesAsync(cancellationToken); } /// @@ -1813,13 +1995,17 @@ public static AsyncPageable GetScheduledQueryRulesAs /// ScheduledQueryRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScheduledQueryRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScheduledQueryRules(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetScheduledQueryRules(cancellationToken); } /// @@ -1834,13 +2020,17 @@ public static Pageable GetScheduledQueryRules(this S /// PrivateLinkScopes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMonitorPrivateLinkScopesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorPrivateLinkScopesAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorPrivateLinkScopesAsync(cancellationToken); } /// @@ -1855,13 +2045,17 @@ public static AsyncPageable GetMonitorPrivateLi /// PrivateLinkScopes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMonitorPrivateLinkScopes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorPrivateLinkScopes(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorPrivateLinkScopes(cancellationToken); } /// @@ -1876,13 +2070,17 @@ public static Pageable GetMonitorPrivateLinkSco /// ActivityLogAlerts_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetActivityLogAlertsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActivityLogAlertsAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActivityLogAlertsAsync(cancellationToken); } /// @@ -1897,13 +2095,17 @@ public static AsyncPageable GetActivityLogAlertsAsync( /// ActivityLogAlerts_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetActivityLogAlerts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetActivityLogAlerts(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetActivityLogAlerts(cancellationToken); } /// @@ -1918,13 +2120,17 @@ public static Pageable GetActivityLogAlerts(this Subsc /// DataCollectionEndpoints_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataCollectionEndpointsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataCollectionEndpointsAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetDataCollectionEndpointsAsync(cancellationToken); } /// @@ -1939,13 +2145,17 @@ public static AsyncPageable GetDataCollectionEnd /// DataCollectionEndpoints_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataCollectionEndpoints(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataCollectionEndpoints(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetDataCollectionEndpoints(cancellationToken); } /// @@ -1960,13 +2170,17 @@ public static Pageable GetDataCollectionEndpoint /// DataCollectionRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataCollectionRulesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataCollectionRulesAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetDataCollectionRulesAsync(cancellationToken); } /// @@ -1981,13 +2195,17 @@ public static AsyncPageable GetDataCollectionRulesAs /// DataCollectionRules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataCollectionRules(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataCollectionRules(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetDataCollectionRules(cancellationToken); } /// @@ -2002,13 +2220,17 @@ public static Pageable GetDataCollectionRules(this S /// AzureMonitorWorkspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMonitorWorkspaceResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorWorkspaceResourcesAsync(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorWorkspaceResourcesAsync(cancellationToken); } /// @@ -2023,13 +2245,17 @@ public static AsyncPageable GetMonitorWorkspaceResourc /// AzureMonitorWorkspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMonitorWorkspaceResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMonitorWorkspaceResources(cancellationToken); + return GetMonitorSubscriptionMockingExtension(subscriptionResource).GetMonitorWorkspaceResources(cancellationToken); } /// @@ -2044,13 +2270,17 @@ public static Pageable GetMonitorWorkspaceResources(th /// EventCategories_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventCategoriesAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetEventCategoriesAsync(cancellationToken); + return GetMonitorTenantMockingExtension(tenantResource).GetEventCategoriesAsync(cancellationToken); } /// @@ -2065,13 +2295,17 @@ public static AsyncPageable GetEventCategoriesAsync(th /// EventCategories_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventCategories(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetEventCategories(cancellationToken); + return GetMonitorTenantMockingExtension(tenantResource).GetEventCategories(cancellationToken); } /// @@ -2086,6 +2320,10 @@ public static Pageable GetEventCategories(this TenantR /// TenantActivityLogs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq '<ResourceProviderName>'.<br>- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. @@ -2094,7 +2332,7 @@ public static Pageable GetEventCategories(this TenantR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTenantActivityLogsAsync(this TenantResource tenantResource, string filter = null, string select = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantActivityLogsAsync(filter, select, cancellationToken); + return GetMonitorTenantMockingExtension(tenantResource).GetTenantActivityLogsAsync(filter, select, cancellationToken); } /// @@ -2109,6 +2347,10 @@ public static AsyncPageable GetTenantActivityLogsAsync(this Tenan /// TenantActivityLogs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Reduces the set of data collected. <br>The **$filter** is very restricted and allows only the following patterns.<br>- List events for a resource group: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceUri eq '<ResourceURI>'.<br>- List events for a subscription: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq '<ResourceProviderName>'.<br>- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq '<CorrelationID>'.<br>**NOTE**: No other syntax is allowed. @@ -2117,7 +2359,7 @@ public static AsyncPageable GetTenantActivityLogsAsync(this Tenan /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTenantActivityLogs(this TenantResource tenantResource, string filter = null, string select = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantActivityLogs(filter, select, cancellationToken); + return GetMonitorTenantMockingExtension(tenantResource).GetTenantActivityLogs(filter, select, cancellationToken); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorResourceGroupMockingExtension.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c424a60cb80b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorResourceGroupMockingExtension.cs @@ -0,0 +1,647 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Monitor; +using Azure.ResourceManager.Monitor.Models; + +namespace Azure.ResourceManager.Monitor.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MonitorResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _privateLinkScopeOperationStatusClientDiagnostics; + private PrivateLinkScopeOperationStatusRestOperations _privateLinkScopeOperationStatusRestClient; + + /// Initializes a new instance of the class for mocking. + protected MonitorResourceGroupMockingExtension() + { + } + + /// 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 MonitorResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics PrivateLinkScopeOperationStatusClientDiagnostics => _privateLinkScopeOperationStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PrivateLinkScopeOperationStatusRestOperations PrivateLinkScopeOperationStatusRestClient => _privateLinkScopeOperationStatusRestClient ??= new PrivateLinkScopeOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. + /// An object representing collection of AutoscaleSettingResources and their operations over a AutoscaleSettingResource. + public virtual AutoscaleSettingCollection GetAutoscaleSettings() + { + return GetCachedClient(client => new AutoscaleSettingCollection(client, Id)); + } + + /// + /// Gets an autoscale setting + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName} + /// + /// + /// Operation Id + /// AutoscaleSettings_Get + /// + /// + /// + /// The autoscale setting name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutoscaleSettingAsync(string autoscaleSettingName, CancellationToken cancellationToken = default) + { + return await GetAutoscaleSettings().GetAsync(autoscaleSettingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an autoscale setting + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName} + /// + /// + /// Operation Id + /// AutoscaleSettings_Get + /// + /// + /// + /// The autoscale setting name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutoscaleSetting(string autoscaleSettingName, CancellationToken cancellationToken = default) + { + return GetAutoscaleSettings().Get(autoscaleSettingName, cancellationToken); + } + + /// Gets a collection of AlertRuleResources in the ResourceGroupResource. + /// An object representing collection of AlertRuleResources and their operations over a AlertRuleResource. + public virtual AlertRuleCollection GetAlertRules() + { + return GetCachedClient(client => new AlertRuleCollection(client, Id)); + } + + /// + /// Gets a classic metric alert rule + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName} + /// + /// + /// Operation Id + /// AlertRules_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAlertRuleAsync(string ruleName, CancellationToken cancellationToken = default) + { + return await GetAlertRules().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a classic metric alert rule + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName} + /// + /// + /// Operation Id + /// AlertRules_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAlertRule(string ruleName, CancellationToken cancellationToken = default) + { + return GetAlertRules().Get(ruleName, cancellationToken); + } + + /// Gets a collection of ActionGroupResources in the ResourceGroupResource. + /// An object representing collection of ActionGroupResources and their operations over a ActionGroupResource. + public virtual ActionGroupCollection GetActionGroups() + { + return GetCachedClient(client => new ActionGroupCollection(client, Id)); + } + + /// + /// Get an action group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName} + /// + /// + /// Operation Id + /// ActionGroups_Get + /// + /// + /// + /// The name of the action group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetActionGroupAsync(string actionGroupName, CancellationToken cancellationToken = default) + { + return await GetActionGroups().GetAsync(actionGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an action group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName} + /// + /// + /// Operation Id + /// ActionGroups_Get + /// + /// + /// + /// The name of the action group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetActionGroup(string actionGroupName, CancellationToken cancellationToken = default) + { + return GetActionGroups().Get(actionGroupName, cancellationToken); + } + + /// Gets a collection of MetricAlertResources in the ResourceGroupResource. + /// An object representing collection of MetricAlertResources and their operations over a MetricAlertResource. + public virtual MetricAlertCollection GetMetricAlerts() + { + return GetCachedClient(client => new MetricAlertCollection(client, Id)); + } + + /// + /// Retrieve an alert rule definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName} + /// + /// + /// Operation Id + /// MetricAlerts_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMetricAlertAsync(string ruleName, CancellationToken cancellationToken = default) + { + return await GetMetricAlerts().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve an alert rule definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName} + /// + /// + /// Operation Id + /// MetricAlerts_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMetricAlert(string ruleName, CancellationToken cancellationToken = default) + { + return GetMetricAlerts().Get(ruleName, cancellationToken); + } + + /// Gets a collection of ScheduledQueryRuleResources in the ResourceGroupResource. + /// An object representing collection of ScheduledQueryRuleResources and their operations over a ScheduledQueryRuleResource. + public virtual ScheduledQueryRuleCollection GetScheduledQueryRules() + { + return GetCachedClient(client => new ScheduledQueryRuleCollection(client, Id)); + } + + /// + /// Retrieve an scheduled query rule definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} + /// + /// + /// Operation Id + /// ScheduledQueryRules_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScheduledQueryRuleAsync(string ruleName, CancellationToken cancellationToken = default) + { + return await GetScheduledQueryRules().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve an scheduled query rule definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} + /// + /// + /// Operation Id + /// ScheduledQueryRules_Get + /// + /// + /// + /// The name of the rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScheduledQueryRule(string ruleName, CancellationToken cancellationToken = default) + { + return GetScheduledQueryRules().Get(ruleName, cancellationToken); + } + + /// Gets a collection of MonitorPrivateLinkScopeResources in the ResourceGroupResource. + /// An object representing collection of MonitorPrivateLinkScopeResources and their operations over a MonitorPrivateLinkScopeResource. + public virtual MonitorPrivateLinkScopeCollection GetMonitorPrivateLinkScopes() + { + return GetCachedClient(client => new MonitorPrivateLinkScopeCollection(client, Id)); + } + + /// + /// Returns a Azure Monitor PrivateLinkScope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName} + /// + /// + /// Operation Id + /// PrivateLinkScopes_Get + /// + /// + /// + /// The name of the Azure Monitor PrivateLinkScope resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMonitorPrivateLinkScopeAsync(string scopeName, CancellationToken cancellationToken = default) + { + return await GetMonitorPrivateLinkScopes().GetAsync(scopeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Azure Monitor PrivateLinkScope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName} + /// + /// + /// Operation Id + /// PrivateLinkScopes_Get + /// + /// + /// + /// The name of the Azure Monitor PrivateLinkScope resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMonitorPrivateLinkScope(string scopeName, CancellationToken cancellationToken = default) + { + return GetMonitorPrivateLinkScopes().Get(scopeName, cancellationToken); + } + + /// Gets a collection of ActivityLogAlertResources in the ResourceGroupResource. + /// An object representing collection of ActivityLogAlertResources and their operations over a ActivityLogAlertResource. + public virtual ActivityLogAlertCollection GetActivityLogAlerts() + { + return GetCachedClient(client => new ActivityLogAlertCollection(client, Id)); + } + + /// + /// Get an Activity Log Alert rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} + /// + /// + /// Operation Id + /// ActivityLogAlerts_Get + /// + /// + /// + /// The name of the Activity Log Alert rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetActivityLogAlertAsync(string activityLogAlertName, CancellationToken cancellationToken = default) + { + return await GetActivityLogAlerts().GetAsync(activityLogAlertName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an Activity Log Alert rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} + /// + /// + /// Operation Id + /// ActivityLogAlerts_Get + /// + /// + /// + /// The name of the Activity Log Alert rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetActivityLogAlert(string activityLogAlertName, CancellationToken cancellationToken = default) + { + return GetActivityLogAlerts().Get(activityLogAlertName, cancellationToken); + } + + /// Gets a collection of DataCollectionEndpointResources in the ResourceGroupResource. + /// An object representing collection of DataCollectionEndpointResources and their operations over a DataCollectionEndpointResource. + public virtual DataCollectionEndpointCollection GetDataCollectionEndpoints() + { + return GetCachedClient(client => new DataCollectionEndpointCollection(client, Id)); + } + + /// + /// Returns the specified data collection endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName} + /// + /// + /// Operation Id + /// DataCollectionEndpoints_Get + /// + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataCollectionEndpointAsync(string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + return await GetDataCollectionEndpoints().GetAsync(dataCollectionEndpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specified data collection endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName} + /// + /// + /// Operation Id + /// DataCollectionEndpoints_Get + /// + /// + /// + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataCollectionEndpoint(string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + return GetDataCollectionEndpoints().Get(dataCollectionEndpointName, cancellationToken); + } + + /// Gets a collection of DataCollectionRuleResources in the ResourceGroupResource. + /// An object representing collection of DataCollectionRuleResources and their operations over a DataCollectionRuleResource. + public virtual DataCollectionRuleCollection GetDataCollectionRules() + { + return GetCachedClient(client => new DataCollectionRuleCollection(client, Id)); + } + + /// + /// Returns the specified data collection rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName} + /// + /// + /// Operation Id + /// DataCollectionRules_Get + /// + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataCollectionRuleAsync(string dataCollectionRuleName, CancellationToken cancellationToken = default) + { + return await GetDataCollectionRules().GetAsync(dataCollectionRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specified data collection rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName} + /// + /// + /// Operation Id + /// DataCollectionRules_Get + /// + /// + /// + /// The name of the data collection rule. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataCollectionRule(string dataCollectionRuleName, CancellationToken cancellationToken = default) + { + return GetDataCollectionRules().Get(dataCollectionRuleName, cancellationToken); + } + + /// Gets a collection of MonitorWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of MonitorWorkspaceResources and their operations over a MonitorWorkspaceResource. + public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() + { + return GetCachedClient(client => new MonitorWorkspaceResourceCollection(client, Id)); + } + + /// + /// Returns the specific Azure Monitor workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName} + /// + /// + /// Operation Id + /// AzureMonitorWorkspaces_Get + /// + /// + /// + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMonitorWorkspaceResourceAsync(string azureMonitorWorkspaceName, CancellationToken cancellationToken = default) + { + return await GetMonitorWorkspaceResources().GetAsync(azureMonitorWorkspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specific Azure Monitor workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName} + /// + /// + /// Operation Id + /// AzureMonitorWorkspaces_Get + /// + /// + /// + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMonitorWorkspaceResource(string azureMonitorWorkspaceName, CancellationToken cancellationToken = default) + { + return GetMonitorWorkspaceResources().Get(azureMonitorWorkspaceName, cancellationToken); + } + + /// + /// Get the status of an azure asynchronous operation associated with a private link scope operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} + /// + /// + /// Operation Id + /// PrivateLinkScopeOperationStatus_Get + /// + /// + /// + /// The operation Id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetPrivateLinkScopeOperationStatusAsync(string asyncOperationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(asyncOperationId, nameof(asyncOperationId)); + + using var scope = PrivateLinkScopeOperationStatusClientDiagnostics.CreateScope("MonitorResourceGroupMockingExtension.GetPrivateLinkScopeOperationStatus"); + scope.Start(); + try + { + var response = await PrivateLinkScopeOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, asyncOperationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the status of an azure asynchronous operation associated with a private link scope operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} + /// + /// + /// Operation Id + /// PrivateLinkScopeOperationStatus_Get + /// + /// + /// + /// The operation Id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetPrivateLinkScopeOperationStatus(string asyncOperationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(asyncOperationId, nameof(asyncOperationId)); + + using var scope = PrivateLinkScopeOperationStatusClientDiagnostics.CreateScope("MonitorResourceGroupMockingExtension.GetPrivateLinkScopeOperationStatus"); + scope.Start(); + try + { + var response = PrivateLinkScopeOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, asyncOperationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorSubscriptionMockingExtension.cs similarity index 88% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorSubscriptionMockingExtension.cs index bcba8371c2d9..9b2c5f426f70 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorSubscriptionMockingExtension.cs @@ -5,18 +5,21 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Monitor; using Azure.ResourceManager.Monitor.Models; -namespace Azure.ResourceManager.Monitor +namespace Azure.ResourceManager.Monitor.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MonitorSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _autoscaleSettingClientDiagnostics; private AutoscaleSettingsRestOperations _autoscaleSettingRestClient; @@ -43,15 +46,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics; private AzureMonitorWorkspacesRestOperations _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MonitorSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MonitorSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -90,7 +93,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of LogProfileResources and their operations over a LogProfileResource. public virtual LogProfileCollection GetLogProfiles() { - return GetCachedClient(Client => new LogProfileCollection(Client, Id)); + return GetCachedClient(client => new LogProfileCollection(client, Id)); + } + + /// + /// Gets the log profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName} + /// + /// + /// Operation Id + /// LogProfiles_Get + /// + /// + /// + /// The name of the log profile. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLogProfileAsync(string logProfileName, CancellationToken cancellationToken = default) + { + return await GetLogProfiles().GetAsync(logProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the log profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName} + /// + /// + /// Operation Id + /// LogProfiles_Get + /// + /// + /// + /// The name of the log profile. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLogProfile(string logProfileName, CancellationToken cancellationToken = default) + { + return GetLogProfiles().Get(logProfileName, cancellationToken); } /// @@ -112,7 +161,7 @@ public virtual AsyncPageable GetAutoscaleSettingsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => AutoscaleSettingRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutoscaleSettingRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoscaleSettingResource(Client, AutoscaleSettingData.DeserializeAutoscaleSettingData(e)), AutoscaleSettingClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoscaleSettings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoscaleSettingResource(Client, AutoscaleSettingData.DeserializeAutoscaleSettingData(e)), AutoscaleSettingClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetAutoscaleSettings", "value", "nextLink", cancellationToken); } /// @@ -134,7 +183,7 @@ public virtual Pageable GetAutoscaleSettings(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => AutoscaleSettingRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutoscaleSettingRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoscaleSettingResource(Client, AutoscaleSettingData.DeserializeAutoscaleSettingData(e)), AutoscaleSettingClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoscaleSettings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoscaleSettingResource(Client, AutoscaleSettingData.DeserializeAutoscaleSettingData(e)), AutoscaleSettingClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetAutoscaleSettings", "value", "nextLink", cancellationToken); } /// @@ -155,7 +204,7 @@ public virtual Pageable GetAutoscaleSettings(Cancellat public virtual AsyncPageable GetAlertRulesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AlertRuleResource(Client, AlertRuleData.DeserializeAlertRuleData(e)), AlertRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlertRules", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AlertRuleResource(Client, AlertRuleData.DeserializeAlertRuleData(e)), AlertRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetAlertRules", "value", null, cancellationToken); } /// @@ -176,7 +225,7 @@ public virtual AsyncPageable GetAlertRulesAsync(CancellationT public virtual Pageable GetAlertRules(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AlertRuleResource(Client, AlertRuleData.DeserializeAlertRuleData(e)), AlertRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlertRules", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AlertRuleResource(Client, AlertRuleData.DeserializeAlertRuleData(e)), AlertRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetAlertRules", "value", null, cancellationToken); } /// @@ -197,7 +246,7 @@ public virtual Pageable GetAlertRules(CancellationToken cance public virtual AsyncPageable GetActionGroupsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ActionGroupRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ActionGroupResource(Client, ActionGroupData.DeserializeActionGroupData(e)), ActionGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActionGroups", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ActionGroupResource(Client, ActionGroupData.DeserializeActionGroupData(e)), ActionGroupClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActionGroups", "value", null, cancellationToken); } /// @@ -218,7 +267,7 @@ public virtual AsyncPageable GetActionGroupsAsync(Cancellat public virtual Pageable GetActionGroups(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ActionGroupRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ActionGroupResource(Client, ActionGroupData.DeserializeActionGroupData(e)), ActionGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActionGroups", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ActionGroupResource(Client, ActionGroupData.DeserializeActionGroupData(e)), ActionGroupClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActionGroups", "value", null, cancellationToken); } /// @@ -237,12 +286,15 @@ public virtual Pageable GetActionGroups(CancellationToken c /// Reduces the set of data collected.<br>This argument is required and it also requires at least the start date/time.<br>The **$filter** argument is very restricted and allows only the following patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other syntax is allowed. /// Used to fetch events with only the given properties.<br>The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetActivityLogsAsync(string filter, string select = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(filter, nameof(filter)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ActivityLogsRestClient.CreateListRequest(Id.SubscriptionId, filter, select); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ActivityLogsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter, select); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, ActivityLogsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActivityLogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, ActivityLogsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActivityLogs", "value", "nextLink", cancellationToken); } /// @@ -261,12 +313,15 @@ public virtual AsyncPageable GetActivityLogsAsync(string filter, /// Reduces the set of data collected.<br>This argument is required and it also requires at least the start date/time.<br>The **$filter** argument is very restricted and allows only the following patterns.<br>- *List events for a resource group*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.<br>- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.<br>- *List events for a subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.<br>- *List events for a resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.<br>- *List events for a correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.<br><br>**NOTE**: No other syntax is allowed. /// Used to fetch events with only the given properties.<br>The **$select** argument is a comma separated list of property names to be returned. Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetActivityLogs(string filter, string select = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(filter, nameof(filter)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ActivityLogsRestClient.CreateListRequest(Id.SubscriptionId, filter, select); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ActivityLogsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter, select); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, ActivityLogsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActivityLogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, ActivityLogsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActivityLogs", "value", "nextLink", cancellationToken); } /// @@ -284,11 +339,14 @@ public virtual Pageable GetActivityLogs(string filter, string sel /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetMonitorMetricsAsync(SubscriptionResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListAtSubscriptionScopeRequest(Id.SubscriptionId, options.Region, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorMetrics", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorMetrics", "value", null, cancellationToken); } /// @@ -306,11 +364,14 @@ public virtual AsyncPageable GetMonitorMetricsAsync(S /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetMonitorMetrics(SubscriptionResourceGetMonitorMetricsOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListAtSubscriptionScopeRequest(Id.SubscriptionId, options.Region, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorMetrics", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorMetrics", "value", null, cancellationToken); } /// @@ -328,11 +389,14 @@ public virtual Pageable GetMonitorMetrics(Subscriptio /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetMonitorMetricsWithPostAsync(SubscriptionResourceGetMonitorMetricsWithPostOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListAtSubscriptionScopePostRequest(Id.SubscriptionId, options.Region, options.Content, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorMetricsWithPost", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorMetricsWithPost", "value", null, cancellationToken); } /// @@ -350,11 +414,14 @@ public virtual AsyncPageable GetMonitorMetricsWithPos /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetMonitorMetricsWithPost(SubscriptionResourceGetMonitorMetricsWithPostOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => MetricsRestClient.CreateListAtSubscriptionScopePostRequest(Id.SubscriptionId, options.Region, options.Content, options.Timespan, options.Interval, options.Metricnames, options.Aggregation, options.Top, options.Orderby, options.Filter, options.ResultType, options.Metricnamespace, options.AutoAdjustTimegrain, options.ValidateDimensions); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorMetricsWithPost", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SubscriptionMonitorMetric.DeserializeSubscriptionMonitorMetric, MetricsClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorMetricsWithPost", "value", null, cancellationToken); } /// @@ -375,7 +442,7 @@ public virtual Pageable GetMonitorMetricsWithPost(Sub public virtual AsyncPageable GetMetricAlertsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MetricAlertRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MetricAlertResource(Client, MetricAlertData.DeserializeMetricAlertData(e)), MetricAlertClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMetricAlerts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MetricAlertResource(Client, MetricAlertData.DeserializeMetricAlertData(e)), MetricAlertClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMetricAlerts", "value", null, cancellationToken); } /// @@ -396,7 +463,7 @@ public virtual AsyncPageable GetMetricAlertsAsync(Cancellat public virtual Pageable GetMetricAlerts(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MetricAlertRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MetricAlertResource(Client, MetricAlertData.DeserializeMetricAlertData(e)), MetricAlertClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMetricAlerts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MetricAlertResource(Client, MetricAlertData.DeserializeMetricAlertData(e)), MetricAlertClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMetricAlerts", "value", null, cancellationToken); } /// @@ -418,7 +485,7 @@ public virtual AsyncPageable GetScheduledQueryRulesA { HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledQueryRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledQueryRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScheduledQueryRuleResource(Client, ScheduledQueryRuleData.DeserializeScheduledQueryRuleData(e)), ScheduledQueryRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScheduledQueryRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScheduledQueryRuleResource(Client, ScheduledQueryRuleData.DeserializeScheduledQueryRuleData(e)), ScheduledQueryRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetScheduledQueryRules", "value", "nextLink", cancellationToken); } /// @@ -440,7 +507,7 @@ public virtual Pageable GetScheduledQueryRules(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ScheduledQueryRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScheduledQueryRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScheduledQueryRuleResource(Client, ScheduledQueryRuleData.DeserializeScheduledQueryRuleData(e)), ScheduledQueryRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScheduledQueryRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScheduledQueryRuleResource(Client, ScheduledQueryRuleData.DeserializeScheduledQueryRuleData(e)), ScheduledQueryRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetScheduledQueryRules", "value", "nextLink", cancellationToken); } /// @@ -462,7 +529,7 @@ public virtual AsyncPageable GetMonitorPrivateL { HttpMessage FirstPageRequest(int? pageSizeHint) => MonitorPrivateLinkScopePrivateLinkScopesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorPrivateLinkScopePrivateLinkScopesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitorPrivateLinkScopeResource(Client, MonitorPrivateLinkScopeData.DeserializeMonitorPrivateLinkScopeData(e)), MonitorPrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorPrivateLinkScopes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitorPrivateLinkScopeResource(Client, MonitorPrivateLinkScopeData.DeserializeMonitorPrivateLinkScopeData(e)), MonitorPrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorPrivateLinkScopes", "value", "nextLink", cancellationToken); } /// @@ -484,7 +551,7 @@ public virtual Pageable GetMonitorPrivateLinkSc { HttpMessage FirstPageRequest(int? pageSizeHint) => MonitorPrivateLinkScopePrivateLinkScopesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorPrivateLinkScopePrivateLinkScopesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorPrivateLinkScopeResource(Client, MonitorPrivateLinkScopeData.DeserializeMonitorPrivateLinkScopeData(e)), MonitorPrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorPrivateLinkScopes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorPrivateLinkScopeResource(Client, MonitorPrivateLinkScopeData.DeserializeMonitorPrivateLinkScopeData(e)), MonitorPrivateLinkScopePrivateLinkScopesClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorPrivateLinkScopes", "value", "nextLink", cancellationToken); } /// @@ -506,7 +573,7 @@ public virtual AsyncPageable GetActivityLogAlertsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => ActivityLogAlertRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ActivityLogAlertRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ActivityLogAlertResource(Client, ActivityLogAlertData.DeserializeActivityLogAlertData(e)), ActivityLogAlertClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActivityLogAlerts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ActivityLogAlertResource(Client, ActivityLogAlertData.DeserializeActivityLogAlertData(e)), ActivityLogAlertClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActivityLogAlerts", "value", "nextLink", cancellationToken); } /// @@ -528,7 +595,7 @@ public virtual Pageable GetActivityLogAlerts(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ActivityLogAlertRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ActivityLogAlertRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ActivityLogAlertResource(Client, ActivityLogAlertData.DeserializeActivityLogAlertData(e)), ActivityLogAlertClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetActivityLogAlerts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ActivityLogAlertResource(Client, ActivityLogAlertData.DeserializeActivityLogAlertData(e)), ActivityLogAlertClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetActivityLogAlerts", "value", "nextLink", cancellationToken); } /// @@ -550,7 +617,7 @@ public virtual AsyncPageable GetDataCollectionEn { HttpMessage FirstPageRequest(int? pageSizeHint) => DataCollectionEndpointRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataCollectionEndpointRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataCollectionEndpointResource(Client, DataCollectionEndpointData.DeserializeDataCollectionEndpointData(e)), DataCollectionEndpointClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataCollectionEndpoints", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataCollectionEndpointResource(Client, DataCollectionEndpointData.DeserializeDataCollectionEndpointData(e)), DataCollectionEndpointClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetDataCollectionEndpoints", "value", "nextLink", cancellationToken); } /// @@ -572,7 +639,7 @@ public virtual Pageable GetDataCollectionEndpoin { HttpMessage FirstPageRequest(int? pageSizeHint) => DataCollectionEndpointRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataCollectionEndpointRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataCollectionEndpointResource(Client, DataCollectionEndpointData.DeserializeDataCollectionEndpointData(e)), DataCollectionEndpointClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataCollectionEndpoints", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataCollectionEndpointResource(Client, DataCollectionEndpointData.DeserializeDataCollectionEndpointData(e)), DataCollectionEndpointClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetDataCollectionEndpoints", "value", "nextLink", cancellationToken); } /// @@ -594,7 +661,7 @@ public virtual AsyncPageable GetDataCollectionRulesA { HttpMessage FirstPageRequest(int? pageSizeHint) => DataCollectionRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataCollectionRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataCollectionRuleResource(Client, DataCollectionRuleData.DeserializeDataCollectionRuleData(e)), DataCollectionRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataCollectionRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataCollectionRuleResource(Client, DataCollectionRuleData.DeserializeDataCollectionRuleData(e)), DataCollectionRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetDataCollectionRules", "value", "nextLink", cancellationToken); } /// @@ -616,7 +683,7 @@ public virtual Pageable GetDataCollectionRules(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DataCollectionRuleRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataCollectionRuleRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataCollectionRuleResource(Client, DataCollectionRuleData.DeserializeDataCollectionRuleData(e)), DataCollectionRuleClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataCollectionRules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataCollectionRuleResource(Client, DataCollectionRuleData.DeserializeDataCollectionRuleData(e)), DataCollectionRuleClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetDataCollectionRules", "value", "nextLink", cancellationToken); } /// @@ -638,7 +705,7 @@ public virtual AsyncPageable GetMonitorWorkspaceResour { HttpMessage FirstPageRequest(int? pageSizeHint) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); } /// @@ -660,7 +727,7 @@ public virtual Pageable GetMonitorWorkspaceResources(C { HttpMessage FirstPageRequest(int? pageSizeHint) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "MonitorSubscriptionMockingExtension.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorTenantMockingExtension.cs similarity index 93% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorTenantMockingExtension.cs index 665aa0e90a91..7ff06d60fc42 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorTenantMockingExtension.cs @@ -11,27 +11,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Monitor; using Azure.ResourceManager.Monitor.Models; -namespace Azure.ResourceManager.Monitor +namespace Azure.ResourceManager.Monitor.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class MonitorTenantMockingExtension : ArmResource { private ClientDiagnostics _eventCategoriesClientDiagnostics; private EventCategoriesRestOperations _eventCategoriesRestClient; private ClientDiagnostics _tenantActivityLogsClientDiagnostics; private TenantActivityLogsRestOperations _tenantActivityLogsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MonitorTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MonitorTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetEventCategoriesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EventCategoriesRestClient.CreateListRequest(); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorLocalizableString.DeserializeMonitorLocalizableString, EventCategoriesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetEventCategories", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MonitorLocalizableString.DeserializeMonitorLocalizableString, EventCategoriesClientDiagnostics, Pipeline, "MonitorTenantMockingExtension.GetEventCategories", "value", null, cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual AsyncPageable GetEventCategoriesAsync(C public virtual Pageable GetEventCategories(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EventCategoriesRestClient.CreateListRequest(); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorLocalizableString.DeserializeMonitorLocalizableString, EventCategoriesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetEventCategories", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MonitorLocalizableString.DeserializeMonitorLocalizableString, EventCategoriesClientDiagnostics, Pipeline, "MonitorTenantMockingExtension.GetEventCategories", "value", null, cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual AsyncPageable GetTenantActivityLogsAsync(string fi { HttpMessage FirstPageRequest(int? pageSizeHint) => TenantActivityLogsRestClient.CreateListRequest(filter, select); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TenantActivityLogsRestClient.CreateListNextPageRequest(nextLink, filter, select); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, TenantActivityLogsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetTenantActivityLogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, TenantActivityLogsClientDiagnostics, Pipeline, "MonitorTenantMockingExtension.GetTenantActivityLogs", "value", "nextLink", cancellationToken); } /// @@ -133,7 +134,7 @@ public virtual Pageable GetTenantActivityLogs(string filter = nul { HttpMessage FirstPageRequest(int? pageSizeHint) => TenantActivityLogsRestClient.CreateListRequest(filter, select); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TenantActivityLogsRestClient.CreateListNextPageRequest(nextLink, filter, select); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, TenantActivityLogsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetTenantActivityLogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EventDataInfo.DeserializeEventDataInfo, TenantActivityLogsClientDiagnostics, Pipeline, "MonitorTenantMockingExtension.GetTenantActivityLogs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3f878efff98f..000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,178 +0,0 @@ -// 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; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Monitor.Models; - -namespace Azure.ResourceManager.Monitor -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _privateLinkScopeOperationStatusClientDiagnostics; - private PrivateLinkScopeOperationStatusRestOperations _privateLinkScopeOperationStatusRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics PrivateLinkScopeOperationStatusClientDiagnostics => _privateLinkScopeOperationStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PrivateLinkScopeOperationStatusRestOperations PrivateLinkScopeOperationStatusRestClient => _privateLinkScopeOperationStatusRestClient ??= new PrivateLinkScopeOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. - /// An object representing collection of AutoscaleSettingResources and their operations over a AutoscaleSettingResource. - public virtual AutoscaleSettingCollection GetAutoscaleSettings() - { - return GetCachedClient(Client => new AutoscaleSettingCollection(Client, Id)); - } - - /// Gets a collection of AlertRuleResources in the ResourceGroupResource. - /// An object representing collection of AlertRuleResources and their operations over a AlertRuleResource. - public virtual AlertRuleCollection GetAlertRules() - { - return GetCachedClient(Client => new AlertRuleCollection(Client, Id)); - } - - /// Gets a collection of ActionGroupResources in the ResourceGroupResource. - /// An object representing collection of ActionGroupResources and their operations over a ActionGroupResource. - public virtual ActionGroupCollection GetActionGroups() - { - return GetCachedClient(Client => new ActionGroupCollection(Client, Id)); - } - - /// Gets a collection of MetricAlertResources in the ResourceGroupResource. - /// An object representing collection of MetricAlertResources and their operations over a MetricAlertResource. - public virtual MetricAlertCollection GetMetricAlerts() - { - return GetCachedClient(Client => new MetricAlertCollection(Client, Id)); - } - - /// Gets a collection of ScheduledQueryRuleResources in the ResourceGroupResource. - /// An object representing collection of ScheduledQueryRuleResources and their operations over a ScheduledQueryRuleResource. - public virtual ScheduledQueryRuleCollection GetScheduledQueryRules() - { - return GetCachedClient(Client => new ScheduledQueryRuleCollection(Client, Id)); - } - - /// Gets a collection of MonitorPrivateLinkScopeResources in the ResourceGroupResource. - /// An object representing collection of MonitorPrivateLinkScopeResources and their operations over a MonitorPrivateLinkScopeResource. - public virtual MonitorPrivateLinkScopeCollection GetMonitorPrivateLinkScopes() - { - return GetCachedClient(Client => new MonitorPrivateLinkScopeCollection(Client, Id)); - } - - /// Gets a collection of ActivityLogAlertResources in the ResourceGroupResource. - /// An object representing collection of ActivityLogAlertResources and their operations over a ActivityLogAlertResource. - public virtual ActivityLogAlertCollection GetActivityLogAlerts() - { - return GetCachedClient(Client => new ActivityLogAlertCollection(Client, Id)); - } - - /// Gets a collection of DataCollectionEndpointResources in the ResourceGroupResource. - /// An object representing collection of DataCollectionEndpointResources and their operations over a DataCollectionEndpointResource. - public virtual DataCollectionEndpointCollection GetDataCollectionEndpoints() - { - return GetCachedClient(Client => new DataCollectionEndpointCollection(Client, Id)); - } - - /// Gets a collection of DataCollectionRuleResources in the ResourceGroupResource. - /// An object representing collection of DataCollectionRuleResources and their operations over a DataCollectionRuleResource. - public virtual DataCollectionRuleCollection GetDataCollectionRules() - { - return GetCachedClient(Client => new DataCollectionRuleCollection(Client, Id)); - } - - /// Gets a collection of MonitorWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of MonitorWorkspaceResources and their operations over a MonitorWorkspaceResource. - public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() - { - return GetCachedClient(Client => new MonitorWorkspaceResourceCollection(Client, Id)); - } - - /// - /// Get the status of an azure asynchronous operation associated with a private link scope operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} - /// - /// - /// Operation Id - /// PrivateLinkScopeOperationStatus_Get - /// - /// - /// - /// The operation Id. - /// The cancellation token to use. - public virtual async Task> GetPrivateLinkScopeOperationStatusAsync(string asyncOperationId, CancellationToken cancellationToken = default) - { - using var scope = PrivateLinkScopeOperationStatusClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetPrivateLinkScopeOperationStatus"); - scope.Start(); - try - { - var response = await PrivateLinkScopeOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, asyncOperationId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get the status of an azure asynchronous operation associated with a private link scope operation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} - /// - /// - /// Operation Id - /// PrivateLinkScopeOperationStatus_Get - /// - /// - /// - /// The operation Id. - /// The cancellation token to use. - public virtual Response GetPrivateLinkScopeOperationStatus(string asyncOperationId, CancellationToken cancellationToken = default) - { - using var scope = PrivateLinkScopeOperationStatusClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetPrivateLinkScopeOperationStatus"); - scope.Start(); - try - { - var response = PrivateLinkScopeOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, asyncOperationId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorPrivateLinkScopeResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorPrivateLinkScopeResource.cs index f845c79fc08b..31f6bf8f80fe 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorPrivateLinkScopeResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorPrivateLinkScopeResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MonitorPrivateLinkResources and their operations over a MonitorPrivateLinkResource. public virtual MonitorPrivateLinkResourceCollection GetMonitorPrivateLinkResources() { - return GetCachedClient(Client => new MonitorPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new MonitorPrivateLinkResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual MonitorPrivateLinkResourceCollection GetMonitorPrivateLinkResourc /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetMonitorPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetMonitorPrivat /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetMonitorPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetMonitorPrivateLinkResourc /// An object representing collection of MonitorPrivateEndpointConnectionResources and their operations over a MonitorPrivateEndpointConnectionResource. public virtual MonitorPrivateEndpointConnectionCollection GetMonitorPrivateEndpointConnections() { - return GetCachedClient(Client => new MonitorPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new MonitorPrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MonitorPrivateEndpointConnectionCollection GetMonitorPrivateEndpo /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetMonitorPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> Ge /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetMonitorPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMonitorPriv /// An object representing collection of MonitorPrivateLinkScopedResources and their operations over a MonitorPrivateLinkScopedResource. public virtual MonitorPrivateLinkScopedResourceCollection GetMonitorPrivateLinkScopedResources() { - return GetCachedClient(Client => new MonitorPrivateLinkScopedResourceCollection(Client, Id)); + return GetCachedClient(client => new MonitorPrivateLinkScopedResourceCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual MonitorPrivateLinkScopedResourceCollection GetMonitorPrivateLinkS /// /// The name of the scoped resource object. /// The cancellation token to use. - /// 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> GetMonitorPrivateLinkScopedResourceAsync(string name, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetMonitor /// /// The name of the scoped resource object. /// The cancellation token to use. - /// 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 GetMonitorPrivateLinkScopedResource(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlArmClientMockingExtension.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlArmClientMockingExtension.cs new file mode 100644 index 000000000000..2fddfd9e8add --- /dev/null +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlArmClientMockingExtension.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MySql; + +namespace Azure.ResourceManager.MySql.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MySqlArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MySqlArmClientMockingExtension() + { + } + + /// 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 MySqlArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MySqlArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MySqlServerResource GetMySqlServerResource(ResourceIdentifier id) + { + MySqlServerResource.ValidateResourceId(id); + return new MySqlServerResource(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 MySqlFirewallRuleResource GetMySqlFirewallRuleResource(ResourceIdentifier id) + { + MySqlFirewallRuleResource.ValidateResourceId(id); + return new MySqlFirewallRuleResource(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 MySqlVirtualNetworkRuleResource GetMySqlVirtualNetworkRuleResource(ResourceIdentifier id) + { + MySqlVirtualNetworkRuleResource.ValidateResourceId(id); + return new MySqlVirtualNetworkRuleResource(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 MySqlDatabaseResource GetMySqlDatabaseResource(ResourceIdentifier id) + { + MySqlDatabaseResource.ValidateResourceId(id); + return new MySqlDatabaseResource(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 MySqlConfigurationResource GetMySqlConfigurationResource(ResourceIdentifier id) + { + MySqlConfigurationResource.ValidateResourceId(id); + return new MySqlConfigurationResource(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 MySqlServerAdministratorResource GetMySqlServerAdministratorResource(ResourceIdentifier id) + { + MySqlServerAdministratorResource.ValidateResourceId(id); + return new MySqlServerAdministratorResource(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 MySqlServerSecurityAlertPolicyResource GetMySqlServerSecurityAlertPolicyResource(ResourceIdentifier id) + { + MySqlServerSecurityAlertPolicyResource.ValidateResourceId(id); + return new MySqlServerSecurityAlertPolicyResource(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 MySqlQueryTextResource GetMySqlQueryTextResource(ResourceIdentifier id) + { + MySqlQueryTextResource.ValidateResourceId(id); + return new MySqlQueryTextResource(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 MySqlQueryStatisticResource GetMySqlQueryStatisticResource(ResourceIdentifier id) + { + MySqlQueryStatisticResource.ValidateResourceId(id); + return new MySqlQueryStatisticResource(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 MySqlWaitStatisticResource GetMySqlWaitStatisticResource(ResourceIdentifier id) + { + MySqlWaitStatisticResource.ValidateResourceId(id); + return new MySqlWaitStatisticResource(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 MySqlAdvisorResource GetMySqlAdvisorResource(ResourceIdentifier id) + { + MySqlAdvisorResource.ValidateResourceId(id); + return new MySqlAdvisorResource(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 MySqlRecommendationActionResource GetMySqlRecommendationActionResource(ResourceIdentifier id) + { + MySqlRecommendationActionResource.ValidateResourceId(id); + return new MySqlRecommendationActionResource(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 MySqlPrivateEndpointConnectionResource GetMySqlPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MySqlPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MySqlPrivateEndpointConnectionResource(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 MySqlPrivateLinkResource GetMySqlPrivateLinkResource(ResourceIdentifier id) + { + MySqlPrivateLinkResource.ValidateResourceId(id); + return new MySqlPrivateLinkResource(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 MySqlServerKeyResource GetMySqlServerKeyResource(ResourceIdentifier id) + { + MySqlServerKeyResource.ValidateResourceId(id); + return new MySqlServerKeyResource(Client, id); + } + } +} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlExtensions.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlExtensions.cs index 965ad5854da7..460821c92e35 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlExtensions.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MySql.Mocking; using Azure.ResourceManager.MySql.Models; using Azure.ResourceManager.Resources; @@ -19,328 +20,273 @@ namespace Azure.ResourceManager.MySql /// A class to add extension methods to Azure.ResourceManager.MySql. public static partial class MySqlExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MySqlArmClientMockingExtension GetMySqlArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MySqlArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MySqlResourceGroupMockingExtension GetMySqlResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MySqlResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MySqlSubscriptionMockingExtension GetMySqlSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MySqlSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region MySqlServerResource /// /// 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. /// Returns a object. public static MySqlServerResource GetMySqlServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlServerResource.ValidateResourceId(id); - return new MySqlServerResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlServerResource(id); } - #endregion - #region MySqlFirewallRuleResource /// /// 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. /// Returns a object. public static MySqlFirewallRuleResource GetMySqlFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFirewallRuleResource.ValidateResourceId(id); - return new MySqlFirewallRuleResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlFirewallRuleResource(id); } - #endregion - #region MySqlVirtualNetworkRuleResource /// /// 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. /// Returns a object. public static MySqlVirtualNetworkRuleResource GetMySqlVirtualNetworkRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlVirtualNetworkRuleResource.ValidateResourceId(id); - return new MySqlVirtualNetworkRuleResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlVirtualNetworkRuleResource(id); } - #endregion - #region MySqlDatabaseResource /// /// 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. /// Returns a object. public static MySqlDatabaseResource GetMySqlDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlDatabaseResource.ValidateResourceId(id); - return new MySqlDatabaseResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlDatabaseResource(id); } - #endregion - #region MySqlConfigurationResource /// /// 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. /// Returns a object. public static MySqlConfigurationResource GetMySqlConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlConfigurationResource.ValidateResourceId(id); - return new MySqlConfigurationResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlConfigurationResource(id); } - #endregion - #region MySqlServerAdministratorResource /// /// 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. /// Returns a object. public static MySqlServerAdministratorResource GetMySqlServerAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlServerAdministratorResource.ValidateResourceId(id); - return new MySqlServerAdministratorResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlServerAdministratorResource(id); } - #endregion - #region MySqlServerSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static MySqlServerSecurityAlertPolicyResource GetMySqlServerSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlServerSecurityAlertPolicyResource.ValidateResourceId(id); - return new MySqlServerSecurityAlertPolicyResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlServerSecurityAlertPolicyResource(id); } - #endregion - #region MySqlQueryTextResource /// /// 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. /// Returns a object. public static MySqlQueryTextResource GetMySqlQueryTextResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlQueryTextResource.ValidateResourceId(id); - return new MySqlQueryTextResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlQueryTextResource(id); } - #endregion - #region MySqlQueryStatisticResource /// /// 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. /// Returns a object. public static MySqlQueryStatisticResource GetMySqlQueryStatisticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlQueryStatisticResource.ValidateResourceId(id); - return new MySqlQueryStatisticResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlQueryStatisticResource(id); } - #endregion - #region MySqlWaitStatisticResource /// /// 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. /// Returns a object. public static MySqlWaitStatisticResource GetMySqlWaitStatisticResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlWaitStatisticResource.ValidateResourceId(id); - return new MySqlWaitStatisticResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlWaitStatisticResource(id); } - #endregion - #region MySqlAdvisorResource /// /// 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. /// Returns a object. public static MySqlAdvisorResource GetMySqlAdvisorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlAdvisorResource.ValidateResourceId(id); - return new MySqlAdvisorResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlAdvisorResource(id); } - #endregion - #region MySqlRecommendationActionResource /// /// 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. /// Returns a object. public static MySqlRecommendationActionResource GetMySqlRecommendationActionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlRecommendationActionResource.ValidateResourceId(id); - return new MySqlRecommendationActionResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlRecommendationActionResource(id); } - #endregion - #region MySqlPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static MySqlPrivateEndpointConnectionResource GetMySqlPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlPrivateEndpointConnectionResource.ValidateResourceId(id); - return new MySqlPrivateEndpointConnectionResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlPrivateEndpointConnectionResource(id); } - #endregion - #region MySqlPrivateLinkResource /// /// 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. /// Returns a object. public static MySqlPrivateLinkResource GetMySqlPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlPrivateLinkResource.ValidateResourceId(id); - return new MySqlPrivateLinkResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlPrivateLinkResource(id); } - #endregion - #region MySqlServerKeyResource /// /// 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. /// Returns a object. public static MySqlServerKeyResource GetMySqlServerKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlServerKeyResource.ValidateResourceId(id); - return new MySqlServerKeyResource(client, id); - } - ); + return GetMySqlArmClientMockingExtension(client).GetMySqlServerKeyResource(id); } - #endregion - /// Gets a collection of MySqlServerResources in the ResourceGroupResource. + /// + /// Gets a collection of MySqlServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MySqlServerResources and their operations over a MySqlServerResource. public static MySqlServerCollection GetMySqlServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMySqlServers(); + return GetMySqlResourceGroupMockingExtension(resourceGroupResource).GetMySqlServers(); } /// @@ -355,16 +301,20 @@ public static MySqlServerCollection GetMySqlServers(this ResourceGroupResource r /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static async Task> GetMySqlServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMySqlServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + return await GetMySqlResourceGroupMockingExtension(resourceGroupResource).GetMySqlServerAsync(serverName, cancellationToken).ConfigureAwait(false); } /// @@ -379,16 +329,20 @@ public static async Task> GetMySqlServerAsync(this /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static Response GetMySqlServer(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMySqlServers().Get(serverName, cancellationToken); + return GetMySqlResourceGroupMockingExtension(resourceGroupResource).GetMySqlServer(serverName, cancellationToken); } /// @@ -403,13 +357,17 @@ public static Response GetMySqlServer(this ResourceGroupRes /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMySqlServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMySqlServersAsync(cancellationToken); + return GetMySqlSubscriptionMockingExtension(subscriptionResource).GetMySqlServersAsync(cancellationToken); } /// @@ -424,13 +382,17 @@ public static AsyncPageable GetMySqlServersAsync(this Subsc /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMySqlServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMySqlServers(cancellationToken); + return GetMySqlSubscriptionMockingExtension(subscriptionResource).GetMySqlServers(cancellationToken); } /// @@ -445,6 +407,10 @@ public static Pageable GetMySqlServers(this SubscriptionRes /// LocationBasedPerformanceTier_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -452,7 +418,7 @@ public static Pageable GetMySqlServers(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLocationBasedPerformanceTiersAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedPerformanceTiersAsync(locationName, cancellationToken); + return GetMySqlSubscriptionMockingExtension(subscriptionResource).GetLocationBasedPerformanceTiersAsync(locationName, cancellationToken); } /// @@ -467,6 +433,10 @@ public static AsyncPageable GetLocationBasedPerformanceTie /// LocationBasedPerformanceTier_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -474,7 +444,7 @@ public static AsyncPageable GetLocationBasedPerformanceTie /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLocationBasedPerformanceTiers(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedPerformanceTiers(locationName, cancellationToken); + return GetMySqlSubscriptionMockingExtension(subscriptionResource).GetLocationBasedPerformanceTiers(locationName, cancellationToken); } /// @@ -489,6 +459,10 @@ public static Pageable GetLocationBasedPerformanceTiers(th /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -496,9 +470,7 @@ public static Pageable GetLocationBasedPerformanceTiers(th /// is null. public static async Task> CheckMySqlNameAvailabilityAsync(this SubscriptionResource subscriptionResource, MySqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetMySqlSubscriptionMockingExtension(subscriptionResource).CheckMySqlNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -513,6 +485,10 @@ public static async Task> CheckMySqlNameAv /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -520,9 +496,7 @@ public static async Task> CheckMySqlNameAv /// is null. public static Response CheckMySqlNameAvailability(this SubscriptionResource subscriptionResource, MySqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlNameAvailability(content, cancellationToken); + return GetMySqlSubscriptionMockingExtension(subscriptionResource).CheckMySqlNameAvailability(content, cancellationToken); } } } diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlResourceGroupMockingExtension.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c1a039632045 --- /dev/null +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MySql; + +namespace Azure.ResourceManager.MySql.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MySqlResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MySqlResourceGroupMockingExtension() + { + } + + /// 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 MySqlResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MySqlServerResources in the ResourceGroupResource. + /// An object representing collection of MySqlServerResources and their operations over a MySqlServerResource. + public virtual MySqlServerCollection GetMySqlServers() + { + return GetCachedClient(client => new MySqlServerCollection(client, Id)); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMySqlServerAsync(string serverName, CancellationToken cancellationToken = default) + { + return await GetMySqlServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMySqlServer(string serverName, CancellationToken cancellationToken = default) + { + return GetMySqlServers().Get(serverName, cancellationToken); + } + } +} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlSubscriptionMockingExtension.cs similarity index 88% rename from sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlSubscriptionMockingExtension.cs index 60cfe673105a..215f8642f903 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/MySqlSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MySql; using Azure.ResourceManager.MySql.Models; -namespace Azure.ResourceManager.MySql +namespace Azure.ResourceManager.MySql.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MySqlSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mySqlServerServersClientDiagnostics; private ServersRestOperations _mySqlServerServersRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _checkNameAvailabilityClientDiagnostics; private CheckNameAvailabilityRestOperations _checkNameAvailabilityRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MySqlSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MySqlSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,7 +71,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetMySqlServersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MySqlServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MySqlServerResource(Client, MySqlServerData.DeserializeMySqlServerData(e)), MySqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMySqlServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MySqlServerResource(Client, MySqlServerData.DeserializeMySqlServerData(e)), MySqlServerServersClientDiagnostics, Pipeline, "MySqlSubscriptionMockingExtension.GetMySqlServers", "value", null, cancellationToken); } /// @@ -91,7 +92,7 @@ public virtual AsyncPageable GetMySqlServersAsync(Cancellat public virtual Pageable GetMySqlServers(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MySqlServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MySqlServerResource(Client, MySqlServerData.DeserializeMySqlServerData(e)), MySqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMySqlServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MySqlServerResource(Client, MySqlServerData.DeserializeMySqlServerData(e)), MySqlServerServersClientDiagnostics, Pipeline, "MySqlSubscriptionMockingExtension.GetMySqlServers", "value", null, cancellationToken); } /// @@ -113,7 +114,7 @@ public virtual Pageable GetMySqlServers(CancellationToken c public virtual AsyncPageable GetLocationBasedPerformanceTiersAsync(AzureLocation locationName, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedPerformanceTierRestClient.CreateListRequest(Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MySqlPerformanceTier.DeserializeMySqlPerformanceTier, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MySqlPerformanceTier.DeserializeMySqlPerformanceTier, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "MySqlSubscriptionMockingExtension.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); } /// @@ -135,7 +136,7 @@ public virtual AsyncPageable GetLocationBasedPerformanceTi public virtual Pageable GetLocationBasedPerformanceTiers(AzureLocation locationName, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedPerformanceTierRestClient.CreateListRequest(Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MySqlPerformanceTier.DeserializeMySqlPerformanceTier, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MySqlPerformanceTier.DeserializeMySqlPerformanceTier, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "MySqlSubscriptionMockingExtension.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); } /// @@ -153,9 +154,12 @@ public virtual Pageable GetLocationBasedPerformanceTiers(A /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckMySqlNameAvailabilityAsync(MySqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MySqlSubscriptionMockingExtension.CheckMySqlNameAvailability"); scope.Start(); try { @@ -184,9 +188,12 @@ public virtual async Task> CheckMySqlNameA /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckMySqlNameAvailability(MySqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MySqlSubscriptionMockingExtension.CheckMySqlNameAvailability"); scope.Start(); try { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 9a81738317f0..000000000000 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MySql -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MySqlServerResources in the ResourceGroupResource. - /// An object representing collection of MySqlServerResources and their operations over a MySqlServerResource. - public virtual MySqlServerCollection GetMySqlServers() - { - return GetCachedClient(Client => new MySqlServerCollection(Client, Id)); - } - } -} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlAdvisorResource.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlAdvisorResource.cs index baa2ac6fe502..a47bbb69cd7a 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlAdvisorResource.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlAdvisorResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MySqlRecommendationActionResources and their operations over a MySqlRecommendationActionResource. public virtual MySqlRecommendationActionCollection GetMySqlRecommendationActions() { - return GetCachedClient(Client => new MySqlRecommendationActionCollection(Client, Id)); + return GetCachedClient(client => new MySqlRecommendationActionCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual MySqlRecommendationActionCollection GetMySqlRecommendationActions /// /// The recommended action name. /// The cancellation token to use. - /// 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> GetMySqlRecommendationActionAsync(string recommendedActionName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetMySqlR /// /// The recommended action name. /// The cancellation token to use. - /// 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 GetMySqlRecommendationAction(string recommendedActionName, CancellationToken cancellationToken = default) { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlServerResource.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlServerResource.cs index 1797d88ba720..c4d33ba76ad3 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlServerResource.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySql/Generated/MySqlServerResource.cs @@ -118,7 +118,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MySqlFirewallRuleResources and their operations over a MySqlFirewallRuleResource. public virtual MySqlFirewallRuleCollection GetMySqlFirewallRules() { - return GetCachedClient(Client => new MySqlFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new MySqlFirewallRuleCollection(client, Id)); } /// @@ -136,8 +136,8 @@ public virtual MySqlFirewallRuleCollection GetMySqlFirewallRules() /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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> GetMySqlFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -159,8 +159,8 @@ public virtual async Task> GetMySqlFirewallR /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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 GetMySqlFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -171,7 +171,7 @@ public virtual Response GetMySqlFirewallRule(string f /// An object representing collection of MySqlVirtualNetworkRuleResources and their operations over a MySqlVirtualNetworkRuleResource. public virtual MySqlVirtualNetworkRuleCollection GetMySqlVirtualNetworkRules() { - return GetCachedClient(Client => new MySqlVirtualNetworkRuleCollection(Client, Id)); + return GetCachedClient(client => new MySqlVirtualNetworkRuleCollection(client, Id)); } /// @@ -189,8 +189,8 @@ public virtual MySqlVirtualNetworkRuleCollection GetMySqlVirtualNetworkRules() /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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> GetMySqlVirtualNetworkRuleAsync(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -212,8 +212,8 @@ public virtual async Task> GetMySqlVir /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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 GetMySqlVirtualNetworkRule(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -224,7 +224,7 @@ public virtual Response GetMySqlVirtualNetworkR /// An object representing collection of MySqlDatabaseResources and their operations over a MySqlDatabaseResource. public virtual MySqlDatabaseCollection GetMySqlDatabases() { - return GetCachedClient(Client => new MySqlDatabaseCollection(Client, Id)); + return GetCachedClient(client => new MySqlDatabaseCollection(client, Id)); } /// @@ -242,8 +242,8 @@ public virtual MySqlDatabaseCollection GetMySqlDatabases() /// /// The name of the database. /// The cancellation token to use. - /// 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> GetMySqlDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -265,8 +265,8 @@ public virtual async Task> GetMySqlDatabaseAsync /// /// The name of the database. /// The cancellation token to use. - /// 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 GetMySqlDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -277,7 +277,7 @@ public virtual Response GetMySqlDatabase(string databaseN /// An object representing collection of MySqlConfigurationResources and their operations over a MySqlConfigurationResource. public virtual MySqlConfigurationCollection GetMySqlConfigurations() { - return GetCachedClient(Client => new MySqlConfigurationCollection(Client, Id)); + return GetCachedClient(client => new MySqlConfigurationCollection(client, Id)); } /// @@ -295,8 +295,8 @@ public virtual MySqlConfigurationCollection GetMySqlConfigurations() /// /// The name of the server configuration. /// The cancellation token to use. - /// 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> GetMySqlConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -318,8 +318,8 @@ public virtual async Task> GetMySqlConfigur /// /// The name of the server configuration. /// The cancellation token to use. - /// 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 GetMySqlConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -337,7 +337,7 @@ public virtual MySqlServerAdministratorResource GetMySqlServerAdministrator() /// An object representing collection of MySqlServerSecurityAlertPolicyResources and their operations over a MySqlServerSecurityAlertPolicyResource. public virtual MySqlServerSecurityAlertPolicyCollection GetMySqlServerSecurityAlertPolicies() { - return GetCachedClient(Client => new MySqlServerSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new MySqlServerSecurityAlertPolicyCollection(client, Id)); } /// @@ -386,7 +386,7 @@ public virtual Response GetMySqlServerSe /// An object representing collection of MySqlQueryTextResources and their operations over a MySqlQueryTextResource. public virtual MySqlQueryTextCollection GetMySqlQueryTexts() { - return GetCachedClient(Client => new MySqlQueryTextCollection(Client, Id)); + return GetCachedClient(client => new MySqlQueryTextCollection(client, Id)); } /// @@ -404,8 +404,8 @@ public virtual MySqlQueryTextCollection GetMySqlQueryTexts() /// /// The Query-Store query identifier. /// The cancellation token to use. - /// 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> GetMySqlQueryTextAsync(string queryId, CancellationToken cancellationToken = default) { @@ -427,8 +427,8 @@ public virtual async Task> GetMySqlQueryTextAsy /// /// The Query-Store query identifier. /// The cancellation token to use. - /// 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 GetMySqlQueryText(string queryId, CancellationToken cancellationToken = default) { @@ -439,7 +439,7 @@ public virtual Response GetMySqlQueryText(string queryId /// An object representing collection of MySqlQueryStatisticResources and their operations over a MySqlQueryStatisticResource. public virtual MySqlQueryStatisticCollection GetMySqlQueryStatistics() { - return GetCachedClient(Client => new MySqlQueryStatisticCollection(Client, Id)); + return GetCachedClient(client => new MySqlQueryStatisticCollection(client, Id)); } /// @@ -457,8 +457,8 @@ public virtual MySqlQueryStatisticCollection GetMySqlQueryStatistics() /// /// The Query Statistic identifier. /// The cancellation token to use. - /// 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> GetMySqlQueryStatisticAsync(string queryStatisticId, CancellationToken cancellationToken = default) { @@ -480,8 +480,8 @@ public virtual async Task> GetMySqlQuerySt /// /// The Query Statistic identifier. /// The cancellation token to use. - /// 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 GetMySqlQueryStatistic(string queryStatisticId, CancellationToken cancellationToken = default) { @@ -492,7 +492,7 @@ public virtual Response GetMySqlQueryStatistic(stri /// An object representing collection of MySqlWaitStatisticResources and their operations over a MySqlWaitStatisticResource. public virtual MySqlWaitStatisticCollection GetMySqlWaitStatistics() { - return GetCachedClient(Client => new MySqlWaitStatisticCollection(Client, Id)); + return GetCachedClient(client => new MySqlWaitStatisticCollection(client, Id)); } /// @@ -510,8 +510,8 @@ public virtual MySqlWaitStatisticCollection GetMySqlWaitStatistics() /// /// The Wait Statistic identifier. /// The cancellation token to use. - /// 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> GetMySqlWaitStatisticAsync(string waitStatisticsId, CancellationToken cancellationToken = default) { @@ -533,8 +533,8 @@ public virtual async Task> GetMySqlWaitStat /// /// The Wait Statistic identifier. /// The cancellation token to use. - /// 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 GetMySqlWaitStatistic(string waitStatisticsId, CancellationToken cancellationToken = default) { @@ -545,7 +545,7 @@ public virtual Response GetMySqlWaitStatistic(string /// An object representing collection of MySqlAdvisorResources and their operations over a MySqlAdvisorResource. public virtual MySqlAdvisorCollection GetMySqlAdvisors() { - return GetCachedClient(Client => new MySqlAdvisorCollection(Client, Id)); + return GetCachedClient(client => new MySqlAdvisorCollection(client, Id)); } /// @@ -563,8 +563,8 @@ public virtual MySqlAdvisorCollection GetMySqlAdvisors() /// /// The advisor name for recommendation action. /// The cancellation token to use. - /// 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> GetMySqlAdvisorAsync(string advisorName, CancellationToken cancellationToken = default) { @@ -586,8 +586,8 @@ public virtual async Task> GetMySqlAdvisorAsync(s /// /// The advisor name for recommendation action. /// The cancellation token to use. - /// 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 GetMySqlAdvisor(string advisorName, CancellationToken cancellationToken = default) { @@ -598,7 +598,7 @@ public virtual Response GetMySqlAdvisor(string advisorName /// An object representing collection of MySqlPrivateEndpointConnectionResources and their operations over a MySqlPrivateEndpointConnectionResource. public virtual MySqlPrivateEndpointConnectionCollection GetMySqlPrivateEndpointConnections() { - return GetCachedClient(Client => new MySqlPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new MySqlPrivateEndpointConnectionCollection(client, Id)); } /// @@ -616,8 +616,8 @@ public virtual MySqlPrivateEndpointConnectionCollection GetMySqlPrivateEndpointC /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetMySqlPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -639,8 +639,8 @@ public virtual async Task> GetM /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetMySqlPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -651,7 +651,7 @@ public virtual Response GetMySqlPrivateE /// An object representing collection of MySqlPrivateLinkResources and their operations over a MySqlPrivateLinkResource. public virtual MySqlPrivateLinkResourceCollection GetMySqlPrivateLinkResources() { - return GetCachedClient(Client => new MySqlPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new MySqlPrivateLinkResourceCollection(client, Id)); } /// @@ -669,8 +669,8 @@ public virtual MySqlPrivateLinkResourceCollection GetMySqlPrivateLinkResources() /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetMySqlPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -692,8 +692,8 @@ public virtual async Task> GetMySqlPrivateLin /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetMySqlPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -704,7 +704,7 @@ public virtual Response GetMySqlPrivateLinkResource(st /// An object representing collection of MySqlServerKeyResources and their operations over a MySqlServerKeyResource. public virtual MySqlServerKeyCollection GetMySqlServerKeys() { - return GetCachedClient(Client => new MySqlServerKeyCollection(Client, Id)); + return GetCachedClient(client => new MySqlServerKeyCollection(client, Id)); } /// @@ -722,8 +722,8 @@ public virtual MySqlServerKeyCollection GetMySqlServerKeys() /// /// The name of the MySQL Server key to be retrieved. /// The cancellation token to use. - /// 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> GetMySqlServerKeyAsync(string keyName, CancellationToken cancellationToken = default) { @@ -745,8 +745,8 @@ public virtual async Task> GetMySqlServerKeyAsy /// /// The name of the MySQL Server key to be retrieved. /// The cancellation token to use. - /// 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 GetMySqlServerKey(string keyName, CancellationToken cancellationToken = default) { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs index 5871205b74d4..abaca139d3a2 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.MySql.FlexibleServers.Mocking; using Azure.ResourceManager.MySql.FlexibleServers.Models; using Azure.ResourceManager.Resources; @@ -19,173 +20,134 @@ namespace Azure.ResourceManager.MySql.FlexibleServers /// A class to add extension methods to Azure.ResourceManager.MySql.FlexibleServers. public static partial class FlexibleServersExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static MySqlFlexibleServersArmClientMockingExtension GetMySqlFlexibleServersArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new MySqlFlexibleServersArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MySqlFlexibleServersResourceGroupMockingExtension GetMySqlFlexibleServersResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MySqlFlexibleServersResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static MySqlFlexibleServersSubscriptionMockingExtension GetMySqlFlexibleServersSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new MySqlFlexibleServersSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static MySqlFlexibleServersTenantMockingExtension GetMySqlFlexibleServersTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new MySqlFlexibleServersTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region MySqlFlexibleServerAadAdministratorResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerAadAdministratorResource GetMySqlFlexibleServerAadAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerAadAdministratorResource.ValidateResourceId(id); - return new MySqlFlexibleServerAadAdministratorResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerAadAdministratorResource(id); } - #endregion - #region MySqlFlexibleServerBackupResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerBackupResource GetMySqlFlexibleServerBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerBackupResource.ValidateResourceId(id); - return new MySqlFlexibleServerBackupResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerBackupResource(id); } - #endregion - #region MySqlFlexibleServerConfigurationResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerConfigurationResource GetMySqlFlexibleServerConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerConfigurationResource.ValidateResourceId(id); - return new MySqlFlexibleServerConfigurationResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerConfigurationResource(id); } - #endregion - #region MySqlFlexibleServerDatabaseResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerDatabaseResource GetMySqlFlexibleServerDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerDatabaseResource.ValidateResourceId(id); - return new MySqlFlexibleServerDatabaseResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerDatabaseResource(id); } - #endregion - #region MySqlFlexibleServerFirewallRuleResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerFirewallRuleResource GetMySqlFlexibleServerFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerFirewallRuleResource.ValidateResourceId(id); - return new MySqlFlexibleServerFirewallRuleResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerFirewallRuleResource(id); } - #endregion - #region MySqlFlexibleServerResource /// /// 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. /// Returns a object. public static MySqlFlexibleServerResource GetMySqlFlexibleServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MySqlFlexibleServerResource.ValidateResourceId(id); - return new MySqlFlexibleServerResource(client, id); - } - ); + return GetMySqlFlexibleServersArmClientMockingExtension(client).GetMySqlFlexibleServerResource(id); } - #endregion - /// Gets a collection of MySqlFlexibleServerResources in the ResourceGroupResource. + /// + /// Gets a collection of MySqlFlexibleServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MySqlFlexibleServerResources and their operations over a MySqlFlexibleServerResource. public static MySqlFlexibleServerCollection GetMySqlFlexibleServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMySqlFlexibleServers(); + return GetMySqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetMySqlFlexibleServers(); } /// @@ -200,16 +162,20 @@ public static MySqlFlexibleServerCollection GetMySqlFlexibleServers(this Resourc /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static async Task> GetMySqlFlexibleServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMySqlFlexibleServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + return await GetMySqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetMySqlFlexibleServerAsync(serverName, cancellationToken).ConfigureAwait(false); } /// @@ -224,16 +190,20 @@ public static async Task> GetMySqlFlexible /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static Response GetMySqlFlexibleServer(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMySqlFlexibleServers().Get(serverName, cancellationToken); + return GetMySqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetMySqlFlexibleServer(serverName, cancellationToken); } /// @@ -248,13 +218,17 @@ public static Response GetMySqlFlexibleServer(this /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMySqlFlexibleServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMySqlFlexibleServersAsync(cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetMySqlFlexibleServersAsync(cancellationToken); } /// @@ -269,13 +243,17 @@ public static AsyncPageable GetMySqlFlexibleServers /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMySqlFlexibleServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMySqlFlexibleServers(cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetMySqlFlexibleServers(cancellationToken); } /// @@ -290,6 +268,10 @@ public static Pageable GetMySqlFlexibleServers(this /// LocationBasedCapabilities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -297,7 +279,7 @@ public static Pageable GetMySqlFlexibleServers(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLocationBasedCapabilitiesAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedCapabilitiesAsync(locationName, cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetLocationBasedCapabilitiesAsync(locationName, cancellationToken); } /// @@ -312,6 +294,10 @@ public static AsyncPageable GetLocation /// LocationBasedCapabilities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -319,7 +305,7 @@ public static AsyncPageable GetLocation /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLocationBasedCapabilities(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedCapabilities(locationName, cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetLocationBasedCapabilities(locationName, cancellationToken); } /// @@ -334,6 +320,10 @@ public static Pageable GetLocationBased /// CheckVirtualNetworkSubnetUsage_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -342,9 +332,7 @@ public static Pageable GetLocationBased /// is null. public static async Task> ExecuteCheckVirtualNetworkSubnetUsageAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, MySqlFlexibleServerVirtualNetworkSubnetUsageParameter mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteCheckVirtualNetworkSubnetUsageAsync(locationName, mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken).ConfigureAwait(false); + return await GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteCheckVirtualNetworkSubnetUsageAsync(locationName, mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken).ConfigureAwait(false); } /// @@ -359,6 +347,10 @@ public static async TaskCheckVirtualNetworkSubnetUsage_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -367,9 +359,7 @@ public static async Task is null. public static Response ExecuteCheckVirtualNetworkSubnetUsage(this SubscriptionResource subscriptionResource, AzureLocation locationName, MySqlFlexibleServerVirtualNetworkSubnetUsageParameter mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteCheckVirtualNetworkSubnetUsage(locationName, mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteCheckVirtualNetworkSubnetUsage(locationName, mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken); } /// @@ -384,6 +374,10 @@ public static Response Execu /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -392,9 +386,7 @@ public static Response Execu /// is null. public static async Task> CheckMySqlFlexibleServerNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -409,6 +401,10 @@ public static async Task> Ch /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -417,9 +413,7 @@ public static async Task> Ch /// is null. public static Response CheckMySqlFlexibleServerNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation locationName, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlFlexibleServerNameAvailability(locationName, content, cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckMySqlFlexibleServerNameAvailability(locationName, content, cancellationToken); } /// @@ -434,6 +428,10 @@ public static Response CheckMySqlFlex /// CheckNameAvailabilityWithoutLocation_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if server name is available. @@ -441,9 +439,7 @@ public static Response CheckMySqlFlex /// is null. public static async Task> CheckMySqlFlexibleServerNameAvailabilityWithoutLocationAsync(this SubscriptionResource subscriptionResource, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityWithoutLocationAsync(content, cancellationToken).ConfigureAwait(false); + return await GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityWithoutLocationAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -458,6 +454,10 @@ public static async Task> Ch /// CheckNameAvailabilityWithoutLocation_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if server name is available. @@ -465,9 +465,7 @@ public static async Task> Ch /// is null. public static Response CheckMySqlFlexibleServerNameAvailabilityWithoutLocation(this SubscriptionResource subscriptionResource, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityWithoutLocation(content, cancellationToken); + return GetMySqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckMySqlFlexibleServerNameAvailabilityWithoutLocation(content, cancellationToken); } /// @@ -482,12 +480,16 @@ public static Response CheckMySqlFlex /// GetPrivateDnsZoneSuffix_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> ExecuteGetPrivateDnsZoneSuffixAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).ExecuteGetPrivateDnsZoneSuffixAsync(cancellationToken).ConfigureAwait(false); + return await GetMySqlFlexibleServersTenantMockingExtension(tenantResource).ExecuteGetPrivateDnsZoneSuffixAsync(cancellationToken).ConfigureAwait(false); } /// @@ -502,12 +504,16 @@ public static async TaskGetPrivateDnsZoneSuffix_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response ExecuteGetPrivateDnsZoneSuffix(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).ExecuteGetPrivateDnsZoneSuffix(cancellationToken); + return GetMySqlFlexibleServersTenantMockingExtension(tenantResource).ExecuteGetPrivateDnsZoneSuffix(cancellationToken); } } } diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersArmClientMockingExtension.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersArmClientMockingExtension.cs new file mode 100644 index 000000000000..29fb7dfcd8a2 --- /dev/null +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MySql.FlexibleServers; + +namespace Azure.ResourceManager.MySql.FlexibleServers.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MySqlFlexibleServersArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MySqlFlexibleServersArmClientMockingExtension() + { + } + + /// 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 MySqlFlexibleServersArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MySqlFlexibleServersArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MySqlFlexibleServerAadAdministratorResource GetMySqlFlexibleServerAadAdministratorResource(ResourceIdentifier id) + { + MySqlFlexibleServerAadAdministratorResource.ValidateResourceId(id); + return new MySqlFlexibleServerAadAdministratorResource(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 MySqlFlexibleServerBackupResource GetMySqlFlexibleServerBackupResource(ResourceIdentifier id) + { + MySqlFlexibleServerBackupResource.ValidateResourceId(id); + return new MySqlFlexibleServerBackupResource(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 MySqlFlexibleServerConfigurationResource GetMySqlFlexibleServerConfigurationResource(ResourceIdentifier id) + { + MySqlFlexibleServerConfigurationResource.ValidateResourceId(id); + return new MySqlFlexibleServerConfigurationResource(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 MySqlFlexibleServerDatabaseResource GetMySqlFlexibleServerDatabaseResource(ResourceIdentifier id) + { + MySqlFlexibleServerDatabaseResource.ValidateResourceId(id); + return new MySqlFlexibleServerDatabaseResource(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 MySqlFlexibleServerFirewallRuleResource GetMySqlFlexibleServerFirewallRuleResource(ResourceIdentifier id) + { + MySqlFlexibleServerFirewallRuleResource.ValidateResourceId(id); + return new MySqlFlexibleServerFirewallRuleResource(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 MySqlFlexibleServerResource GetMySqlFlexibleServerResource(ResourceIdentifier id) + { + MySqlFlexibleServerResource.ValidateResourceId(id); + return new MySqlFlexibleServerResource(Client, id); + } + } +} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersResourceGroupMockingExtension.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..3ec32dc8641c --- /dev/null +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.MySql.FlexibleServers; + +namespace Azure.ResourceManager.MySql.FlexibleServers.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MySqlFlexibleServersResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MySqlFlexibleServersResourceGroupMockingExtension() + { + } + + /// 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 MySqlFlexibleServersResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MySqlFlexibleServerResources in the ResourceGroupResource. + /// An object representing collection of MySqlFlexibleServerResources and their operations over a MySqlFlexibleServerResource. + public virtual MySqlFlexibleServerCollection GetMySqlFlexibleServers() + { + return GetCachedClient(client => new MySqlFlexibleServerCollection(client, Id)); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMySqlFlexibleServerAsync(string serverName, CancellationToken cancellationToken = default) + { + return await GetMySqlFlexibleServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMySqlFlexibleServer(string serverName, CancellationToken cancellationToken = default) + { + return GetMySqlFlexibleServers().Get(serverName, cancellationToken); + } + } +} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersSubscriptionMockingExtension.cs similarity index 86% rename from sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersSubscriptionMockingExtension.cs index abf6b109ea72..1a3f3da15701 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MySql.FlexibleServers; using Azure.ResourceManager.MySql.FlexibleServers.Models; -namespace Azure.ResourceManager.MySql.FlexibleServers +namespace Azure.ResourceManager.MySql.FlexibleServers.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class MySqlFlexibleServersSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mySqlFlexibleServerServersClientDiagnostics; private ServersRestOperations _mySqlFlexibleServerServersRestClient; @@ -31,15 +32,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _checkNameAvailabilityWithoutLocationClientDiagnostics; private CheckNameAvailabilityWithoutLocationRestOperations _checkNameAvailabilityWithoutLocationRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MySqlFlexibleServersSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MySqlFlexibleServersSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -79,7 +80,7 @@ public virtual AsyncPageable GetMySqlFlexibleServer { HttpMessage FirstPageRequest(int? pageSizeHint) => MySqlFlexibleServerServersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MySqlFlexibleServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MySqlFlexibleServerResource(Client, MySqlFlexibleServerData.DeserializeMySqlFlexibleServerData(e)), MySqlFlexibleServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMySqlFlexibleServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MySqlFlexibleServerResource(Client, MySqlFlexibleServerData.DeserializeMySqlFlexibleServerData(e)), MySqlFlexibleServerServersClientDiagnostics, Pipeline, "MySqlFlexibleServersSubscriptionMockingExtension.GetMySqlFlexibleServers", "value", "nextLink", cancellationToken); } /// @@ -101,7 +102,7 @@ public virtual Pageable GetMySqlFlexibleServers(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => MySqlFlexibleServerServersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MySqlFlexibleServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MySqlFlexibleServerResource(Client, MySqlFlexibleServerData.DeserializeMySqlFlexibleServerData(e)), MySqlFlexibleServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMySqlFlexibleServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MySqlFlexibleServerResource(Client, MySqlFlexibleServerData.DeserializeMySqlFlexibleServerData(e)), MySqlFlexibleServerServersClientDiagnostics, Pipeline, "MySqlFlexibleServersSubscriptionMockingExtension.GetMySqlFlexibleServers", "value", "nextLink", cancellationToken); } /// @@ -124,7 +125,7 @@ public virtual AsyncPageable GetLocatio { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedCapabilitiesRestClient.CreateListRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationBasedCapabilitiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MySqlFlexibleServerCapabilityProperties.DeserializeMySqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedCapabilities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, MySqlFlexibleServerCapabilityProperties.DeserializeMySqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "MySqlFlexibleServersSubscriptionMockingExtension.GetLocationBasedCapabilities", "value", "nextLink", cancellationToken); } /// @@ -147,7 +148,7 @@ public virtual Pageable GetLocationBase { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedCapabilitiesRestClient.CreateListRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationBasedCapabilitiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MySqlFlexibleServerCapabilityProperties.DeserializeMySqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedCapabilities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, MySqlFlexibleServerCapabilityProperties.DeserializeMySqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "MySqlFlexibleServersSubscriptionMockingExtension.GetLocationBasedCapabilities", "value", "nextLink", cancellationToken); } /// @@ -166,9 +167,12 @@ public virtual Pageable GetLocationBase /// The name of the location. /// The required parameters for creating or updating a server. /// The cancellation token to use. + /// is null. public virtual async Task> ExecuteCheckVirtualNetworkSubnetUsageAsync(AzureLocation locationName, MySqlFlexibleServerVirtualNetworkSubnetUsageParameter mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - using var scope = CheckVirtualNetworkSubnetUsageClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExecuteCheckVirtualNetworkSubnetUsage"); + Argument.AssertNotNull(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter)); + + using var scope = CheckVirtualNetworkSubnetUsageClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.ExecuteCheckVirtualNetworkSubnetUsage"); scope.Start(); try { @@ -198,9 +202,12 @@ public virtual async Task The name of the location. /// The required parameters for creating or updating a server. /// The cancellation token to use. + /// is null. public virtual Response ExecuteCheckVirtualNetworkSubnetUsage(AzureLocation locationName, MySqlFlexibleServerVirtualNetworkSubnetUsageParameter mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - using var scope = CheckVirtualNetworkSubnetUsageClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExecuteCheckVirtualNetworkSubnetUsage"); + Argument.AssertNotNull(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(mySqlFlexibleServerVirtualNetworkSubnetUsageParameter)); + + using var scope = CheckVirtualNetworkSubnetUsageClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.ExecuteCheckVirtualNetworkSubnetUsage"); scope.Start(); try { @@ -230,9 +237,12 @@ public virtual Response Exec /// The name of the location. /// The required parameters for checking if server name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckMySqlFlexibleServerNameAvailabilityAsync(AzureLocation locationName, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlFlexibleServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.CheckMySqlFlexibleServerNameAvailability"); scope.Start(); try { @@ -262,9 +272,12 @@ public virtual async Task> C /// The name of the location. /// The required parameters for checking if server name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckMySqlFlexibleServerNameAvailability(AzureLocation locationName, MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlFlexibleServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.CheckMySqlFlexibleServerNameAvailability"); scope.Start(); try { @@ -293,9 +306,12 @@ public virtual Response CheckMySqlFle /// /// The required parameters for checking if server name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckMySqlFlexibleServerNameAvailabilityWithoutLocationAsync(MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityWithoutLocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlFlexibleServerNameAvailabilityWithoutLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityWithoutLocationClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.CheckMySqlFlexibleServerNameAvailabilityWithoutLocation"); scope.Start(); try { @@ -324,9 +340,12 @@ public virtual async Task> C /// /// The required parameters for checking if server name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckMySqlFlexibleServerNameAvailabilityWithoutLocation(MySqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityWithoutLocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckMySqlFlexibleServerNameAvailabilityWithoutLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityWithoutLocationClientDiagnostics.CreateScope("MySqlFlexibleServersSubscriptionMockingExtension.CheckMySqlFlexibleServerNameAvailabilityWithoutLocation"); scope.Start(); try { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersTenantMockingExtension.cs similarity index 84% rename from sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersTenantMockingExtension.cs index bf0b0866fe16..8781d18dda1b 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/MySqlFlexibleServersTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.MySql.FlexibleServers; using Azure.ResourceManager.MySql.FlexibleServers.Models; -namespace Azure.ResourceManager.MySql.FlexibleServers +namespace Azure.ResourceManager.MySql.FlexibleServers.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class MySqlFlexibleServersTenantMockingExtension : ArmResource { private ClientDiagnostics _getPrivateDnsZoneSuffixClientDiagnostics; private GetPrivateDnsZoneSuffixRestOperations _getPrivateDnsZoneSuffixRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected MySqlFlexibleServersTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal MySqlFlexibleServersTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,7 +60,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> ExecuteGetPrivateDnsZoneSuffixAsync(CancellationToken cancellationToken = default) { - using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExecuteGetPrivateDnsZoneSuffix"); + using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("MySqlFlexibleServersTenantMockingExtension.ExecuteGetPrivateDnsZoneSuffix"); scope.Start(); try { @@ -89,7 +90,7 @@ public virtual async Task The cancellation token to use. public virtual Response ExecuteGetPrivateDnsZoneSuffix(CancellationToken cancellationToken = default) { - using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExecuteGetPrivateDnsZoneSuffix"); + using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("MySqlFlexibleServersTenantMockingExtension.ExecuteGetPrivateDnsZoneSuffix"); scope.Start(); try { diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f6b92bac38da..000000000000 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.MySql.FlexibleServers -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MySqlFlexibleServerResources in the ResourceGroupResource. - /// An object representing collection of MySqlFlexibleServerResources and their operations over a MySqlFlexibleServerResource. - public virtual MySqlFlexibleServerCollection GetMySqlFlexibleServers() - { - return GetCachedClient(Client => new MySqlFlexibleServerCollection(Client, Id)); - } - } -} diff --git a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/MySqlFlexibleServerResource.cs b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/MySqlFlexibleServerResource.cs index 6519b6ad1ebc..0e46365cbb2a 100644 --- a/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/MySqlFlexibleServerResource.cs +++ b/sdk/mysql/Azure.ResourceManager.MySql/src/MySqlFlexibleServers/Generated/MySqlFlexibleServerResource.cs @@ -107,7 +107,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MySqlFlexibleServerAadAdministratorResources and their operations over a MySqlFlexibleServerAadAdministratorResource. public virtual MySqlFlexibleServerAadAdministratorCollection GetMySqlFlexibleServerAadAdministrators() { - return GetCachedClient(Client => new MySqlFlexibleServerAadAdministratorCollection(Client, Id)); + return GetCachedClient(client => new MySqlFlexibleServerAadAdministratorCollection(client, Id)); } /// @@ -156,7 +156,7 @@ public virtual Response GetMySqlFle /// An object representing collection of MySqlFlexibleServerBackupResources and their operations over a MySqlFlexibleServerBackupResource. public virtual MySqlFlexibleServerBackupCollection GetMySqlFlexibleServerBackups() { - return GetCachedClient(Client => new MySqlFlexibleServerBackupCollection(Client, Id)); + return GetCachedClient(client => new MySqlFlexibleServerBackupCollection(client, Id)); } /// @@ -174,8 +174,8 @@ public virtual MySqlFlexibleServerBackupCollection GetMySqlFlexibleServerBackups /// /// The name of the backup. /// The cancellation token to use. - /// 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> GetMySqlFlexibleServerBackupAsync(string backupName, CancellationToken cancellationToken = default) { @@ -197,8 +197,8 @@ public virtual async Task> GetMySqlF /// /// The name of the backup. /// The cancellation token to use. - /// 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 GetMySqlFlexibleServerBackup(string backupName, CancellationToken cancellationToken = default) { @@ -209,7 +209,7 @@ public virtual Response GetMySqlFlexibleServe /// An object representing collection of MySqlFlexibleServerConfigurationResources and their operations over a MySqlFlexibleServerConfigurationResource. public virtual MySqlFlexibleServerConfigurationCollection GetMySqlFlexibleServerConfigurations() { - return GetCachedClient(Client => new MySqlFlexibleServerConfigurationCollection(Client, Id)); + return GetCachedClient(client => new MySqlFlexibleServerConfigurationCollection(client, Id)); } /// @@ -227,8 +227,8 @@ public virtual MySqlFlexibleServerConfigurationCollection GetMySqlFlexibleServer /// /// The name of the server configuration. /// The cancellation token to use. - /// 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> GetMySqlFlexibleServerConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -250,8 +250,8 @@ public virtual async Task> Ge /// /// The name of the server configuration. /// The cancellation token to use. - /// 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 GetMySqlFlexibleServerConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -262,7 +262,7 @@ public virtual Response GetMySqlFlexib /// An object representing collection of MySqlFlexibleServerDatabaseResources and their operations over a MySqlFlexibleServerDatabaseResource. public virtual MySqlFlexibleServerDatabaseCollection GetMySqlFlexibleServerDatabases() { - return GetCachedClient(Client => new MySqlFlexibleServerDatabaseCollection(Client, Id)); + return GetCachedClient(client => new MySqlFlexibleServerDatabaseCollection(client, Id)); } /// @@ -280,8 +280,8 @@ public virtual MySqlFlexibleServerDatabaseCollection GetMySqlFlexibleServerDatab /// /// The name of the database. /// The cancellation token to use. - /// 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> GetMySqlFlexibleServerDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -303,8 +303,8 @@ public virtual async Task> GetMySq /// /// The name of the database. /// The cancellation token to use. - /// 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 GetMySqlFlexibleServerDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -315,7 +315,7 @@ public virtual Response GetMySqlFlexibleSer /// An object representing collection of MySqlFlexibleServerFirewallRuleResources and their operations over a MySqlFlexibleServerFirewallRuleResource. public virtual MySqlFlexibleServerFirewallRuleCollection GetMySqlFlexibleServerFirewallRules() { - return GetCachedClient(Client => new MySqlFlexibleServerFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new MySqlFlexibleServerFirewallRuleCollection(client, Id)); } /// @@ -333,8 +333,8 @@ public virtual MySqlFlexibleServerFirewallRuleCollection GetMySqlFlexibleServerF /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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> GetMySqlFlexibleServerFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -356,8 +356,8 @@ public virtual async Task> Get /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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 GetMySqlFlexibleServerFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/CapacityPoolResource.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/CapacityPoolResource.cs index 5c6a752575fc..cad02cb59396 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/CapacityPoolResource.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/CapacityPoolResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetAppVolumeResources and their operations over a NetAppVolumeResource. public virtual NetAppVolumeCollection GetNetAppVolumes() { - return GetCachedClient(Client => new NetAppVolumeCollection(Client, Id)); + return GetCachedClient(client => new NetAppVolumeCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual NetAppVolumeCollection GetNetAppVolumes() /// /// The name of the volume. /// The cancellation token to use. - /// 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> GetNetAppVolumeAsync(string volumeName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetNetAppVolumeAsync(s /// /// The name of the volume. /// The cancellation token to use. - /// 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 GetNetAppVolume(string volumeName, CancellationToken cancellationToken = default) { diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppArmClientMockingExtension.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppArmClientMockingExtension.cs new file mode 100644 index 000000000000..7fa4280a7cd4 --- /dev/null +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetApp; + +namespace Azure.ResourceManager.NetApp.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NetAppArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetAppArmClientMockingExtension() + { + } + + /// 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 NetAppArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NetAppArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetAppAccountResource GetNetAppAccountResource(ResourceIdentifier id) + { + NetAppAccountResource.ValidateResourceId(id); + return new NetAppAccountResource(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 CapacityPoolResource GetCapacityPoolResource(ResourceIdentifier id) + { + CapacityPoolResource.ValidateResourceId(id); + return new CapacityPoolResource(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 NetAppVolumeResource GetNetAppVolumeResource(ResourceIdentifier id) + { + NetAppVolumeResource.ValidateResourceId(id); + return new NetAppVolumeResource(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 NetAppVolumeSnapshotResource GetNetAppVolumeSnapshotResource(ResourceIdentifier id) + { + NetAppVolumeSnapshotResource.ValidateResourceId(id); + return new NetAppVolumeSnapshotResource(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 SnapshotPolicyResource GetSnapshotPolicyResource(ResourceIdentifier id) + { + SnapshotPolicyResource.ValidateResourceId(id); + return new SnapshotPolicyResource(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 NetAppBackupPolicyResource GetNetAppBackupPolicyResource(ResourceIdentifier id) + { + NetAppBackupPolicyResource.ValidateResourceId(id); + return new NetAppBackupPolicyResource(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 NetAppVolumeQuotaRuleResource GetNetAppVolumeQuotaRuleResource(ResourceIdentifier id) + { + NetAppVolumeQuotaRuleResource.ValidateResourceId(id); + return new NetAppVolumeQuotaRuleResource(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 NetAppVolumeGroupResource GetNetAppVolumeGroupResource(ResourceIdentifier id) + { + NetAppVolumeGroupResource.ValidateResourceId(id); + return new NetAppVolumeGroupResource(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 NetAppSubvolumeInfoResource GetNetAppSubvolumeInfoResource(ResourceIdentifier id) + { + NetAppSubvolumeInfoResource.ValidateResourceId(id); + return new NetAppSubvolumeInfoResource(Client, id); + } + } +} diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppExtensions.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppExtensions.cs index 9d8a9f124808..505a73547ee5 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppExtensions.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.NetApp.Mocking; using Azure.ResourceManager.NetApp.Models; using Azure.ResourceManager.Resources; @@ -19,214 +20,177 @@ namespace Azure.ResourceManager.NetApp /// A class to add extension methods to Azure.ResourceManager.NetApp. public static partial class NetAppExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NetAppArmClientMockingExtension GetNetAppArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NetAppArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NetAppResourceGroupMockingExtension GetNetAppResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NetAppResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NetAppSubscriptionMockingExtension GetNetAppSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NetAppSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NetAppAccountResource /// /// 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. /// Returns a object. public static NetAppAccountResource GetNetAppAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppAccountResource.ValidateResourceId(id); - return new NetAppAccountResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppAccountResource(id); } - #endregion - #region CapacityPoolResource /// /// 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. /// Returns a object. public static CapacityPoolResource GetCapacityPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CapacityPoolResource.ValidateResourceId(id); - return new CapacityPoolResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetCapacityPoolResource(id); } - #endregion - #region NetAppVolumeResource /// /// 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. /// Returns a object. public static NetAppVolumeResource GetNetAppVolumeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppVolumeResource.ValidateResourceId(id); - return new NetAppVolumeResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppVolumeResource(id); } - #endregion - #region NetAppVolumeSnapshotResource /// /// 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. /// Returns a object. public static NetAppVolumeSnapshotResource GetNetAppVolumeSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppVolumeSnapshotResource.ValidateResourceId(id); - return new NetAppVolumeSnapshotResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppVolumeSnapshotResource(id); } - #endregion - #region SnapshotPolicyResource /// /// 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. /// Returns a object. public static SnapshotPolicyResource GetSnapshotPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SnapshotPolicyResource.ValidateResourceId(id); - return new SnapshotPolicyResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetSnapshotPolicyResource(id); } - #endregion - #region NetAppBackupPolicyResource /// /// 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. /// Returns a object. public static NetAppBackupPolicyResource GetNetAppBackupPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppBackupPolicyResource.ValidateResourceId(id); - return new NetAppBackupPolicyResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppBackupPolicyResource(id); } - #endregion - #region NetAppVolumeQuotaRuleResource /// /// 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. /// Returns a object. public static NetAppVolumeQuotaRuleResource GetNetAppVolumeQuotaRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppVolumeQuotaRuleResource.ValidateResourceId(id); - return new NetAppVolumeQuotaRuleResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppVolumeQuotaRuleResource(id); } - #endregion - #region NetAppVolumeGroupResource /// /// 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. /// Returns a object. public static NetAppVolumeGroupResource GetNetAppVolumeGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppVolumeGroupResource.ValidateResourceId(id); - return new NetAppVolumeGroupResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppVolumeGroupResource(id); } - #endregion - #region NetAppSubvolumeInfoResource /// /// 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. /// Returns a object. public static NetAppSubvolumeInfoResource GetNetAppSubvolumeInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetAppSubvolumeInfoResource.ValidateResourceId(id); - return new NetAppSubvolumeInfoResource(client, id); - } - ); + return GetNetAppArmClientMockingExtension(client).GetNetAppSubvolumeInfoResource(id); } - #endregion - /// Gets a collection of NetAppAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of NetAppAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetAppAccountResources and their operations over a NetAppAccountResource. public static NetAppAccountCollection GetNetAppAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetAppAccounts(); + return GetNetAppResourceGroupMockingExtension(resourceGroupResource).GetNetAppAccounts(); } /// @@ -241,16 +205,20 @@ public static NetAppAccountCollection GetNetAppAccounts(this ResourceGroupResour /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the NetApp account. /// The cancellation token to use. - /// 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 static async Task> GetNetAppAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetAppAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetNetAppResourceGroupMockingExtension(resourceGroupResource).GetNetAppAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -265,16 +233,20 @@ public static async Task> GetNetAppAccountAsync( /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the NetApp account. /// The cancellation token to use. - /// 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 static Response GetNetAppAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetAppAccounts().Get(accountName, cancellationToken); + return GetNetAppResourceGroupMockingExtension(resourceGroupResource).GetNetAppAccount(accountName, cancellationToken); } /// @@ -289,6 +261,10 @@ public static Response GetNetAppAccount(this ResourceGrou /// NetAppResource_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -297,9 +273,7 @@ public static Response GetNetAppAccount(this ResourceGrou /// is null. public static async Task> CheckNetAppNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -314,6 +288,10 @@ public static async Task> CheckNetAppNam /// NetAppResource_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -322,9 +300,7 @@ public static async Task> CheckNetAppNam /// is null. public static Response CheckNetAppNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppNameAvailability(location, content, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppNameAvailability(location, content, cancellationToken); } /// @@ -339,6 +315,10 @@ public static Response CheckNetAppNameAvailabilit /// NetAppResource_CheckFilePathAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -347,9 +327,7 @@ public static Response CheckNetAppNameAvailabilit /// is null. public static async Task> CheckNetAppFilePathAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppFilePathAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppFilePathAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppFilePathAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -364,6 +342,10 @@ public static async Task> CheckNetAppFil /// NetAppResource_CheckFilePathAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -372,9 +354,7 @@ public static async Task> CheckNetAppFil /// is null. public static Response CheckNetAppFilePathAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppFilePathAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppFilePathAvailability(location, content, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppFilePathAvailability(location, content, cancellationToken); } /// @@ -389,6 +369,10 @@ public static Response CheckNetAppFilePathAvailab /// NetAppResource_CheckQuotaAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -397,9 +381,7 @@ public static Response CheckNetAppFilePathAvailab /// is null. public static async Task> CheckNetAppQuotaAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppQuotaAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppQuotaAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppQuotaAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -414,6 +396,10 @@ public static async Task> CheckNetAppQuo /// NetAppResource_CheckQuotaAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -422,9 +408,7 @@ public static async Task> CheckNetAppQuo /// is null. public static Response CheckNetAppQuotaAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, NetAppQuotaAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNetAppQuotaAvailability(location, content, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).CheckNetAppQuotaAvailability(location, content, cancellationToken); } /// @@ -439,13 +423,17 @@ public static Response CheckNetAppQuotaAvailabili /// NetAppResource_QueryRegionInfo /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// The cancellation token to use. public static async Task> QueryRegionInfoNetAppResourceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).QueryRegionInfoNetAppResourceAsync(location, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).QueryRegionInfoNetAppResourceAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -460,13 +448,17 @@ public static async Task> QueryRegionInfoNetAppResour /// NetAppResource_QueryRegionInfo /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// The cancellation token to use. public static Response QueryRegionInfoNetAppResource(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).QueryRegionInfoNetAppResource(location, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).QueryRegionInfoNetAppResource(location, cancellationToken); } /// @@ -481,6 +473,10 @@ public static Response QueryRegionInfoNetAppResource(this Subs /// NetAppResource_QueryNetworkSiblingSet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -489,9 +485,7 @@ public static Response QueryRegionInfoNetAppResource(this Subs /// is null. public static async Task> QueryNetworkSiblingSetNetAppResourceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, QueryNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).QueryNetworkSiblingSetNetAppResourceAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).QueryNetworkSiblingSetNetAppResourceAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -506,6 +500,10 @@ public static async Task> QueryNetworkSiblingSetNetA /// NetAppResource_QueryNetworkSiblingSet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -514,9 +512,7 @@ public static async Task> QueryNetworkSiblingSetNetA /// is null. public static Response QueryNetworkSiblingSetNetAppResource(this SubscriptionResource subscriptionResource, AzureLocation location, QueryNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).QueryNetworkSiblingSetNetAppResource(location, content, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).QueryNetworkSiblingSetNetAppResource(location, content, cancellationToken); } /// @@ -531,6 +527,10 @@ public static Response QueryNetworkSiblingSetNetAppResource(t /// NetAppResource_UpdateNetworkSiblingSet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -540,9 +540,7 @@ public static Response QueryNetworkSiblingSetNetAppResource(t /// is null. public static async Task> UpdateNetworkSiblingSetNetAppResourceAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, UpdateNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateNetworkSiblingSetNetAppResourceAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).UpdateNetworkSiblingSetNetAppResourceAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -557,6 +555,10 @@ public static async Task> UpdateNetworkSiblingSe /// NetAppResource_UpdateNetworkSiblingSet /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -566,9 +568,7 @@ public static async Task> UpdateNetworkSiblingSe /// is null. public static ArmOperation UpdateNetworkSiblingSetNetAppResource(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, UpdateNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).UpdateNetworkSiblingSetNetAppResource(waitUntil, location, content, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).UpdateNetworkSiblingSetNetAppResource(waitUntil, location, content, cancellationToken); } /// @@ -583,6 +583,10 @@ public static ArmOperation UpdateNetworkSiblingSetNetAppResou /// NetAppResourceQuotaLimits_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -590,7 +594,7 @@ public static ArmOperation UpdateNetworkSiblingSetNetAppResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetAppQuotaLimitsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppQuotaLimitsAsync(location, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppQuotaLimitsAsync(location, cancellationToken); } /// @@ -605,6 +609,10 @@ public static AsyncPageable GetNetAppQuotaLimitsAsy /// NetAppResourceQuotaLimits_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -612,7 +620,7 @@ public static AsyncPageable GetNetAppQuotaLimitsAsy /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetAppQuotaLimits(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppQuotaLimits(location, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppQuotaLimits(location, cancellationToken); } /// @@ -627,6 +635,10 @@ public static Pageable GetNetAppQuotaLimits(this Su /// NetAppResourceQuotaLimits_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -636,9 +648,7 @@ public static Pageable GetNetAppQuotaLimits(this Su /// is null. public static async Task> GetNetAppQuotaLimitAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string quotaLimitName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(quotaLimitName, nameof(quotaLimitName)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppQuotaLimitAsync(location, quotaLimitName, cancellationToken).ConfigureAwait(false); + return await GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppQuotaLimitAsync(location, quotaLimitName, cancellationToken).ConfigureAwait(false); } /// @@ -653,6 +663,10 @@ public static async Task> GetNetAppQuotaLi /// NetAppResourceQuotaLimits_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -662,9 +676,7 @@ public static async Task> GetNetAppQuotaLi /// is null. public static Response GetNetAppQuotaLimit(this SubscriptionResource subscriptionResource, AzureLocation location, string quotaLimitName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(quotaLimitName, nameof(quotaLimitName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppQuotaLimit(location, quotaLimitName, cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppQuotaLimit(location, quotaLimitName, cancellationToken); } /// @@ -679,13 +691,17 @@ public static Response GetNetAppQuotaLimit(this Sub /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetAppAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppAccountsAsync(cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppAccountsAsync(cancellationToken); } /// @@ -700,13 +716,17 @@ public static AsyncPageable GetNetAppAccountsAsync(this S /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetAppAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetAppAccounts(cancellationToken); + return GetNetAppSubscriptionMockingExtension(subscriptionResource).GetNetAppAccounts(cancellationToken); } } } diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppResourceGroupMockingExtension.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..62bdb2150224 --- /dev/null +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetApp; + +namespace Azure.ResourceManager.NetApp.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NetAppResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetAppResourceGroupMockingExtension() + { + } + + /// 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 NetAppResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NetAppAccountResources in the ResourceGroupResource. + /// An object representing collection of NetAppAccountResources and their operations over a NetAppAccountResource. + public virtual NetAppAccountCollection GetNetAppAccounts() + { + return GetCachedClient(client => new NetAppAccountCollection(client, Id)); + } + + /// + /// Get the NetApp account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the NetApp account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetAppAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetNetAppAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the NetApp account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the NetApp account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetAppAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetNetAppAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppSubscriptionMockingExtension.cs similarity index 87% rename from sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppSubscriptionMockingExtension.cs index dedbaa98ecac..6ea9aa5db75b 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/NetAppSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.NetApp; using Azure.ResourceManager.NetApp.Models; -namespace Azure.ResourceManager.NetApp +namespace Azure.ResourceManager.NetApp.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NetAppSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _netAppResourceClientDiagnostics; private NetAppResourceRestOperations _netAppResourceRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _netAppAccountAccountsClientDiagnostics; private AccountsRestOperations _netAppAccountAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NetAppSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NetAppSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,9 +69,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The name of Azure region. /// Name availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNetAppNameAvailabilityAsync(AzureLocation location, NetAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppNameAvailability"); scope.Start(); try { @@ -100,9 +104,12 @@ public virtual async Task> CheckNetAppNa /// The name of Azure region. /// Name availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckNetAppNameAvailability(AzureLocation location, NetAppNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppNameAvailability"); scope.Start(); try { @@ -132,9 +139,12 @@ public virtual Response CheckNetAppNameAvailabili /// The name of Azure region. /// File path availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNetAppFilePathAvailabilityAsync(AzureLocation location, NetAppFilePathAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppFilePathAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppFilePathAvailability"); scope.Start(); try { @@ -164,9 +174,12 @@ public virtual async Task> CheckNetAppFi /// The name of Azure region. /// File path availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckNetAppFilePathAvailability(AzureLocation location, NetAppFilePathAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppFilePathAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppFilePathAvailability"); scope.Start(); try { @@ -196,9 +209,12 @@ public virtual Response CheckNetAppFilePathAvaila /// The name of Azure region. /// Quota availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNetAppQuotaAvailabilityAsync(AzureLocation location, NetAppQuotaAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppQuotaAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppQuotaAvailability"); scope.Start(); try { @@ -228,9 +244,12 @@ public virtual async Task> CheckNetAppQu /// The name of Azure region. /// Quota availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckNetAppQuotaAvailability(AzureLocation location, NetAppQuotaAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNetAppQuotaAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.CheckNetAppQuotaAvailability"); scope.Start(); try { @@ -261,7 +280,7 @@ public virtual Response CheckNetAppQuotaAvailabil /// The cancellation token to use. public virtual async Task> QueryRegionInfoNetAppResourceAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.QueryRegionInfoNetAppResource"); + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.QueryRegionInfoNetAppResource"); scope.Start(); try { @@ -292,7 +311,7 @@ public virtual async Task> QueryRegionInfoNetAppResou /// The cancellation token to use. public virtual Response QueryRegionInfoNetAppResource(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.QueryRegionInfoNetAppResource"); + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.QueryRegionInfoNetAppResource"); scope.Start(); try { @@ -322,9 +341,12 @@ public virtual Response QueryRegionInfoNetAppResource(AzureLoc /// The name of Azure region. /// Network sibling set to query. /// The cancellation token to use. + /// is null. public virtual async Task> QueryNetworkSiblingSetNetAppResourceAsync(AzureLocation location, QueryNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.QueryNetworkSiblingSetNetAppResource"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.QueryNetworkSiblingSetNetAppResource"); scope.Start(); try { @@ -354,9 +376,12 @@ public virtual async Task> QueryNetworkSiblingSetNet /// The name of Azure region. /// Network sibling set to query. /// The cancellation token to use. + /// is null. public virtual Response QueryNetworkSiblingSetNetAppResource(AzureLocation location, QueryNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.QueryNetworkSiblingSetNetAppResource"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.QueryNetworkSiblingSetNetAppResource"); scope.Start(); try { @@ -387,9 +412,12 @@ public virtual Response QueryNetworkSiblingSetNetAppResource( /// The name of Azure region. /// Update for the specified network sibling set. /// The cancellation token to use. + /// is null. public virtual async Task> UpdateNetworkSiblingSetNetAppResourceAsync(WaitUntil waitUntil, AzureLocation location, UpdateNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateNetworkSiblingSetNetAppResource"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.UpdateNetworkSiblingSetNetAppResource"); scope.Start(); try { @@ -423,9 +451,12 @@ public virtual async Task> UpdateNetworkSiblingS /// The name of Azure region. /// Update for the specified network sibling set. /// The cancellation token to use. + /// is null. public virtual ArmOperation UpdateNetworkSiblingSetNetAppResource(WaitUntil waitUntil, AzureLocation location, UpdateNetworkSiblingSetContent content, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.UpdateNetworkSiblingSetNetAppResource"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NetAppResourceClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.UpdateNetworkSiblingSetNetAppResource"); scope.Start(); try { @@ -461,7 +492,7 @@ public virtual ArmOperation UpdateNetworkSiblingSetNetAppReso public virtual AsyncPageable GetNetAppQuotaLimitsAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => NetAppResourceQuotaLimitsRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, NetAppSubscriptionQuotaItem.DeserializeNetAppSubscriptionQuotaItem, NetAppResourceQuotaLimitsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetAppQuotaLimits", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, NetAppSubscriptionQuotaItem.DeserializeNetAppSubscriptionQuotaItem, NetAppResourceQuotaLimitsClientDiagnostics, Pipeline, "NetAppSubscriptionMockingExtension.GetNetAppQuotaLimits", "value", null, cancellationToken); } /// @@ -483,7 +514,7 @@ public virtual AsyncPageable GetNetAppQuotaLimitsAs public virtual Pageable GetNetAppQuotaLimits(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => NetAppResourceQuotaLimitsRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, NetAppSubscriptionQuotaItem.DeserializeNetAppSubscriptionQuotaItem, NetAppResourceQuotaLimitsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetAppQuotaLimits", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, NetAppSubscriptionQuotaItem.DeserializeNetAppSubscriptionQuotaItem, NetAppResourceQuotaLimitsClientDiagnostics, Pipeline, "NetAppSubscriptionMockingExtension.GetNetAppQuotaLimits", "value", null, cancellationToken); } /// @@ -502,9 +533,13 @@ public virtual Pageable GetNetAppQuotaLimits(AzureL /// The name of Azure region. /// The name of the Quota Limit. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetNetAppQuotaLimitAsync(AzureLocation location, string quotaLimitName, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceQuotaLimitsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetNetAppQuotaLimit"); + Argument.AssertNotNullOrEmpty(quotaLimitName, nameof(quotaLimitName)); + + using var scope = NetAppResourceQuotaLimitsClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.GetNetAppQuotaLimit"); scope.Start(); try { @@ -534,9 +569,13 @@ public virtual async Task> GetNetAppQuotaL /// The name of Azure region. /// The name of the Quota Limit. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetNetAppQuotaLimit(AzureLocation location, string quotaLimitName, CancellationToken cancellationToken = default) { - using var scope = NetAppResourceQuotaLimitsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetNetAppQuotaLimit"); + Argument.AssertNotNullOrEmpty(quotaLimitName, nameof(quotaLimitName)); + + using var scope = NetAppResourceQuotaLimitsClientDiagnostics.CreateScope("NetAppSubscriptionMockingExtension.GetNetAppQuotaLimit"); scope.Start(); try { @@ -569,7 +608,7 @@ public virtual AsyncPageable GetNetAppAccountsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => NetAppAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetAppAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetAppAccountResource(Client, NetAppAccountData.DeserializeNetAppAccountData(e)), NetAppAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetAppAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetAppAccountResource(Client, NetAppAccountData.DeserializeNetAppAccountData(e)), NetAppAccountAccountsClientDiagnostics, Pipeline, "NetAppSubscriptionMockingExtension.GetNetAppAccounts", "value", "nextLink", cancellationToken); } /// @@ -591,7 +630,7 @@ public virtual Pageable GetNetAppAccounts(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => NetAppAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetAppAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetAppAccountResource(Client, NetAppAccountData.DeserializeNetAppAccountData(e)), NetAppAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetAppAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetAppAccountResource(Client, NetAppAccountData.DeserializeNetAppAccountData(e)), NetAppAccountAccountsClientDiagnostics, Pipeline, "NetAppSubscriptionMockingExtension.GetNetAppAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 51609d609e1f..000000000000 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.NetApp -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NetAppAccountResources in the ResourceGroupResource. - /// An object representing collection of NetAppAccountResources and their operations over a NetAppAccountResource. - public virtual NetAppAccountCollection GetNetAppAccounts() - { - return GetCachedClient(Client => new NetAppAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppAccountResource.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppAccountResource.cs index 220b79542c63..7e3839356157 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppAccountResource.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppAccountResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CapacityPoolResources and their operations over a CapacityPoolResource. public virtual CapacityPoolCollection GetCapacityPools() { - return GetCachedClient(Client => new CapacityPoolCollection(Client, Id)); + return GetCachedClient(client => new CapacityPoolCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual CapacityPoolCollection GetCapacityPools() /// /// The name of the capacity pool. /// The cancellation token to use. - /// 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> GetCapacityPoolAsync(string poolName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetCapacityPoolAsync(s /// /// The name of the capacity pool. /// The cancellation token to use. - /// 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 GetCapacityPool(string poolName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetCapacityPool(string poolName, C /// An object representing collection of SnapshotPolicyResources and their operations over a SnapshotPolicyResource. public virtual SnapshotPolicyCollection GetSnapshotPolicies() { - return GetCachedClient(Client => new SnapshotPolicyCollection(Client, Id)); + return GetCachedClient(client => new SnapshotPolicyCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual SnapshotPolicyCollection GetSnapshotPolicies() /// /// The name of the snapshot policy. /// The cancellation token to use. - /// 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> GetSnapshotPolicyAsync(string snapshotPolicyName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetSnapshotPolicyAsy /// /// The name of the snapshot policy. /// The cancellation token to use. - /// 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 GetSnapshotPolicy(string snapshotPolicyName, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetSnapshotPolicy(string snapsho /// An object representing collection of NetAppBackupPolicyResources and their operations over a NetAppBackupPolicyResource. public virtual NetAppBackupPolicyCollection GetNetAppBackupPolicies() { - return GetCachedClient(Client => new NetAppBackupPolicyCollection(Client, Id)); + return GetCachedClient(client => new NetAppBackupPolicyCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual NetAppBackupPolicyCollection GetNetAppBackupPolicies() /// /// Backup policy Name which uniquely identify backup policy. /// The cancellation token to use. - /// 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> GetNetAppBackupPolicyAsync(string backupPolicyName, CancellationToken cancellationToken = default) { @@ -246,8 +246,8 @@ public virtual async Task> GetNetAppBackupP /// /// Backup policy Name which uniquely identify backup policy. /// The cancellation token to use. - /// 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 GetNetAppBackupPolicy(string backupPolicyName, CancellationToken cancellationToken = default) { @@ -258,7 +258,7 @@ public virtual Response GetNetAppBackupPolicy(string /// An object representing collection of NetAppVolumeGroupResources and their operations over a NetAppVolumeGroupResource. public virtual NetAppVolumeGroupCollection GetNetAppVolumeGroups() { - return GetCachedClient(Client => new NetAppVolumeGroupCollection(Client, Id)); + return GetCachedClient(client => new NetAppVolumeGroupCollection(client, Id)); } /// @@ -276,8 +276,8 @@ public virtual NetAppVolumeGroupCollection GetNetAppVolumeGroups() /// /// The name of the volumeGroup. /// The cancellation token to use. - /// 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> GetNetAppVolumeGroupAsync(string volumeGroupName, CancellationToken cancellationToken = default) { @@ -299,8 +299,8 @@ public virtual async Task> GetNetAppVolumeGr /// /// The name of the volumeGroup. /// The cancellation token to use. - /// 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 GetNetAppVolumeGroup(string volumeGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppVolumeResource.cs b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppVolumeResource.cs index c552ca0e9312..c1a4cf59431d 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppVolumeResource.cs +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Generated/NetAppVolumeResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetAppVolumeSnapshotResources and their operations over a NetAppVolumeSnapshotResource. public virtual NetAppVolumeSnapshotCollection GetNetAppVolumeSnapshots() { - return GetCachedClient(Client => new NetAppVolumeSnapshotCollection(Client, Id)); + return GetCachedClient(client => new NetAppVolumeSnapshotCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual NetAppVolumeSnapshotCollection GetNetAppVolumeSnapshots() /// /// The name of the snapshot. /// The cancellation token to use. - /// 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> GetNetAppVolumeSnapshotAsync(string snapshotName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetNetAppVolum /// /// The name of the snapshot. /// The cancellation token to use. - /// 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 GetNetAppVolumeSnapshot(string snapshotName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetNetAppVolumeSnapshot(st /// An object representing collection of NetAppVolumeQuotaRuleResources and their operations over a NetAppVolumeQuotaRuleResource. public virtual NetAppVolumeQuotaRuleCollection GetNetAppVolumeQuotaRules() { - return GetCachedClient(Client => new NetAppVolumeQuotaRuleCollection(Client, Id)); + return GetCachedClient(client => new NetAppVolumeQuotaRuleCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual NetAppVolumeQuotaRuleCollection GetNetAppVolumeQuotaRules() /// /// The name of volume quota rule. /// The cancellation token to use. - /// 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> GetNetAppVolumeQuotaRuleAsync(string volumeQuotaRuleName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> GetNetAppVolu /// /// The name of volume quota rule. /// The cancellation token to use. - /// 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 GetNetAppVolumeQuotaRule(string volumeQuotaRuleName, CancellationToken cancellationToken = default) { @@ -203,7 +203,7 @@ public virtual Response GetNetAppVolumeQuotaRule( /// An object representing collection of NetAppSubvolumeInfoResources and their operations over a NetAppSubvolumeInfoResource. public virtual NetAppSubvolumeInfoCollection GetNetAppSubvolumeInfos() { - return GetCachedClient(Client => new NetAppSubvolumeInfoCollection(Client, Id)); + return GetCachedClient(client => new NetAppSubvolumeInfoCollection(client, Id)); } /// @@ -221,8 +221,8 @@ public virtual NetAppSubvolumeInfoCollection GetNetAppSubvolumeInfos() /// /// The name of the subvolume. /// The cancellation token to use. - /// 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> GetNetAppSubvolumeInfoAsync(string subvolumeName, CancellationToken cancellationToken = default) { @@ -244,8 +244,8 @@ public virtual async Task> GetNetAppSubvol /// /// The name of the subvolume. /// The cancellation token to use. - /// 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 GetNetAppSubvolumeInfo(string subvolumeName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/AdminRuleGroupResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/AdminRuleGroupResource.cs index c79b3efe5803..332de50e10e2 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/AdminRuleGroupResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/AdminRuleGroupResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BaseAdminRuleResources and their operations over a BaseAdminRuleResource. public virtual BaseAdminRuleCollection GetBaseAdminRules() { - return GetCachedClient(Client => new BaseAdminRuleCollection(Client, Id)); + return GetCachedClient(client => new BaseAdminRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual BaseAdminRuleCollection GetBaseAdminRules() /// /// The name of the rule. /// The cancellation token to use. - /// 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> GetBaseAdminRuleAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetBaseAdminRuleAsync /// /// The name of the rule. /// The cancellation token to use. - /// 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 GetBaseAdminRule(string ruleName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ApplicationGatewayResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ApplicationGatewayResource.cs index 78051b280d1d..07bd8a681c9e 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ApplicationGatewayResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ApplicationGatewayResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ApplicationGatewayPrivateEndpointConnectionResources and their operations over a ApplicationGatewayPrivateEndpointConnectionResource. public virtual ApplicationGatewayPrivateEndpointConnectionCollection GetApplicationGatewayPrivateEndpointConnections() { - return GetCachedClient(Client => new ApplicationGatewayPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ApplicationGatewayPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual ApplicationGatewayPrivateEndpointConnectionCollection GetApplicat /// /// The name of the application gateway private endpoint connection. /// The cancellation token to use. - /// 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> GetApplicationGatewayPrivateEndpointConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// The name of the application gateway private endpoint connection. /// The cancellation token to use. - /// 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 GetApplicationGatewayPrivateEndpointConnection(string connectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitPeeringResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitPeeringResource.cs index cfe69db0150a..601778b7b1ba 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitPeeringResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitPeeringResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExpressRouteCircuitConnectionResources and their operations over a ExpressRouteCircuitConnectionResource. public virtual ExpressRouteCircuitConnectionCollection GetExpressRouteCircuitConnections() { - return GetCachedClient(Client => new ExpressRouteCircuitConnectionCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteCircuitConnectionCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual ExpressRouteCircuitConnectionCollection GetExpressRouteCircuitCon /// /// The name of the express route circuit connection. /// The cancellation token to use. - /// 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> GetExpressRouteCircuitConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetEx /// /// The name of the express route circuit connection. /// The cancellation token to use. - /// 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 GetExpressRouteCircuitConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetExpressRouteCi /// An object representing collection of PeerExpressRouteCircuitConnectionResources and their operations over a PeerExpressRouteCircuitConnectionResource. public virtual PeerExpressRouteCircuitConnectionCollection GetPeerExpressRouteCircuitConnections() { - return GetCachedClient(Client => new PeerExpressRouteCircuitConnectionCollection(Client, Id)); + return GetCachedClient(client => new PeerExpressRouteCircuitConnectionCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual PeerExpressRouteCircuitConnectionCollection GetPeerExpressRouteCi /// /// The name of the peer express route circuit connection. /// The cancellation token to use. - /// 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> GetPeerExpressRouteCircuitConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> G /// /// The name of the peer express route circuit connection. /// The cancellation token to use. - /// 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 GetPeerExpressRouteCircuitConnection(string connectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitResource.cs index 3c91b792152a..4ef304bc834f 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCircuitResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExpressRouteCircuitAuthorizationResources and their operations over a ExpressRouteCircuitAuthorizationResource. public virtual ExpressRouteCircuitAuthorizationCollection GetExpressRouteCircuitAuthorizations() { - return GetCachedClient(Client => new ExpressRouteCircuitAuthorizationCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteCircuitAuthorizationCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ExpressRouteCircuitAuthorizationCollection GetExpressRouteCircuit /// /// The name of the authorization. /// The cancellation token to use. - /// 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> GetExpressRouteCircuitAuthorizationAsync(string authorizationName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// The name of the authorization. /// The cancellation token to use. - /// 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 GetExpressRouteCircuitAuthorization(string authorizationName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetExpressRout /// An object representing collection of ExpressRouteCircuitPeeringResources and their operations over a ExpressRouteCircuitPeeringResource. public virtual ExpressRouteCircuitPeeringCollection GetExpressRouteCircuitPeerings() { - return GetCachedClient(Client => new ExpressRouteCircuitPeeringCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteCircuitPeeringCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ExpressRouteCircuitPeeringCollection GetExpressRouteCircuitPeerin /// /// The name of the peering. /// The cancellation token to use. - /// 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> GetExpressRouteCircuitPeeringAsync(string peeringName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetExpre /// /// The name of the peering. /// The cancellation token to use. - /// 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 GetExpressRouteCircuitPeering(string peeringName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCrossConnectionResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCrossConnectionResource.cs index 185a8249408c..515407f58cc5 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCrossConnectionResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteCrossConnectionResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExpressRouteCrossConnectionPeeringResources and their operations over a ExpressRouteCrossConnectionPeeringResource. public virtual ExpressRouteCrossConnectionPeeringCollection GetExpressRouteCrossConnectionPeerings() { - return GetCachedClient(Client => new ExpressRouteCrossConnectionPeeringCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteCrossConnectionPeeringCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ExpressRouteCrossConnectionPeeringCollection GetExpressRouteCross /// /// The name of the peering. /// The cancellation token to use. - /// 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> GetExpressRouteCrossConnectionPeeringAsync(string peeringName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> /// /// The name of the peering. /// The cancellation token to use. - /// 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 GetExpressRouteCrossConnectionPeering(string peeringName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteGatewayResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteGatewayResource.cs index 599c36e3546d..303b2cf8f2a0 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteGatewayResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRouteGatewayResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExpressRouteConnectionResources and their operations over a ExpressRouteConnectionResource. public virtual ExpressRouteConnectionCollection GetExpressRouteConnections() { - return GetCachedClient(Client => new ExpressRouteConnectionCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ExpressRouteConnectionCollection GetExpressRouteConnections() /// /// The name of the ExpressRoute connection. /// The cancellation token to use. - /// 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> GetExpressRouteConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetExpressRo /// /// The name of the ExpressRoute connection. /// The cancellation token to use. - /// 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 GetExpressRouteConnection(string connectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRoutePortResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRoutePortResource.cs index f76df3d25248..ada0f1977e44 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRoutePortResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ExpressRoutePortResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ExpressRouteLinkResources and their operations over a ExpressRouteLinkResource. public virtual ExpressRouteLinkCollection GetExpressRouteLinks() { - return GetCachedClient(Client => new ExpressRouteLinkCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteLinkCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ExpressRouteLinkCollection GetExpressRouteLinks() /// /// The name of the ExpressRouteLink resource. /// The cancellation token to use. - /// 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> GetExpressRouteLinkAsync(string linkName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetExpressRouteLin /// /// The name of the ExpressRouteLink resource. /// The cancellation token to use. - /// 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 GetExpressRouteLink(string linkName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetExpressRouteLink(string lin /// An object representing collection of ExpressRoutePortAuthorizationResources and their operations over a ExpressRoutePortAuthorizationResource. public virtual ExpressRoutePortAuthorizationCollection GetExpressRoutePortAuthorizations() { - return GetCachedClient(Client => new ExpressRoutePortAuthorizationCollection(Client, Id)); + return GetCachedClient(client => new ExpressRoutePortAuthorizationCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ExpressRoutePortAuthorizationCollection GetExpressRoutePortAuthor /// /// The name of the authorization. /// The cancellation token to use. - /// 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> GetExpressRoutePortAuthorizationAsync(string authorizationName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetEx /// /// The name of the authorization. /// The cancellation token to use. - /// 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 GetExpressRoutePortAuthorization(string authorizationName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs deleted file mode 100644 index d680f58f9dbd..000000000000 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Network -{ - /// A class to add extension methods to ManagementGroupResource. - internal partial class ManagementGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ManagementGroupResourceExtensionClient() - { - } - - /// 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 ManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ManagementGroupNetworkManagerConnectionResources in the ManagementGroupResource. - /// An object representing collection of ManagementGroupNetworkManagerConnectionResources and their operations over a ManagementGroupNetworkManagerConnectionResource. - public virtual ManagementGroupNetworkManagerConnectionCollection GetManagementGroupNetworkManagerConnections() - { - return GetCachedClient(Client => new ManagementGroupNetworkManagerConnectionCollection(Client, Id)); - } - } -} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkArmClientMockingExtension.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkArmClientMockingExtension.cs new file mode 100644 index 000000000000..3ccfeef623b2 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkArmClientMockingExtension.cs @@ -0,0 +1,1335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Network; + +namespace Azure.ResourceManager.Network.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NetworkArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkArmClientMockingExtension() + { + } + + /// 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 NetworkArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NetworkArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationGatewayResource GetApplicationGatewayResource(ResourceIdentifier id) + { + ApplicationGatewayResource.ValidateResourceId(id); + return new ApplicationGatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationGatewayPrivateEndpointConnectionResource GetApplicationGatewayPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ApplicationGatewayPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ApplicationGatewayPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationGatewayWafDynamicManifestResource GetApplicationGatewayWafDynamicManifestResource(ResourceIdentifier id) + { + ApplicationGatewayWafDynamicManifestResource.ValidateResourceId(id); + return new ApplicationGatewayWafDynamicManifestResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ApplicationSecurityGroupResource GetApplicationSecurityGroupResource(ResourceIdentifier id) + { + ApplicationSecurityGroupResource.ValidateResourceId(id); + return new ApplicationSecurityGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureFirewallResource GetAzureFirewallResource(ResourceIdentifier id) + { + AzureFirewallResource.ValidateResourceId(id); + return new AzureFirewallResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureWebCategoryResource GetAzureWebCategoryResource(ResourceIdentifier id) + { + AzureWebCategoryResource.ValidateResourceId(id); + return new AzureWebCategoryResource(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 BastionHostResource GetBastionHostResource(ResourceIdentifier id) + { + BastionHostResource.ValidateResourceId(id); + return new BastionHostResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteProviderPortResource GetExpressRouteProviderPortResource(ResourceIdentifier id) + { + ExpressRouteProviderPortResource.ValidateResourceId(id); + return new ExpressRouteProviderPortResource(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 CloudServiceSwapResource GetCloudServiceSwapResource(ResourceIdentifier id) + { + CloudServiceSwapResource.ValidateResourceId(id); + return new CloudServiceSwapResource(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 CustomIPPrefixResource GetCustomIPPrefixResource(ResourceIdentifier id) + { + CustomIPPrefixResource.ValidateResourceId(id); + return new CustomIPPrefixResource(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 DdosCustomPolicyResource GetDdosCustomPolicyResource(ResourceIdentifier id) + { + DdosCustomPolicyResource.ValidateResourceId(id); + return new DdosCustomPolicyResource(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 DdosProtectionPlanResource GetDdosProtectionPlanResource(ResourceIdentifier id) + { + DdosProtectionPlanResource.ValidateResourceId(id); + return new DdosProtectionPlanResource(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 DscpConfigurationResource GetDscpConfigurationResource(ResourceIdentifier id) + { + DscpConfigurationResource.ValidateResourceId(id); + return new DscpConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCircuitAuthorizationResource GetExpressRouteCircuitAuthorizationResource(ResourceIdentifier id) + { + ExpressRouteCircuitAuthorizationResource.ValidateResourceId(id); + return new ExpressRouteCircuitAuthorizationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCircuitPeeringResource GetExpressRouteCircuitPeeringResource(ResourceIdentifier id) + { + ExpressRouteCircuitPeeringResource.ValidateResourceId(id); + return new ExpressRouteCircuitPeeringResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCircuitConnectionResource GetExpressRouteCircuitConnectionResource(ResourceIdentifier id) + { + ExpressRouteCircuitConnectionResource.ValidateResourceId(id); + return new ExpressRouteCircuitConnectionResource(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 PeerExpressRouteCircuitConnectionResource GetPeerExpressRouteCircuitConnectionResource(ResourceIdentifier id) + { + PeerExpressRouteCircuitConnectionResource.ValidateResourceId(id); + return new PeerExpressRouteCircuitConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCircuitResource GetExpressRouteCircuitResource(ResourceIdentifier id) + { + ExpressRouteCircuitResource.ValidateResourceId(id); + return new ExpressRouteCircuitResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCrossConnectionResource GetExpressRouteCrossConnectionResource(ResourceIdentifier id) + { + ExpressRouteCrossConnectionResource.ValidateResourceId(id); + return new ExpressRouteCrossConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteCrossConnectionPeeringResource GetExpressRouteCrossConnectionPeeringResource(ResourceIdentifier id) + { + ExpressRouteCrossConnectionPeeringResource.ValidateResourceId(id); + return new ExpressRouteCrossConnectionPeeringResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRoutePortsLocationResource GetExpressRoutePortsLocationResource(ResourceIdentifier id) + { + ExpressRoutePortsLocationResource.ValidateResourceId(id); + return new ExpressRoutePortsLocationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRoutePortResource GetExpressRoutePortResource(ResourceIdentifier id) + { + ExpressRoutePortResource.ValidateResourceId(id); + return new ExpressRoutePortResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteLinkResource GetExpressRouteLinkResource(ResourceIdentifier id) + { + ExpressRouteLinkResource.ValidateResourceId(id); + return new ExpressRouteLinkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRoutePortAuthorizationResource GetExpressRoutePortAuthorizationResource(ResourceIdentifier id) + { + ExpressRoutePortAuthorizationResource.ValidateResourceId(id); + return new ExpressRoutePortAuthorizationResource(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 FirewallPolicyResource GetFirewallPolicyResource(ResourceIdentifier id) + { + FirewallPolicyResource.ValidateResourceId(id); + return new FirewallPolicyResource(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 FirewallPolicyRuleCollectionGroupResource GetFirewallPolicyRuleCollectionGroupResource(ResourceIdentifier id) + { + FirewallPolicyRuleCollectionGroupResource.ValidateResourceId(id); + return new FirewallPolicyRuleCollectionGroupResource(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 PolicySignaturesOverridesForIdpsResource GetPolicySignaturesOverridesForIdpsResource(ResourceIdentifier id) + { + PolicySignaturesOverridesForIdpsResource.ValidateResourceId(id); + return new PolicySignaturesOverridesForIdpsResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IPAllocationResource GetIPAllocationResource(ResourceIdentifier id) + { + IPAllocationResource.ValidateResourceId(id); + return new IPAllocationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IPGroupResource GetIPGroupResource(ResourceIdentifier id) + { + IPGroupResource.ValidateResourceId(id); + return new IPGroupResource(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 BackendAddressPoolResource GetBackendAddressPoolResource(ResourceIdentifier id) + { + BackendAddressPoolResource.ValidateResourceId(id); + return new BackendAddressPoolResource(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 FrontendIPConfigurationResource GetFrontendIPConfigurationResource(ResourceIdentifier id) + { + FrontendIPConfigurationResource.ValidateResourceId(id); + return new FrontendIPConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InboundNatRuleResource GetInboundNatRuleResource(ResourceIdentifier id) + { + InboundNatRuleResource.ValidateResourceId(id); + return new InboundNatRuleResource(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 LoadBalancingRuleResource GetLoadBalancingRuleResource(ResourceIdentifier id) + { + LoadBalancingRuleResource.ValidateResourceId(id); + return new LoadBalancingRuleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OutboundRuleResource GetOutboundRuleResource(ResourceIdentifier id) + { + OutboundRuleResource.ValidateResourceId(id); + return new OutboundRuleResource(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 ProbeResource GetProbeResource(ResourceIdentifier id) + { + ProbeResource.ValidateResourceId(id); + return new ProbeResource(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 NatGatewayResource GetNatGatewayResource(ResourceIdentifier id) + { + NatGatewayResource.ValidateResourceId(id); + return new NatGatewayResource(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 NetworkInterfaceResource GetNetworkInterfaceResource(ResourceIdentifier id) + { + NetworkInterfaceResource.ValidateResourceId(id); + return new NetworkInterfaceResource(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 NetworkInterfaceIPConfigurationResource GetNetworkInterfaceIPConfigurationResource(ResourceIdentifier id) + { + NetworkInterfaceIPConfigurationResource.ValidateResourceId(id); + return new NetworkInterfaceIPConfigurationResource(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 NetworkInterfaceTapConfigurationResource GetNetworkInterfaceTapConfigurationResource(ResourceIdentifier id) + { + NetworkInterfaceTapConfigurationResource.ValidateResourceId(id); + return new NetworkInterfaceTapConfigurationResource(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 NetworkManagerResource GetNetworkManagerResource(ResourceIdentifier id) + { + NetworkManagerResource.ValidateResourceId(id); + return new NetworkManagerResource(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 SubscriptionNetworkManagerConnectionResource GetSubscriptionNetworkManagerConnectionResource(ResourceIdentifier id) + { + SubscriptionNetworkManagerConnectionResource.ValidateResourceId(id); + return new SubscriptionNetworkManagerConnectionResource(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 ManagementGroupNetworkManagerConnectionResource GetManagementGroupNetworkManagerConnectionResource(ResourceIdentifier id) + { + ManagementGroupNetworkManagerConnectionResource.ValidateResourceId(id); + return new ManagementGroupNetworkManagerConnectionResource(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 ConnectivityConfigurationResource GetConnectivityConfigurationResource(ResourceIdentifier id) + { + ConnectivityConfigurationResource.ValidateResourceId(id); + return new ConnectivityConfigurationResource(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 NetworkGroupResource GetNetworkGroupResource(ResourceIdentifier id) + { + NetworkGroupResource.ValidateResourceId(id); + return new NetworkGroupResource(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 NetworkGroupStaticMemberResource GetNetworkGroupStaticMemberResource(ResourceIdentifier id) + { + NetworkGroupStaticMemberResource.ValidateResourceId(id); + return new NetworkGroupStaticMemberResource(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 ScopeConnectionResource GetScopeConnectionResource(ResourceIdentifier id) + { + ScopeConnectionResource.ValidateResourceId(id); + return new ScopeConnectionResource(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 SecurityAdminConfigurationResource GetSecurityAdminConfigurationResource(ResourceIdentifier id) + { + SecurityAdminConfigurationResource.ValidateResourceId(id); + return new SecurityAdminConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AdminRuleGroupResource GetAdminRuleGroupResource(ResourceIdentifier id) + { + AdminRuleGroupResource.ValidateResourceId(id); + return new AdminRuleGroupResource(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 BaseAdminRuleResource GetBaseAdminRuleResource(ResourceIdentifier id) + { + BaseAdminRuleResource.ValidateResourceId(id); + return new BaseAdminRuleResource(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 NetworkProfileResource GetNetworkProfileResource(ResourceIdentifier id) + { + NetworkProfileResource.ValidateResourceId(id); + return new NetworkProfileResource(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 NetworkSecurityGroupResource GetNetworkSecurityGroupResource(ResourceIdentifier id) + { + NetworkSecurityGroupResource.ValidateResourceId(id); + return new NetworkSecurityGroupResource(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 SecurityRuleResource GetSecurityRuleResource(ResourceIdentifier id) + { + SecurityRuleResource.ValidateResourceId(id); + return new SecurityRuleResource(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 DefaultSecurityRuleResource GetDefaultSecurityRuleResource(ResourceIdentifier id) + { + DefaultSecurityRuleResource.ValidateResourceId(id); + return new DefaultSecurityRuleResource(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 NetworkVirtualApplianceResource GetNetworkVirtualApplianceResource(ResourceIdentifier id) + { + NetworkVirtualApplianceResource.ValidateResourceId(id); + return new NetworkVirtualApplianceResource(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 VirtualApplianceSiteResource GetVirtualApplianceSiteResource(ResourceIdentifier id) + { + VirtualApplianceSiteResource.ValidateResourceId(id); + return new VirtualApplianceSiteResource(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 NetworkVirtualApplianceSkuResource GetNetworkVirtualApplianceSkuResource(ResourceIdentifier id) + { + NetworkVirtualApplianceSkuResource.ValidateResourceId(id); + return new NetworkVirtualApplianceSkuResource(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 NetworkWatcherResource GetNetworkWatcherResource(ResourceIdentifier id) + { + NetworkWatcherResource.ValidateResourceId(id); + return new NetworkWatcherResource(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 PacketCaptureResource GetPacketCaptureResource(ResourceIdentifier id) + { + PacketCaptureResource.ValidateResourceId(id); + return new PacketCaptureResource(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 ConnectionMonitorResource GetConnectionMonitorResource(ResourceIdentifier id) + { + ConnectionMonitorResource.ValidateResourceId(id); + return new ConnectionMonitorResource(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 FlowLogResource GetFlowLogResource(ResourceIdentifier id) + { + FlowLogResource.ValidateResourceId(id); + return new FlowLogResource(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 PrivateEndpointResource GetPrivateEndpointResource(ResourceIdentifier id) + { + PrivateEndpointResource.ValidateResourceId(id); + return new PrivateEndpointResource(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 PrivateDnsZoneGroupResource GetPrivateDnsZoneGroupResource(ResourceIdentifier id) + { + PrivateDnsZoneGroupResource.ValidateResourceId(id); + return new PrivateDnsZoneGroupResource(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 PrivateLinkServiceResource GetPrivateLinkServiceResource(ResourceIdentifier id) + { + PrivateLinkServiceResource.ValidateResourceId(id); + return new PrivateLinkServiceResource(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 NetworkPrivateEndpointConnectionResource GetNetworkPrivateEndpointConnectionResource(ResourceIdentifier id) + { + NetworkPrivateEndpointConnectionResource.ValidateResourceId(id); + return new NetworkPrivateEndpointConnectionResource(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 PublicIPAddressResource GetPublicIPAddressResource(ResourceIdentifier id) + { + PublicIPAddressResource.ValidateResourceId(id); + return new PublicIPAddressResource(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 PublicIPPrefixResource GetPublicIPPrefixResource(ResourceIdentifier id) + { + PublicIPPrefixResource.ValidateResourceId(id); + return new PublicIPPrefixResource(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 RouteFilterResource GetRouteFilterResource(ResourceIdentifier id) + { + RouteFilterResource.ValidateResourceId(id); + return new RouteFilterResource(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 RouteFilterRuleResource GetRouteFilterRuleResource(ResourceIdentifier id) + { + RouteFilterRuleResource.ValidateResourceId(id); + return new RouteFilterRuleResource(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 RouteTableResource GetRouteTableResource(ResourceIdentifier id) + { + RouteTableResource.ValidateResourceId(id); + return new RouteTableResource(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 RouteResource GetRouteResource(ResourceIdentifier id) + { + RouteResource.ValidateResourceId(id); + return new RouteResource(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 SecurityPartnerProviderResource GetSecurityPartnerProviderResource(ResourceIdentifier id) + { + SecurityPartnerProviderResource.ValidateResourceId(id); + return new SecurityPartnerProviderResource(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 ServiceEndpointPolicyResource GetServiceEndpointPolicyResource(ResourceIdentifier id) + { + ServiceEndpointPolicyResource.ValidateResourceId(id); + return new ServiceEndpointPolicyResource(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 ServiceEndpointPolicyDefinitionResource GetServiceEndpointPolicyDefinitionResource(ResourceIdentifier id) + { + ServiceEndpointPolicyDefinitionResource.ValidateResourceId(id); + return new ServiceEndpointPolicyDefinitionResource(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 VirtualNetworkResource GetVirtualNetworkResource(ResourceIdentifier id) + { + VirtualNetworkResource.ValidateResourceId(id); + return new VirtualNetworkResource(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 SubnetResource GetSubnetResource(ResourceIdentifier id) + { + SubnetResource.ValidateResourceId(id); + return new SubnetResource(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 VirtualNetworkPeeringResource GetVirtualNetworkPeeringResource(ResourceIdentifier id) + { + VirtualNetworkPeeringResource.ValidateResourceId(id); + return new VirtualNetworkPeeringResource(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 VirtualNetworkGatewayResource GetVirtualNetworkGatewayResource(ResourceIdentifier id) + { + VirtualNetworkGatewayResource.ValidateResourceId(id); + return new VirtualNetworkGatewayResource(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 VirtualNetworkGatewayConnectionResource GetVirtualNetworkGatewayConnectionResource(ResourceIdentifier id) + { + VirtualNetworkGatewayConnectionResource.ValidateResourceId(id); + return new VirtualNetworkGatewayConnectionResource(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 LocalNetworkGatewayResource GetLocalNetworkGatewayResource(ResourceIdentifier id) + { + LocalNetworkGatewayResource.ValidateResourceId(id); + return new LocalNetworkGatewayResource(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 VirtualNetworkGatewayNatRuleResource GetVirtualNetworkGatewayNatRuleResource(ResourceIdentifier id) + { + VirtualNetworkGatewayNatRuleResource.ValidateResourceId(id); + return new VirtualNetworkGatewayNatRuleResource(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 VirtualNetworkTapResource GetVirtualNetworkTapResource(ResourceIdentifier id) + { + VirtualNetworkTapResource.ValidateResourceId(id); + return new VirtualNetworkTapResource(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 VirtualRouterResource GetVirtualRouterResource(ResourceIdentifier id) + { + VirtualRouterResource.ValidateResourceId(id); + return new VirtualRouterResource(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 VirtualRouterPeeringResource GetVirtualRouterPeeringResource(ResourceIdentifier id) + { + VirtualRouterPeeringResource.ValidateResourceId(id); + return new VirtualRouterPeeringResource(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 VirtualWanResource GetVirtualWanResource(ResourceIdentifier id) + { + VirtualWanResource.ValidateResourceId(id); + return new VirtualWanResource(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 VpnSiteResource GetVpnSiteResource(ResourceIdentifier id) + { + VpnSiteResource.ValidateResourceId(id); + return new VpnSiteResource(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 VpnSiteLinkResource GetVpnSiteLinkResource(ResourceIdentifier id) + { + VpnSiteLinkResource.ValidateResourceId(id); + return new VpnSiteLinkResource(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 VpnServerConfigurationResource GetVpnServerConfigurationResource(ResourceIdentifier id) + { + VpnServerConfigurationResource.ValidateResourceId(id); + return new VpnServerConfigurationResource(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 VpnServerConfigurationPolicyGroupResource GetVpnServerConfigurationPolicyGroupResource(ResourceIdentifier id) + { + VpnServerConfigurationPolicyGroupResource.ValidateResourceId(id); + return new VpnServerConfigurationPolicyGroupResource(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 VirtualHubResource GetVirtualHubResource(ResourceIdentifier id) + { + VirtualHubResource.ValidateResourceId(id); + return new VirtualHubResource(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 RouteMapResource GetRouteMapResource(ResourceIdentifier id) + { + RouteMapResource.ValidateResourceId(id); + return new RouteMapResource(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 HubVirtualNetworkConnectionResource GetHubVirtualNetworkConnectionResource(ResourceIdentifier id) + { + HubVirtualNetworkConnectionResource.ValidateResourceId(id); + return new HubVirtualNetworkConnectionResource(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 VpnGatewayResource GetVpnGatewayResource(ResourceIdentifier id) + { + VpnGatewayResource.ValidateResourceId(id); + return new VpnGatewayResource(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 VpnConnectionResource GetVpnConnectionResource(ResourceIdentifier id) + { + VpnConnectionResource.ValidateResourceId(id); + return new VpnConnectionResource(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 VpnSiteLinkConnectionResource GetVpnSiteLinkConnectionResource(ResourceIdentifier id) + { + VpnSiteLinkConnectionResource.ValidateResourceId(id); + return new VpnSiteLinkConnectionResource(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 VpnGatewayNatRuleResource GetVpnGatewayNatRuleResource(ResourceIdentifier id) + { + VpnGatewayNatRuleResource.ValidateResourceId(id); + return new VpnGatewayNatRuleResource(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 P2SVpnGatewayResource GetP2SVpnGatewayResource(ResourceIdentifier id) + { + P2SVpnGatewayResource.ValidateResourceId(id); + return new P2SVpnGatewayResource(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 VirtualHubRouteTableV2Resource GetVirtualHubRouteTableV2Resource(ResourceIdentifier id) + { + VirtualHubRouteTableV2Resource.ValidateResourceId(id); + return new VirtualHubRouteTableV2Resource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteGatewayResource GetExpressRouteGatewayResource(ResourceIdentifier id) + { + ExpressRouteGatewayResource.ValidateResourceId(id); + return new ExpressRouteGatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExpressRouteConnectionResource GetExpressRouteConnectionResource(ResourceIdentifier id) + { + ExpressRouteConnectionResource.ValidateResourceId(id); + return new ExpressRouteConnectionResource(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 NetworkVirtualApplianceConnectionResource GetNetworkVirtualApplianceConnectionResource(ResourceIdentifier id) + { + NetworkVirtualApplianceConnectionResource.ValidateResourceId(id); + return new NetworkVirtualApplianceConnectionResource(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 BgpConnectionResource GetBgpConnectionResource(ResourceIdentifier id) + { + BgpConnectionResource.ValidateResourceId(id); + return new BgpConnectionResource(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 HubIPConfigurationResource GetHubIPConfigurationResource(ResourceIdentifier id) + { + HubIPConfigurationResource.ValidateResourceId(id); + return new HubIPConfigurationResource(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 HubRouteTableResource GetHubRouteTableResource(ResourceIdentifier id) + { + HubRouteTableResource.ValidateResourceId(id); + return new HubRouteTableResource(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 RoutingIntentResource GetRoutingIntentResource(ResourceIdentifier id) + { + RoutingIntentResource.ValidateResourceId(id); + return new RoutingIntentResource(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 WebApplicationFirewallPolicyResource GetWebApplicationFirewallPolicyResource(ResourceIdentifier id) + { + WebApplicationFirewallPolicyResource.ValidateResourceId(id); + return new WebApplicationFirewallPolicyResource(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 VirtualMachineScaleSetNetworkResource GetVirtualMachineScaleSetNetworkResource(ResourceIdentifier id) + { + VirtualMachineScaleSetNetworkResource.ValidateResourceId(id); + return new VirtualMachineScaleSetNetworkResource(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 VirtualMachineScaleSetVmNetworkResource GetVirtualMachineScaleSetVmNetworkResource(ResourceIdentifier id) + { + VirtualMachineScaleSetVmNetworkResource.ValidateResourceId(id); + return new VirtualMachineScaleSetVmNetworkResource(Client, id); + } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkExtensions.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkExtensions.cs index 4997a4ba859c..cc69f5ea81c9 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkExtensions.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.ManagementGroups; +using Azure.ResourceManager.Network.Mocking; using Azure.ResourceManager.Network.Models; using Azure.ResourceManager.Resources; @@ -20,2111 +21,1766 @@ namespace Azure.ResourceManager.Network /// A class to add extension methods to Azure.ResourceManager.Network. public static partial class NetworkExtensions { - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmResource resource) + private static NetworkArmClientMockingExtension GetNetworkArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ManagementGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NetworkArmClientMockingExtension(client0)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NetworkManagementGroupMockingExtension GetNetworkManagementGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ManagementGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NetworkManagementGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NetworkResourceGroupMockingExtension GetNetworkResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NetworkResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NetworkSubscriptionMockingExtension GetNetworkSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NetworkSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ApplicationGatewayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApplicationGatewayResource GetApplicationGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApplicationGatewayResource.ValidateResourceId(id); - return new ApplicationGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetApplicationGatewayResource(id); } - #endregion - #region ApplicationGatewayPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApplicationGatewayPrivateEndpointConnectionResource GetApplicationGatewayPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApplicationGatewayPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ApplicationGatewayPrivateEndpointConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetApplicationGatewayPrivateEndpointConnectionResource(id); } - #endregion - #region ApplicationGatewayWafDynamicManifestResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApplicationGatewayWafDynamicManifestResource GetApplicationGatewayWafDynamicManifestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApplicationGatewayWafDynamicManifestResource.ValidateResourceId(id); - return new ApplicationGatewayWafDynamicManifestResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetApplicationGatewayWafDynamicManifestResource(id); } - #endregion - #region ApplicationSecurityGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ApplicationSecurityGroupResource GetApplicationSecurityGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ApplicationSecurityGroupResource.ValidateResourceId(id); - return new ApplicationSecurityGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetApplicationSecurityGroupResource(id); } - #endregion - #region AzureFirewallResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureFirewallResource GetAzureFirewallResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureFirewallResource.ValidateResourceId(id); - return new AzureFirewallResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetAzureFirewallResource(id); } - #endregion - #region AzureWebCategoryResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureWebCategoryResource GetAzureWebCategoryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureWebCategoryResource.ValidateResourceId(id); - return new AzureWebCategoryResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetAzureWebCategoryResource(id); } - #endregion - #region BastionHostResource /// /// 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. /// Returns a object. public static BastionHostResource GetBastionHostResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BastionHostResource.ValidateResourceId(id); - return new BastionHostResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetBastionHostResource(id); } - #endregion - #region ExpressRouteProviderPortResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteProviderPortResource GetExpressRouteProviderPortResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteProviderPortResource.ValidateResourceId(id); - return new ExpressRouteProviderPortResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteProviderPortResource(id); } - #endregion - #region CloudServiceSwapResource /// /// 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. /// Returns a object. public static CloudServiceSwapResource GetCloudServiceSwapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceSwapResource.ValidateResourceId(id); - return new CloudServiceSwapResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetCloudServiceSwapResource(id); } - #endregion - #region CustomIPPrefixResource /// /// 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. /// Returns a object. public static CustomIPPrefixResource GetCustomIPPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CustomIPPrefixResource.ValidateResourceId(id); - return new CustomIPPrefixResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetCustomIPPrefixResource(id); } - #endregion - #region DdosCustomPolicyResource /// /// 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. /// Returns a object. public static DdosCustomPolicyResource GetDdosCustomPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DdosCustomPolicyResource.ValidateResourceId(id); - return new DdosCustomPolicyResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetDdosCustomPolicyResource(id); } - #endregion - #region DdosProtectionPlanResource /// /// 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. /// Returns a object. public static DdosProtectionPlanResource GetDdosProtectionPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DdosProtectionPlanResource.ValidateResourceId(id); - return new DdosProtectionPlanResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetDdosProtectionPlanResource(id); } - #endregion - #region DscpConfigurationResource /// /// 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. /// Returns a object. public static DscpConfigurationResource GetDscpConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DscpConfigurationResource.ValidateResourceId(id); - return new DscpConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetDscpConfigurationResource(id); } - #endregion - #region ExpressRouteCircuitAuthorizationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCircuitAuthorizationResource GetExpressRouteCircuitAuthorizationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCircuitAuthorizationResource.ValidateResourceId(id); - return new ExpressRouteCircuitAuthorizationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCircuitAuthorizationResource(id); } - #endregion - #region ExpressRouteCircuitPeeringResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCircuitPeeringResource GetExpressRouteCircuitPeeringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCircuitPeeringResource.ValidateResourceId(id); - return new ExpressRouteCircuitPeeringResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCircuitPeeringResource(id); } - #endregion - #region ExpressRouteCircuitConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCircuitConnectionResource GetExpressRouteCircuitConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCircuitConnectionResource.ValidateResourceId(id); - return new ExpressRouteCircuitConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCircuitConnectionResource(id); } - #endregion - #region PeerExpressRouteCircuitConnectionResource /// /// 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. /// Returns a object. public static PeerExpressRouteCircuitConnectionResource GetPeerExpressRouteCircuitConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeerExpressRouteCircuitConnectionResource.ValidateResourceId(id); - return new PeerExpressRouteCircuitConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPeerExpressRouteCircuitConnectionResource(id); } - #endregion - #region ExpressRouteCircuitResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCircuitResource GetExpressRouteCircuitResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCircuitResource.ValidateResourceId(id); - return new ExpressRouteCircuitResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCircuitResource(id); } - #endregion - #region ExpressRouteCrossConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCrossConnectionResource GetExpressRouteCrossConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCrossConnectionResource.ValidateResourceId(id); - return new ExpressRouteCrossConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCrossConnectionResource(id); } - #endregion - #region ExpressRouteCrossConnectionPeeringResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteCrossConnectionPeeringResource GetExpressRouteCrossConnectionPeeringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteCrossConnectionPeeringResource.ValidateResourceId(id); - return new ExpressRouteCrossConnectionPeeringResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteCrossConnectionPeeringResource(id); } - #endregion - #region ExpressRoutePortsLocationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRoutePortsLocationResource GetExpressRoutePortsLocationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRoutePortsLocationResource.ValidateResourceId(id); - return new ExpressRoutePortsLocationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRoutePortsLocationResource(id); } - #endregion - #region ExpressRoutePortResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRoutePortResource GetExpressRoutePortResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRoutePortResource.ValidateResourceId(id); - return new ExpressRoutePortResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRoutePortResource(id); } - #endregion - #region ExpressRouteLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteLinkResource GetExpressRouteLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteLinkResource.ValidateResourceId(id); - return new ExpressRouteLinkResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteLinkResource(id); } - #endregion - #region ExpressRoutePortAuthorizationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRoutePortAuthorizationResource GetExpressRoutePortAuthorizationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRoutePortAuthorizationResource.ValidateResourceId(id); - return new ExpressRoutePortAuthorizationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRoutePortAuthorizationResource(id); } - #endregion - #region FirewallPolicyResource /// /// 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. /// Returns a object. public static FirewallPolicyResource GetFirewallPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FirewallPolicyResource.ValidateResourceId(id); - return new FirewallPolicyResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetFirewallPolicyResource(id); } - #endregion - #region FirewallPolicyRuleCollectionGroupResource /// /// 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. /// Returns a object. public static FirewallPolicyRuleCollectionGroupResource GetFirewallPolicyRuleCollectionGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FirewallPolicyRuleCollectionGroupResource.ValidateResourceId(id); - return new FirewallPolicyRuleCollectionGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetFirewallPolicyRuleCollectionGroupResource(id); } - #endregion - #region PolicySignaturesOverridesForIdpsResource /// /// 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. /// Returns a object. public static PolicySignaturesOverridesForIdpsResource GetPolicySignaturesOverridesForIdpsResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PolicySignaturesOverridesForIdpsResource.ValidateResourceId(id); - return new PolicySignaturesOverridesForIdpsResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPolicySignaturesOverridesForIdpsResource(id); } - #endregion - #region IPAllocationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IPAllocationResource GetIPAllocationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IPAllocationResource.ValidateResourceId(id); - return new IPAllocationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetIPAllocationResource(id); } - #endregion - #region IPGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IPGroupResource GetIPGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IPGroupResource.ValidateResourceId(id); - return new IPGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetIPGroupResource(id); } - #endregion - #region LoadBalancerResource /// /// 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. /// Returns a object. public static LoadBalancerResource GetLoadBalancerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LoadBalancerResource.ValidateResourceId(id); - return new LoadBalancerResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetLoadBalancerResource(id); } - #endregion - #region BackendAddressPoolResource /// /// 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. /// Returns a object. public static BackendAddressPoolResource GetBackendAddressPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackendAddressPoolResource.ValidateResourceId(id); - return new BackendAddressPoolResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetBackendAddressPoolResource(id); } - #endregion - #region FrontendIPConfigurationResource /// /// 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. /// Returns a object. public static FrontendIPConfigurationResource GetFrontendIPConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontendIPConfigurationResource.ValidateResourceId(id); - return new FrontendIPConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetFrontendIPConfigurationResource(id); } - #endregion - #region InboundNatRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InboundNatRuleResource GetInboundNatRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InboundNatRuleResource.ValidateResourceId(id); - return new InboundNatRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetInboundNatRuleResource(id); } - #endregion - #region LoadBalancingRuleResource /// /// 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. /// Returns a object. public static LoadBalancingRuleResource GetLoadBalancingRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LoadBalancingRuleResource.ValidateResourceId(id); - return new LoadBalancingRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetLoadBalancingRuleResource(id); } - #endregion - #region OutboundRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OutboundRuleResource GetOutboundRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OutboundRuleResource.ValidateResourceId(id); - return new OutboundRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetOutboundRuleResource(id); } - #endregion - #region ProbeResource /// /// 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. /// Returns a object. public static ProbeResource GetProbeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProbeResource.ValidateResourceId(id); - return new ProbeResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetProbeResource(id); } - #endregion - #region NatGatewayResource /// /// 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. /// Returns a object. public static NatGatewayResource GetNatGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NatGatewayResource.ValidateResourceId(id); - return new NatGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNatGatewayResource(id); } - #endregion - #region NetworkInterfaceResource /// /// 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. /// Returns a object. public static NetworkInterfaceResource GetNetworkInterfaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkInterfaceResource.ValidateResourceId(id); - return new NetworkInterfaceResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkInterfaceResource(id); } - #endregion - #region NetworkInterfaceIPConfigurationResource /// /// 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. /// Returns a object. public static NetworkInterfaceIPConfigurationResource GetNetworkInterfaceIPConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkInterfaceIPConfigurationResource.ValidateResourceId(id); - return new NetworkInterfaceIPConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkInterfaceIPConfigurationResource(id); } - #endregion - #region NetworkInterfaceTapConfigurationResource /// /// 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. /// Returns a object. public static NetworkInterfaceTapConfigurationResource GetNetworkInterfaceTapConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkInterfaceTapConfigurationResource.ValidateResourceId(id); - return new NetworkInterfaceTapConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkInterfaceTapConfigurationResource(id); } - #endregion - #region NetworkManagerResource /// /// 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. /// Returns a object. public static NetworkManagerResource GetNetworkManagerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkManagerResource.ValidateResourceId(id); - return new NetworkManagerResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkManagerResource(id); } - #endregion - #region SubscriptionNetworkManagerConnectionResource /// /// 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. /// Returns a object. public static SubscriptionNetworkManagerConnectionResource GetSubscriptionNetworkManagerConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionNetworkManagerConnectionResource.ValidateResourceId(id); - return new SubscriptionNetworkManagerConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetSubscriptionNetworkManagerConnectionResource(id); } - #endregion - #region ManagementGroupNetworkManagerConnectionResource /// /// 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. /// Returns a object. public static ManagementGroupNetworkManagerConnectionResource GetManagementGroupNetworkManagerConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagementGroupNetworkManagerConnectionResource.ValidateResourceId(id); - return new ManagementGroupNetworkManagerConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetManagementGroupNetworkManagerConnectionResource(id); } - #endregion - #region ConnectivityConfigurationResource /// /// 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. /// Returns a object. public static ConnectivityConfigurationResource GetConnectivityConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectivityConfigurationResource.ValidateResourceId(id); - return new ConnectivityConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetConnectivityConfigurationResource(id); } - #endregion - #region NetworkGroupResource /// /// 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. /// Returns a object. public static NetworkGroupResource GetNetworkGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkGroupResource.ValidateResourceId(id); - return new NetworkGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkGroupResource(id); } - #endregion - #region NetworkGroupStaticMemberResource /// /// 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. /// Returns a object. public static NetworkGroupStaticMemberResource GetNetworkGroupStaticMemberResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkGroupStaticMemberResource.ValidateResourceId(id); - return new NetworkGroupStaticMemberResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkGroupStaticMemberResource(id); } - #endregion - #region ScopeConnectionResource /// /// 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. /// Returns a object. public static ScopeConnectionResource GetScopeConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScopeConnectionResource.ValidateResourceId(id); - return new ScopeConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetScopeConnectionResource(id); } - #endregion - #region SecurityAdminConfigurationResource /// /// 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. /// Returns a object. public static SecurityAdminConfigurationResource GetSecurityAdminConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityAdminConfigurationResource.ValidateResourceId(id); - return new SecurityAdminConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetSecurityAdminConfigurationResource(id); } - #endregion - #region AdminRuleGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AdminRuleGroupResource GetAdminRuleGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AdminRuleGroupResource.ValidateResourceId(id); - return new AdminRuleGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetAdminRuleGroupResource(id); } - #endregion - #region BaseAdminRuleResource /// /// 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. /// Returns a object. public static BaseAdminRuleResource GetBaseAdminRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BaseAdminRuleResource.ValidateResourceId(id); - return new BaseAdminRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetBaseAdminRuleResource(id); } - #endregion - #region NetworkProfileResource /// /// 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. /// Returns a object. public static NetworkProfileResource GetNetworkProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkProfileResource.ValidateResourceId(id); - return new NetworkProfileResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkProfileResource(id); } - #endregion - #region NetworkSecurityGroupResource /// /// 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. /// Returns a object. public static NetworkSecurityGroupResource GetNetworkSecurityGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkSecurityGroupResource.ValidateResourceId(id); - return new NetworkSecurityGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkSecurityGroupResource(id); } - #endregion - #region SecurityRuleResource /// /// 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. /// Returns a object. public static SecurityRuleResource GetSecurityRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityRuleResource.ValidateResourceId(id); - return new SecurityRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetSecurityRuleResource(id); } - #endregion - #region DefaultSecurityRuleResource /// /// 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. /// Returns a object. public static DefaultSecurityRuleResource GetDefaultSecurityRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DefaultSecurityRuleResource.ValidateResourceId(id); - return new DefaultSecurityRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetDefaultSecurityRuleResource(id); } - #endregion - #region NetworkVirtualApplianceResource /// /// 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. /// Returns a object. public static NetworkVirtualApplianceResource GetNetworkVirtualApplianceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkVirtualApplianceResource.ValidateResourceId(id); - return new NetworkVirtualApplianceResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkVirtualApplianceResource(id); } - #endregion - #region VirtualApplianceSiteResource /// /// 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. /// Returns a object. public static VirtualApplianceSiteResource GetVirtualApplianceSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualApplianceSiteResource.ValidateResourceId(id); - return new VirtualApplianceSiteResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualApplianceSiteResource(id); } - #endregion - #region NetworkVirtualApplianceSkuResource /// /// 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. /// Returns a object. public static NetworkVirtualApplianceSkuResource GetNetworkVirtualApplianceSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkVirtualApplianceSkuResource.ValidateResourceId(id); - return new NetworkVirtualApplianceSkuResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkVirtualApplianceSkuResource(id); } - #endregion - #region NetworkWatcherResource /// /// 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. /// Returns a object. public static NetworkWatcherResource GetNetworkWatcherResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkWatcherResource.ValidateResourceId(id); - return new NetworkWatcherResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkWatcherResource(id); } - #endregion - #region PacketCaptureResource /// /// 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. /// Returns a object. public static PacketCaptureResource GetPacketCaptureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PacketCaptureResource.ValidateResourceId(id); - return new PacketCaptureResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPacketCaptureResource(id); } - #endregion - #region ConnectionMonitorResource /// /// 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. /// Returns a object. public static ConnectionMonitorResource GetConnectionMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectionMonitorResource.ValidateResourceId(id); - return new ConnectionMonitorResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetConnectionMonitorResource(id); } - #endregion - #region FlowLogResource /// /// 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. /// Returns a object. public static FlowLogResource GetFlowLogResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FlowLogResource.ValidateResourceId(id); - return new FlowLogResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetFlowLogResource(id); } - #endregion - #region PrivateEndpointResource /// /// 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. /// Returns a object. public static PrivateEndpointResource GetPrivateEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateEndpointResource.ValidateResourceId(id); - return new PrivateEndpointResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPrivateEndpointResource(id); } - #endregion - #region PrivateDnsZoneGroupResource /// /// 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. /// Returns a object. public static PrivateDnsZoneGroupResource GetPrivateDnsZoneGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsZoneGroupResource.ValidateResourceId(id); - return new PrivateDnsZoneGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPrivateDnsZoneGroupResource(id); } - #endregion - #region PrivateLinkServiceResource /// /// 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. /// Returns a object. public static PrivateLinkServiceResource GetPrivateLinkServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateLinkServiceResource.ValidateResourceId(id); - return new PrivateLinkServiceResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPrivateLinkServiceResource(id); } - #endregion - #region NetworkPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static NetworkPrivateEndpointConnectionResource GetNetworkPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkPrivateEndpointConnectionResource.ValidateResourceId(id); - return new NetworkPrivateEndpointConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkPrivateEndpointConnectionResource(id); } - #endregion - #region PublicIPAddressResource /// /// 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. /// Returns a object. public static PublicIPAddressResource GetPublicIPAddressResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PublicIPAddressResource.ValidateResourceId(id); - return new PublicIPAddressResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPublicIPAddressResource(id); } - #endregion - #region PublicIPPrefixResource /// /// 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. /// Returns a object. public static PublicIPPrefixResource GetPublicIPPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PublicIPPrefixResource.ValidateResourceId(id); - return new PublicIPPrefixResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetPublicIPPrefixResource(id); } - #endregion - #region RouteFilterResource /// /// 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. /// Returns a object. public static RouteFilterResource GetRouteFilterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RouteFilterResource.ValidateResourceId(id); - return new RouteFilterResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRouteFilterResource(id); } - #endregion - #region RouteFilterRuleResource /// /// 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. /// Returns a object. public static RouteFilterRuleResource GetRouteFilterRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RouteFilterRuleResource.ValidateResourceId(id); - return new RouteFilterRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRouteFilterRuleResource(id); } - #endregion - #region RouteTableResource /// /// 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. /// Returns a object. public static RouteTableResource GetRouteTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RouteTableResource.ValidateResourceId(id); - return new RouteTableResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRouteTableResource(id); } - #endregion - #region RouteResource /// /// 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. /// Returns a object. public static RouteResource GetRouteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RouteResource.ValidateResourceId(id); - return new RouteResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRouteResource(id); } - #endregion - #region SecurityPartnerProviderResource /// /// 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. /// Returns a object. public static SecurityPartnerProviderResource GetSecurityPartnerProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityPartnerProviderResource.ValidateResourceId(id); - return new SecurityPartnerProviderResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetSecurityPartnerProviderResource(id); } - #endregion - #region ServiceEndpointPolicyResource /// /// 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. /// Returns a object. public static ServiceEndpointPolicyResource GetServiceEndpointPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceEndpointPolicyResource.ValidateResourceId(id); - return new ServiceEndpointPolicyResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetServiceEndpointPolicyResource(id); } - #endregion - #region ServiceEndpointPolicyDefinitionResource /// /// 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. /// Returns a object. public static ServiceEndpointPolicyDefinitionResource GetServiceEndpointPolicyDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceEndpointPolicyDefinitionResource.ValidateResourceId(id); - return new ServiceEndpointPolicyDefinitionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetServiceEndpointPolicyDefinitionResource(id); } - #endregion - #region VirtualNetworkResource /// /// 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. /// Returns a object. public static VirtualNetworkResource GetVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkResource.ValidateResourceId(id); - return new VirtualNetworkResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkResource(id); } - #endregion - #region SubnetResource /// /// 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. /// Returns a object. public static SubnetResource GetSubnetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubnetResource.ValidateResourceId(id); - return new SubnetResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetSubnetResource(id); } - #endregion - #region VirtualNetworkPeeringResource /// /// 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. /// Returns a object. public static VirtualNetworkPeeringResource GetVirtualNetworkPeeringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkPeeringResource.ValidateResourceId(id); - return new VirtualNetworkPeeringResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkPeeringResource(id); } - #endregion - #region VirtualNetworkGatewayResource /// /// 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. /// Returns a object. public static VirtualNetworkGatewayResource GetVirtualNetworkGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkGatewayResource.ValidateResourceId(id); - return new VirtualNetworkGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkGatewayResource(id); } - #endregion - #region VirtualNetworkGatewayConnectionResource /// /// 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. /// Returns a object. public static VirtualNetworkGatewayConnectionResource GetVirtualNetworkGatewayConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkGatewayConnectionResource.ValidateResourceId(id); - return new VirtualNetworkGatewayConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkGatewayConnectionResource(id); } - #endregion - #region LocalNetworkGatewayResource /// /// 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. /// Returns a object. public static LocalNetworkGatewayResource GetLocalNetworkGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalNetworkGatewayResource.ValidateResourceId(id); - return new LocalNetworkGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetLocalNetworkGatewayResource(id); } - #endregion - #region VirtualNetworkGatewayNatRuleResource /// /// 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. /// Returns a object. public static VirtualNetworkGatewayNatRuleResource GetVirtualNetworkGatewayNatRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkGatewayNatRuleResource.ValidateResourceId(id); - return new VirtualNetworkGatewayNatRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkGatewayNatRuleResource(id); } - #endregion - #region VirtualNetworkTapResource /// /// 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. /// Returns a object. public static VirtualNetworkTapResource GetVirtualNetworkTapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkTapResource.ValidateResourceId(id); - return new VirtualNetworkTapResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualNetworkTapResource(id); } - #endregion - #region VirtualRouterResource /// /// 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. /// Returns a object. public static VirtualRouterResource GetVirtualRouterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualRouterResource.ValidateResourceId(id); - return new VirtualRouterResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualRouterResource(id); } - #endregion - #region VirtualRouterPeeringResource /// /// 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. /// Returns a object. public static VirtualRouterPeeringResource GetVirtualRouterPeeringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualRouterPeeringResource.ValidateResourceId(id); - return new VirtualRouterPeeringResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualRouterPeeringResource(id); } - #endregion - #region VirtualWanResource /// /// 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. /// Returns a object. public static VirtualWanResource GetVirtualWanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualWanResource.ValidateResourceId(id); - return new VirtualWanResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualWanResource(id); } - #endregion - #region VpnSiteResource /// /// 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. /// Returns a object. public static VpnSiteResource GetVpnSiteResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnSiteResource.ValidateResourceId(id); - return new VpnSiteResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnSiteResource(id); } - #endregion - #region VpnSiteLinkResource /// /// 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. /// Returns a object. public static VpnSiteLinkResource GetVpnSiteLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnSiteLinkResource.ValidateResourceId(id); - return new VpnSiteLinkResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnSiteLinkResource(id); } - #endregion - #region VpnServerConfigurationResource /// /// 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. /// Returns a object. public static VpnServerConfigurationResource GetVpnServerConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnServerConfigurationResource.ValidateResourceId(id); - return new VpnServerConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnServerConfigurationResource(id); } - #endregion - #region VpnServerConfigurationPolicyGroupResource /// /// 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. /// Returns a object. public static VpnServerConfigurationPolicyGroupResource GetVpnServerConfigurationPolicyGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnServerConfigurationPolicyGroupResource.ValidateResourceId(id); - return new VpnServerConfigurationPolicyGroupResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnServerConfigurationPolicyGroupResource(id); } - #endregion - #region VirtualHubResource /// /// 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. /// Returns a object. public static VirtualHubResource GetVirtualHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualHubResource.ValidateResourceId(id); - return new VirtualHubResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualHubResource(id); } - #endregion - #region RouteMapResource /// /// 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. /// Returns a object. public static RouteMapResource GetRouteMapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RouteMapResource.ValidateResourceId(id); - return new RouteMapResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRouteMapResource(id); } - #endregion - #region HubVirtualNetworkConnectionResource /// /// 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. /// Returns a object. public static HubVirtualNetworkConnectionResource GetHubVirtualNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HubVirtualNetworkConnectionResource.ValidateResourceId(id); - return new HubVirtualNetworkConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetHubVirtualNetworkConnectionResource(id); } - #endregion - #region VpnGatewayResource /// /// 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. /// Returns a object. public static VpnGatewayResource GetVpnGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnGatewayResource.ValidateResourceId(id); - return new VpnGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnGatewayResource(id); } - #endregion - #region VpnConnectionResource /// /// 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. /// Returns a object. public static VpnConnectionResource GetVpnConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnConnectionResource.ValidateResourceId(id); - return new VpnConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnConnectionResource(id); } - #endregion - #region VpnSiteLinkConnectionResource /// /// 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. /// Returns a object. public static VpnSiteLinkConnectionResource GetVpnSiteLinkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnSiteLinkConnectionResource.ValidateResourceId(id); - return new VpnSiteLinkConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnSiteLinkConnectionResource(id); } - #endregion - #region VpnGatewayNatRuleResource /// /// 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. /// Returns a object. public static VpnGatewayNatRuleResource GetVpnGatewayNatRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VpnGatewayNatRuleResource.ValidateResourceId(id); - return new VpnGatewayNatRuleResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVpnGatewayNatRuleResource(id); } - #endregion - #region P2SVpnGatewayResource /// /// 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. /// Returns a object. public static P2SVpnGatewayResource GetP2SVpnGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - P2SVpnGatewayResource.ValidateResourceId(id); - return new P2SVpnGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetP2SVpnGatewayResource(id); } - #endregion - #region VirtualHubRouteTableV2Resource /// /// 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. /// Returns a object. public static VirtualHubRouteTableV2Resource GetVirtualHubRouteTableV2Resource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualHubRouteTableV2Resource.ValidateResourceId(id); - return new VirtualHubRouteTableV2Resource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualHubRouteTableV2Resource(id); } - #endregion - #region ExpressRouteGatewayResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteGatewayResource GetExpressRouteGatewayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteGatewayResource.ValidateResourceId(id); - return new ExpressRouteGatewayResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteGatewayResource(id); } - #endregion - #region ExpressRouteConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExpressRouteConnectionResource GetExpressRouteConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExpressRouteConnectionResource.ValidateResourceId(id); - return new ExpressRouteConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetExpressRouteConnectionResource(id); } - #endregion - #region NetworkVirtualApplianceConnectionResource /// /// 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. /// Returns a object. public static NetworkVirtualApplianceConnectionResource GetNetworkVirtualApplianceConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkVirtualApplianceConnectionResource.ValidateResourceId(id); - return new NetworkVirtualApplianceConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetNetworkVirtualApplianceConnectionResource(id); } - #endregion - #region BgpConnectionResource /// /// 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. /// Returns a object. public static BgpConnectionResource GetBgpConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BgpConnectionResource.ValidateResourceId(id); - return new BgpConnectionResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetBgpConnectionResource(id); } - #endregion - #region HubIPConfigurationResource /// /// 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. /// Returns a object. public static HubIPConfigurationResource GetHubIPConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HubIPConfigurationResource.ValidateResourceId(id); - return new HubIPConfigurationResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetHubIPConfigurationResource(id); } - #endregion - #region HubRouteTableResource /// /// 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. /// Returns a object. public static HubRouteTableResource GetHubRouteTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HubRouteTableResource.ValidateResourceId(id); - return new HubRouteTableResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetHubRouteTableResource(id); } - #endregion - #region RoutingIntentResource /// /// 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. /// Returns a object. public static RoutingIntentResource GetRoutingIntentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoutingIntentResource.ValidateResourceId(id); - return new RoutingIntentResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetRoutingIntentResource(id); } - #endregion - #region WebApplicationFirewallPolicyResource /// /// 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. /// Returns a object. public static WebApplicationFirewallPolicyResource GetWebApplicationFirewallPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WebApplicationFirewallPolicyResource.ValidateResourceId(id); - return new WebApplicationFirewallPolicyResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetWebApplicationFirewallPolicyResource(id); } - #endregion - #region VirtualMachineScaleSetNetworkResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetNetworkResource GetVirtualMachineScaleSetNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetNetworkResource.ValidateResourceId(id); - return new VirtualMachineScaleSetNetworkResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualMachineScaleSetNetworkResource(id); } - #endregion - #region VirtualMachineScaleSetVmNetworkResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetVmNetworkResource GetVirtualMachineScaleSetVmNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetVmNetworkResource.ValidateResourceId(id); - return new VirtualMachineScaleSetVmNetworkResource(client, id); - } - ); + return GetNetworkArmClientMockingExtension(client).GetVirtualMachineScaleSetVmNetworkResource(id); } - #endregion - /// Gets a collection of ManagementGroupNetworkManagerConnectionResources in the ManagementGroupResource. + /// + /// Gets a collection of ManagementGroupNetworkManagerConnectionResources in the ManagementGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagementGroupNetworkManagerConnectionResources and their operations over a ManagementGroupNetworkManagerConnectionResource. public static ManagementGroupNetworkManagerConnectionCollection GetManagementGroupNetworkManagerConnections(this ManagementGroupResource managementGroupResource) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetManagementGroupNetworkManagerConnections(); + return GetNetworkManagementGroupMockingExtension(managementGroupResource).GetManagementGroupNetworkManagerConnections(); } /// @@ -2139,16 +1795,20 @@ public static ManagementGroupNetworkManagerConnectionCollection GetManagementGro /// ManagementGroupNetworkManagerConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the network manager connection. /// The cancellation token to use. - /// 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 static async Task> GetManagementGroupNetworkManagerConnectionAsync(this ManagementGroupResource managementGroupResource, string networkManagerConnectionName, CancellationToken cancellationToken = default) { - return await managementGroupResource.GetManagementGroupNetworkManagerConnections().GetAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); + return await GetNetworkManagementGroupMockingExtension(managementGroupResource).GetManagementGroupNetworkManagerConnectionAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -2163,24 +1823,34 @@ public static async TaskManagementGroupNetworkManagerConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the network manager connection. /// The cancellation token to use. - /// 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 static Response GetManagementGroupNetworkManagerConnection(this ManagementGroupResource managementGroupResource, string networkManagerConnectionName, CancellationToken cancellationToken = default) { - return managementGroupResource.GetManagementGroupNetworkManagerConnections().Get(networkManagerConnectionName, cancellationToken); + return GetNetworkManagementGroupMockingExtension(managementGroupResource).GetManagementGroupNetworkManagerConnection(networkManagerConnectionName, cancellationToken); } - /// Gets a collection of ApplicationGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of ApplicationGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ApplicationGatewayResources and their operations over a ApplicationGatewayResource. public static ApplicationGatewayCollection GetApplicationGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApplicationGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationGateways(); } /// @@ -2195,16 +1865,20 @@ public static ApplicationGatewayCollection GetApplicationGateways(this ResourceG /// ApplicationGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application gateway. /// The cancellation token to use. - /// 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 static async Task> GetApplicationGatewayAsync(this ResourceGroupResource resourceGroupResource, string applicationGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetApplicationGateways().GetAsync(applicationGatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationGatewayAsync(applicationGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -2219,24 +1893,34 @@ public static async Task> GetApplicationGat /// ApplicationGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application gateway. /// The cancellation token to use. - /// 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 static Response GetApplicationGateway(this ResourceGroupResource resourceGroupResource, string applicationGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetApplicationGateways().Get(applicationGatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationGateway(applicationGatewayName, cancellationToken); } - /// Gets a collection of ApplicationSecurityGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of ApplicationSecurityGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ApplicationSecurityGroupResources and their operations over a ApplicationSecurityGroupResource. public static ApplicationSecurityGroupCollection GetApplicationSecurityGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetApplicationSecurityGroups(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationSecurityGroups(); } /// @@ -2251,16 +1935,20 @@ public static ApplicationSecurityGroupCollection GetApplicationSecurityGroups(th /// ApplicationSecurityGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application security group. /// The cancellation token to use. - /// 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 static async Task> GetApplicationSecurityGroupAsync(this ResourceGroupResource resourceGroupResource, string applicationSecurityGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetApplicationSecurityGroups().GetAsync(applicationSecurityGroupName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationSecurityGroupAsync(applicationSecurityGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -2275,24 +1963,34 @@ public static async Task> GetApplicat /// ApplicationSecurityGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application security group. /// The cancellation token to use. - /// 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 static Response GetApplicationSecurityGroup(this ResourceGroupResource resourceGroupResource, string applicationSecurityGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetApplicationSecurityGroups().Get(applicationSecurityGroupName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetApplicationSecurityGroup(applicationSecurityGroupName, cancellationToken); } - /// Gets a collection of AzureFirewallResources in the ResourceGroupResource. + /// + /// Gets a collection of AzureFirewallResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AzureFirewallResources and their operations over a AzureFirewallResource. public static AzureFirewallCollection GetAzureFirewalls(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzureFirewalls(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAzureFirewalls(); } /// @@ -2307,16 +2005,20 @@ public static AzureFirewallCollection GetAzureFirewalls(this ResourceGroupResour /// AzureFirewalls_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Firewall. /// The cancellation token to use. - /// 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 static async Task> GetAzureFirewallAsync(this ResourceGroupResource resourceGroupResource, string azureFirewallName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAzureFirewalls().GetAsync(azureFirewallName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAzureFirewallAsync(azureFirewallName, cancellationToken).ConfigureAwait(false); } /// @@ -2331,24 +2033,34 @@ public static async Task> GetAzureFirewallAsync( /// AzureFirewalls_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Firewall. /// The cancellation token to use. - /// 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 static Response GetAzureFirewall(this ResourceGroupResource resourceGroupResource, string azureFirewallName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAzureFirewalls().Get(azureFirewallName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAzureFirewall(azureFirewallName, cancellationToken); } - /// Gets a collection of BastionHostResources in the ResourceGroupResource. + /// + /// Gets a collection of BastionHostResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BastionHostResources and their operations over a BastionHostResource. public static BastionHostCollection GetBastionHosts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBastionHosts(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetBastionHosts(); } /// @@ -2363,16 +2075,20 @@ public static BastionHostCollection GetBastionHosts(this ResourceGroupResource r /// BastionHosts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bastion Host. /// The cancellation token to use. - /// 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 static async Task> GetBastionHostAsync(this ResourceGroupResource resourceGroupResource, string bastionHostName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBastionHosts().GetAsync(bastionHostName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetBastionHostAsync(bastionHostName, cancellationToken).ConfigureAwait(false); } /// @@ -2387,29 +2103,37 @@ public static async Task> GetBastionHostAsync(this /// BastionHosts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bastion Host. /// The cancellation token to use. - /// 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 static Response GetBastionHost(this ResourceGroupResource resourceGroupResource, string bastionHostName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBastionHosts().Get(bastionHostName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetBastionHost(bastionHostName, cancellationToken); } - /// Gets a collection of CloudServiceSwapResources in the ResourceGroupResource. + /// + /// Gets a collection of CloudServiceSwapResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the cloud service. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of CloudServiceSwapResources and their operations over a CloudServiceSwapResource. public static CloudServiceSwapCollection GetCloudServiceSwaps(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCloudServiceSwaps(resourceName); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCloudServiceSwaps(resourceName); } /// @@ -2424,16 +2148,20 @@ public static CloudServiceSwapCollection GetCloudServiceSwaps(this ResourceGroup /// VipSwap_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cloud service. /// The cancellation token to use. - /// 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 static async Task> GetCloudServiceSwapAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCloudServiceSwaps(resourceName).GetAsync(cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCloudServiceSwapAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -2448,24 +2176,34 @@ public static async Task> GetCloudServiceSwap /// VipSwap_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cloud service. /// The cancellation token to use. - /// 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 static Response GetCloudServiceSwap(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCloudServiceSwaps(resourceName).Get(cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCloudServiceSwap(resourceName, cancellationToken); } - /// Gets a collection of CustomIPPrefixResources in the ResourceGroupResource. + /// + /// Gets a collection of CustomIPPrefixResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CustomIPPrefixResources and their operations over a CustomIPPrefixResource. public static CustomIPPrefixCollection GetCustomIPPrefixes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCustomIPPrefixes(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCustomIPPrefixes(); } /// @@ -2480,17 +2218,21 @@ public static CustomIPPrefixCollection GetCustomIPPrefixes(this ResourceGroupRes /// CustomIPPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the custom IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetCustomIPPrefixAsync(this ResourceGroupResource resourceGroupResource, string customIPPrefixName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCustomIPPrefixes().GetAsync(customIPPrefixName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCustomIPPrefixAsync(customIPPrefixName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -2505,25 +2247,35 @@ public static async Task> GetCustomIPPrefixAsyn /// CustomIPPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the custom IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetCustomIPPrefix(this ResourceGroupResource resourceGroupResource, string customIPPrefixName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCustomIPPrefixes().Get(customIPPrefixName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetCustomIPPrefix(customIPPrefixName, expand, cancellationToken); } - /// Gets a collection of DdosCustomPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of DdosCustomPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DdosCustomPolicyResources and their operations over a DdosCustomPolicyResource. public static DdosCustomPolicyCollection GetDdosCustomPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDdosCustomPolicies(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosCustomPolicies(); } /// @@ -2538,16 +2290,20 @@ public static DdosCustomPolicyCollection GetDdosCustomPolicies(this ResourceGrou /// DdosCustomPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DDoS custom policy. /// The cancellation token to use. - /// 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 static async Task> GetDdosCustomPolicyAsync(this ResourceGroupResource resourceGroupResource, string ddosCustomPolicyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDdosCustomPolicies().GetAsync(ddosCustomPolicyName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosCustomPolicyAsync(ddosCustomPolicyName, cancellationToken).ConfigureAwait(false); } /// @@ -2562,24 +2318,34 @@ public static async Task> GetDdosCustomPolicy /// DdosCustomPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DDoS custom policy. /// The cancellation token to use. - /// 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 static Response GetDdosCustomPolicy(this ResourceGroupResource resourceGroupResource, string ddosCustomPolicyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDdosCustomPolicies().Get(ddosCustomPolicyName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosCustomPolicy(ddosCustomPolicyName, cancellationToken); } - /// Gets a collection of DdosProtectionPlanResources in the ResourceGroupResource. + /// + /// Gets a collection of DdosProtectionPlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DdosProtectionPlanResources and their operations over a DdosProtectionPlanResource. public static DdosProtectionPlanCollection GetDdosProtectionPlans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDdosProtectionPlans(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosProtectionPlans(); } /// @@ -2594,16 +2360,20 @@ public static DdosProtectionPlanCollection GetDdosProtectionPlans(this ResourceG /// DdosProtectionPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DDoS protection plan. /// The cancellation token to use. - /// 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 static async Task> GetDdosProtectionPlanAsync(this ResourceGroupResource resourceGroupResource, string ddosProtectionPlanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDdosProtectionPlans().GetAsync(ddosProtectionPlanName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosProtectionPlanAsync(ddosProtectionPlanName, cancellationToken).ConfigureAwait(false); } /// @@ -2618,24 +2388,34 @@ public static async Task> GetDdosProtection /// DdosProtectionPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DDoS protection plan. /// The cancellation token to use. - /// 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 static Response GetDdosProtectionPlan(this ResourceGroupResource resourceGroupResource, string ddosProtectionPlanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDdosProtectionPlans().Get(ddosProtectionPlanName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDdosProtectionPlan(ddosProtectionPlanName, cancellationToken); } - /// Gets a collection of DscpConfigurationResources in the ResourceGroupResource. + /// + /// Gets a collection of DscpConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DscpConfigurationResources and their operations over a DscpConfigurationResource. public static DscpConfigurationCollection GetDscpConfigurations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDscpConfigurations(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDscpConfigurations(); } /// @@ -2650,16 +2430,20 @@ public static DscpConfigurationCollection GetDscpConfigurations(this ResourceGro /// DscpConfiguration_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static async Task> GetDscpConfigurationAsync(this ResourceGroupResource resourceGroupResource, string dscpConfigurationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDscpConfigurations().GetAsync(dscpConfigurationName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDscpConfigurationAsync(dscpConfigurationName, cancellationToken).ConfigureAwait(false); } /// @@ -2674,24 +2458,34 @@ public static async Task> GetDscpConfigurati /// DscpConfiguration_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static Response GetDscpConfiguration(this ResourceGroupResource resourceGroupResource, string dscpConfigurationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDscpConfigurations().Get(dscpConfigurationName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetDscpConfiguration(dscpConfigurationName, cancellationToken); } - /// Gets a collection of ExpressRouteCircuitResources in the ResourceGroupResource. + /// + /// Gets a collection of ExpressRouteCircuitResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRouteCircuitResources and their operations over a ExpressRouteCircuitResource. public static ExpressRouteCircuitCollection GetExpressRouteCircuits(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExpressRouteCircuits(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCircuits(); } /// @@ -2706,16 +2500,20 @@ public static ExpressRouteCircuitCollection GetExpressRouteCircuits(this Resourc /// ExpressRouteCircuits_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of express route circuit. /// The cancellation token to use. - /// 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 static async Task> GetExpressRouteCircuitAsync(this ResourceGroupResource resourceGroupResource, string circuitName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetExpressRouteCircuits().GetAsync(circuitName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCircuitAsync(circuitName, cancellationToken).ConfigureAwait(false); } /// @@ -2730,24 +2528,34 @@ public static async Task> GetExpressRouteC /// ExpressRouteCircuits_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of express route circuit. /// The cancellation token to use. - /// 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 static Response GetExpressRouteCircuit(this ResourceGroupResource resourceGroupResource, string circuitName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetExpressRouteCircuits().Get(circuitName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCircuit(circuitName, cancellationToken); } - /// Gets a collection of ExpressRouteCrossConnectionResources in the ResourceGroupResource. + /// + /// Gets a collection of ExpressRouteCrossConnectionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRouteCrossConnectionResources and their operations over a ExpressRouteCrossConnectionResource. public static ExpressRouteCrossConnectionCollection GetExpressRouteCrossConnections(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExpressRouteCrossConnections(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCrossConnections(); } /// @@ -2762,16 +2570,20 @@ public static ExpressRouteCrossConnectionCollection GetExpressRouteCrossConnecti /// ExpressRouteCrossConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ExpressRouteCrossConnection (service key of the circuit). /// The cancellation token to use. - /// 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 static async Task> GetExpressRouteCrossConnectionAsync(this ResourceGroupResource resourceGroupResource, string crossConnectionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetExpressRouteCrossConnections().GetAsync(crossConnectionName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCrossConnectionAsync(crossConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -2786,24 +2598,34 @@ public static async Task> GetExpre /// ExpressRouteCrossConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ExpressRouteCrossConnection (service key of the circuit). /// The cancellation token to use. - /// 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 static Response GetExpressRouteCrossConnection(this ResourceGroupResource resourceGroupResource, string crossConnectionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetExpressRouteCrossConnections().Get(crossConnectionName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteCrossConnection(crossConnectionName, cancellationToken); } - /// Gets a collection of ExpressRoutePortResources in the ResourceGroupResource. + /// + /// Gets a collection of ExpressRoutePortResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRoutePortResources and their operations over a ExpressRoutePortResource. public static ExpressRoutePortCollection GetExpressRoutePorts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExpressRoutePorts(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRoutePorts(); } /// @@ -2818,16 +2640,20 @@ public static ExpressRoutePortCollection GetExpressRoutePorts(this ResourceGroup /// ExpressRoutePorts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of ExpressRoutePort. /// The cancellation token to use. - /// 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 static async Task> GetExpressRoutePortAsync(this ResourceGroupResource resourceGroupResource, string expressRoutePortName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetExpressRoutePorts().GetAsync(expressRoutePortName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRoutePortAsync(expressRoutePortName, cancellationToken).ConfigureAwait(false); } /// @@ -2842,24 +2668,34 @@ public static async Task> GetExpressRoutePort /// ExpressRoutePorts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of ExpressRoutePort. /// The cancellation token to use. - /// 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 static Response GetExpressRoutePort(this ResourceGroupResource resourceGroupResource, string expressRoutePortName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetExpressRoutePorts().Get(expressRoutePortName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRoutePort(expressRoutePortName, cancellationToken); } - /// Gets a collection of FirewallPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of FirewallPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FirewallPolicyResources and their operations over a FirewallPolicyResource. public static FirewallPolicyCollection GetFirewallPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFirewallPolicies(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetFirewallPolicies(); } /// @@ -2874,17 +2710,21 @@ public static FirewallPolicyCollection GetFirewallPolicies(this ResourceGroupRes /// FirewallPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Firewall Policy. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetFirewallPolicyAsync(this ResourceGroupResource resourceGroupResource, string firewallPolicyName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFirewallPolicies().GetAsync(firewallPolicyName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetFirewallPolicyAsync(firewallPolicyName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -2899,25 +2739,35 @@ public static async Task> GetFirewallPolicyAsyn /// FirewallPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Firewall Policy. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetFirewallPolicy(this ResourceGroupResource resourceGroupResource, string firewallPolicyName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFirewallPolicies().Get(firewallPolicyName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetFirewallPolicy(firewallPolicyName, expand, cancellationToken); } - /// Gets a collection of IPAllocationResources in the ResourceGroupResource. + /// + /// Gets a collection of IPAllocationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IPAllocationResources and their operations over a IPAllocationResource. public static IPAllocationCollection GetIPAllocations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIPAllocations(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPAllocations(); } /// @@ -2932,17 +2782,21 @@ public static IPAllocationCollection GetIPAllocations(this ResourceGroupResource /// IpAllocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IpAllocation. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetIPAllocationAsync(this ResourceGroupResource resourceGroupResource, string ipAllocationName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIPAllocations().GetAsync(ipAllocationName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPAllocationAsync(ipAllocationName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -2957,25 +2811,35 @@ public static async Task> GetIPAllocationAsync(th /// IpAllocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IpAllocation. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetIPAllocation(this ResourceGroupResource resourceGroupResource, string ipAllocationName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIPAllocations().Get(ipAllocationName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPAllocation(ipAllocationName, expand, cancellationToken); } - /// Gets a collection of IPGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of IPGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IPGroupResources and their operations over a IPGroupResource. public static IPGroupCollection GetIPGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIPGroups(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPGroups(); } /// @@ -2990,17 +2854,21 @@ public static IPGroupCollection GetIPGroups(this ResourceGroupResource resourceG /// IpGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ipGroups. /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. /// The cancellation token to use. - /// 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 static async Task> GetIPGroupAsync(this ResourceGroupResource resourceGroupResource, string ipGroupsName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIPGroups().GetAsync(ipGroupsName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPGroupAsync(ipGroupsName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3015,25 +2883,35 @@ public static async Task> GetIPGroupAsync(this Resourc /// IpGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ipGroups. /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. /// The cancellation token to use. - /// 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 static Response GetIPGroup(this ResourceGroupResource resourceGroupResource, string ipGroupsName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIPGroups().Get(ipGroupsName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetIPGroup(ipGroupsName, expand, cancellationToken); } - /// Gets a collection of LoadBalancerResources in the ResourceGroupResource. + /// + /// Gets a collection of LoadBalancerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. public static LoadBalancerCollection GetLoadBalancers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLoadBalancers(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLoadBalancers(); } /// @@ -3048,17 +2926,21 @@ public static LoadBalancerCollection GetLoadBalancers(this ResourceGroupResource /// LoadBalancers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the load balancer. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetLoadBalancerAsync(this ResourceGroupResource resourceGroupResource, string loadBalancerName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLoadBalancers().GetAsync(loadBalancerName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLoadBalancerAsync(loadBalancerName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3073,25 +2955,35 @@ public static async Task> GetLoadBalancerAsync(th /// LoadBalancers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the load balancer. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetLoadBalancer(this ResourceGroupResource resourceGroupResource, string loadBalancerName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLoadBalancers().Get(loadBalancerName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLoadBalancer(loadBalancerName, expand, cancellationToken); } - /// Gets a collection of NatGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of NatGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NatGatewayResources and their operations over a NatGatewayResource. public static NatGatewayCollection GetNatGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNatGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNatGateways(); } /// @@ -3106,17 +2998,21 @@ public static NatGatewayCollection GetNatGateways(this ResourceGroupResource res /// NatGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the nat gateway. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetNatGatewayAsync(this ResourceGroupResource resourceGroupResource, string natGatewayName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNatGateways().GetAsync(natGatewayName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNatGatewayAsync(natGatewayName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3131,25 +3027,35 @@ public static async Task> GetNatGatewayAsync(this R /// NatGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the nat gateway. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetNatGateway(this ResourceGroupResource resourceGroupResource, string natGatewayName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNatGateways().Get(natGatewayName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNatGateway(natGatewayName, expand, cancellationToken); } - /// Gets a collection of NetworkInterfaceResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkInterfaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkInterfaceResources and their operations over a NetworkInterfaceResource. public static NetworkInterfaceCollection GetNetworkInterfaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkInterfaces(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkInterfaces(); } /// @@ -3164,17 +3070,21 @@ public static NetworkInterfaceCollection GetNetworkInterfaces(this ResourceGroup /// NetworkInterfaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network interface. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetNetworkInterfaceAsync(this ResourceGroupResource resourceGroupResource, string networkInterfaceName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkInterfaces().GetAsync(networkInterfaceName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkInterfaceAsync(networkInterfaceName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3189,25 +3099,35 @@ public static async Task> GetNetworkInterface /// NetworkInterfaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network interface. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetNetworkInterface(this ResourceGroupResource resourceGroupResource, string networkInterfaceName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkInterfaces().Get(networkInterfaceName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkInterface(networkInterfaceName, expand, cancellationToken); } - /// Gets a collection of NetworkManagerResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkManagerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkManagerResources and their operations over a NetworkManagerResource. public static NetworkManagerCollection GetNetworkManagers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkManagers(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkManagers(); } /// @@ -3222,16 +3142,20 @@ public static NetworkManagerCollection GetNetworkManagers(this ResourceGroupReso /// NetworkManagers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network manager. /// The cancellation token to use. - /// 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 static async Task> GetNetworkManagerAsync(this ResourceGroupResource resourceGroupResource, string networkManagerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkManagers().GetAsync(networkManagerName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkManagerAsync(networkManagerName, cancellationToken).ConfigureAwait(false); } /// @@ -3246,24 +3170,34 @@ public static async Task> GetNetworkManagerAsyn /// NetworkManagers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network manager. /// The cancellation token to use. - /// 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 static Response GetNetworkManager(this ResourceGroupResource resourceGroupResource, string networkManagerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkManagers().Get(networkManagerName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkManager(networkManagerName, cancellationToken); } - /// Gets a collection of NetworkProfileResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkProfileResources and their operations over a NetworkProfileResource. public static NetworkProfileCollection GetNetworkProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkProfiles(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkProfiles(); } /// @@ -3278,17 +3212,21 @@ public static NetworkProfileCollection GetNetworkProfiles(this ResourceGroupReso /// NetworkProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetNetworkProfileAsync(this ResourceGroupResource resourceGroupResource, string networkProfileName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkProfiles().GetAsync(networkProfileName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkProfileAsync(networkProfileName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3303,25 +3241,35 @@ public static async Task> GetNetworkProfileAsyn /// NetworkProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetNetworkProfile(this ResourceGroupResource resourceGroupResource, string networkProfileName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkProfiles().Get(networkProfileName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkProfile(networkProfileName, expand, cancellationToken); } - /// Gets a collection of NetworkSecurityGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkSecurityGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkSecurityGroupResources and their operations over a NetworkSecurityGroupResource. public static NetworkSecurityGroupCollection GetNetworkSecurityGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkSecurityGroups(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkSecurityGroups(); } /// @@ -3336,17 +3284,21 @@ public static NetworkSecurityGroupCollection GetNetworkSecurityGroups(this Resou /// NetworkSecurityGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network security group. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetNetworkSecurityGroupAsync(this ResourceGroupResource resourceGroupResource, string networkSecurityGroupName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkSecurityGroups().GetAsync(networkSecurityGroupName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkSecurityGroupAsync(networkSecurityGroupName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3361,25 +3313,35 @@ public static async Task> GetNetworkSecur /// NetworkSecurityGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network security group. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetNetworkSecurityGroup(this ResourceGroupResource resourceGroupResource, string networkSecurityGroupName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkSecurityGroups().Get(networkSecurityGroupName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkSecurityGroup(networkSecurityGroupName, expand, cancellationToken); } - /// Gets a collection of NetworkVirtualApplianceResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkVirtualApplianceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkVirtualApplianceResources and their operations over a NetworkVirtualApplianceResource. public static NetworkVirtualApplianceCollection GetNetworkVirtualAppliances(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkVirtualAppliances(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkVirtualAppliances(); } /// @@ -3394,17 +3356,21 @@ public static NetworkVirtualApplianceCollection GetNetworkVirtualAppliances(this /// NetworkVirtualAppliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Network Virtual Appliance. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetNetworkVirtualApplianceAsync(this ResourceGroupResource resourceGroupResource, string networkVirtualApplianceName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkVirtualAppliances().GetAsync(networkVirtualApplianceName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkVirtualApplianceAsync(networkVirtualApplianceName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3419,25 +3385,35 @@ public static async Task> GetNetworkVi /// NetworkVirtualAppliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Network Virtual Appliance. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetNetworkVirtualAppliance(this ResourceGroupResource resourceGroupResource, string networkVirtualApplianceName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkVirtualAppliances().Get(networkVirtualApplianceName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkVirtualAppliance(networkVirtualApplianceName, expand, cancellationToken); } - /// Gets a collection of NetworkWatcherResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkWatcherResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkWatcherResources and their operations over a NetworkWatcherResource. public static NetworkWatcherCollection GetNetworkWatchers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkWatchers(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkWatchers(); } /// @@ -3452,16 +3428,20 @@ public static NetworkWatcherCollection GetNetworkWatchers(this ResourceGroupReso /// NetworkWatchers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network watcher. /// The cancellation token to use. - /// 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 static async Task> GetNetworkWatcherAsync(this ResourceGroupResource resourceGroupResource, string networkWatcherName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkWatchers().GetAsync(networkWatcherName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkWatcherAsync(networkWatcherName, cancellationToken).ConfigureAwait(false); } /// @@ -3476,24 +3456,34 @@ public static async Task> GetNetworkWatcherAsyn /// NetworkWatchers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the network watcher. /// The cancellation token to use. - /// 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 static Response GetNetworkWatcher(this ResourceGroupResource resourceGroupResource, string networkWatcherName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkWatchers().Get(networkWatcherName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetNetworkWatcher(networkWatcherName, cancellationToken); } - /// Gets a collection of PrivateEndpointResources in the ResourceGroupResource. + /// + /// Gets a collection of PrivateEndpointResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PrivateEndpointResources and their operations over a PrivateEndpointResource. public static PrivateEndpointCollection GetPrivateEndpoints(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPrivateEndpoints(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateEndpoints(); } /// @@ -3508,17 +3498,21 @@ public static PrivateEndpointCollection GetPrivateEndpoints(this ResourceGroupRe /// PrivateEndpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the private endpoint. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetPrivateEndpointAsync(this ResourceGroupResource resourceGroupResource, string privateEndpointName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPrivateEndpoints().GetAsync(privateEndpointName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateEndpointAsync(privateEndpointName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3533,25 +3527,35 @@ public static async Task> GetPrivateEndpointAs /// PrivateEndpoints_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the private endpoint. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetPrivateEndpoint(this ResourceGroupResource resourceGroupResource, string privateEndpointName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPrivateEndpoints().Get(privateEndpointName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateEndpoint(privateEndpointName, expand, cancellationToken); } - /// Gets a collection of PrivateLinkServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of PrivateLinkServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PrivateLinkServiceResources and their operations over a PrivateLinkServiceResource. public static PrivateLinkServiceCollection GetPrivateLinkServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPrivateLinkServices(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateLinkServices(); } /// @@ -3566,17 +3570,21 @@ public static PrivateLinkServiceCollection GetPrivateLinkServices(this ResourceG /// PrivateLinkServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the private link service. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetPrivateLinkServiceAsync(this ResourceGroupResource resourceGroupResource, string serviceName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPrivateLinkServices().GetAsync(serviceName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateLinkServiceAsync(serviceName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3591,25 +3599,35 @@ public static async Task> GetPrivateLinkSer /// PrivateLinkServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the private link service. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetPrivateLinkService(this ResourceGroupResource resourceGroupResource, string serviceName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPrivateLinkServices().Get(serviceName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPrivateLinkService(serviceName, expand, cancellationToken); } - /// Gets a collection of PublicIPAddressResources in the ResourceGroupResource. + /// + /// Gets a collection of PublicIPAddressResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PublicIPAddressResources and their operations over a PublicIPAddressResource. public static PublicIPAddressCollection GetPublicIPAddresses(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPublicIPAddresses(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPAddresses(); } /// @@ -3624,17 +3642,21 @@ public static PublicIPAddressCollection GetPublicIPAddresses(this ResourceGroupR /// PublicIPAddresses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP address. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetPublicIPAddressAsync(this ResourceGroupResource resourceGroupResource, string publicIPAddressName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPublicIPAddresses().GetAsync(publicIPAddressName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPAddressAsync(publicIPAddressName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3649,25 +3671,35 @@ public static async Task> GetPublicIPAddressAs /// PublicIPAddresses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP address. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetPublicIPAddress(this ResourceGroupResource resourceGroupResource, string publicIPAddressName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPublicIPAddresses().Get(publicIPAddressName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPAddress(publicIPAddressName, expand, cancellationToken); } - /// Gets a collection of PublicIPPrefixResources in the ResourceGroupResource. + /// + /// Gets a collection of PublicIPPrefixResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PublicIPPrefixResources and their operations over a PublicIPPrefixResource. public static PublicIPPrefixCollection GetPublicIPPrefixes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPublicIPPrefixes(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPPrefixes(); } /// @@ -3682,17 +3714,21 @@ public static PublicIPPrefixCollection GetPublicIPPrefixes(this ResourceGroupRes /// PublicIPPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetPublicIPPrefixAsync(this ResourceGroupResource resourceGroupResource, string publicIPPrefixName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPublicIPPrefixes().GetAsync(publicIPPrefixName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPPrefixAsync(publicIPPrefixName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3707,25 +3743,35 @@ public static async Task> GetPublicIPPrefixAsyn /// PublicIPPrefixes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the public IP prefix. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetPublicIPPrefix(this ResourceGroupResource resourceGroupResource, string publicIPPrefixName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPublicIPPrefixes().Get(publicIPPrefixName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetPublicIPPrefix(publicIPPrefixName, expand, cancellationToken); } - /// Gets a collection of RouteFilterResources in the ResourceGroupResource. + /// + /// Gets a collection of RouteFilterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RouteFilterResources and their operations over a RouteFilterResource. public static RouteFilterCollection GetRouteFilters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRouteFilters(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteFilters(); } /// @@ -3740,17 +3786,21 @@ public static RouteFilterCollection GetRouteFilters(this ResourceGroupResource r /// RouteFilters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the route filter. /// Expands referenced express route bgp peering resources. /// The cancellation token to use. - /// 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 static async Task> GetRouteFilterAsync(this ResourceGroupResource resourceGroupResource, string routeFilterName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRouteFilters().GetAsync(routeFilterName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteFilterAsync(routeFilterName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3765,25 +3815,35 @@ public static async Task> GetRouteFilterAsync(this /// RouteFilters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the route filter. /// Expands referenced express route bgp peering resources. /// The cancellation token to use. - /// 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 static Response GetRouteFilter(this ResourceGroupResource resourceGroupResource, string routeFilterName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRouteFilters().Get(routeFilterName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteFilter(routeFilterName, expand, cancellationToken); } - /// Gets a collection of RouteTableResources in the ResourceGroupResource. + /// + /// Gets a collection of RouteTableResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RouteTableResources and their operations over a RouteTableResource. public static RouteTableCollection GetRouteTables(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRouteTables(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteTables(); } /// @@ -3798,17 +3858,21 @@ public static RouteTableCollection GetRouteTables(this ResourceGroupResource res /// RouteTables_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the route table. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetRouteTableAsync(this ResourceGroupResource resourceGroupResource, string routeTableName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRouteTables().GetAsync(routeTableName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteTableAsync(routeTableName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3823,25 +3887,35 @@ public static async Task> GetRouteTableAsync(this R /// RouteTables_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the route table. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetRouteTable(this ResourceGroupResource resourceGroupResource, string routeTableName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRouteTables().Get(routeTableName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetRouteTable(routeTableName, expand, cancellationToken); } - /// Gets a collection of SecurityPartnerProviderResources in the ResourceGroupResource. + /// + /// Gets a collection of SecurityPartnerProviderResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityPartnerProviderResources and their operations over a SecurityPartnerProviderResource. public static SecurityPartnerProviderCollection GetSecurityPartnerProviders(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecurityPartnerProviders(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetSecurityPartnerProviders(); } /// @@ -3856,16 +3930,20 @@ public static SecurityPartnerProviderCollection GetSecurityPartnerProviders(this /// SecurityPartnerProviders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Security Partner Provider. /// The cancellation token to use. - /// 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 static async Task> GetSecurityPartnerProviderAsync(this ResourceGroupResource resourceGroupResource, string securityPartnerProviderName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSecurityPartnerProviders().GetAsync(securityPartnerProviderName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetSecurityPartnerProviderAsync(securityPartnerProviderName, cancellationToken).ConfigureAwait(false); } /// @@ -3880,24 +3958,34 @@ public static async Task> GetSecurityP /// SecurityPartnerProviders_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Security Partner Provider. /// The cancellation token to use. - /// 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 static Response GetSecurityPartnerProvider(this ResourceGroupResource resourceGroupResource, string securityPartnerProviderName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSecurityPartnerProviders().Get(securityPartnerProviderName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetSecurityPartnerProvider(securityPartnerProviderName, cancellationToken); } - /// Gets a collection of ServiceEndpointPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of ServiceEndpointPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceEndpointPolicyResources and their operations over a ServiceEndpointPolicyResource. public static ServiceEndpointPolicyCollection GetServiceEndpointPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetServiceEndpointPolicies(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetServiceEndpointPolicies(); } /// @@ -3912,17 +4000,21 @@ public static ServiceEndpointPolicyCollection GetServiceEndpointPolicies(this Re /// ServiceEndpointPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the service endpoint policy. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetServiceEndpointPolicyAsync(this ResourceGroupResource resourceGroupResource, string serviceEndpointPolicyName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetServiceEndpointPolicies().GetAsync(serviceEndpointPolicyName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetServiceEndpointPolicyAsync(serviceEndpointPolicyName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3937,25 +4029,35 @@ public static async Task> GetServiceEndp /// ServiceEndpointPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the service endpoint policy. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetServiceEndpointPolicy(this ResourceGroupResource resourceGroupResource, string serviceEndpointPolicyName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetServiceEndpointPolicies().Get(serviceEndpointPolicyName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetServiceEndpointPolicy(serviceEndpointPolicyName, expand, cancellationToken); } - /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. public static VirtualNetworkCollection GetVirtualNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualNetworks(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworks(); } /// @@ -3970,17 +4072,21 @@ public static VirtualNetworkCollection GetVirtualNetworks(this ResourceGroupReso /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetVirtualNetworkAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualNetworks().GetAsync(virtualNetworkName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkAsync(virtualNetworkName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -3995,25 +4101,35 @@ public static async Task> GetVirtualNetworkAsyn /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetVirtualNetwork(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualNetworks().Get(virtualNetworkName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetwork(virtualNetworkName, expand, cancellationToken); } - /// Gets a collection of VirtualNetworkGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualNetworkGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualNetworkGatewayResources and their operations over a VirtualNetworkGatewayResource. public static VirtualNetworkGatewayCollection GetVirtualNetworkGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualNetworkGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGateways(); } /// @@ -4028,16 +4144,20 @@ public static VirtualNetworkGatewayCollection GetVirtualNetworkGateways(this Res /// VirtualNetworkGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network gateway. /// The cancellation token to use. - /// 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 static async Task> GetVirtualNetworkGatewayAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualNetworkGateways().GetAsync(virtualNetworkGatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGatewayAsync(virtualNetworkGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -4052,24 +4172,34 @@ public static async Task> GetVirtualNetw /// VirtualNetworkGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network gateway. /// The cancellation token to use. - /// 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 static Response GetVirtualNetworkGateway(this ResourceGroupResource resourceGroupResource, string virtualNetworkGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualNetworkGateways().Get(virtualNetworkGatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGateway(virtualNetworkGatewayName, cancellationToken); } - /// Gets a collection of VirtualNetworkGatewayConnectionResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualNetworkGatewayConnectionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualNetworkGatewayConnectionResources and their operations over a VirtualNetworkGatewayConnectionResource. public static VirtualNetworkGatewayConnectionCollection GetVirtualNetworkGatewayConnections(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualNetworkGatewayConnections(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGatewayConnections(); } /// @@ -4084,16 +4214,20 @@ public static VirtualNetworkGatewayConnectionCollection GetVirtualNetworkGateway /// VirtualNetworkGatewayConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network gateway connection. /// The cancellation token to use. - /// 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 static async Task> GetVirtualNetworkGatewayConnectionAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualNetworkGatewayConnections().GetAsync(virtualNetworkGatewayConnectionName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGatewayConnectionAsync(virtualNetworkGatewayConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -4108,24 +4242,34 @@ public static async Task> GetV /// VirtualNetworkGatewayConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual network gateway connection. /// The cancellation token to use. - /// 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 static Response GetVirtualNetworkGatewayConnection(this ResourceGroupResource resourceGroupResource, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualNetworkGatewayConnections().Get(virtualNetworkGatewayConnectionName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkGatewayConnection(virtualNetworkGatewayConnectionName, cancellationToken); } - /// Gets a collection of LocalNetworkGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of LocalNetworkGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LocalNetworkGatewayResources and their operations over a LocalNetworkGatewayResource. public static LocalNetworkGatewayCollection GetLocalNetworkGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLocalNetworkGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLocalNetworkGateways(); } /// @@ -4140,16 +4284,20 @@ public static LocalNetworkGatewayCollection GetLocalNetworkGateways(this Resourc /// LocalNetworkGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the local network gateway. /// The cancellation token to use. - /// 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 static async Task> GetLocalNetworkGatewayAsync(this ResourceGroupResource resourceGroupResource, string localNetworkGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLocalNetworkGateways().GetAsync(localNetworkGatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLocalNetworkGatewayAsync(localNetworkGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -4164,24 +4312,34 @@ public static async Task> GetLocalNetworkG /// LocalNetworkGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the local network gateway. /// The cancellation token to use. - /// 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 static Response GetLocalNetworkGateway(this ResourceGroupResource resourceGroupResource, string localNetworkGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLocalNetworkGateways().Get(localNetworkGatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetLocalNetworkGateway(localNetworkGatewayName, cancellationToken); } - /// Gets a collection of VirtualNetworkTapResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualNetworkTapResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualNetworkTapResources and their operations over a VirtualNetworkTapResource. public static VirtualNetworkTapCollection GetVirtualNetworkTaps(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualNetworkTaps(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkTaps(); } /// @@ -4196,16 +4354,20 @@ public static VirtualNetworkTapCollection GetVirtualNetworkTaps(this ResourceGro /// VirtualNetworkTaps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of virtual network tap. /// The cancellation token to use. - /// 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 static async Task> GetVirtualNetworkTapAsync(this ResourceGroupResource resourceGroupResource, string tapName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualNetworkTaps().GetAsync(tapName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkTapAsync(tapName, cancellationToken).ConfigureAwait(false); } /// @@ -4220,24 +4382,34 @@ public static async Task> GetVirtualNetworkT /// VirtualNetworkTaps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of virtual network tap. /// The cancellation token to use. - /// 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 static Response GetVirtualNetworkTap(this ResourceGroupResource resourceGroupResource, string tapName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualNetworkTaps().Get(tapName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkTap(tapName, cancellationToken); } - /// Gets a collection of VirtualRouterResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualRouterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualRouterResources and their operations over a VirtualRouterResource. public static VirtualRouterCollection GetVirtualRouters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualRouters(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualRouters(); } /// @@ -4252,17 +4424,21 @@ public static VirtualRouterCollection GetVirtualRouters(this ResourceGroupResour /// VirtualRouters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Virtual Router. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static async Task> GetVirtualRouterAsync(this ResourceGroupResource resourceGroupResource, string virtualRouterName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualRouters().GetAsync(virtualRouterName, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualRouterAsync(virtualRouterName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -4277,25 +4453,35 @@ public static async Task> GetVirtualRouterAsync( /// VirtualRouters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Virtual Router. /// Expands referenced resources. /// The cancellation token to use. - /// 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 static Response GetVirtualRouter(this ResourceGroupResource resourceGroupResource, string virtualRouterName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualRouters().Get(virtualRouterName, expand, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualRouter(virtualRouterName, expand, cancellationToken); } - /// Gets a collection of VirtualWanResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualWanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualWanResources and their operations over a VirtualWanResource. public static VirtualWanCollection GetVirtualWans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualWans(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualWans(); } /// @@ -4310,16 +4496,20 @@ public static VirtualWanCollection GetVirtualWans(this ResourceGroupResource res /// VirtualWans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VirtualWAN being retrieved. /// The cancellation token to use. - /// 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 static async Task> GetVirtualWanAsync(this ResourceGroupResource resourceGroupResource, string virtualWanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualWans().GetAsync(virtualWanName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualWanAsync(virtualWanName, cancellationToken).ConfigureAwait(false); } /// @@ -4334,24 +4524,34 @@ public static async Task> GetVirtualWanAsync(this R /// VirtualWans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VirtualWAN being retrieved. /// The cancellation token to use. - /// 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 static Response GetVirtualWan(this ResourceGroupResource resourceGroupResource, string virtualWanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualWans().Get(virtualWanName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualWan(virtualWanName, cancellationToken); } - /// Gets a collection of VpnSiteResources in the ResourceGroupResource. + /// + /// Gets a collection of VpnSiteResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VpnSiteResources and their operations over a VpnSiteResource. public static VpnSiteCollection GetVpnSites(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVpnSites(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnSites(); } /// @@ -4366,16 +4566,20 @@ public static VpnSiteCollection GetVpnSites(this ResourceGroupResource resourceG /// VpnSites_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VpnSite being retrieved. /// The cancellation token to use. - /// 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 static async Task> GetVpnSiteAsync(this ResourceGroupResource resourceGroupResource, string vpnSiteName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVpnSites().GetAsync(vpnSiteName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnSiteAsync(vpnSiteName, cancellationToken).ConfigureAwait(false); } /// @@ -4390,24 +4594,34 @@ public static async Task> GetVpnSiteAsync(this Resourc /// VpnSites_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VpnSite being retrieved. /// The cancellation token to use. - /// 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 static Response GetVpnSite(this ResourceGroupResource resourceGroupResource, string vpnSiteName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVpnSites().Get(vpnSiteName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnSite(vpnSiteName, cancellationToken); } - /// Gets a collection of VpnServerConfigurationResources in the ResourceGroupResource. + /// + /// Gets a collection of VpnServerConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VpnServerConfigurationResources and their operations over a VpnServerConfigurationResource. public static VpnServerConfigurationCollection GetVpnServerConfigurations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVpnServerConfigurations(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnServerConfigurations(); } /// @@ -4422,16 +4636,20 @@ public static VpnServerConfigurationCollection GetVpnServerConfigurations(this R /// VpnServerConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VpnServerConfiguration being retrieved. /// The cancellation token to use. - /// 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 static async Task> GetVpnServerConfigurationAsync(this ResourceGroupResource resourceGroupResource, string vpnServerConfigurationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVpnServerConfigurations().GetAsync(vpnServerConfigurationName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnServerConfigurationAsync(vpnServerConfigurationName, cancellationToken).ConfigureAwait(false); } /// @@ -4446,24 +4664,34 @@ public static async Task> GetVpnServerC /// VpnServerConfigurations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VpnServerConfiguration being retrieved. /// The cancellation token to use. - /// 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 static Response GetVpnServerConfiguration(this ResourceGroupResource resourceGroupResource, string vpnServerConfigurationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVpnServerConfigurations().Get(vpnServerConfigurationName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnServerConfiguration(vpnServerConfigurationName, cancellationToken); } - /// Gets a collection of VirtualHubResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualHubResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualHubResources and their operations over a VirtualHubResource. public static VirtualHubCollection GetVirtualHubs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualHubs(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualHubs(); } /// @@ -4478,16 +4706,20 @@ public static VirtualHubCollection GetVirtualHubs(this ResourceGroupResource res /// VirtualHubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VirtualHub. /// The cancellation token to use. - /// 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 static async Task> GetVirtualHubAsync(this ResourceGroupResource resourceGroupResource, string virtualHubName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualHubs().GetAsync(virtualHubName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualHubAsync(virtualHubName, cancellationToken).ConfigureAwait(false); } /// @@ -4502,24 +4734,34 @@ public static async Task> GetVirtualHubAsync(this R /// VirtualHubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VirtualHub. /// The cancellation token to use. - /// 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 static Response GetVirtualHub(this ResourceGroupResource resourceGroupResource, string virtualHubName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualHubs().Get(virtualHubName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVirtualHub(virtualHubName, cancellationToken); } - /// Gets a collection of VpnGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of VpnGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VpnGatewayResources and their operations over a VpnGatewayResource. public static VpnGatewayCollection GetVpnGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVpnGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnGateways(); } /// @@ -4534,16 +4776,20 @@ public static VpnGatewayCollection GetVpnGateways(this ResourceGroupResource res /// VpnGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the gateway. /// The cancellation token to use. - /// 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 static async Task> GetVpnGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVpnGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -4558,24 +4804,34 @@ public static async Task> GetVpnGatewayAsync(this R /// VpnGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the gateway. /// The cancellation token to use. - /// 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 static Response GetVpnGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVpnGateways().Get(gatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetVpnGateway(gatewayName, cancellationToken); } - /// Gets a collection of P2SVpnGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of P2SVpnGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of P2SVpnGatewayResources and their operations over a P2SVpnGatewayResource. public static P2SVpnGatewayCollection GetP2SVpnGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetP2SVpnGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetP2SVpnGateways(); } /// @@ -4590,16 +4846,20 @@ public static P2SVpnGatewayCollection GetP2SVpnGateways(this ResourceGroupResour /// P2sVpnGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the gateway. /// The cancellation token to use. - /// 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 static async Task> GetP2SVpnGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetP2SVpnGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetP2SVpnGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -4614,24 +4874,34 @@ public static async Task> GetP2SVpnGatewayAsync( /// P2sVpnGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the gateway. /// The cancellation token to use. - /// 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 static Response GetP2SVpnGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetP2SVpnGateways().Get(gatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetP2SVpnGateway(gatewayName, cancellationToken); } - /// Gets a collection of ExpressRouteGatewayResources in the ResourceGroupResource. + /// + /// Gets a collection of ExpressRouteGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRouteGatewayResources and their operations over a ExpressRouteGatewayResource. public static ExpressRouteGatewayCollection GetExpressRouteGateways(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExpressRouteGateways(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteGateways(); } /// @@ -4646,16 +4916,20 @@ public static ExpressRouteGatewayCollection GetExpressRouteGateways(this Resourc /// ExpressRouteGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ExpressRoute gateway. /// The cancellation token to use. - /// 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 static async Task> GetExpressRouteGatewayAsync(this ResourceGroupResource resourceGroupResource, string expressRouteGatewayName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetExpressRouteGateways().GetAsync(expressRouteGatewayName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteGatewayAsync(expressRouteGatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -4670,24 +4944,34 @@ public static async Task> GetExpressRouteG /// ExpressRouteGateways_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ExpressRoute gateway. /// The cancellation token to use. - /// 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 static Response GetExpressRouteGateway(this ResourceGroupResource resourceGroupResource, string expressRouteGatewayName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetExpressRouteGateways().Get(expressRouteGatewayName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetExpressRouteGateway(expressRouteGatewayName, cancellationToken); } - /// Gets a collection of WebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of WebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of WebApplicationFirewallPolicyResources and their operations over a WebApplicationFirewallPolicyResource. public static WebApplicationFirewallPolicyCollection GetWebApplicationFirewallPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetWebApplicationFirewallPolicies(); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetWebApplicationFirewallPolicies(); } /// @@ -4702,16 +4986,20 @@ public static WebApplicationFirewallPolicyCollection GetWebApplicationFirewallPo /// WebApplicationFirewallPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the policy. /// The cancellation token to use. - /// 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 static async Task> GetWebApplicationFirewallPolicyAsync(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetWebApplicationFirewallPolicyAsync(policyName, cancellationToken).ConfigureAwait(false); } /// @@ -4726,16 +5014,20 @@ public static async Task> GetWebA /// WebApplicationFirewallPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the policy. /// The cancellation token to use. - /// 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 static Response GetWebApplicationFirewallPolicy(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetWebApplicationFirewallPolicy(policyName, cancellationToken); } /// @@ -4750,6 +5042,10 @@ public static Response GetWebApplicationFi /// AvailableResourceGroupDelegations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4757,7 +5053,7 @@ public static Response GetWebApplicationFi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableResourceGroupDelegationsAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableResourceGroupDelegationsAsync(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailableResourceGroupDelegationsAsync(location, cancellationToken); } /// @@ -4772,6 +5068,10 @@ public static AsyncPageable GetAvailableResourceGroupDelega /// AvailableResourceGroupDelegations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4779,7 +5079,7 @@ public static AsyncPageable GetAvailableResourceGroupDelega /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableResourceGroupDelegations(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableResourceGroupDelegations(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailableResourceGroupDelegations(location, cancellationToken); } /// @@ -4794,6 +5094,10 @@ public static Pageable GetAvailableResourceGroupDelegations /// AvailableServiceAliases_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location. @@ -4801,7 +5105,7 @@ public static Pageable GetAvailableResourceGroupDelegations /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableServiceAliasesByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableServiceAliasesByResourceGroupAsync(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailableServiceAliasesByResourceGroupAsync(location, cancellationToken); } /// @@ -4816,6 +5120,10 @@ public static AsyncPageable GetAvailableServiceAliasesByR /// AvailableServiceAliases_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location. @@ -4823,7 +5131,7 @@ public static AsyncPageable GetAvailableServiceAliasesByR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableServiceAliasesByResourceGroup(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableServiceAliasesByResourceGroup(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailableServiceAliasesByResourceGroup(location, cancellationToken); } /// @@ -4838,6 +5146,10 @@ public static Pageable GetAvailableServiceAliasesByResour /// AvailablePrivateEndpointTypes_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4845,7 +5157,7 @@ public static Pageable GetAvailableServiceAliasesByResour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailablePrivateEndpointTypesByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailablePrivateEndpointTypesByResourceGroupAsync(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailablePrivateEndpointTypesByResourceGroupAsync(location, cancellationToken); } /// @@ -4860,6 +5172,10 @@ public static AsyncPageable GetAvailablePrivateEnd /// AvailablePrivateEndpointTypes_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4867,7 +5183,7 @@ public static AsyncPageable GetAvailablePrivateEnd /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailablePrivateEndpointTypesByResourceGroup(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailablePrivateEndpointTypesByResourceGroup(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAvailablePrivateEndpointTypesByResourceGroup(location, cancellationToken); } /// @@ -4882,6 +5198,10 @@ public static Pageable GetAvailablePrivateEndpoint /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -4891,9 +5211,7 @@ public static Pageable GetAvailablePrivateEndpoint /// is null. public static async Task> CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkServiceAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkServiceAsync(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); + return await GetNetworkResourceGroupMockingExtension(resourceGroupResource).CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkServiceAsync(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); } /// @@ -4908,6 +5226,10 @@ public static async Task> CheckPrivat /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -4917,9 +5239,7 @@ public static async Task> CheckPrivat /// is null. public static ArmOperation CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); } /// @@ -4934,6 +5254,10 @@ public static ArmOperation CheckPrivateLinkService /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4941,7 +5265,7 @@ public static ArmOperation CheckPrivateLinkService /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServicesAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServicesAsync(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServicesAsync(location, cancellationToken); } /// @@ -4956,6 +5280,10 @@ public static AsyncPageable GetAutoApprovedPriva /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -4963,16 +5291,22 @@ public static AsyncPageable GetAutoApprovedPriva /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices(this ResourceGroupResource resourceGroupResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices(location, cancellationToken); + return GetNetworkResourceGroupMockingExtension(resourceGroupResource).GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices(location, cancellationToken); } - /// Gets a collection of ApplicationGatewayWafDynamicManifestResources in the SubscriptionResource. + /// + /// Gets a collection of ApplicationGatewayWafDynamicManifestResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The region where the nrp are located at. /// An object representing collection of ApplicationGatewayWafDynamicManifestResources and their operations over a ApplicationGatewayWafDynamicManifestResource. public static ApplicationGatewayWafDynamicManifestCollection GetApplicationGatewayWafDynamicManifests(this SubscriptionResource subscriptionResource, AzureLocation location) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewayWafDynamicManifests(location); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayWafDynamicManifests(location); } /// @@ -4987,6 +5321,10 @@ public static ApplicationGatewayWafDynamicManifestCollection GetApplicationGatew /// ApplicationGatewayWafDynamicManifestsDefault_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region where the nrp are located at. @@ -4994,7 +5332,7 @@ public static ApplicationGatewayWafDynamicManifestCollection GetApplicationGatew [ForwardsClientCalls] public static async Task> GetApplicationGatewayWafDynamicManifestAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetApplicationGatewayWafDynamicManifests(location).GetAsync(cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayWafDynamicManifestAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -5009,6 +5347,10 @@ public static async Task> /// ApplicationGatewayWafDynamicManifestsDefault_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region where the nrp are located at. @@ -5016,15 +5358,21 @@ public static async Task> [ForwardsClientCalls] public static Response GetApplicationGatewayWafDynamicManifest(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return subscriptionResource.GetApplicationGatewayWafDynamicManifests(location).Get(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayWafDynamicManifest(location, cancellationToken); } - /// Gets a collection of AzureWebCategoryResources in the SubscriptionResource. + /// + /// Gets a collection of AzureWebCategoryResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AzureWebCategoryResources and their operations over a AzureWebCategoryResource. public static AzureWebCategoryCollection GetAzureWebCategories(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureWebCategories(); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureWebCategories(); } /// @@ -5039,17 +5387,21 @@ public static AzureWebCategoryCollection GetAzureWebCategories(this Subscription /// WebCategories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the azureWebCategory. /// Expands resourceIds back referenced by the azureWebCategory resource. /// The cancellation token to use. - /// 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 static async Task> GetAzureWebCategoryAsync(this SubscriptionResource subscriptionResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAzureWebCategories().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureWebCategoryAsync(name, expand, cancellationToken).ConfigureAwait(false); } /// @@ -5064,25 +5416,35 @@ public static async Task> GetAzureWebCategory /// WebCategories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the azureWebCategory. /// Expands resourceIds back referenced by the azureWebCategory resource. /// The cancellation token to use. - /// 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 static Response GetAzureWebCategory(this SubscriptionResource subscriptionResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAzureWebCategories().Get(name, expand, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureWebCategory(name, expand, cancellationToken); } - /// Gets a collection of ExpressRouteProviderPortResources in the SubscriptionResource. + /// + /// Gets a collection of ExpressRouteProviderPortResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRouteProviderPortResources and their operations over a ExpressRouteProviderPortResource. public static ExpressRouteProviderPortCollection GetExpressRouteProviderPorts(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteProviderPorts(); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteProviderPorts(); } /// @@ -5097,16 +5459,20 @@ public static ExpressRouteProviderPortCollection GetExpressRouteProviderPorts(th /// ExpressRouteProviderPort /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the provider port. /// The cancellation token to use. - /// 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 static async Task> GetExpressRouteProviderPortAsync(this SubscriptionResource subscriptionResource, string providerport, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetExpressRouteProviderPorts().GetAsync(providerport, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteProviderPortAsync(providerport, cancellationToken).ConfigureAwait(false); } /// @@ -5121,24 +5487,34 @@ public static async Task> GetExpressR /// ExpressRouteProviderPort /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the provider port. /// The cancellation token to use. - /// 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 static Response GetExpressRouteProviderPort(this SubscriptionResource subscriptionResource, string providerport, CancellationToken cancellationToken = default) { - return subscriptionResource.GetExpressRouteProviderPorts().Get(providerport, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteProviderPort(providerport, cancellationToken); } - /// Gets a collection of ExpressRoutePortsLocationResources in the SubscriptionResource. + /// + /// Gets a collection of ExpressRoutePortsLocationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ExpressRoutePortsLocationResources and their operations over a ExpressRoutePortsLocationResource. public static ExpressRoutePortsLocationCollection GetExpressRoutePortsLocations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRoutePortsLocations(); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRoutePortsLocations(); } /// @@ -5153,16 +5529,20 @@ public static ExpressRoutePortsLocationCollection GetExpressRoutePortsLocations( /// ExpressRoutePortsLocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the requested ExpressRoutePort peering location. /// The cancellation token to use. - /// 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 static async Task> GetExpressRoutePortsLocationAsync(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetExpressRoutePortsLocations().GetAsync(locationName, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRoutePortsLocationAsync(locationName, cancellationToken).ConfigureAwait(false); } /// @@ -5177,24 +5557,34 @@ public static async Task> GetExpress /// ExpressRoutePortsLocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the requested ExpressRoutePort peering location. /// The cancellation token to use. - /// 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 static Response GetExpressRoutePortsLocation(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetExpressRoutePortsLocations().Get(locationName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRoutePortsLocation(locationName, cancellationToken); } - /// Gets a collection of SubscriptionNetworkManagerConnectionResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionNetworkManagerConnectionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SubscriptionNetworkManagerConnectionResources and their operations over a SubscriptionNetworkManagerConnectionResource. public static SubscriptionNetworkManagerConnectionCollection GetSubscriptionNetworkManagerConnections(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionNetworkManagerConnections(); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionNetworkManagerConnections(); } /// @@ -5209,16 +5599,20 @@ public static SubscriptionNetworkManagerConnectionCollection GetSubscriptionNetw /// SubscriptionNetworkManagerConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the network manager connection. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionNetworkManagerConnectionAsync(this SubscriptionResource subscriptionResource, string networkManagerConnectionName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionNetworkManagerConnections().GetAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionNetworkManagerConnectionAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -5233,24 +5627,34 @@ public static async Task> /// SubscriptionNetworkManagerConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name for the network manager connection. /// The cancellation token to use. - /// 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 static Response GetSubscriptionNetworkManagerConnection(this SubscriptionResource subscriptionResource, string networkManagerConnectionName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionNetworkManagerConnections().Get(networkManagerConnectionName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetSubscriptionNetworkManagerConnection(networkManagerConnectionName, cancellationToken); } - /// Gets a collection of NetworkVirtualApplianceSkuResources in the SubscriptionResource. + /// + /// Gets a collection of NetworkVirtualApplianceSkuResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkVirtualApplianceSkuResources and their operations over a NetworkVirtualApplianceSkuResource. public static NetworkVirtualApplianceSkuCollection GetNetworkVirtualApplianceSkus(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkVirtualApplianceSkus(); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkVirtualApplianceSkus(); } /// @@ -5265,16 +5669,20 @@ public static NetworkVirtualApplianceSkuCollection GetNetworkVirtualApplianceSku /// VirtualApplianceSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Sku. /// The cancellation token to use. - /// 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 static async Task> GetNetworkVirtualApplianceSkuAsync(this SubscriptionResource subscriptionResource, string skuName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetNetworkVirtualApplianceSkus().GetAsync(skuName, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkVirtualApplianceSkuAsync(skuName, cancellationToken).ConfigureAwait(false); } /// @@ -5289,16 +5697,20 @@ public static async Task> GetNetwor /// VirtualApplianceSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Sku. /// The cancellation token to use. - /// 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 static Response GetNetworkVirtualApplianceSku(this SubscriptionResource subscriptionResource, string skuName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetNetworkVirtualApplianceSkus().Get(skuName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkVirtualApplianceSku(skuName, cancellationToken); } /// @@ -5313,13 +5725,17 @@ public static Response GetNetworkVirtualAppl /// ApplicationGateways_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApplicationGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewaysAsync(cancellationToken); } /// @@ -5334,13 +5750,17 @@ public static AsyncPageable GetApplicationGatewaysAs /// ApplicationGateways_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApplicationGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGateways(cancellationToken); } /// @@ -5355,13 +5775,17 @@ public static Pageable GetApplicationGateways(this S /// ApplicationGateways_ListAvailableServerVariables /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableServerVariablesApplicationGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableServerVariablesApplicationGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableServerVariablesApplicationGatewaysAsync(cancellationToken); } /// @@ -5376,13 +5800,17 @@ public static AsyncPageable GetAvailableServerVariablesApplicationGatewa /// ApplicationGateways_ListAvailableServerVariables /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableServerVariablesApplicationGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableServerVariablesApplicationGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableServerVariablesApplicationGateways(cancellationToken); } /// @@ -5397,13 +5825,17 @@ public static Pageable GetAvailableServerVariablesApplicationGateways(th /// ApplicationGateways_ListAvailableRequestHeaders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableRequestHeadersApplicationGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableRequestHeadersApplicationGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableRequestHeadersApplicationGatewaysAsync(cancellationToken); } /// @@ -5418,13 +5850,17 @@ public static AsyncPageable GetAvailableRequestHeadersApplicationGateway /// ApplicationGateways_ListAvailableRequestHeaders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableRequestHeadersApplicationGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableRequestHeadersApplicationGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableRequestHeadersApplicationGateways(cancellationToken); } /// @@ -5439,13 +5875,17 @@ public static Pageable GetAvailableRequestHeadersApplicationGateways(thi /// ApplicationGateways_ListAvailableResponseHeaders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableResponseHeadersApplicationGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableResponseHeadersApplicationGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableResponseHeadersApplicationGatewaysAsync(cancellationToken); } /// @@ -5460,13 +5900,17 @@ public static AsyncPageable GetAvailableResponseHeadersApplicationGatewa /// ApplicationGateways_ListAvailableResponseHeaders /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableResponseHeadersApplicationGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableResponseHeadersApplicationGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableResponseHeadersApplicationGateways(cancellationToken); } /// @@ -5481,13 +5925,17 @@ public static Pageable GetAvailableResponseHeadersApplicationGateways(th /// ApplicationGateways_ListAvailableWafRuleSets /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAppGatewayAvailableWafRuleSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppGatewayAvailableWafRuleSetsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAppGatewayAvailableWafRuleSetsAsync(cancellationToken); } /// @@ -5502,13 +5950,17 @@ public static AsyncPageable GetAppGatewayAvai /// ApplicationGateways_ListAvailableWafRuleSets /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAppGatewayAvailableWafRuleSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppGatewayAvailableWafRuleSets(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAppGatewayAvailableWafRuleSets(cancellationToken); } /// @@ -5523,12 +5975,16 @@ public static Pageable GetAppGatewayAvailable /// ApplicationGateways_ListAvailableSslOptions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetApplicationGatewayAvailableSslOptionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewayAvailableSslOptionsAsync(cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayAvailableSslOptionsAsync(cancellationToken).ConfigureAwait(false); } /// @@ -5543,12 +5999,16 @@ public static async Task> Ge /// ApplicationGateways_ListAvailableSslOptions /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetApplicationGatewayAvailableSslOptions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewayAvailableSslOptions(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayAvailableSslOptions(cancellationToken); } /// @@ -5563,13 +6023,17 @@ public static Response GetApplication /// ApplicationGateways_ListAvailableSslPredefinedPolicies /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApplicationGatewayAvailableSslPredefinedPoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewayAvailableSslPredefinedPoliciesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayAvailableSslPredefinedPoliciesAsync(cancellationToken); } /// @@ -5584,13 +6048,17 @@ public static AsyncPageable GetApplicatio /// ApplicationGateways_ListAvailableSslPredefinedPolicies /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApplicationGatewayAvailableSslPredefinedPolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewayAvailableSslPredefinedPolicies(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewayAvailableSslPredefinedPolicies(cancellationToken); } /// @@ -5605,6 +6073,10 @@ public static Pageable GetApplicationGate /// ApplicationGateways_GetSslPredefinedPolicy /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Ssl predefined policy. @@ -5613,9 +6085,7 @@ public static Pageable GetApplicationGate /// is null. public static async Task> GetApplicationGatewaySslPredefinedPolicyAsync(this SubscriptionResource subscriptionResource, string predefinedPolicyName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(predefinedPolicyName, nameof(predefinedPolicyName)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewaySslPredefinedPolicyAsync(predefinedPolicyName, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewaySslPredefinedPolicyAsync(predefinedPolicyName, cancellationToken).ConfigureAwait(false); } /// @@ -5630,6 +6100,10 @@ public static async Task> GetApp /// ApplicationGateways_GetSslPredefinedPolicy /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of Ssl predefined policy. @@ -5638,9 +6112,7 @@ public static async Task> GetApp /// is null. public static Response GetApplicationGatewaySslPredefinedPolicy(this SubscriptionResource subscriptionResource, string predefinedPolicyName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(predefinedPolicyName, nameof(predefinedPolicyName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationGatewaySslPredefinedPolicy(predefinedPolicyName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationGatewaySslPredefinedPolicy(predefinedPolicyName, cancellationToken); } /// @@ -5655,13 +6127,17 @@ public static Response GetApplicationGate /// ApplicationSecurityGroups_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetApplicationSecurityGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationSecurityGroupsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationSecurityGroupsAsync(cancellationToken); } /// @@ -5676,13 +6152,17 @@ public static AsyncPageable GetApplicationSecu /// ApplicationSecurityGroups_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetApplicationSecurityGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetApplicationSecurityGroups(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetApplicationSecurityGroups(cancellationToken); } /// @@ -5697,6 +6177,10 @@ public static Pageable GetApplicationSecurityG /// AvailableDelegations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the subnet. @@ -5704,7 +6188,7 @@ public static Pageable GetApplicationSecurityG /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableDelegationsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableDelegationsAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableDelegationsAsync(location, cancellationToken); } /// @@ -5719,6 +6203,10 @@ public static AsyncPageable GetAvailableDelegationsAsync(th /// AvailableDelegations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the subnet. @@ -5726,7 +6214,7 @@ public static AsyncPageable GetAvailableDelegationsAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableDelegations(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableDelegations(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableDelegations(location, cancellationToken); } /// @@ -5741,6 +6229,10 @@ public static Pageable GetAvailableDelegations(this Subscri /// AvailableServiceAliases_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location. @@ -5748,7 +6240,7 @@ public static Pageable GetAvailableDelegations(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableServiceAliasesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableServiceAliasesAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableServiceAliasesAsync(location, cancellationToken); } /// @@ -5763,6 +6255,10 @@ public static AsyncPageable GetAvailableServiceAliasesAsy /// AvailableServiceAliases_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location. @@ -5770,7 +6266,7 @@ public static AsyncPageable GetAvailableServiceAliasesAsy /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableServiceAliases(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableServiceAliases(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableServiceAliases(location, cancellationToken); } /// @@ -5785,13 +6281,17 @@ public static Pageable GetAvailableServiceAliases(this Su /// AzureFirewalls_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzureFirewallsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureFirewallsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureFirewallsAsync(cancellationToken); } /// @@ -5806,13 +6306,17 @@ public static AsyncPageable GetAzureFirewallsAsync(this S /// AzureFirewalls_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzureFirewalls(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureFirewalls(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureFirewalls(cancellationToken); } /// @@ -5827,13 +6331,17 @@ public static Pageable GetAzureFirewalls(this Subscriptio /// AzureFirewallFqdnTags_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzureFirewallFqdnTagsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureFirewallFqdnTagsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureFirewallFqdnTagsAsync(cancellationToken); } /// @@ -5848,13 +6356,17 @@ public static AsyncPageable GetAzureFirewallFqdnTagsAsync( /// AzureFirewallFqdnTags_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzureFirewallFqdnTags(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureFirewallFqdnTags(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAzureFirewallFqdnTags(cancellationToken); } /// @@ -5869,13 +6381,17 @@ public static Pageable GetAzureFirewallFqdnTags(this Subsc /// BastionHosts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBastionHostsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBastionHostsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetBastionHostsAsync(cancellationToken); } /// @@ -5890,13 +6406,17 @@ public static AsyncPageable GetBastionHostsAsync(this Subsc /// BastionHosts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBastionHosts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBastionHosts(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetBastionHosts(cancellationToken); } /// @@ -5911,6 +6431,10 @@ public static Pageable GetBastionHosts(this SubscriptionRes /// CheckDnsNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -5919,9 +6443,7 @@ public static Pageable GetBastionHosts(this SubscriptionRes /// is null. public static async Task> CheckDnsNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string domainNameLabel, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDnsNameAvailabilityAsync(location, domainNameLabel, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).CheckDnsNameAvailabilityAsync(location, domainNameLabel, cancellationToken).ConfigureAwait(false); } /// @@ -5936,6 +6458,10 @@ public static async Task> CheckDnsNameAvaila /// CheckDnsNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -5944,9 +6470,7 @@ public static async Task> CheckDnsNameAvaila /// is null. public static Response CheckDnsNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, string domainNameLabel, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDnsNameAvailability(location, domainNameLabel, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).CheckDnsNameAvailability(location, domainNameLabel, cancellationToken); } /// @@ -5961,13 +6485,17 @@ public static Response CheckDnsNameAvailability(this /// CustomIPPrefixes_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCustomIPPrefixesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomIPPrefixesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetCustomIPPrefixesAsync(cancellationToken); } /// @@ -5982,13 +6510,17 @@ public static AsyncPageable GetCustomIPPrefixesAsync(thi /// CustomIPPrefixes_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCustomIPPrefixes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomIPPrefixes(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetCustomIPPrefixes(cancellationToken); } /// @@ -6003,13 +6535,17 @@ public static Pageable GetCustomIPPrefixes(this Subscrip /// DdosProtectionPlans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDdosProtectionPlansAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDdosProtectionPlansAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetDdosProtectionPlansAsync(cancellationToken); } /// @@ -6024,13 +6560,17 @@ public static AsyncPageable GetDdosProtectionPlansAs /// DdosProtectionPlans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDdosProtectionPlans(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDdosProtectionPlans(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetDdosProtectionPlans(cancellationToken); } /// @@ -6045,13 +6585,17 @@ public static Pageable GetDdosProtectionPlans(this S /// DscpConfiguration_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDscpConfigurationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDscpConfigurationsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetDscpConfigurationsAsync(cancellationToken); } /// @@ -6066,13 +6610,17 @@ public static AsyncPageable GetDscpConfigurationsAsyn /// DscpConfiguration_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDscpConfigurations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDscpConfigurations(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetDscpConfigurations(cancellationToken); } /// @@ -6087,6 +6635,10 @@ public static Pageable GetDscpConfigurations(this Sub /// AvailableEndpointServices_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location to check available endpoint services. @@ -6094,7 +6646,7 @@ public static Pageable GetDscpConfigurations(this Sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableEndpointServicesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableEndpointServicesAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableEndpointServicesAsync(location, cancellationToken); } /// @@ -6109,6 +6661,10 @@ public static AsyncPageable GetAvailableEndpointServicesA /// AvailableEndpointServices_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location to check available endpoint services. @@ -6116,7 +6672,7 @@ public static AsyncPageable GetAvailableEndpointServicesA /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableEndpointServices(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableEndpointServices(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailableEndpointServices(location, cancellationToken); } /// @@ -6131,13 +6687,17 @@ public static Pageable GetAvailableEndpointServices(this /// ExpressRouteCircuits_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExpressRouteCircuitsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteCircuitsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteCircuitsAsync(cancellationToken); } /// @@ -6152,13 +6712,17 @@ public static AsyncPageable GetExpressRouteCircuits /// ExpressRouteCircuits_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExpressRouteCircuits(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteCircuits(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteCircuits(cancellationToken); } /// @@ -6173,13 +6737,17 @@ public static Pageable GetExpressRouteCircuits(this /// ExpressRouteServiceProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExpressRouteServiceProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteServiceProvidersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteServiceProvidersAsync(cancellationToken); } /// @@ -6194,13 +6762,17 @@ public static AsyncPageable GetExpressRouteServiceP /// ExpressRouteServiceProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExpressRouteServiceProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteServiceProviders(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteServiceProviders(cancellationToken); } /// @@ -6215,13 +6787,17 @@ public static Pageable GetExpressRouteServiceProvid /// ExpressRouteCrossConnections_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExpressRouteCrossConnectionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteCrossConnectionsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteCrossConnectionsAsync(cancellationToken); } /// @@ -6236,13 +6812,17 @@ public static AsyncPageable GetExpressRoute /// ExpressRouteCrossConnections_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExpressRouteCrossConnections(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteCrossConnections(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteCrossConnections(cancellationToken); } /// @@ -6257,13 +6837,17 @@ public static Pageable GetExpressRouteCross /// ExpressRoutePorts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExpressRoutePortsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRoutePortsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRoutePortsAsync(cancellationToken); } /// @@ -6278,13 +6862,17 @@ public static AsyncPageable GetExpressRoutePortsAsync( /// ExpressRoutePorts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExpressRoutePorts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRoutePorts(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRoutePorts(cancellationToken); } /// @@ -6299,13 +6887,17 @@ public static Pageable GetExpressRoutePorts(this Subsc /// FirewallPolicies_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFirewallPoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFirewallPoliciesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetFirewallPoliciesAsync(cancellationToken); } /// @@ -6320,13 +6912,17 @@ public static AsyncPageable GetFirewallPoliciesAsync(thi /// FirewallPolicies_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFirewallPolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFirewallPolicies(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetFirewallPolicies(cancellationToken); } /// @@ -6341,13 +6937,17 @@ public static Pageable GetFirewallPolicies(this Subscrip /// IpAllocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIPAllocationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIPAllocationsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetIPAllocationsAsync(cancellationToken); } /// @@ -6362,13 +6962,17 @@ public static AsyncPageable GetIPAllocationsAsync(this Sub /// IpAllocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIPAllocations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIPAllocations(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetIPAllocations(cancellationToken); } /// @@ -6383,13 +6987,17 @@ public static Pageable GetIPAllocations(this SubscriptionR /// IpGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIPGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIPGroupsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetIPGroupsAsync(cancellationToken); } /// @@ -6404,13 +7012,17 @@ public static AsyncPageable GetIPGroupsAsync(this SubscriptionR /// IpGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIPGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIPGroups(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetIPGroups(cancellationToken); } /// @@ -6425,13 +7037,17 @@ public static Pageable GetIPGroups(this SubscriptionResource su /// LoadBalancers_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLoadBalancersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLoadBalancersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetLoadBalancersAsync(cancellationToken); } /// @@ -6446,13 +7062,17 @@ public static AsyncPageable GetLoadBalancersAsync(this Sub /// LoadBalancers_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLoadBalancers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLoadBalancers(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetLoadBalancers(cancellationToken); } /// @@ -6467,6 +7087,10 @@ public static Pageable GetLoadBalancers(this SubscriptionR /// LoadBalancers_SwapPublicIpAddresses /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -6476,9 +7100,7 @@ public static Pageable GetLoadBalancers(this SubscriptionR /// is null. public static async Task SwapPublicIPAddressesLoadBalancerAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, LoadBalancerVipSwapContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).SwapPublicIPAddressesLoadBalancerAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).SwapPublicIPAddressesLoadBalancerAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -6493,6 +7115,10 @@ public static async Task SwapPublicIPAddressesLoadBalancerAsync(th /// LoadBalancers_SwapPublicIpAddresses /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -6502,9 +7128,7 @@ public static async Task SwapPublicIPAddressesLoadBalancerAsync(th /// is null. public static ArmOperation SwapPublicIPAddressesLoadBalancer(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, LoadBalancerVipSwapContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).SwapPublicIPAddressesLoadBalancer(waitUntil, location, content, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).SwapPublicIPAddressesLoadBalancer(waitUntil, location, content, cancellationToken); } /// @@ -6519,13 +7143,17 @@ public static ArmOperation SwapPublicIPAddressesLoadBalancer(this SubscriptionRe /// NatGateways_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNatGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNatGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNatGatewaysAsync(cancellationToken); } /// @@ -6540,13 +7168,17 @@ public static AsyncPageable GetNatGatewaysAsync(this Subscri /// NatGateways_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNatGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNatGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNatGateways(cancellationToken); } /// @@ -6561,13 +7193,17 @@ public static Pageable GetNatGateways(this SubscriptionResou /// NetworkInterfaces_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkInterfacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkInterfacesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkInterfacesAsync(cancellationToken); } /// @@ -6582,13 +7218,17 @@ public static AsyncPageable GetNetworkInterfacesAsync( /// NetworkInterfaces_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkInterfaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkInterfaces(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkInterfaces(cancellationToken); } /// @@ -6603,6 +7243,10 @@ public static Pageable GetNetworkInterfaces(this Subsc /// NetworkManagers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -6611,7 +7255,7 @@ public static Pageable GetNetworkInterfaces(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkManagersAsync(this SubscriptionResource subscriptionResource, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkManagersAsync(top, skipToken, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkManagersAsync(top, skipToken, cancellationToken); } /// @@ -6626,6 +7270,10 @@ public static AsyncPageable GetNetworkManagersAsync(this /// NetworkManagers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An optional query parameter which specifies the maximum number of records to be returned by the server. @@ -6634,7 +7282,7 @@ public static AsyncPageable GetNetworkManagersAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkManagers(this SubscriptionResource subscriptionResource, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkManagers(top, skipToken, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkManagers(top, skipToken, cancellationToken); } /// @@ -6649,13 +7297,17 @@ public static Pageable GetNetworkManagers(this Subscript /// NetworkProfiles_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkProfilesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkProfilesAsync(cancellationToken); } /// @@ -6670,13 +7322,17 @@ public static AsyncPageable GetNetworkProfilesAsync(this /// NetworkProfiles_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkProfiles(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkProfiles(cancellationToken); } /// @@ -6691,13 +7347,17 @@ public static Pageable GetNetworkProfiles(this Subscript /// NetworkSecurityGroups_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkSecurityGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkSecurityGroupsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkSecurityGroupsAsync(cancellationToken); } /// @@ -6712,13 +7372,17 @@ public static AsyncPageable GetNetworkSecurityGrou /// NetworkSecurityGroups_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkSecurityGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkSecurityGroups(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkSecurityGroups(cancellationToken); } /// @@ -6733,13 +7397,17 @@ public static Pageable GetNetworkSecurityGroups(th /// NetworkVirtualAppliances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkVirtualAppliancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkVirtualAppliancesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkVirtualAppliancesAsync(cancellationToken); } /// @@ -6754,13 +7422,17 @@ public static AsyncPageable GetNetworkVirtualAp /// NetworkVirtualAppliances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkVirtualAppliances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkVirtualAppliances(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkVirtualAppliances(cancellationToken); } /// @@ -6775,13 +7447,17 @@ public static Pageable GetNetworkVirtualApplian /// NetworkWatchers_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkWatchersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkWatchersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkWatchersAsync(cancellationToken); } /// @@ -6796,13 +7472,17 @@ public static AsyncPageable GetNetworkWatchersAsync(this /// NetworkWatchers_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkWatchers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkWatchers(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetNetworkWatchers(cancellationToken); } /// @@ -6817,13 +7497,17 @@ public static Pageable GetNetworkWatchers(this Subscript /// PrivateEndpoints_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPrivateEndpointsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateEndpointsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPrivateEndpointsAsync(cancellationToken); } /// @@ -6838,13 +7522,17 @@ public static AsyncPageable GetPrivateEndpointsAsync(th /// PrivateEndpoints_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPrivateEndpoints(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateEndpoints(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPrivateEndpoints(cancellationToken); } /// @@ -6859,6 +7547,10 @@ public static Pageable GetPrivateEndpoints(this Subscri /// AvailablePrivateEndpointTypes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -6866,7 +7558,7 @@ public static Pageable GetPrivateEndpoints(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailablePrivateEndpointTypesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailablePrivateEndpointTypesAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailablePrivateEndpointTypesAsync(location, cancellationToken); } /// @@ -6881,6 +7573,10 @@ public static AsyncPageable GetAvailablePrivateEnd /// AvailablePrivateEndpointTypes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -6888,7 +7584,7 @@ public static AsyncPageable GetAvailablePrivateEnd /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailablePrivateEndpointTypes(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailablePrivateEndpointTypes(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAvailablePrivateEndpointTypes(location, cancellationToken); } /// @@ -6903,13 +7599,17 @@ public static Pageable GetAvailablePrivateEndpoint /// PrivateLinkServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPrivateLinkServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateLinkServicesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPrivateLinkServicesAsync(cancellationToken); } /// @@ -6924,13 +7624,17 @@ public static AsyncPageable GetPrivateLinkServicesAs /// PrivateLinkServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPrivateLinkServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateLinkServices(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPrivateLinkServices(cancellationToken); } /// @@ -6945,6 +7649,10 @@ public static Pageable GetPrivateLinkServices(this S /// PrivateLinkServices_CheckPrivateLinkServiceVisibility /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -6954,9 +7662,7 @@ public static Pageable GetPrivateLinkServices(this S /// is null. public static async Task> CheckPrivateLinkServiceVisibilityPrivateLinkServiceAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPrivateLinkServiceVisibilityPrivateLinkServiceAsync(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).CheckPrivateLinkServiceVisibilityPrivateLinkServiceAsync(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); } /// @@ -6971,6 +7677,10 @@ public static async Task> CheckPrivat /// PrivateLinkServices_CheckPrivateLinkServiceVisibility /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -6980,9 +7690,7 @@ public static async Task> CheckPrivat /// is null. public static ArmOperation CheckPrivateLinkServiceVisibilityPrivateLinkService(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPrivateLinkServiceVisibilityPrivateLinkService(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).CheckPrivateLinkServiceVisibilityPrivateLinkService(waitUntil, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); } /// @@ -6997,6 +7705,10 @@ public static ArmOperation CheckPrivateLinkService /// PrivateLinkServices_ListAutoApprovedPrivateLinkServices /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -7004,7 +7716,7 @@ public static ArmOperation CheckPrivateLinkService /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutoApprovedPrivateLinkServicesPrivateLinkServicesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoApprovedPrivateLinkServicesPrivateLinkServicesAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAutoApprovedPrivateLinkServicesPrivateLinkServicesAsync(location, cancellationToken); } /// @@ -7019,6 +7731,10 @@ public static AsyncPageable GetAutoApprovedPriva /// PrivateLinkServices_ListAutoApprovedPrivateLinkServices /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the domain name. @@ -7026,7 +7742,7 @@ public static AsyncPageable GetAutoApprovedPriva /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutoApprovedPrivateLinkServicesPrivateLinkServices(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoApprovedPrivateLinkServicesPrivateLinkServices(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAutoApprovedPrivateLinkServicesPrivateLinkServices(location, cancellationToken); } /// @@ -7041,13 +7757,17 @@ public static Pageable GetAutoApprovedPrivateLin /// PublicIPAddresses_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPublicIPAddressesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublicIPAddressesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPublicIPAddressesAsync(cancellationToken); } /// @@ -7062,13 +7782,17 @@ public static AsyncPageable GetPublicIPAddressesAsync(t /// PublicIPAddresses_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPublicIPAddresses(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublicIPAddresses(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPublicIPAddresses(cancellationToken); } /// @@ -7083,13 +7807,17 @@ public static Pageable GetPublicIPAddresses(this Subscr /// PublicIPPrefixes_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPublicIPPrefixesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublicIPPrefixesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPublicIPPrefixesAsync(cancellationToken); } /// @@ -7104,13 +7832,17 @@ public static AsyncPageable GetPublicIPPrefixesAsync(thi /// PublicIPPrefixes_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPublicIPPrefixes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublicIPPrefixes(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetPublicIPPrefixes(cancellationToken); } /// @@ -7125,13 +7857,17 @@ public static Pageable GetPublicIPPrefixes(this Subscrip /// RouteFilters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRouteFiltersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRouteFiltersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetRouteFiltersAsync(cancellationToken); } /// @@ -7146,13 +7882,17 @@ public static AsyncPageable GetRouteFiltersAsync(this Subsc /// RouteFilters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRouteFilters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRouteFilters(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetRouteFilters(cancellationToken); } /// @@ -7167,13 +7907,17 @@ public static Pageable GetRouteFilters(this SubscriptionRes /// RouteTables_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRouteTablesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRouteTablesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetRouteTablesAsync(cancellationToken); } /// @@ -7188,13 +7932,17 @@ public static AsyncPageable GetRouteTablesAsync(this Subscri /// RouteTables_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRouteTables(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRouteTables(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetRouteTables(cancellationToken); } /// @@ -7209,13 +7957,17 @@ public static Pageable GetRouteTables(this SubscriptionResou /// SecurityPartnerProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecurityPartnerProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityPartnerProvidersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetSecurityPartnerProvidersAsync(cancellationToken); } /// @@ -7230,13 +7982,17 @@ public static AsyncPageable GetSecurityPartnerP /// SecurityPartnerProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecurityPartnerProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityPartnerProviders(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetSecurityPartnerProviders(cancellationToken); } /// @@ -7251,13 +8007,17 @@ public static Pageable GetSecurityPartnerProvid /// BgpServiceCommunities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBgpServiceCommunitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBgpServiceCommunitiesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetBgpServiceCommunitiesAsync(cancellationToken); } /// @@ -7272,13 +8032,17 @@ public static AsyncPageable GetBgpServiceCommunitiesAsync(t /// BgpServiceCommunities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBgpServiceCommunities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBgpServiceCommunities(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetBgpServiceCommunities(cancellationToken); } /// @@ -7293,13 +8057,17 @@ public static Pageable GetBgpServiceCommunities(this Subscr /// ServiceEndpointPolicies_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetServiceEndpointPoliciesByServiceEndpointPolicyAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceEndpointPoliciesByServiceEndpointPolicyAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetServiceEndpointPoliciesByServiceEndpointPolicyAsync(cancellationToken); } /// @@ -7314,13 +8082,17 @@ public static AsyncPageable GetServiceEndpointPol /// ServiceEndpointPolicies_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetServiceEndpointPoliciesByServiceEndpointPolicy(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceEndpointPoliciesByServiceEndpointPolicy(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetServiceEndpointPoliciesByServiceEndpointPolicy(cancellationToken); } /// @@ -7335,13 +8107,17 @@ public static Pageable GetServiceEndpointPolicies /// ServiceTags_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location that will be used as a reference for version (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to). /// The cancellation token to use. public static async Task> GetServiceTagAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceTagAsync(location, cancellationToken).ConfigureAwait(false); + return await GetNetworkSubscriptionMockingExtension(subscriptionResource).GetServiceTagAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -7356,13 +8132,17 @@ public static async Task> GetServiceTagAsync(thi /// ServiceTags_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location that will be used as a reference for version (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to). /// The cancellation token to use. public static Response GetServiceTag(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceTag(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetServiceTag(location, cancellationToken); } /// @@ -7377,6 +8157,10 @@ public static Response GetServiceTag(this SubscriptionRes /// ServiceTagInformation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location that will be used as a reference for cloud (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to). @@ -7386,7 +8170,7 @@ public static Response GetServiceTag(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAllServiceTagInformationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, bool? noAddressPrefixes = null, string tagName = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllServiceTagInformationAsync(location, noAddressPrefixes, tagName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAllServiceTagInformationAsync(location, noAddressPrefixes, tagName, cancellationToken); } /// @@ -7401,6 +8185,10 @@ public static AsyncPageable GetAllServiceTagInformationAs /// ServiceTagInformation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location that will be used as a reference for cloud (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to). @@ -7410,7 +8198,7 @@ public static AsyncPageable GetAllServiceTagInformationAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAllServiceTagInformation(this SubscriptionResource subscriptionResource, AzureLocation location, bool? noAddressPrefixes = null, string tagName = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllServiceTagInformation(location, noAddressPrefixes, tagName, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetAllServiceTagInformation(location, noAddressPrefixes, tagName, cancellationToken); } /// @@ -7425,6 +8213,10 @@ public static Pageable GetAllServiceTagInformation(this S /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where resource usage is queried. @@ -7432,7 +8224,7 @@ public static Pageable GetAllServiceTagInformation(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, cancellationToken); } /// @@ -7447,6 +8239,10 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where resource usage is queried. @@ -7454,7 +8250,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetUsages(location, cancellationToken); } /// @@ -7469,13 +8265,17 @@ public static Pageable GetUsages(this SubscriptionResource subscri /// VirtualNetworks_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworksAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworksAsync(cancellationToken); } /// @@ -7490,13 +8290,17 @@ public static AsyncPageable GetVirtualNetworksAsync(this /// VirtualNetworks_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworks(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworks(cancellationToken); } /// @@ -7511,13 +8315,17 @@ public static Pageable GetVirtualNetworks(this Subscript /// VirtualNetworkTaps_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualNetworkTapsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworkTapsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworkTapsAsync(cancellationToken); } /// @@ -7532,13 +8340,17 @@ public static AsyncPageable GetVirtualNetworkTapsAsyn /// VirtualNetworkTaps_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualNetworkTaps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworkTaps(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworkTaps(cancellationToken); } /// @@ -7553,13 +8365,17 @@ public static Pageable GetVirtualNetworkTaps(this Sub /// VirtualRouters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualRoutersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualRoutersAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualRoutersAsync(cancellationToken); } /// @@ -7574,13 +8390,17 @@ public static AsyncPageable GetVirtualRoutersAsync(this S /// VirtualRouters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualRouters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualRouters(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualRouters(cancellationToken); } /// @@ -7595,13 +8415,17 @@ public static Pageable GetVirtualRouters(this Subscriptio /// VirtualWans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualWansAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualWansAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualWansAsync(cancellationToken); } /// @@ -7616,13 +8440,17 @@ public static AsyncPageable GetVirtualWansAsync(this Subscri /// VirtualWans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualWans(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualWans(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualWans(cancellationToken); } /// @@ -7637,13 +8465,17 @@ public static Pageable GetVirtualWans(this SubscriptionResou /// VpnSites_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVpnSitesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnSitesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnSitesAsync(cancellationToken); } /// @@ -7658,13 +8490,17 @@ public static AsyncPageable GetVpnSitesAsync(this SubscriptionR /// VpnSites_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVpnSites(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnSites(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnSites(cancellationToken); } /// @@ -7679,13 +8515,17 @@ public static Pageable GetVpnSites(this SubscriptionResource su /// VpnServerConfigurations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVpnServerConfigurationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnServerConfigurationsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnServerConfigurationsAsync(cancellationToken); } /// @@ -7700,13 +8540,17 @@ public static AsyncPageable GetVpnServerConfigur /// VpnServerConfigurations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVpnServerConfigurations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnServerConfigurations(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnServerConfigurations(cancellationToken); } /// @@ -7721,13 +8565,17 @@ public static Pageable GetVpnServerConfiguration /// VirtualHubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualHubsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualHubsAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualHubsAsync(cancellationToken); } /// @@ -7742,13 +8590,17 @@ public static AsyncPageable GetVirtualHubsAsync(this Subscri /// VirtualHubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualHubs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualHubs(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVirtualHubs(cancellationToken); } /// @@ -7763,13 +8615,17 @@ public static Pageable GetVirtualHubs(this SubscriptionResou /// VpnGateways_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVpnGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnGatewaysAsync(cancellationToken); } /// @@ -7784,13 +8640,17 @@ public static AsyncPageable GetVpnGatewaysAsync(this Subscri /// VpnGateways_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVpnGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVpnGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetVpnGateways(cancellationToken); } /// @@ -7805,13 +8665,17 @@ public static Pageable GetVpnGateways(this SubscriptionResou /// P2sVpnGateways_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetP2SVpnGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetP2SVpnGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetP2SVpnGatewaysAsync(cancellationToken); } /// @@ -7826,13 +8690,17 @@ public static AsyncPageable GetP2SVpnGatewaysAsync(this S /// P2sVpnGateways_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetP2SVpnGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetP2SVpnGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetP2SVpnGateways(cancellationToken); } /// @@ -7847,13 +8715,17 @@ public static Pageable GetP2SVpnGateways(this Subscriptio /// ExpressRouteGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExpressRouteGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteGatewaysAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteGatewaysAsync(cancellationToken); } /// @@ -7868,13 +8740,17 @@ public static AsyncPageable GetExpressRouteGateways /// ExpressRouteGateways_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExpressRouteGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExpressRouteGateways(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetExpressRouteGateways(cancellationToken); } /// @@ -7889,13 +8765,17 @@ public static Pageable GetExpressRouteGateways(this /// WebApplicationFirewallPolicies_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetWebApplicationFirewallPoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebApplicationFirewallPoliciesAsync(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetWebApplicationFirewallPoliciesAsync(cancellationToken); } /// @@ -7910,13 +8790,17 @@ public static AsyncPageable GetWebApplicat /// WebApplicationFirewallPolicies_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetWebApplicationFirewallPolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetWebApplicationFirewallPolicies(cancellationToken); + return GetNetworkSubscriptionMockingExtension(subscriptionResource).GetWebApplicationFirewallPolicies(cancellationToken); } } } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkManagementGroupMockingExtension.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkManagementGroupMockingExtension.cs new file mode 100644 index 000000000000..4a537916a8e9 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkManagementGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Network; + +namespace Azure.ResourceManager.Network.Mocking +{ + /// A class to add extension methods to ManagementGroupResource. + public partial class NetworkManagementGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkManagementGroupMockingExtension() + { + } + + /// 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 NetworkManagementGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ManagementGroupNetworkManagerConnectionResources in the ManagementGroupResource. + /// An object representing collection of ManagementGroupNetworkManagerConnectionResources and their operations over a ManagementGroupNetworkManagerConnectionResource. + public virtual ManagementGroupNetworkManagerConnectionCollection GetManagementGroupNetworkManagerConnections() + { + return GetCachedClient(client => new ManagementGroupNetworkManagerConnectionCollection(client, Id)); + } + + /// + /// Get a specified connection created by this management group. + /// + /// + /// Request Path + /// /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName} + /// + /// + /// Operation Id + /// ManagementGroupNetworkManagerConnections_Get + /// + /// + /// + /// Name for the network manager connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagementGroupNetworkManagerConnectionAsync(string networkManagerConnectionName, CancellationToken cancellationToken = default) + { + return await GetManagementGroupNetworkManagerConnections().GetAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specified connection created by this management group. + /// + /// + /// Request Path + /// /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName} + /// + /// + /// Operation Id + /// ManagementGroupNetworkManagerConnections_Get + /// + /// + /// + /// Name for the network manager connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagementGroupNetworkManagerConnection(string networkManagerConnectionName, CancellationToken cancellationToken = default) + { + return GetManagementGroupNetworkManagerConnections().Get(networkManagerConnectionName, cancellationToken); + } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkResourceGroupMockingExtension.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..00bb9cc40af1 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkResourceGroupMockingExtension.cs @@ -0,0 +1,2748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Network; +using Azure.ResourceManager.Network.Models; + +namespace Azure.ResourceManager.Network.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NetworkResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _availableResourceGroupDelegationsClientDiagnostics; + private AvailableResourceGroupDelegationsRestOperations _availableResourceGroupDelegationsRestClient; + private ClientDiagnostics _availableServiceAliasesClientDiagnostics; + private AvailableServiceAliasesRestOperations _availableServiceAliasesRestClient; + private ClientDiagnostics _availablePrivateEndpointTypesClientDiagnostics; + private AvailablePrivateEndpointTypesRestOperations _availablePrivateEndpointTypesRestClient; + private ClientDiagnostics _privateLinkServicesClientDiagnostics; + private PrivateLinkServicesRestOperations _privateLinkServicesRestClient; + + /// Initializes a new instance of the class for mocking. + protected NetworkResourceGroupMockingExtension() + { + } + + /// 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 NetworkResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics AvailableResourceGroupDelegationsClientDiagnostics => _availableResourceGroupDelegationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AvailableResourceGroupDelegationsRestOperations AvailableResourceGroupDelegationsRestClient => _availableResourceGroupDelegationsRestClient ??= new AvailableResourceGroupDelegationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics AvailableServiceAliasesClientDiagnostics => _availableServiceAliasesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AvailableServiceAliasesRestOperations AvailableServiceAliasesRestClient => _availableServiceAliasesRestClient ??= new AvailableServiceAliasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics AvailablePrivateEndpointTypesClientDiagnostics => _availablePrivateEndpointTypesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AvailablePrivateEndpointTypesRestOperations AvailablePrivateEndpointTypesRestClient => _availablePrivateEndpointTypesRestClient ??= new AvailablePrivateEndpointTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics PrivateLinkServicesClientDiagnostics => _privateLinkServicesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PrivateLinkServicesRestOperations PrivateLinkServicesRestClient => _privateLinkServicesRestClient ??= new PrivateLinkServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ApplicationGatewayResources in the ResourceGroupResource. + /// An object representing collection of ApplicationGatewayResources and their operations over a ApplicationGatewayResource. + public virtual ApplicationGatewayCollection GetApplicationGateways() + { + return GetCachedClient(client => new ApplicationGatewayCollection(client, Id)); + } + + /// + /// Gets the specified application gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName} + /// + /// + /// Operation Id + /// ApplicationGateways_Get + /// + /// + /// + /// The name of the application gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApplicationGatewayAsync(string applicationGatewayName, CancellationToken cancellationToken = default) + { + return await GetApplicationGateways().GetAsync(applicationGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified application gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName} + /// + /// + /// Operation Id + /// ApplicationGateways_Get + /// + /// + /// + /// The name of the application gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApplicationGateway(string applicationGatewayName, CancellationToken cancellationToken = default) + { + return GetApplicationGateways().Get(applicationGatewayName, cancellationToken); + } + + /// Gets a collection of ApplicationSecurityGroupResources in the ResourceGroupResource. + /// An object representing collection of ApplicationSecurityGroupResources and their operations over a ApplicationSecurityGroupResource. + public virtual ApplicationSecurityGroupCollection GetApplicationSecurityGroups() + { + return GetCachedClient(client => new ApplicationSecurityGroupCollection(client, Id)); + } + + /// + /// Gets information about the specified application security group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName} + /// + /// + /// Operation Id + /// ApplicationSecurityGroups_Get + /// + /// + /// + /// The name of the application security group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetApplicationSecurityGroupAsync(string applicationSecurityGroupName, CancellationToken cancellationToken = default) + { + return await GetApplicationSecurityGroups().GetAsync(applicationSecurityGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified application security group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName} + /// + /// + /// Operation Id + /// ApplicationSecurityGroups_Get + /// + /// + /// + /// The name of the application security group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetApplicationSecurityGroup(string applicationSecurityGroupName, CancellationToken cancellationToken = default) + { + return GetApplicationSecurityGroups().Get(applicationSecurityGroupName, cancellationToken); + } + + /// Gets a collection of AzureFirewallResources in the ResourceGroupResource. + /// An object representing collection of AzureFirewallResources and their operations over a AzureFirewallResource. + public virtual AzureFirewallCollection GetAzureFirewalls() + { + return GetCachedClient(client => new AzureFirewallCollection(client, Id)); + } + + /// + /// Gets the specified Azure Firewall. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName} + /// + /// + /// Operation Id + /// AzureFirewalls_Get + /// + /// + /// + /// The name of the Azure Firewall. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAzureFirewallAsync(string azureFirewallName, CancellationToken cancellationToken = default) + { + return await GetAzureFirewalls().GetAsync(azureFirewallName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Azure Firewall. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName} + /// + /// + /// Operation Id + /// AzureFirewalls_Get + /// + /// + /// + /// The name of the Azure Firewall. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAzureFirewall(string azureFirewallName, CancellationToken cancellationToken = default) + { + return GetAzureFirewalls().Get(azureFirewallName, cancellationToken); + } + + /// Gets a collection of BastionHostResources in the ResourceGroupResource. + /// An object representing collection of BastionHostResources and their operations over a BastionHostResource. + public virtual BastionHostCollection GetBastionHosts() + { + return GetCachedClient(client => new BastionHostCollection(client, Id)); + } + + /// + /// Gets the specified Bastion Host. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName} + /// + /// + /// Operation Id + /// BastionHosts_Get + /// + /// + /// + /// The name of the Bastion Host. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBastionHostAsync(string bastionHostName, CancellationToken cancellationToken = default) + { + return await GetBastionHosts().GetAsync(bastionHostName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Bastion Host. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName} + /// + /// + /// Operation Id + /// BastionHosts_Get + /// + /// + /// + /// The name of the Bastion Host. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBastionHost(string bastionHostName, CancellationToken cancellationToken = default) + { + return GetBastionHosts().Get(bastionHostName, cancellationToken); + } + + /// Gets a collection of CloudServiceSwapResources in the ResourceGroupResource. + /// The name of the cloud service. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of CloudServiceSwapResources and their operations over a CloudServiceSwapResource. + public virtual CloudServiceSwapCollection GetCloudServiceSwaps(string resourceName) + { + return new CloudServiceSwapCollection(Client, Id, resourceName); + } + + /// + /// Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud service can either be Staging or Production + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource} + /// + /// + /// Operation Id + /// VipSwap_Get + /// + /// + /// + /// The name of the cloud service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudServiceSwapAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetCloudServiceSwaps(resourceName).GetAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud service can either be Staging or Production + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource} + /// + /// + /// Operation Id + /// VipSwap_Get + /// + /// + /// + /// The name of the cloud service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudServiceSwap(string resourceName, CancellationToken cancellationToken = default) + { + return GetCloudServiceSwaps(resourceName).Get(cancellationToken); + } + + /// Gets a collection of CustomIPPrefixResources in the ResourceGroupResource. + /// An object representing collection of CustomIPPrefixResources and their operations over a CustomIPPrefixResource. + public virtual CustomIPPrefixCollection GetCustomIPPrefixes() + { + return GetCachedClient(client => new CustomIPPrefixCollection(client, Id)); + } + + /// + /// Gets the specified custom IP prefix in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName} + /// + /// + /// Operation Id + /// CustomIPPrefixes_Get + /// + /// + /// + /// The name of the custom IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCustomIPPrefixAsync(string customIPPrefixName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetCustomIPPrefixes().GetAsync(customIPPrefixName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom IP prefix in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName} + /// + /// + /// Operation Id + /// CustomIPPrefixes_Get + /// + /// + /// + /// The name of the custom IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCustomIPPrefix(string customIPPrefixName, string expand = null, CancellationToken cancellationToken = default) + { + return GetCustomIPPrefixes().Get(customIPPrefixName, expand, cancellationToken); + } + + /// Gets a collection of DdosCustomPolicyResources in the ResourceGroupResource. + /// An object representing collection of DdosCustomPolicyResources and their operations over a DdosCustomPolicyResource. + public virtual DdosCustomPolicyCollection GetDdosCustomPolicies() + { + return GetCachedClient(client => new DdosCustomPolicyCollection(client, Id)); + } + + /// + /// Gets information about the specified DDoS custom policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName} + /// + /// + /// Operation Id + /// DdosCustomPolicies_Get + /// + /// + /// + /// The name of the DDoS custom policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDdosCustomPolicyAsync(string ddosCustomPolicyName, CancellationToken cancellationToken = default) + { + return await GetDdosCustomPolicies().GetAsync(ddosCustomPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified DDoS custom policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName} + /// + /// + /// Operation Id + /// DdosCustomPolicies_Get + /// + /// + /// + /// The name of the DDoS custom policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDdosCustomPolicy(string ddosCustomPolicyName, CancellationToken cancellationToken = default) + { + return GetDdosCustomPolicies().Get(ddosCustomPolicyName, cancellationToken); + } + + /// Gets a collection of DdosProtectionPlanResources in the ResourceGroupResource. + /// An object representing collection of DdosProtectionPlanResources and their operations over a DdosProtectionPlanResource. + public virtual DdosProtectionPlanCollection GetDdosProtectionPlans() + { + return GetCachedClient(client => new DdosProtectionPlanCollection(client, Id)); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName} + /// + /// + /// Operation Id + /// DdosProtectionPlans_Get + /// + /// + /// + /// The name of the DDoS protection plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDdosProtectionPlanAsync(string ddosProtectionPlanName, CancellationToken cancellationToken = default) + { + return await GetDdosProtectionPlans().GetAsync(ddosProtectionPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName} + /// + /// + /// Operation Id + /// DdosProtectionPlans_Get + /// + /// + /// + /// The name of the DDoS protection plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDdosProtectionPlan(string ddosProtectionPlanName, CancellationToken cancellationToken = default) + { + return GetDdosProtectionPlans().Get(ddosProtectionPlanName, cancellationToken); + } + + /// Gets a collection of DscpConfigurationResources in the ResourceGroupResource. + /// An object representing collection of DscpConfigurationResources and their operations over a DscpConfigurationResource. + public virtual DscpConfigurationCollection GetDscpConfigurations() + { + return GetCachedClient(client => new DscpConfigurationCollection(client, Id)); + } + + /// + /// Gets a DSCP Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName} + /// + /// + /// Operation Id + /// DscpConfiguration_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDscpConfigurationAsync(string dscpConfigurationName, CancellationToken cancellationToken = default) + { + return await GetDscpConfigurations().GetAsync(dscpConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a DSCP Configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName} + /// + /// + /// Operation Id + /// DscpConfiguration_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDscpConfiguration(string dscpConfigurationName, CancellationToken cancellationToken = default) + { + return GetDscpConfigurations().Get(dscpConfigurationName, cancellationToken); + } + + /// Gets a collection of ExpressRouteCircuitResources in the ResourceGroupResource. + /// An object representing collection of ExpressRouteCircuitResources and their operations over a ExpressRouteCircuitResource. + public virtual ExpressRouteCircuitCollection GetExpressRouteCircuits() + { + return GetCachedClient(client => new ExpressRouteCircuitCollection(client, Id)); + } + + /// + /// Gets information about the specified express route circuit. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName} + /// + /// + /// Operation Id + /// ExpressRouteCircuits_Get + /// + /// + /// + /// The name of express route circuit. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRouteCircuitAsync(string circuitName, CancellationToken cancellationToken = default) + { + return await GetExpressRouteCircuits().GetAsync(circuitName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified express route circuit. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName} + /// + /// + /// Operation Id + /// ExpressRouteCircuits_Get + /// + /// + /// + /// The name of express route circuit. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRouteCircuit(string circuitName, CancellationToken cancellationToken = default) + { + return GetExpressRouteCircuits().Get(circuitName, cancellationToken); + } + + /// Gets a collection of ExpressRouteCrossConnectionResources in the ResourceGroupResource. + /// An object representing collection of ExpressRouteCrossConnectionResources and their operations over a ExpressRouteCrossConnectionResource. + public virtual ExpressRouteCrossConnectionCollection GetExpressRouteCrossConnections() + { + return GetCachedClient(client => new ExpressRouteCrossConnectionCollection(client, Id)); + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName} + /// + /// + /// Operation Id + /// ExpressRouteCrossConnections_Get + /// + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRouteCrossConnectionAsync(string crossConnectionName, CancellationToken cancellationToken = default) + { + return await GetExpressRouteCrossConnections().GetAsync(crossConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName} + /// + /// + /// Operation Id + /// ExpressRouteCrossConnections_Get + /// + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRouteCrossConnection(string crossConnectionName, CancellationToken cancellationToken = default) + { + return GetExpressRouteCrossConnections().Get(crossConnectionName, cancellationToken); + } + + /// Gets a collection of ExpressRoutePortResources in the ResourceGroupResource. + /// An object representing collection of ExpressRoutePortResources and their operations over a ExpressRoutePortResource. + public virtual ExpressRoutePortCollection GetExpressRoutePorts() + { + return GetCachedClient(client => new ExpressRoutePortCollection(client, Id)); + } + + /// + /// Retrieves the requested ExpressRoutePort resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName} + /// + /// + /// Operation Id + /// ExpressRoutePorts_Get + /// + /// + /// + /// The name of ExpressRoutePort. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRoutePortAsync(string expressRoutePortName, CancellationToken cancellationToken = default) + { + return await GetExpressRoutePorts().GetAsync(expressRoutePortName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the requested ExpressRoutePort resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName} + /// + /// + /// Operation Id + /// ExpressRoutePorts_Get + /// + /// + /// + /// The name of ExpressRoutePort. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRoutePort(string expressRoutePortName, CancellationToken cancellationToken = default) + { + return GetExpressRoutePorts().Get(expressRoutePortName, cancellationToken); + } + + /// Gets a collection of FirewallPolicyResources in the ResourceGroupResource. + /// An object representing collection of FirewallPolicyResources and their operations over a FirewallPolicyResource. + public virtual FirewallPolicyCollection GetFirewallPolicies() + { + return GetCachedClient(client => new FirewallPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Firewall Policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName} + /// + /// + /// Operation Id + /// FirewallPolicies_Get + /// + /// + /// + /// The name of the Firewall Policy. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFirewallPolicyAsync(string firewallPolicyName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetFirewallPolicies().GetAsync(firewallPolicyName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Firewall Policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName} + /// + /// + /// Operation Id + /// FirewallPolicies_Get + /// + /// + /// + /// The name of the Firewall Policy. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFirewallPolicy(string firewallPolicyName, string expand = null, CancellationToken cancellationToken = default) + { + return GetFirewallPolicies().Get(firewallPolicyName, expand, cancellationToken); + } + + /// Gets a collection of IPAllocationResources in the ResourceGroupResource. + /// An object representing collection of IPAllocationResources and their operations over a IPAllocationResource. + public virtual IPAllocationCollection GetIPAllocations() + { + return GetCachedClient(client => new IPAllocationCollection(client, Id)); + } + + /// + /// Gets the specified IpAllocation by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName} + /// + /// + /// Operation Id + /// IpAllocations_Get + /// + /// + /// + /// The name of the IpAllocation. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIPAllocationAsync(string ipAllocationName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetIPAllocations().GetAsync(ipAllocationName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified IpAllocation by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName} + /// + /// + /// Operation Id + /// IpAllocations_Get + /// + /// + /// + /// The name of the IpAllocation. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIPAllocation(string ipAllocationName, string expand = null, CancellationToken cancellationToken = default) + { + return GetIPAllocations().Get(ipAllocationName, expand, cancellationToken); + } + + /// Gets a collection of IPGroupResources in the ResourceGroupResource. + /// An object representing collection of IPGroupResources and their operations over a IPGroupResource. + public virtual IPGroupCollection GetIPGroups() + { + return GetCachedClient(client => new IPGroupCollection(client, Id)); + } + + /// + /// Gets the specified ipGroups. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName} + /// + /// + /// Operation Id + /// IpGroups_Get + /// + /// + /// + /// The name of the ipGroups. + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIPGroupAsync(string ipGroupsName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetIPGroups().GetAsync(ipGroupsName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified ipGroups. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName} + /// + /// + /// Operation Id + /// IpGroups_Get + /// + /// + /// + /// The name of the ipGroups. + /// Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIPGroup(string ipGroupsName, string expand = null, CancellationToken cancellationToken = default) + { + return GetIPGroups().Get(ipGroupsName, expand, cancellationToken); + } + + /// Gets a collection of LoadBalancerResources in the ResourceGroupResource. + /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. + public virtual LoadBalancerCollection GetLoadBalancers() + { + return GetCachedClient(client => new LoadBalancerCollection(client, Id)); + } + + /// + /// Gets the specified load balancer. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// + /// The name of the load balancer. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLoadBalancerAsync(string loadBalancerName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetLoadBalancers().GetAsync(loadBalancerName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified load balancer. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName} + /// + /// + /// Operation Id + /// LoadBalancers_Get + /// + /// + /// + /// The name of the load balancer. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLoadBalancer(string loadBalancerName, string expand = null, CancellationToken cancellationToken = default) + { + return GetLoadBalancers().Get(loadBalancerName, expand, cancellationToken); + } + + /// Gets a collection of NatGatewayResources in the ResourceGroupResource. + /// An object representing collection of NatGatewayResources and their operations over a NatGatewayResource. + public virtual NatGatewayCollection GetNatGateways() + { + return GetCachedClient(client => new NatGatewayCollection(client, Id)); + } + + /// + /// Gets the specified nat gateway in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName} + /// + /// + /// Operation Id + /// NatGateways_Get + /// + /// + /// + /// The name of the nat gateway. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNatGatewayAsync(string natGatewayName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetNatGateways().GetAsync(natGatewayName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified nat gateway in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName} + /// + /// + /// Operation Id + /// NatGateways_Get + /// + /// + /// + /// The name of the nat gateway. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNatGateway(string natGatewayName, string expand = null, CancellationToken cancellationToken = default) + { + return GetNatGateways().Get(natGatewayName, expand, cancellationToken); + } + + /// Gets a collection of NetworkInterfaceResources in the ResourceGroupResource. + /// An object representing collection of NetworkInterfaceResources and their operations over a NetworkInterfaceResource. + public virtual NetworkInterfaceCollection GetNetworkInterfaces() + { + return GetCachedClient(client => new NetworkInterfaceCollection(client, Id)); + } + + /// + /// Gets information about the specified network interface. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName} + /// + /// + /// Operation Id + /// NetworkInterfaces_Get + /// + /// + /// + /// The name of the network interface. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkInterfaceAsync(string networkInterfaceName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetNetworkInterfaces().GetAsync(networkInterfaceName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified network interface. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName} + /// + /// + /// Operation Id + /// NetworkInterfaces_Get + /// + /// + /// + /// The name of the network interface. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkInterface(string networkInterfaceName, string expand = null, CancellationToken cancellationToken = default) + { + return GetNetworkInterfaces().Get(networkInterfaceName, expand, cancellationToken); + } + + /// Gets a collection of NetworkManagerResources in the ResourceGroupResource. + /// An object representing collection of NetworkManagerResources and their operations over a NetworkManagerResource. + public virtual NetworkManagerCollection GetNetworkManagers() + { + return GetCachedClient(client => new NetworkManagerCollection(client, Id)); + } + + /// + /// Gets the specified Network Manager. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName} + /// + /// + /// Operation Id + /// NetworkManagers_Get + /// + /// + /// + /// The name of the network manager. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkManagerAsync(string networkManagerName, CancellationToken cancellationToken = default) + { + return await GetNetworkManagers().GetAsync(networkManagerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Network Manager. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName} + /// + /// + /// Operation Id + /// NetworkManagers_Get + /// + /// + /// + /// The name of the network manager. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkManager(string networkManagerName, CancellationToken cancellationToken = default) + { + return GetNetworkManagers().Get(networkManagerName, cancellationToken); + } + + /// Gets a collection of NetworkProfileResources in the ResourceGroupResource. + /// An object representing collection of NetworkProfileResources and their operations over a NetworkProfileResource. + public virtual NetworkProfileCollection GetNetworkProfiles() + { + return GetCachedClient(client => new NetworkProfileCollection(client, Id)); + } + + /// + /// Gets the specified network profile in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName} + /// + /// + /// Operation Id + /// NetworkProfiles_Get + /// + /// + /// + /// The name of the public IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkProfileAsync(string networkProfileName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetNetworkProfiles().GetAsync(networkProfileName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified network profile in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName} + /// + /// + /// Operation Id + /// NetworkProfiles_Get + /// + /// + /// + /// The name of the public IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkProfile(string networkProfileName, string expand = null, CancellationToken cancellationToken = default) + { + return GetNetworkProfiles().Get(networkProfileName, expand, cancellationToken); + } + + /// Gets a collection of NetworkSecurityGroupResources in the ResourceGroupResource. + /// An object representing collection of NetworkSecurityGroupResources and their operations over a NetworkSecurityGroupResource. + public virtual NetworkSecurityGroupCollection GetNetworkSecurityGroups() + { + return GetCachedClient(client => new NetworkSecurityGroupCollection(client, Id)); + } + + /// + /// Gets the specified network security group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName} + /// + /// + /// Operation Id + /// NetworkSecurityGroups_Get + /// + /// + /// + /// The name of the network security group. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkSecurityGroupAsync(string networkSecurityGroupName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetNetworkSecurityGroups().GetAsync(networkSecurityGroupName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified network security group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName} + /// + /// + /// Operation Id + /// NetworkSecurityGroups_Get + /// + /// + /// + /// The name of the network security group. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkSecurityGroup(string networkSecurityGroupName, string expand = null, CancellationToken cancellationToken = default) + { + return GetNetworkSecurityGroups().Get(networkSecurityGroupName, expand, cancellationToken); + } + + /// Gets a collection of NetworkVirtualApplianceResources in the ResourceGroupResource. + /// An object representing collection of NetworkVirtualApplianceResources and their operations over a NetworkVirtualApplianceResource. + public virtual NetworkVirtualApplianceCollection GetNetworkVirtualAppliances() + { + return GetCachedClient(client => new NetworkVirtualApplianceCollection(client, Id)); + } + + /// + /// Gets the specified Network Virtual Appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName} + /// + /// + /// Operation Id + /// NetworkVirtualAppliances_Get + /// + /// + /// + /// The name of Network Virtual Appliance. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkVirtualApplianceAsync(string networkVirtualApplianceName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetNetworkVirtualAppliances().GetAsync(networkVirtualApplianceName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Network Virtual Appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName} + /// + /// + /// Operation Id + /// NetworkVirtualAppliances_Get + /// + /// + /// + /// The name of Network Virtual Appliance. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkVirtualAppliance(string networkVirtualApplianceName, string expand = null, CancellationToken cancellationToken = default) + { + return GetNetworkVirtualAppliances().Get(networkVirtualApplianceName, expand, cancellationToken); + } + + /// Gets a collection of NetworkWatcherResources in the ResourceGroupResource. + /// An object representing collection of NetworkWatcherResources and their operations over a NetworkWatcherResource. + public virtual NetworkWatcherCollection GetNetworkWatchers() + { + return GetCachedClient(client => new NetworkWatcherCollection(client, Id)); + } + + /// + /// Gets the specified network watcher by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName} + /// + /// + /// Operation Id + /// NetworkWatchers_Get + /// + /// + /// + /// The name of the network watcher. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkWatcherAsync(string networkWatcherName, CancellationToken cancellationToken = default) + { + return await GetNetworkWatchers().GetAsync(networkWatcherName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified network watcher by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName} + /// + /// + /// Operation Id + /// NetworkWatchers_Get + /// + /// + /// + /// The name of the network watcher. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkWatcher(string networkWatcherName, CancellationToken cancellationToken = default) + { + return GetNetworkWatchers().Get(networkWatcherName, cancellationToken); + } + + /// Gets a collection of PrivateEndpointResources in the ResourceGroupResource. + /// An object representing collection of PrivateEndpointResources and their operations over a PrivateEndpointResource. + public virtual PrivateEndpointCollection GetPrivateEndpoints() + { + return GetCachedClient(client => new PrivateEndpointCollection(client, Id)); + } + + /// + /// Gets the specified private endpoint by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// PrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPrivateEndpointAsync(string privateEndpointName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetPrivateEndpoints().GetAsync(privateEndpointName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified private endpoint by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// PrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPrivateEndpoint(string privateEndpointName, string expand = null, CancellationToken cancellationToken = default) + { + return GetPrivateEndpoints().Get(privateEndpointName, expand, cancellationToken); + } + + /// Gets a collection of PrivateLinkServiceResources in the ResourceGroupResource. + /// An object representing collection of PrivateLinkServiceResources and their operations over a PrivateLinkServiceResource. + public virtual PrivateLinkServiceCollection GetPrivateLinkServices() + { + return GetCachedClient(client => new PrivateLinkServiceCollection(client, Id)); + } + + /// + /// Gets the specified private link service by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName} + /// + /// + /// Operation Id + /// PrivateLinkServices_Get + /// + /// + /// + /// The name of the private link service. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPrivateLinkServiceAsync(string serviceName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetPrivateLinkServices().GetAsync(serviceName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified private link service by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName} + /// + /// + /// Operation Id + /// PrivateLinkServices_Get + /// + /// + /// + /// The name of the private link service. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPrivateLinkService(string serviceName, string expand = null, CancellationToken cancellationToken = default) + { + return GetPrivateLinkServices().Get(serviceName, expand, cancellationToken); + } + + /// Gets a collection of PublicIPAddressResources in the ResourceGroupResource. + /// An object representing collection of PublicIPAddressResources and their operations over a PublicIPAddressResource. + public virtual PublicIPAddressCollection GetPublicIPAddresses() + { + return GetCachedClient(client => new PublicIPAddressCollection(client, Id)); + } + + /// + /// Gets the specified public IP address in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} + /// + /// + /// Operation Id + /// PublicIPAddresses_Get + /// + /// + /// + /// The name of the public IP address. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPublicIPAddressAsync(string publicIPAddressName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetPublicIPAddresses().GetAsync(publicIPAddressName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified public IP address in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} + /// + /// + /// Operation Id + /// PublicIPAddresses_Get + /// + /// + /// + /// The name of the public IP address. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPublicIPAddress(string publicIPAddressName, string expand = null, CancellationToken cancellationToken = default) + { + return GetPublicIPAddresses().Get(publicIPAddressName, expand, cancellationToken); + } + + /// Gets a collection of PublicIPPrefixResources in the ResourceGroupResource. + /// An object representing collection of PublicIPPrefixResources and their operations over a PublicIPPrefixResource. + public virtual PublicIPPrefixCollection GetPublicIPPrefixes() + { + return GetCachedClient(client => new PublicIPPrefixCollection(client, Id)); + } + + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName} + /// + /// + /// Operation Id + /// PublicIPPrefixes_Get + /// + /// + /// + /// The name of the public IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPublicIPPrefixAsync(string publicIPPrefixName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetPublicIPPrefixes().GetAsync(publicIPPrefixName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified public IP prefix in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName} + /// + /// + /// Operation Id + /// PublicIPPrefixes_Get + /// + /// + /// + /// The name of the public IP prefix. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPublicIPPrefix(string publicIPPrefixName, string expand = null, CancellationToken cancellationToken = default) + { + return GetPublicIPPrefixes().Get(publicIPPrefixName, expand, cancellationToken); + } + + /// Gets a collection of RouteFilterResources in the ResourceGroupResource. + /// An object representing collection of RouteFilterResources and their operations over a RouteFilterResource. + public virtual RouteFilterCollection GetRouteFilters() + { + return GetCachedClient(client => new RouteFilterCollection(client, Id)); + } + + /// + /// Gets the specified route filter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName} + /// + /// + /// Operation Id + /// RouteFilters_Get + /// + /// + /// + /// The name of the route filter. + /// Expands referenced express route bgp peering resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRouteFilterAsync(string routeFilterName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetRouteFilters().GetAsync(routeFilterName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified route filter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName} + /// + /// + /// Operation Id + /// RouteFilters_Get + /// + /// + /// + /// The name of the route filter. + /// Expands referenced express route bgp peering resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRouteFilter(string routeFilterName, string expand = null, CancellationToken cancellationToken = default) + { + return GetRouteFilters().Get(routeFilterName, expand, cancellationToken); + } + + /// Gets a collection of RouteTableResources in the ResourceGroupResource. + /// An object representing collection of RouteTableResources and their operations over a RouteTableResource. + public virtual RouteTableCollection GetRouteTables() + { + return GetCachedClient(client => new RouteTableCollection(client, Id)); + } + + /// + /// Gets the specified route table. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName} + /// + /// + /// Operation Id + /// RouteTables_Get + /// + /// + /// + /// The name of the route table. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRouteTableAsync(string routeTableName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetRouteTables().GetAsync(routeTableName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified route table. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName} + /// + /// + /// Operation Id + /// RouteTables_Get + /// + /// + /// + /// The name of the route table. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRouteTable(string routeTableName, string expand = null, CancellationToken cancellationToken = default) + { + return GetRouteTables().Get(routeTableName, expand, cancellationToken); + } + + /// Gets a collection of SecurityPartnerProviderResources in the ResourceGroupResource. + /// An object representing collection of SecurityPartnerProviderResources and their operations over a SecurityPartnerProviderResource. + public virtual SecurityPartnerProviderCollection GetSecurityPartnerProviders() + { + return GetCachedClient(client => new SecurityPartnerProviderCollection(client, Id)); + } + + /// + /// Gets the specified Security Partner Provider. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName} + /// + /// + /// Operation Id + /// SecurityPartnerProviders_Get + /// + /// + /// + /// The name of the Security Partner Provider. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityPartnerProviderAsync(string securityPartnerProviderName, CancellationToken cancellationToken = default) + { + return await GetSecurityPartnerProviders().GetAsync(securityPartnerProviderName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Security Partner Provider. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName} + /// + /// + /// Operation Id + /// SecurityPartnerProviders_Get + /// + /// + /// + /// The name of the Security Partner Provider. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityPartnerProvider(string securityPartnerProviderName, CancellationToken cancellationToken = default) + { + return GetSecurityPartnerProviders().Get(securityPartnerProviderName, cancellationToken); + } + + /// Gets a collection of ServiceEndpointPolicyResources in the ResourceGroupResource. + /// An object representing collection of ServiceEndpointPolicyResources and their operations over a ServiceEndpointPolicyResource. + public virtual ServiceEndpointPolicyCollection GetServiceEndpointPolicies() + { + return GetCachedClient(client => new ServiceEndpointPolicyCollection(client, Id)); + } + + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName} + /// + /// + /// Operation Id + /// ServiceEndpointPolicies_Get + /// + /// + /// + /// The name of the service endpoint policy. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceEndpointPolicyAsync(string serviceEndpointPolicyName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetServiceEndpointPolicies().GetAsync(serviceEndpointPolicyName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified service Endpoint Policies in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName} + /// + /// + /// Operation Id + /// ServiceEndpointPolicies_Get + /// + /// + /// + /// The name of the service endpoint policy. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceEndpointPolicy(string serviceEndpointPolicyName, string expand = null, CancellationToken cancellationToken = default) + { + return GetServiceEndpointPolicies().Get(serviceEndpointPolicyName, expand, cancellationToken); + } + + /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. + public virtual VirtualNetworkCollection GetVirtualNetworks() + { + return GetCachedClient(client => new VirtualNetworkCollection(client, Id)); + } + + /// + /// Gets the specified virtual network by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// The name of the virtual network. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkAsync(string virtualNetworkName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworks().GetAsync(virtualNetworkName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified virtual network by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// The name of the virtual network. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetwork(string virtualNetworkName, string expand = null, CancellationToken cancellationToken = default) + { + return GetVirtualNetworks().Get(virtualNetworkName, expand, cancellationToken); + } + + /// Gets a collection of VirtualNetworkGatewayResources in the ResourceGroupResource. + /// An object representing collection of VirtualNetworkGatewayResources and their operations over a VirtualNetworkGatewayResource. + public virtual VirtualNetworkGatewayCollection GetVirtualNetworkGateways() + { + return GetCachedClient(client => new VirtualNetworkGatewayCollection(client, Id)); + } + + /// + /// Gets the specified virtual network gateway by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName} + /// + /// + /// Operation Id + /// VirtualNetworkGateways_Get + /// + /// + /// + /// The name of the virtual network gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkGatewayAsync(string virtualNetworkGatewayName, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworkGateways().GetAsync(virtualNetworkGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified virtual network gateway by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName} + /// + /// + /// Operation Id + /// VirtualNetworkGateways_Get + /// + /// + /// + /// The name of the virtual network gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetworkGateway(string virtualNetworkGatewayName, CancellationToken cancellationToken = default) + { + return GetVirtualNetworkGateways().Get(virtualNetworkGatewayName, cancellationToken); + } + + /// Gets a collection of VirtualNetworkGatewayConnectionResources in the ResourceGroupResource. + /// An object representing collection of VirtualNetworkGatewayConnectionResources and their operations over a VirtualNetworkGatewayConnectionResource. + public virtual VirtualNetworkGatewayConnectionCollection GetVirtualNetworkGatewayConnections() + { + return GetCachedClient(client => new VirtualNetworkGatewayConnectionCollection(client, Id)); + } + + /// + /// Gets the specified virtual network gateway connection by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName} + /// + /// + /// Operation Id + /// VirtualNetworkGatewayConnections_Get + /// + /// + /// + /// The name of the virtual network gateway connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkGatewayConnectionAsync(string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworkGatewayConnections().GetAsync(virtualNetworkGatewayConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified virtual network gateway connection by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName} + /// + /// + /// Operation Id + /// VirtualNetworkGatewayConnections_Get + /// + /// + /// + /// The name of the virtual network gateway connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetworkGatewayConnection(string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default) + { + return GetVirtualNetworkGatewayConnections().Get(virtualNetworkGatewayConnectionName, cancellationToken); + } + + /// Gets a collection of LocalNetworkGatewayResources in the ResourceGroupResource. + /// An object representing collection of LocalNetworkGatewayResources and their operations over a LocalNetworkGatewayResource. + public virtual LocalNetworkGatewayCollection GetLocalNetworkGateways() + { + return GetCachedClient(client => new LocalNetworkGatewayCollection(client, Id)); + } + + /// + /// Gets the specified local network gateway in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName} + /// + /// + /// Operation Id + /// LocalNetworkGateways_Get + /// + /// + /// + /// The name of the local network gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLocalNetworkGatewayAsync(string localNetworkGatewayName, CancellationToken cancellationToken = default) + { + return await GetLocalNetworkGateways().GetAsync(localNetworkGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified local network gateway in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName} + /// + /// + /// Operation Id + /// LocalNetworkGateways_Get + /// + /// + /// + /// The name of the local network gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLocalNetworkGateway(string localNetworkGatewayName, CancellationToken cancellationToken = default) + { + return GetLocalNetworkGateways().Get(localNetworkGatewayName, cancellationToken); + } + + /// Gets a collection of VirtualNetworkTapResources in the ResourceGroupResource. + /// An object representing collection of VirtualNetworkTapResources and their operations over a VirtualNetworkTapResource. + public virtual VirtualNetworkTapCollection GetVirtualNetworkTaps() + { + return GetCachedClient(client => new VirtualNetworkTapCollection(client, Id)); + } + + /// + /// Gets information about the specified virtual network tap. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName} + /// + /// + /// Operation Id + /// VirtualNetworkTaps_Get + /// + /// + /// + /// The name of virtual network tap. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkTapAsync(string tapName, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworkTaps().GetAsync(tapName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified virtual network tap. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName} + /// + /// + /// Operation Id + /// VirtualNetworkTaps_Get + /// + /// + /// + /// The name of virtual network tap. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetworkTap(string tapName, CancellationToken cancellationToken = default) + { + return GetVirtualNetworkTaps().Get(tapName, cancellationToken); + } + + /// Gets a collection of VirtualRouterResources in the ResourceGroupResource. + /// An object representing collection of VirtualRouterResources and their operations over a VirtualRouterResource. + public virtual VirtualRouterCollection GetVirtualRouters() + { + return GetCachedClient(client => new VirtualRouterCollection(client, Id)); + } + + /// + /// Gets the specified Virtual Router. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName} + /// + /// + /// Operation Id + /// VirtualRouters_Get + /// + /// + /// + /// The name of the Virtual Router. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualRouterAsync(string virtualRouterName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetVirtualRouters().GetAsync(virtualRouterName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Virtual Router. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName} + /// + /// + /// Operation Id + /// VirtualRouters_Get + /// + /// + /// + /// The name of the Virtual Router. + /// Expands referenced resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualRouter(string virtualRouterName, string expand = null, CancellationToken cancellationToken = default) + { + return GetVirtualRouters().Get(virtualRouterName, expand, cancellationToken); + } + + /// Gets a collection of VirtualWanResources in the ResourceGroupResource. + /// An object representing collection of VirtualWanResources and their operations over a VirtualWanResource. + public virtual VirtualWanCollection GetVirtualWans() + { + return GetCachedClient(client => new VirtualWanCollection(client, Id)); + } + + /// + /// Retrieves the details of a VirtualWAN. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName} + /// + /// + /// Operation Id + /// VirtualWans_Get + /// + /// + /// + /// The name of the VirtualWAN being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualWanAsync(string virtualWanName, CancellationToken cancellationToken = default) + { + return await GetVirtualWans().GetAsync(virtualWanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a VirtualWAN. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName} + /// + /// + /// Operation Id + /// VirtualWans_Get + /// + /// + /// + /// The name of the VirtualWAN being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualWan(string virtualWanName, CancellationToken cancellationToken = default) + { + return GetVirtualWans().Get(virtualWanName, cancellationToken); + } + + /// Gets a collection of VpnSiteResources in the ResourceGroupResource. + /// An object representing collection of VpnSiteResources and their operations over a VpnSiteResource. + public virtual VpnSiteCollection GetVpnSites() + { + return GetCachedClient(client => new VpnSiteCollection(client, Id)); + } + + /// + /// Retrieves the details of a VPN site. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName} + /// + /// + /// Operation Id + /// VpnSites_Get + /// + /// + /// + /// The name of the VpnSite being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVpnSiteAsync(string vpnSiteName, CancellationToken cancellationToken = default) + { + return await GetVpnSites().GetAsync(vpnSiteName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a VPN site. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName} + /// + /// + /// Operation Id + /// VpnSites_Get + /// + /// + /// + /// The name of the VpnSite being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVpnSite(string vpnSiteName, CancellationToken cancellationToken = default) + { + return GetVpnSites().Get(vpnSiteName, cancellationToken); + } + + /// Gets a collection of VpnServerConfigurationResources in the ResourceGroupResource. + /// An object representing collection of VpnServerConfigurationResources and their operations over a VpnServerConfigurationResource. + public virtual VpnServerConfigurationCollection GetVpnServerConfigurations() + { + return GetCachedClient(client => new VpnServerConfigurationCollection(client, Id)); + } + + /// + /// Retrieves the details of a VpnServerConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName} + /// + /// + /// Operation Id + /// VpnServerConfigurations_Get + /// + /// + /// + /// The name of the VpnServerConfiguration being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVpnServerConfigurationAsync(string vpnServerConfigurationName, CancellationToken cancellationToken = default) + { + return await GetVpnServerConfigurations().GetAsync(vpnServerConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a VpnServerConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName} + /// + /// + /// Operation Id + /// VpnServerConfigurations_Get + /// + /// + /// + /// The name of the VpnServerConfiguration being retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVpnServerConfiguration(string vpnServerConfigurationName, CancellationToken cancellationToken = default) + { + return GetVpnServerConfigurations().Get(vpnServerConfigurationName, cancellationToken); + } + + /// Gets a collection of VirtualHubResources in the ResourceGroupResource. + /// An object representing collection of VirtualHubResources and their operations over a VirtualHubResource. + public virtual VirtualHubCollection GetVirtualHubs() + { + return GetCachedClient(client => new VirtualHubCollection(client, Id)); + } + + /// + /// Retrieves the details of a VirtualHub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName} + /// + /// + /// Operation Id + /// VirtualHubs_Get + /// + /// + /// + /// The name of the VirtualHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualHubAsync(string virtualHubName, CancellationToken cancellationToken = default) + { + return await GetVirtualHubs().GetAsync(virtualHubName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a VirtualHub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName} + /// + /// + /// Operation Id + /// VirtualHubs_Get + /// + /// + /// + /// The name of the VirtualHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualHub(string virtualHubName, CancellationToken cancellationToken = default) + { + return GetVirtualHubs().Get(virtualHubName, cancellationToken); + } + + /// Gets a collection of VpnGatewayResources in the ResourceGroupResource. + /// An object representing collection of VpnGatewayResources and their operations over a VpnGatewayResource. + public virtual VpnGatewayCollection GetVpnGateways() + { + return GetCachedClient(client => new VpnGatewayCollection(client, Id)); + } + + /// + /// Retrieves the details of a virtual wan vpn gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName} + /// + /// + /// Operation Id + /// VpnGateways_Get + /// + /// + /// + /// The name of the gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVpnGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + { + return await GetVpnGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a virtual wan vpn gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName} + /// + /// + /// Operation Id + /// VpnGateways_Get + /// + /// + /// + /// The name of the gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVpnGateway(string gatewayName, CancellationToken cancellationToken = default) + { + return GetVpnGateways().Get(gatewayName, cancellationToken); + } + + /// Gets a collection of P2SVpnGatewayResources in the ResourceGroupResource. + /// An object representing collection of P2SVpnGatewayResources and their operations over a P2SVpnGatewayResource. + public virtual P2SVpnGatewayCollection GetP2SVpnGateways() + { + return GetCachedClient(client => new P2SVpnGatewayCollection(client, Id)); + } + + /// + /// Retrieves the details of a virtual wan p2s vpn gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName} + /// + /// + /// Operation Id + /// P2sVpnGateways_Get + /// + /// + /// + /// The name of the gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetP2SVpnGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + { + return await GetP2SVpnGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the details of a virtual wan p2s vpn gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName} + /// + /// + /// Operation Id + /// P2sVpnGateways_Get + /// + /// + /// + /// The name of the gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetP2SVpnGateway(string gatewayName, CancellationToken cancellationToken = default) + { + return GetP2SVpnGateways().Get(gatewayName, cancellationToken); + } + + /// Gets a collection of ExpressRouteGatewayResources in the ResourceGroupResource. + /// An object representing collection of ExpressRouteGatewayResources and their operations over a ExpressRouteGatewayResource. + public virtual ExpressRouteGatewayCollection GetExpressRouteGateways() + { + return GetCachedClient(client => new ExpressRouteGatewayCollection(client, Id)); + } + + /// + /// Fetches the details of a ExpressRoute gateway in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName} + /// + /// + /// Operation Id + /// ExpressRouteGateways_Get + /// + /// + /// + /// The name of the ExpressRoute gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRouteGatewayAsync(string expressRouteGatewayName, CancellationToken cancellationToken = default) + { + return await GetExpressRouteGateways().GetAsync(expressRouteGatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fetches the details of a ExpressRoute gateway in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName} + /// + /// + /// Operation Id + /// ExpressRouteGateways_Get + /// + /// + /// + /// The name of the ExpressRoute gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRouteGateway(string expressRouteGatewayName, CancellationToken cancellationToken = default) + { + return GetExpressRouteGateways().Get(expressRouteGatewayName, cancellationToken); + } + + /// Gets a collection of WebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// An object representing collection of WebApplicationFirewallPolicyResources and their operations over a WebApplicationFirewallPolicyResource. + public virtual WebApplicationFirewallPolicyCollection GetWebApplicationFirewallPolicies() + { + return GetCachedClient(client => new WebApplicationFirewallPolicyCollection(client, Id)); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// WebApplicationFirewallPolicies_Get + /// + /// + /// + /// The name of the policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebApplicationFirewallPolicyAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// WebApplicationFirewallPolicies_Get + /// + /// + /// + /// The name of the policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebApplicationFirewallPolicy(string policyName, CancellationToken cancellationToken = default) + { + return GetWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + } + + /// + /// Gets all of the available subnet delegations for this resource group in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations + /// + /// + /// Operation Id + /// AvailableResourceGroupDelegations_List + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAvailableResourceGroupDelegationsAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableResourceGroupDelegationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableResourceGroupDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableResourceGroupDelegationsClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailableResourceGroupDelegations", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all of the available subnet delegations for this resource group in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations + /// + /// + /// Operation Id + /// AvailableResourceGroupDelegations_List + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAvailableResourceGroupDelegations(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableResourceGroupDelegationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableResourceGroupDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableResourceGroupDelegationsClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailableResourceGroupDelegations", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases + /// + /// + /// Operation Id + /// AvailableServiceAliases_ListByResourceGroup + /// + /// + /// + /// The location. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAvailableServiceAliasesByResourceGroupAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailableServiceAliasesByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all available service aliases for this resource group in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases + /// + /// + /// Operation Id + /// AvailableServiceAliases_ListByResourceGroup + /// + /// + /// + /// The location. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAvailableServiceAliasesByResourceGroup(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailableServiceAliasesByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes + /// + /// + /// Operation Id + /// AvailablePrivateEndpointTypes_ListByResourceGroup + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAvailablePrivateEndpointTypesByResourceGroupAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailablePrivateEndpointTypesByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes + /// + /// + /// Operation Id + /// AvailablePrivateEndpointTypes_ListByResourceGroup + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAvailablePrivateEndpointTypesByResourceGroup(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAvailablePrivateEndpointTypesByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Checks whether the subscription is visible to private link service in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility + /// + /// + /// Operation Id + /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup + /// + /// + /// + /// 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 location of the domain name. + /// The request body of CheckPrivateLinkService API call. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkServiceAsync(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); + + using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("NetworkResourceGroupMockingExtension.CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService"); + scope.Start(); + try + { + var response = await PrivateLinkServicesRestClient.CheckPrivateLinkServiceVisibilityByResourceGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); + var operation = new NetworkArmOperation(new PrivateLinkServiceVisibilityOperationSource(), PrivateLinkServicesClientDiagnostics, Pipeline, PrivateLinkServicesRestClient.CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks whether the subscription is visible to private link service in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility + /// + /// + /// Operation Id + /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup + /// + /// + /// + /// 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 location of the domain name. + /// The request body of CheckPrivateLinkService API call. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); + + using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("NetworkResourceGroupMockingExtension.CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService"); + scope.Start(); + try + { + var response = PrivateLinkServicesRestClient.CheckPrivateLinkServiceVisibilityByResourceGroup(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); + var operation = new NetworkArmOperation(new PrivateLinkServiceVisibilityOperationSource(), PrivateLinkServicesClientDiagnostics, Pipeline, PrivateLinkServicesRestClient.CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices + /// + /// + /// Operation Id + /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServicesAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices", "value", "nextLink", cancellationToken); + } + + /// + /// Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices + /// + /// + /// Operation Id + /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup + /// + /// + /// + /// The location of the domain name. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "NetworkResourceGroupMockingExtension.GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkSubscriptionMockingExtension.cs similarity index 87% rename from sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkSubscriptionMockingExtension.cs index 89496a249ba3..4c01a1961fce 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/NetworkSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Network; using Azure.ResourceManager.Network.Models; -namespace Azure.ResourceManager.Network +namespace Azure.ResourceManager.Network.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NetworkSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _applicationGatewayClientDiagnostics; private ApplicationGatewaysRestOperations _applicationGatewayRestClient; @@ -125,15 +126,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _webApplicationFirewallPolicyClientDiagnostics; private WebApplicationFirewallPoliciesRestOperations _webApplicationFirewallPolicyRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NetworkSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NetworkSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -256,39 +257,313 @@ public virtual ApplicationGatewayWafDynamicManifestCollection GetApplicationGate return new ApplicationGatewayWafDynamicManifestCollection(Client, Id, location); } + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault + /// + /// + /// Operation Id + /// ApplicationGatewayWafDynamicManifestsDefault_Get + /// + /// + /// + /// The region where the nrp are located at. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetApplicationGatewayWafDynamicManifestAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + return await GetApplicationGatewayWafDynamicManifests(location).GetAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the regional application gateway waf manifest. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault + /// + /// + /// Operation Id + /// ApplicationGatewayWafDynamicManifestsDefault_Get + /// + /// + /// + /// The region where the nrp are located at. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetApplicationGatewayWafDynamicManifest(AzureLocation location, CancellationToken cancellationToken = default) + { + return GetApplicationGatewayWafDynamicManifests(location).Get(cancellationToken); + } + /// Gets a collection of AzureWebCategoryResources in the SubscriptionResource. /// An object representing collection of AzureWebCategoryResources and their operations over a AzureWebCategoryResource. public virtual AzureWebCategoryCollection GetAzureWebCategories() { - return GetCachedClient(Client => new AzureWebCategoryCollection(Client, Id)); + return GetCachedClient(client => new AzureWebCategoryCollection(client, Id)); + } + + /// + /// Gets the specified Azure Web Category. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name} + /// + /// + /// Operation Id + /// WebCategories_Get + /// + /// + /// + /// The name of the azureWebCategory. + /// Expands resourceIds back referenced by the azureWebCategory resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAzureWebCategoryAsync(string name, string expand = null, CancellationToken cancellationToken = default) + { + return await GetAzureWebCategories().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Azure Web Category. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name} + /// + /// + /// Operation Id + /// WebCategories_Get + /// + /// + /// + /// The name of the azureWebCategory. + /// Expands resourceIds back referenced by the azureWebCategory resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAzureWebCategory(string name, string expand = null, CancellationToken cancellationToken = default) + { + return GetAzureWebCategories().Get(name, expand, cancellationToken); } /// Gets a collection of ExpressRouteProviderPortResources in the SubscriptionResource. /// An object representing collection of ExpressRouteProviderPortResources and their operations over a ExpressRouteProviderPortResource. public virtual ExpressRouteProviderPortCollection GetExpressRouteProviderPorts() { - return GetCachedClient(Client => new ExpressRouteProviderPortCollection(Client, Id)); + return GetCachedClient(client => new ExpressRouteProviderPortCollection(client, Id)); + } + + /// + /// Retrieves detail of a provider port. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport} + /// + /// + /// Operation Id + /// ExpressRouteProviderPort + /// + /// + /// + /// The name of the provider port. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRouteProviderPortAsync(string providerport, CancellationToken cancellationToken = default) + { + return await GetExpressRouteProviderPorts().GetAsync(providerport, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves detail of a provider port. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport} + /// + /// + /// Operation Id + /// ExpressRouteProviderPort + /// + /// + /// + /// The name of the provider port. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRouteProviderPort(string providerport, CancellationToken cancellationToken = default) + { + return GetExpressRouteProviderPorts().Get(providerport, cancellationToken); } /// Gets a collection of ExpressRoutePortsLocationResources in the SubscriptionResource. /// An object representing collection of ExpressRoutePortsLocationResources and their operations over a ExpressRoutePortsLocationResource. public virtual ExpressRoutePortsLocationCollection GetExpressRoutePortsLocations() { - return GetCachedClient(Client => new ExpressRoutePortsLocationCollection(Client, Id)); + return GetCachedClient(client => new ExpressRoutePortsLocationCollection(client, Id)); + } + + /// + /// Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName} + /// + /// + /// Operation Id + /// ExpressRoutePortsLocations_Get + /// + /// + /// + /// Name of the requested ExpressRoutePort peering location. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExpressRoutePortsLocationAsync(string locationName, CancellationToken cancellationToken = default) + { + return await GetExpressRoutePortsLocations().GetAsync(locationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName} + /// + /// + /// Operation Id + /// ExpressRoutePortsLocations_Get + /// + /// + /// + /// Name of the requested ExpressRoutePort peering location. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExpressRoutePortsLocation(string locationName, CancellationToken cancellationToken = default) + { + return GetExpressRoutePortsLocations().Get(locationName, cancellationToken); } /// Gets a collection of SubscriptionNetworkManagerConnectionResources in the SubscriptionResource. /// An object representing collection of SubscriptionNetworkManagerConnectionResources and their operations over a SubscriptionNetworkManagerConnectionResource. public virtual SubscriptionNetworkManagerConnectionCollection GetSubscriptionNetworkManagerConnections() { - return GetCachedClient(Client => new SubscriptionNetworkManagerConnectionCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionNetworkManagerConnectionCollection(client, Id)); + } + + /// + /// Get a specified connection created by this subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName} + /// + /// + /// Operation Id + /// SubscriptionNetworkManagerConnections_Get + /// + /// + /// + /// Name for the network manager connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionNetworkManagerConnectionAsync(string networkManagerConnectionName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionNetworkManagerConnections().GetAsync(networkManagerConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specified connection created by this subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName} + /// + /// + /// Operation Id + /// SubscriptionNetworkManagerConnections_Get + /// + /// + /// + /// Name for the network manager connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionNetworkManagerConnection(string networkManagerConnectionName, CancellationToken cancellationToken = default) + { + return GetSubscriptionNetworkManagerConnections().Get(networkManagerConnectionName, cancellationToken); } /// Gets a collection of NetworkVirtualApplianceSkuResources in the SubscriptionResource. /// An object representing collection of NetworkVirtualApplianceSkuResources and their operations over a NetworkVirtualApplianceSkuResource. public virtual NetworkVirtualApplianceSkuCollection GetNetworkVirtualApplianceSkus() { - return GetCachedClient(Client => new NetworkVirtualApplianceSkuCollection(Client, Id)); + return GetCachedClient(client => new NetworkVirtualApplianceSkuCollection(client, Id)); + } + + /// + /// Retrieves a single available sku for network virtual appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName} + /// + /// + /// Operation Id + /// VirtualApplianceSkus_Get + /// + /// + /// + /// Name of the Sku. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkVirtualApplianceSkuAsync(string skuName, CancellationToken cancellationToken = default) + { + return await GetNetworkVirtualApplianceSkus().GetAsync(skuName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves a single available sku for network virtual appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName} + /// + /// + /// Operation Id + /// VirtualApplianceSkus_Get + /// + /// + /// + /// Name of the Sku. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkVirtualApplianceSku(string skuName, CancellationToken cancellationToken = default) + { + return GetNetworkVirtualApplianceSkus().Get(skuName, cancellationToken); } /// @@ -310,7 +585,7 @@ public virtual AsyncPageable GetApplicationGatewaysA { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationGatewayRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayResource(Client, ApplicationGatewayData.DeserializeApplicationGatewayData(e)), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayResource(Client, ApplicationGatewayData.DeserializeApplicationGatewayData(e)), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationGateways", "value", "nextLink", cancellationToken); } /// @@ -332,7 +607,7 @@ public virtual Pageable GetApplicationGateways(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationGatewayRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayResource(Client, ApplicationGatewayData.DeserializeApplicationGatewayData(e)), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationGatewayResource(Client, ApplicationGatewayData.DeserializeApplicationGatewayData(e)), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationGateways", "value", "nextLink", cancellationToken); } /// @@ -353,7 +628,7 @@ public virtual Pageable GetApplicationGateways(Cance public virtual AsyncPageable GetAvailableServerVariablesApplicationGatewaysAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableServerVariablesRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableServerVariablesApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableServerVariablesApplicationGateways", "", null, cancellationToken); } /// @@ -374,7 +649,7 @@ public virtual AsyncPageable GetAvailableServerVariablesApplicationGatew public virtual Pageable GetAvailableServerVariablesApplicationGateways(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableServerVariablesRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableServerVariablesApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableServerVariablesApplicationGateways", "", null, cancellationToken); } /// @@ -395,7 +670,7 @@ public virtual Pageable GetAvailableServerVariablesApplicationGateways(C public virtual AsyncPageable GetAvailableRequestHeadersApplicationGatewaysAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableRequestHeadersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableRequestHeadersApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableRequestHeadersApplicationGateways", "", null, cancellationToken); } /// @@ -416,7 +691,7 @@ public virtual AsyncPageable GetAvailableRequestHeadersApplicationGatewa public virtual Pageable GetAvailableRequestHeadersApplicationGateways(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableRequestHeadersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableRequestHeadersApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableRequestHeadersApplicationGateways", "", null, cancellationToken); } /// @@ -437,7 +712,7 @@ public virtual Pageable GetAvailableRequestHeadersApplicationGateways(Ca public virtual AsyncPageable GetAvailableResponseHeadersApplicationGatewaysAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableResponseHeadersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableResponseHeadersApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableResponseHeadersApplicationGateways", "", null, cancellationToken); } /// @@ -458,7 +733,7 @@ public virtual AsyncPageable GetAvailableResponseHeadersApplicationGatew public virtual Pageable GetAvailableResponseHeadersApplicationGateways(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableResponseHeadersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableResponseHeadersApplicationGateways", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableResponseHeadersApplicationGateways", "", null, cancellationToken); } /// @@ -479,7 +754,7 @@ public virtual Pageable GetAvailableResponseHeadersApplicationGateways(C public virtual AsyncPageable GetAppGatewayAvailableWafRuleSetsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableWafRuleSetsRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ApplicationGatewayFirewallRuleSet.DeserializeApplicationGatewayFirewallRuleSet, ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppGatewayAvailableWafRuleSets", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ApplicationGatewayFirewallRuleSet.DeserializeApplicationGatewayFirewallRuleSet, ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAppGatewayAvailableWafRuleSets", "value", null, cancellationToken); } /// @@ -500,7 +775,7 @@ public virtual AsyncPageable GetAppGatewayAva public virtual Pageable GetAppGatewayAvailableWafRuleSets(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableWafRuleSetsRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ApplicationGatewayFirewallRuleSet.DeserializeApplicationGatewayFirewallRuleSet, ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppGatewayAvailableWafRuleSets", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ApplicationGatewayFirewallRuleSet.DeserializeApplicationGatewayFirewallRuleSet, ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAppGatewayAvailableWafRuleSets", "value", null, cancellationToken); } /// @@ -519,7 +794,7 @@ public virtual Pageable GetAppGatewayAvailabl /// The cancellation token to use. public virtual async Task> GetApplicationGatewayAvailableSslOptionsAsync(CancellationToken cancellationToken = default) { - using var scope = ApplicationGatewayClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApplicationGatewayAvailableSslOptions"); + using var scope = ApplicationGatewayClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetApplicationGatewayAvailableSslOptions"); scope.Start(); try { @@ -549,7 +824,7 @@ public virtual async Task> G /// The cancellation token to use. public virtual Response GetApplicationGatewayAvailableSslOptions(CancellationToken cancellationToken = default) { - using var scope = ApplicationGatewayClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApplicationGatewayAvailableSslOptions"); + using var scope = ApplicationGatewayClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetApplicationGatewayAvailableSslOptions"); scope.Start(); try { @@ -582,7 +857,7 @@ public virtual AsyncPageable GetApplicati { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableSslPredefinedPoliciesRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationGatewayRestClient.CreateListAvailableSslPredefinedPoliciesNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationGatewaySslPredefinedPolicy.DeserializeApplicationGatewaySslPredefinedPolicy, ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationGatewayAvailableSslPredefinedPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ApplicationGatewaySslPredefinedPolicy.DeserializeApplicationGatewaySslPredefinedPolicy, ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationGatewayAvailableSslPredefinedPolicies", "value", "nextLink", cancellationToken); } /// @@ -604,7 +879,7 @@ public virtual Pageable GetApplicationGat { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationGatewayRestClient.CreateListAvailableSslPredefinedPoliciesRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationGatewayRestClient.CreateListAvailableSslPredefinedPoliciesNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationGatewaySslPredefinedPolicy.DeserializeApplicationGatewaySslPredefinedPolicy, ApplicationGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationGatewayAvailableSslPredefinedPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ApplicationGatewaySslPredefinedPolicy.DeserializeApplicationGatewaySslPredefinedPolicy, ApplicationGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationGatewayAvailableSslPredefinedPolicies", "value", "nextLink", cancellationToken); } /// @@ -622,9 +897,13 @@ public virtual Pageable GetApplicationGat /// /// Name of Ssl predefined policy. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetApplicationGatewaySslPredefinedPolicyAsync(string predefinedPolicyName, CancellationToken cancellationToken = default) { - using var scope = ApplicationGatewayClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApplicationGatewaySslPredefinedPolicy"); + Argument.AssertNotNullOrEmpty(predefinedPolicyName, nameof(predefinedPolicyName)); + + using var scope = ApplicationGatewayClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetApplicationGatewaySslPredefinedPolicy"); scope.Start(); try { @@ -653,9 +932,13 @@ public virtual async Task> GetAp /// /// Name of Ssl predefined policy. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetApplicationGatewaySslPredefinedPolicy(string predefinedPolicyName, CancellationToken cancellationToken = default) { - using var scope = ApplicationGatewayClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetApplicationGatewaySslPredefinedPolicy"); + Argument.AssertNotNullOrEmpty(predefinedPolicyName, nameof(predefinedPolicyName)); + + using var scope = ApplicationGatewayClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetApplicationGatewaySslPredefinedPolicy"); scope.Start(); try { @@ -688,7 +971,7 @@ public virtual AsyncPageable GetApplicationSec { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationSecurityGroupRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationSecurityGroupRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationSecurityGroupResource(Client, ApplicationSecurityGroupData.DeserializeApplicationSecurityGroupData(e)), ApplicationSecurityGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationSecurityGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ApplicationSecurityGroupResource(Client, ApplicationSecurityGroupData.DeserializeApplicationSecurityGroupData(e)), ApplicationSecurityGroupClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationSecurityGroups", "value", "nextLink", cancellationToken); } /// @@ -710,7 +993,7 @@ public virtual Pageable GetApplicationSecurity { HttpMessage FirstPageRequest(int? pageSizeHint) => ApplicationSecurityGroupRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ApplicationSecurityGroupRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationSecurityGroupResource(Client, ApplicationSecurityGroupData.DeserializeApplicationSecurityGroupData(e)), ApplicationSecurityGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetApplicationSecurityGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ApplicationSecurityGroupResource(Client, ApplicationSecurityGroupData.DeserializeApplicationSecurityGroupData(e)), ApplicationSecurityGroupClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetApplicationSecurityGroups", "value", "nextLink", cancellationToken); } /// @@ -733,7 +1016,7 @@ public virtual AsyncPageable GetAvailableDelegationsAsync(A { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableDelegationsRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableDelegationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableDelegations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableDelegationsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableDelegations", "value", "nextLink", cancellationToken); } /// @@ -756,7 +1039,7 @@ public virtual Pageable GetAvailableDelegations(AzureLocati { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableDelegationsRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableDelegationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableDelegations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableDelegationsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableDelegations", "value", "nextLink", cancellationToken); } /// @@ -779,7 +1062,7 @@ public virtual AsyncPageable GetAvailableServiceAliasesAs { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableServiceAliases", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableServiceAliases", "value", "nextLink", cancellationToken); } /// @@ -802,7 +1085,7 @@ public virtual Pageable GetAvailableServiceAliases(AzureL { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableServiceAliases", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableServiceAliases", "value", "nextLink", cancellationToken); } /// @@ -824,7 +1107,7 @@ public virtual AsyncPageable GetAzureFirewallsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureFirewallRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureFirewallRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureFirewallResource(Client, AzureFirewallData.DeserializeAzureFirewallData(e)), AzureFirewallClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureFirewalls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureFirewallResource(Client, AzureFirewallData.DeserializeAzureFirewallData(e)), AzureFirewallClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAzureFirewalls", "value", "nextLink", cancellationToken); } /// @@ -846,7 +1129,7 @@ public virtual Pageable GetAzureFirewalls(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureFirewallRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureFirewallRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureFirewallResource(Client, AzureFirewallData.DeserializeAzureFirewallData(e)), AzureFirewallClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureFirewalls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureFirewallResource(Client, AzureFirewallData.DeserializeAzureFirewallData(e)), AzureFirewallClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAzureFirewalls", "value", "nextLink", cancellationToken); } /// @@ -868,7 +1151,7 @@ public virtual AsyncPageable GetAzureFirewallFqdnTagsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureFirewallFqdnTagsRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureFirewallFqdnTagsRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AzureFirewallFqdnTag.DeserializeAzureFirewallFqdnTag, AzureFirewallFqdnTagsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureFirewallFqdnTags", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AzureFirewallFqdnTag.DeserializeAzureFirewallFqdnTag, AzureFirewallFqdnTagsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAzureFirewallFqdnTags", "value", "nextLink", cancellationToken); } /// @@ -890,7 +1173,7 @@ public virtual Pageable GetAzureFirewallFqdnTags(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureFirewallFqdnTagsRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureFirewallFqdnTagsRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AzureFirewallFqdnTag.DeserializeAzureFirewallFqdnTag, AzureFirewallFqdnTagsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureFirewallFqdnTags", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AzureFirewallFqdnTag.DeserializeAzureFirewallFqdnTag, AzureFirewallFqdnTagsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAzureFirewallFqdnTags", "value", "nextLink", cancellationToken); } /// @@ -912,7 +1195,7 @@ public virtual AsyncPageable GetBastionHostsAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => BastionHostRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BastionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BastionHostResource(Client, BastionHostData.DeserializeBastionHostData(e)), BastionHostClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBastionHosts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BastionHostResource(Client, BastionHostData.DeserializeBastionHostData(e)), BastionHostClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetBastionHosts", "value", "nextLink", cancellationToken); } /// @@ -934,7 +1217,7 @@ public virtual Pageable GetBastionHosts(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => BastionHostRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BastionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BastionHostResource(Client, BastionHostData.DeserializeBastionHostData(e)), BastionHostClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBastionHosts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BastionHostResource(Client, BastionHostData.DeserializeBastionHostData(e)), BastionHostClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetBastionHosts", "value", "nextLink", cancellationToken); } /// @@ -953,9 +1236,12 @@ public virtual Pageable GetBastionHosts(CancellationToken c /// The location of the domain name. /// The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDnsNameAvailabilityAsync(AzureLocation location, string domainNameLabel, CancellationToken cancellationToken = default) { - using var scope = ExpressRouteProviderPortClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDnsNameAvailability"); + Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); + + using var scope = ExpressRouteProviderPortClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.CheckDnsNameAvailability"); scope.Start(); try { @@ -985,9 +1271,12 @@ public virtual async Task> CheckDnsNameAvail /// The location of the domain name. /// The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. /// The cancellation token to use. + /// is null. public virtual Response CheckDnsNameAvailability(AzureLocation location, string domainNameLabel, CancellationToken cancellationToken = default) { - using var scope = ExpressRouteProviderPortClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDnsNameAvailability"); + Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); + + using var scope = ExpressRouteProviderPortClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.CheckDnsNameAvailability"); scope.Start(); try { @@ -1020,7 +1309,7 @@ public virtual AsyncPageable GetCustomIPPrefixesAsync(Ca { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomIPPrefixRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomIPPrefixRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomIPPrefixResource(Client, CustomIPPrefixData.DeserializeCustomIPPrefixData(e)), CustomIPPrefixClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomIPPrefixResource(Client, CustomIPPrefixData.DeserializeCustomIPPrefixData(e)), CustomIPPrefixClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetCustomIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -1042,7 +1331,7 @@ public virtual Pageable GetCustomIPPrefixes(Cancellation { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomIPPrefixRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomIPPrefixRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomIPPrefixResource(Client, CustomIPPrefixData.DeserializeCustomIPPrefixData(e)), CustomIPPrefixClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomIPPrefixResource(Client, CustomIPPrefixData.DeserializeCustomIPPrefixData(e)), CustomIPPrefixClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetCustomIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -1064,7 +1353,7 @@ public virtual AsyncPageable GetDdosProtectionPlansA { HttpMessage FirstPageRequest(int? pageSizeHint) => DdosProtectionPlanRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DdosProtectionPlanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DdosProtectionPlanResource(Client, DdosProtectionPlanData.DeserializeDdosProtectionPlanData(e)), DdosProtectionPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDdosProtectionPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DdosProtectionPlanResource(Client, DdosProtectionPlanData.DeserializeDdosProtectionPlanData(e)), DdosProtectionPlanClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetDdosProtectionPlans", "value", "nextLink", cancellationToken); } /// @@ -1086,7 +1375,7 @@ public virtual Pageable GetDdosProtectionPlans(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DdosProtectionPlanRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DdosProtectionPlanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DdosProtectionPlanResource(Client, DdosProtectionPlanData.DeserializeDdosProtectionPlanData(e)), DdosProtectionPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDdosProtectionPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DdosProtectionPlanResource(Client, DdosProtectionPlanData.DeserializeDdosProtectionPlanData(e)), DdosProtectionPlanClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetDdosProtectionPlans", "value", "nextLink", cancellationToken); } /// @@ -1108,7 +1397,7 @@ public virtual AsyncPageable GetDscpConfigurationsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => DscpConfigurationRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DscpConfigurationRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DscpConfigurationResource(Client, DscpConfigurationData.DeserializeDscpConfigurationData(e)), DscpConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDscpConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DscpConfigurationResource(Client, DscpConfigurationData.DeserializeDscpConfigurationData(e)), DscpConfigurationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetDscpConfigurations", "value", "nextLink", cancellationToken); } /// @@ -1130,7 +1419,7 @@ public virtual Pageable GetDscpConfigurations(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => DscpConfigurationRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DscpConfigurationRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DscpConfigurationResource(Client, DscpConfigurationData.DeserializeDscpConfigurationData(e)), DscpConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDscpConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DscpConfigurationResource(Client, DscpConfigurationData.DeserializeDscpConfigurationData(e)), DscpConfigurationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetDscpConfigurations", "value", "nextLink", cancellationToken); } /// @@ -1153,7 +1442,7 @@ public virtual AsyncPageable GetAvailableEndpointServices { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableEndpointServicesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableEndpointServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EndpointServiceResult.DeserializeEndpointServiceResult, AvailableEndpointServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableEndpointServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, EndpointServiceResult.DeserializeEndpointServiceResult, AvailableEndpointServicesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableEndpointServices", "value", "nextLink", cancellationToken); } /// @@ -1176,7 +1465,7 @@ public virtual Pageable GetAvailableEndpointServices(Azur { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableEndpointServicesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableEndpointServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EndpointServiceResult.DeserializeEndpointServiceResult, AvailableEndpointServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableEndpointServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, EndpointServiceResult.DeserializeEndpointServiceResult, AvailableEndpointServicesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailableEndpointServices", "value", "nextLink", cancellationToken); } /// @@ -1198,7 +1487,7 @@ public virtual AsyncPageable GetExpressRouteCircuit { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteCircuitRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteCircuitRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCircuitResource(Client, ExpressRouteCircuitData.DeserializeExpressRouteCircuitData(e)), ExpressRouteCircuitClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteCircuits", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCircuitResource(Client, ExpressRouteCircuitData.DeserializeExpressRouteCircuitData(e)), ExpressRouteCircuitClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteCircuits", "value", "nextLink", cancellationToken); } /// @@ -1220,7 +1509,7 @@ public virtual Pageable GetExpressRouteCircuits(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteCircuitRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteCircuitRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCircuitResource(Client, ExpressRouteCircuitData.DeserializeExpressRouteCircuitData(e)), ExpressRouteCircuitClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteCircuits", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCircuitResource(Client, ExpressRouteCircuitData.DeserializeExpressRouteCircuitData(e)), ExpressRouteCircuitClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteCircuits", "value", "nextLink", cancellationToken); } /// @@ -1242,7 +1531,7 @@ public virtual AsyncPageable GetExpressRouteService { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteServiceProvidersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteServiceProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExpressRouteServiceProvider.DeserializeExpressRouteServiceProvider, ExpressRouteServiceProvidersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteServiceProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExpressRouteServiceProvider.DeserializeExpressRouteServiceProvider, ExpressRouteServiceProvidersClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteServiceProviders", "value", "nextLink", cancellationToken); } /// @@ -1264,7 +1553,7 @@ public virtual Pageable GetExpressRouteServiceProvi { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteServiceProvidersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteServiceProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExpressRouteServiceProvider.DeserializeExpressRouteServiceProvider, ExpressRouteServiceProvidersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteServiceProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExpressRouteServiceProvider.DeserializeExpressRouteServiceProvider, ExpressRouteServiceProvidersClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteServiceProviders", "value", "nextLink", cancellationToken); } /// @@ -1286,7 +1575,7 @@ public virtual AsyncPageable GetExpressRout { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteCrossConnectionRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteCrossConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCrossConnectionResource(Client, ExpressRouteCrossConnectionData.DeserializeExpressRouteCrossConnectionData(e)), ExpressRouteCrossConnectionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteCrossConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCrossConnectionResource(Client, ExpressRouteCrossConnectionData.DeserializeExpressRouteCrossConnectionData(e)), ExpressRouteCrossConnectionClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteCrossConnections", "value", "nextLink", cancellationToken); } /// @@ -1308,7 +1597,7 @@ public virtual Pageable GetExpressRouteCros { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteCrossConnectionRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRouteCrossConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCrossConnectionResource(Client, ExpressRouteCrossConnectionData.DeserializeExpressRouteCrossConnectionData(e)), ExpressRouteCrossConnectionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteCrossConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRouteCrossConnectionResource(Client, ExpressRouteCrossConnectionData.DeserializeExpressRouteCrossConnectionData(e)), ExpressRouteCrossConnectionClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteCrossConnections", "value", "nextLink", cancellationToken); } /// @@ -1330,7 +1619,7 @@ public virtual AsyncPageable GetExpressRoutePortsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRoutePortRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRoutePortRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRoutePortResource(Client, ExpressRoutePortData.DeserializeExpressRoutePortData(e)), ExpressRoutePortClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRoutePorts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExpressRoutePortResource(Client, ExpressRoutePortData.DeserializeExpressRoutePortData(e)), ExpressRoutePortClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRoutePorts", "value", "nextLink", cancellationToken); } /// @@ -1352,7 +1641,7 @@ public virtual Pageable GetExpressRoutePorts(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRoutePortRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExpressRoutePortRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRoutePortResource(Client, ExpressRoutePortData.DeserializeExpressRoutePortData(e)), ExpressRoutePortClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRoutePorts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExpressRoutePortResource(Client, ExpressRoutePortData.DeserializeExpressRoutePortData(e)), ExpressRoutePortClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRoutePorts", "value", "nextLink", cancellationToken); } /// @@ -1374,7 +1663,7 @@ public virtual AsyncPageable GetFirewallPoliciesAsync(Ca { HttpMessage FirstPageRequest(int? pageSizeHint) => FirewallPolicyRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FirewallPolicyRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirewallPolicyResource(Client, FirewallPolicyData.DeserializeFirewallPolicyData(e)), FirewallPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFirewallPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirewallPolicyResource(Client, FirewallPolicyData.DeserializeFirewallPolicyData(e)), FirewallPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetFirewallPolicies", "value", "nextLink", cancellationToken); } /// @@ -1396,7 +1685,7 @@ public virtual Pageable GetFirewallPolicies(Cancellation { HttpMessage FirstPageRequest(int? pageSizeHint) => FirewallPolicyRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FirewallPolicyRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirewallPolicyResource(Client, FirewallPolicyData.DeserializeFirewallPolicyData(e)), FirewallPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFirewallPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirewallPolicyResource(Client, FirewallPolicyData.DeserializeFirewallPolicyData(e)), FirewallPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetFirewallPolicies", "value", "nextLink", cancellationToken); } /// @@ -1418,7 +1707,7 @@ public virtual AsyncPageable GetIPAllocationsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => IPAllocationIpAllocationsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IPAllocationIpAllocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IPAllocationResource(Client, IPAllocationData.DeserializeIPAllocationData(e)), IPAllocationIpAllocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIPAllocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IPAllocationResource(Client, IPAllocationData.DeserializeIPAllocationData(e)), IPAllocationIpAllocationsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetIPAllocations", "value", "nextLink", cancellationToken); } /// @@ -1440,7 +1729,7 @@ public virtual Pageable GetIPAllocations(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => IPAllocationIpAllocationsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IPAllocationIpAllocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IPAllocationResource(Client, IPAllocationData.DeserializeIPAllocationData(e)), IPAllocationIpAllocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIPAllocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IPAllocationResource(Client, IPAllocationData.DeserializeIPAllocationData(e)), IPAllocationIpAllocationsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetIPAllocations", "value", "nextLink", cancellationToken); } /// @@ -1462,7 +1751,7 @@ public virtual AsyncPageable GetIPGroupsAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => IPGroupIpGroupsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IPGroupIpGroupsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IPGroupResource(Client, IPGroupData.DeserializeIPGroupData(e)), IPGroupIpGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIPGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IPGroupResource(Client, IPGroupData.DeserializeIPGroupData(e)), IPGroupIpGroupsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetIPGroups", "value", "nextLink", cancellationToken); } /// @@ -1484,7 +1773,7 @@ public virtual Pageable GetIPGroups(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => IPGroupIpGroupsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IPGroupIpGroupsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IPGroupResource(Client, IPGroupData.DeserializeIPGroupData(e)), IPGroupIpGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIPGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IPGroupResource(Client, IPGroupData.DeserializeIPGroupData(e)), IPGroupIpGroupsClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetIPGroups", "value", "nextLink", cancellationToken); } /// @@ -1506,7 +1795,7 @@ public virtual AsyncPageable GetLoadBalancersAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => LoadBalancerRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LoadBalancerRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), LoadBalancerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLoadBalancers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), LoadBalancerClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetLoadBalancers", "value", "nextLink", cancellationToken); } /// @@ -1528,7 +1817,7 @@ public virtual Pageable GetLoadBalancers(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => LoadBalancerRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LoadBalancerRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), LoadBalancerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLoadBalancers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LoadBalancerResource(Client, LoadBalancerData.DeserializeLoadBalancerData(e)), LoadBalancerClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetLoadBalancers", "value", "nextLink", cancellationToken); } /// @@ -1548,9 +1837,12 @@ public virtual Pageable GetLoadBalancers(CancellationToken /// The region where load balancers are located at. /// Parameters that define which VIPs should be swapped. /// The cancellation token to use. + /// is null. public virtual async Task SwapPublicIPAddressesLoadBalancerAsync(WaitUntil waitUntil, AzureLocation location, LoadBalancerVipSwapContent content, CancellationToken cancellationToken = default) { - using var scope = LoadBalancerClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SwapPublicIPAddressesLoadBalancer"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LoadBalancerClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.SwapPublicIPAddressesLoadBalancer"); scope.Start(); try { @@ -1584,9 +1876,12 @@ public virtual async Task SwapPublicIPAddressesLoadBalancerAsync(W /// The region where load balancers are located at. /// Parameters that define which VIPs should be swapped. /// The cancellation token to use. + /// is null. public virtual ArmOperation SwapPublicIPAddressesLoadBalancer(WaitUntil waitUntil, AzureLocation location, LoadBalancerVipSwapContent content, CancellationToken cancellationToken = default) { - using var scope = LoadBalancerClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.SwapPublicIPAddressesLoadBalancer"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LoadBalancerClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.SwapPublicIPAddressesLoadBalancer"); scope.Start(); try { @@ -1622,7 +1917,7 @@ public virtual AsyncPageable GetNatGatewaysAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => NatGatewayRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NatGatewayRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NatGatewayResource(Client, NatGatewayData.DeserializeNatGatewayData(e)), NatGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNatGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NatGatewayResource(Client, NatGatewayData.DeserializeNatGatewayData(e)), NatGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNatGateways", "value", "nextLink", cancellationToken); } /// @@ -1644,7 +1939,7 @@ public virtual Pageable GetNatGateways(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => NatGatewayRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NatGatewayRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NatGatewayResource(Client, NatGatewayData.DeserializeNatGatewayData(e)), NatGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNatGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NatGatewayResource(Client, NatGatewayData.DeserializeNatGatewayData(e)), NatGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNatGateways", "value", "nextLink", cancellationToken); } /// @@ -1666,7 +1961,7 @@ public virtual AsyncPageable GetNetworkInterfacesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkInterfaceRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkInterfaceRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkInterfaceResource(Client, NetworkInterfaceData.DeserializeNetworkInterfaceData(e)), NetworkInterfaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkInterfaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkInterfaceResource(Client, NetworkInterfaceData.DeserializeNetworkInterfaceData(e)), NetworkInterfaceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkInterfaces", "value", "nextLink", cancellationToken); } /// @@ -1688,7 +1983,7 @@ public virtual Pageable GetNetworkInterfaces(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkInterfaceRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkInterfaceRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkInterfaceResource(Client, NetworkInterfaceData.DeserializeNetworkInterfaceData(e)), NetworkInterfaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkInterfaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkInterfaceResource(Client, NetworkInterfaceData.DeserializeNetworkInterfaceData(e)), NetworkInterfaceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkInterfaces", "value", "nextLink", cancellationToken); } /// @@ -1712,7 +2007,7 @@ public virtual AsyncPageable GetNetworkManagersAsync(int { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkManagerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkManagerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkManagerResource(Client, NetworkManagerData.DeserializeNetworkManagerData(e)), NetworkManagerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkManagers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkManagerResource(Client, NetworkManagerData.DeserializeNetworkManagerData(e)), NetworkManagerClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkManagers", "value", "nextLink", cancellationToken); } /// @@ -1736,7 +2031,7 @@ public virtual Pageable GetNetworkManagers(int? top = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkManagerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkManagerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkManagerResource(Client, NetworkManagerData.DeserializeNetworkManagerData(e)), NetworkManagerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkManagers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkManagerResource(Client, NetworkManagerData.DeserializeNetworkManagerData(e)), NetworkManagerClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkManagers", "value", "nextLink", cancellationToken); } /// @@ -1758,7 +2053,7 @@ public virtual AsyncPageable GetNetworkProfilesAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkProfileRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkProfileRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkProfileResource(Client, NetworkProfileData.DeserializeNetworkProfileData(e)), NetworkProfileClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkProfileResource(Client, NetworkProfileData.DeserializeNetworkProfileData(e)), NetworkProfileClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkProfiles", "value", "nextLink", cancellationToken); } /// @@ -1780,7 +2075,7 @@ public virtual Pageable GetNetworkProfiles(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkProfileRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkProfileRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkProfileResource(Client, NetworkProfileData.DeserializeNetworkProfileData(e)), NetworkProfileClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkProfileResource(Client, NetworkProfileData.DeserializeNetworkProfileData(e)), NetworkProfileClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkProfiles", "value", "nextLink", cancellationToken); } /// @@ -1802,7 +2097,7 @@ public virtual AsyncPageable GetNetworkSecurityGro { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkSecurityGroupRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkSecurityGroupRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityGroupResource(Client, NetworkSecurityGroupData.DeserializeNetworkSecurityGroupData(e)), NetworkSecurityGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkSecurityGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityGroupResource(Client, NetworkSecurityGroupData.DeserializeNetworkSecurityGroupData(e)), NetworkSecurityGroupClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkSecurityGroups", "value", "nextLink", cancellationToken); } /// @@ -1824,7 +2119,7 @@ public virtual Pageable GetNetworkSecurityGroups(C { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkSecurityGroupRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkSecurityGroupRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityGroupResource(Client, NetworkSecurityGroupData.DeserializeNetworkSecurityGroupData(e)), NetworkSecurityGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkSecurityGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityGroupResource(Client, NetworkSecurityGroupData.DeserializeNetworkSecurityGroupData(e)), NetworkSecurityGroupClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkSecurityGroups", "value", "nextLink", cancellationToken); } /// @@ -1846,7 +2141,7 @@ public virtual AsyncPageable GetNetworkVirtualA { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkVirtualApplianceRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkVirtualApplianceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkVirtualApplianceResource(Client, NetworkVirtualApplianceData.DeserializeNetworkVirtualApplianceData(e)), NetworkVirtualApplianceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkVirtualAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkVirtualApplianceResource(Client, NetworkVirtualApplianceData.DeserializeNetworkVirtualApplianceData(e)), NetworkVirtualApplianceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkVirtualAppliances", "value", "nextLink", cancellationToken); } /// @@ -1868,7 +2163,7 @@ public virtual Pageable GetNetworkVirtualApplia { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkVirtualApplianceRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkVirtualApplianceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkVirtualApplianceResource(Client, NetworkVirtualApplianceData.DeserializeNetworkVirtualApplianceData(e)), NetworkVirtualApplianceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkVirtualAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkVirtualApplianceResource(Client, NetworkVirtualApplianceData.DeserializeNetworkVirtualApplianceData(e)), NetworkVirtualApplianceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkVirtualAppliances", "value", "nextLink", cancellationToken); } /// @@ -1889,7 +2184,7 @@ public virtual Pageable GetNetworkVirtualApplia public virtual AsyncPageable GetNetworkWatchersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkWatcherRestClient.CreateListAllRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new NetworkWatcherResource(Client, NetworkWatcherData.DeserializeNetworkWatcherData(e)), NetworkWatcherClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkWatchers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new NetworkWatcherResource(Client, NetworkWatcherData.DeserializeNetworkWatcherData(e)), NetworkWatcherClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkWatchers", "value", null, cancellationToken); } /// @@ -1910,7 +2205,7 @@ public virtual AsyncPageable GetNetworkWatchersAsync(Can public virtual Pageable GetNetworkWatchers(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkWatcherRestClient.CreateListAllRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new NetworkWatcherResource(Client, NetworkWatcherData.DeserializeNetworkWatcherData(e)), NetworkWatcherClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkWatchers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new NetworkWatcherResource(Client, NetworkWatcherData.DeserializeNetworkWatcherData(e)), NetworkWatcherClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetNetworkWatchers", "value", null, cancellationToken); } /// @@ -1932,7 +2227,7 @@ public virtual AsyncPageable GetPrivateEndpointsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateEndpointRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateEndpointRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointResource(Client, PrivateEndpointData.DeserializePrivateEndpointData(e)), PrivateEndpointClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateEndpoints", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointResource(Client, PrivateEndpointData.DeserializePrivateEndpointData(e)), PrivateEndpointClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPrivateEndpoints", "value", "nextLink", cancellationToken); } /// @@ -1954,7 +2249,7 @@ public virtual Pageable GetPrivateEndpoints(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateEndpointRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateEndpointRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointResource(Client, PrivateEndpointData.DeserializePrivateEndpointData(e)), PrivateEndpointClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateEndpoints", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateEndpointResource(Client, PrivateEndpointData.DeserializePrivateEndpointData(e)), PrivateEndpointClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPrivateEndpoints", "value", "nextLink", cancellationToken); } /// @@ -1977,7 +2272,7 @@ public virtual AsyncPageable GetAvailablePrivateEn { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailablePrivateEndpointTypes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailablePrivateEndpointTypes", "value", "nextLink", cancellationToken); } /// @@ -2000,7 +2295,7 @@ public virtual Pageable GetAvailablePrivateEndpoin { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailablePrivateEndpointTypes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAvailablePrivateEndpointTypes", "value", "nextLink", cancellationToken); } /// @@ -2022,7 +2317,7 @@ public virtual AsyncPageable GetPrivateLinkServicesA { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateLinkServiceResource(Client, PrivateLinkServiceData.DeserializePrivateLinkServiceData(e)), PrivateLinkServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateLinkServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateLinkServiceResource(Client, PrivateLinkServiceData.DeserializePrivateLinkServiceData(e)), PrivateLinkServiceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPrivateLinkServices", "value", "nextLink", cancellationToken); } /// @@ -2044,7 +2339,7 @@ public virtual Pageable GetPrivateLinkServices(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateLinkServiceResource(Client, PrivateLinkServiceData.DeserializePrivateLinkServiceData(e)), PrivateLinkServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateLinkServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateLinkServiceResource(Client, PrivateLinkServiceData.DeserializePrivateLinkServiceData(e)), PrivateLinkServiceClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPrivateLinkServices", "value", "nextLink", cancellationToken); } /// @@ -2064,9 +2359,12 @@ public virtual Pageable GetPrivateLinkServices(Cance /// The location of the domain name. /// The request body of CheckPrivateLinkService API call. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPrivateLinkServiceVisibilityPrivateLinkServiceAsync(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPrivateLinkServiceVisibilityPrivateLinkService"); + Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); + + using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.CheckPrivateLinkServiceVisibilityPrivateLinkService"); scope.Start(); try { @@ -2100,9 +2398,12 @@ public virtual async Task> CheckPriva /// The location of the domain name. /// The request body of CheckPrivateLinkService API call. /// The cancellation token to use. + /// is null. public virtual ArmOperation CheckPrivateLinkServiceVisibilityPrivateLinkService(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) { - using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPrivateLinkServiceVisibilityPrivateLinkService"); + Argument.AssertNotNull(checkPrivateLinkServiceVisibilityRequest, nameof(checkPrivateLinkServiceVisibilityRequest)); + + using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.CheckPrivateLinkServiceVisibilityPrivateLinkService"); scope.Start(); try { @@ -2139,7 +2440,7 @@ public virtual AsyncPageable GetAutoApprovedPriv { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoApprovedPrivateLinkServicesPrivateLinkServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAutoApprovedPrivateLinkServicesPrivateLinkServices", "value", "nextLink", cancellationToken); } /// @@ -2162,7 +2463,7 @@ public virtual Pageable GetAutoApprovedPrivateLi { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoApprovedPrivateLinkServicesPrivateLinkServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAutoApprovedPrivateLinkServicesPrivateLinkServices", "value", "nextLink", cancellationToken); } /// @@ -2184,7 +2485,7 @@ public virtual AsyncPageable GetPublicIPAddressesAsync( { HttpMessage FirstPageRequest(int? pageSizeHint) => PublicIPAddressRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicIPAddressRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicIPAddressResource(Client, PublicIPAddressData.DeserializePublicIPAddressData(e)), PublicIPAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublicIPAddresses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicIPAddressResource(Client, PublicIPAddressData.DeserializePublicIPAddressData(e)), PublicIPAddressClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPublicIPAddresses", "value", "nextLink", cancellationToken); } /// @@ -2206,7 +2507,7 @@ public virtual Pageable GetPublicIPAddresses(Cancellati { HttpMessage FirstPageRequest(int? pageSizeHint) => PublicIPAddressRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicIPAddressRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicIPAddressResource(Client, PublicIPAddressData.DeserializePublicIPAddressData(e)), PublicIPAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublicIPAddresses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicIPAddressResource(Client, PublicIPAddressData.DeserializePublicIPAddressData(e)), PublicIPAddressClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPublicIPAddresses", "value", "nextLink", cancellationToken); } /// @@ -2228,7 +2529,7 @@ public virtual AsyncPageable GetPublicIPPrefixesAsync(Ca { HttpMessage FirstPageRequest(int? pageSizeHint) => PublicIPPrefixRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicIPPrefixRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicIPPrefixResource(Client, PublicIPPrefixData.DeserializePublicIPPrefixData(e)), PublicIPPrefixClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublicIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PublicIPPrefixResource(Client, PublicIPPrefixData.DeserializePublicIPPrefixData(e)), PublicIPPrefixClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPublicIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -2250,7 +2551,7 @@ public virtual Pageable GetPublicIPPrefixes(Cancellation { HttpMessage FirstPageRequest(int? pageSizeHint) => PublicIPPrefixRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PublicIPPrefixRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicIPPrefixResource(Client, PublicIPPrefixData.DeserializePublicIPPrefixData(e)), PublicIPPrefixClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublicIPPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PublicIPPrefixResource(Client, PublicIPPrefixData.DeserializePublicIPPrefixData(e)), PublicIPPrefixClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetPublicIPPrefixes", "value", "nextLink", cancellationToken); } /// @@ -2272,7 +2573,7 @@ public virtual AsyncPageable GetRouteFiltersAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => RouteFilterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RouteFilterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RouteFilterResource(Client, RouteFilterData.DeserializeRouteFilterData(e)), RouteFilterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRouteFilters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RouteFilterResource(Client, RouteFilterData.DeserializeRouteFilterData(e)), RouteFilterClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetRouteFilters", "value", "nextLink", cancellationToken); } /// @@ -2294,7 +2595,7 @@ public virtual Pageable GetRouteFilters(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => RouteFilterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RouteFilterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RouteFilterResource(Client, RouteFilterData.DeserializeRouteFilterData(e)), RouteFilterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRouteFilters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RouteFilterResource(Client, RouteFilterData.DeserializeRouteFilterData(e)), RouteFilterClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetRouteFilters", "value", "nextLink", cancellationToken); } /// @@ -2316,7 +2617,7 @@ public virtual AsyncPageable GetRouteTablesAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => RouteTableRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RouteTableRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RouteTableResource(Client, RouteTableData.DeserializeRouteTableData(e)), RouteTableClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRouteTables", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RouteTableResource(Client, RouteTableData.DeserializeRouteTableData(e)), RouteTableClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetRouteTables", "value", "nextLink", cancellationToken); } /// @@ -2338,7 +2639,7 @@ public virtual Pageable GetRouteTables(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => RouteTableRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RouteTableRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RouteTableResource(Client, RouteTableData.DeserializeRouteTableData(e)), RouteTableClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRouteTables", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RouteTableResource(Client, RouteTableData.DeserializeRouteTableData(e)), RouteTableClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetRouteTables", "value", "nextLink", cancellationToken); } /// @@ -2360,7 +2661,7 @@ public virtual AsyncPageable GetSecurityPartner { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityPartnerProviderRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityPartnerProviderRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityPartnerProviderResource(Client, SecurityPartnerProviderData.DeserializeSecurityPartnerProviderData(e)), SecurityPartnerProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityPartnerProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityPartnerProviderResource(Client, SecurityPartnerProviderData.DeserializeSecurityPartnerProviderData(e)), SecurityPartnerProviderClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetSecurityPartnerProviders", "value", "nextLink", cancellationToken); } /// @@ -2382,7 +2683,7 @@ public virtual Pageable GetSecurityPartnerProvi { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityPartnerProviderRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityPartnerProviderRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityPartnerProviderResource(Client, SecurityPartnerProviderData.DeserializeSecurityPartnerProviderData(e)), SecurityPartnerProviderClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityPartnerProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityPartnerProviderResource(Client, SecurityPartnerProviderData.DeserializeSecurityPartnerProviderData(e)), SecurityPartnerProviderClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetSecurityPartnerProviders", "value", "nextLink", cancellationToken); } /// @@ -2404,7 +2705,7 @@ public virtual AsyncPageable GetBgpServiceCommunitiesAsync( { HttpMessage FirstPageRequest(int? pageSizeHint) => BgpServiceCommunitiesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BgpServiceCommunitiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BgpServiceCommunity.DeserializeBgpServiceCommunity, BgpServiceCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBgpServiceCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BgpServiceCommunity.DeserializeBgpServiceCommunity, BgpServiceCommunitiesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetBgpServiceCommunities", "value", "nextLink", cancellationToken); } /// @@ -2426,7 +2727,7 @@ public virtual Pageable GetBgpServiceCommunities(Cancellati { HttpMessage FirstPageRequest(int? pageSizeHint) => BgpServiceCommunitiesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BgpServiceCommunitiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BgpServiceCommunity.DeserializeBgpServiceCommunity, BgpServiceCommunitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBgpServiceCommunities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BgpServiceCommunity.DeserializeBgpServiceCommunity, BgpServiceCommunitiesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetBgpServiceCommunities", "value", "nextLink", cancellationToken); } /// @@ -2448,7 +2749,7 @@ public virtual AsyncPageable GetServiceEndpointPo { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceEndpointPolicyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceEndpointPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceEndpointPolicyResource(Client, ServiceEndpointPolicyData.DeserializeServiceEndpointPolicyData(e)), ServiceEndpointPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceEndpointPoliciesByServiceEndpointPolicy", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceEndpointPolicyResource(Client, ServiceEndpointPolicyData.DeserializeServiceEndpointPolicyData(e)), ServiceEndpointPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetServiceEndpointPoliciesByServiceEndpointPolicy", "value", "nextLink", cancellationToken); } /// @@ -2470,7 +2771,7 @@ public virtual Pageable GetServiceEndpointPolicie { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceEndpointPolicyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceEndpointPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceEndpointPolicyResource(Client, ServiceEndpointPolicyData.DeserializeServiceEndpointPolicyData(e)), ServiceEndpointPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceEndpointPoliciesByServiceEndpointPolicy", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceEndpointPolicyResource(Client, ServiceEndpointPolicyData.DeserializeServiceEndpointPolicyData(e)), ServiceEndpointPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetServiceEndpointPoliciesByServiceEndpointPolicy", "value", "nextLink", cancellationToken); } /// @@ -2490,7 +2791,7 @@ public virtual Pageable GetServiceEndpointPolicie /// The cancellation token to use. public virtual async Task> GetServiceTagAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = ServiceTagsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServiceTag"); + using var scope = ServiceTagsClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetServiceTag"); scope.Start(); try { @@ -2521,7 +2822,7 @@ public virtual async Task> GetServiceTagAsync(Az /// The cancellation token to use. public virtual Response GetServiceTag(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = ServiceTagsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetServiceTag"); + using var scope = ServiceTagsClientDiagnostics.CreateScope("NetworkSubscriptionMockingExtension.GetServiceTag"); scope.Start(); try { @@ -2557,7 +2858,7 @@ public virtual AsyncPageable GetAllServiceTagInformationA { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceTagInformationRestClient.CreateListRequest(Id.SubscriptionId, location, noAddressPrefixes, tagName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceTagInformationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location, noAddressPrefixes, tagName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceTagInformation.DeserializeServiceTagInformation, ServiceTagInformationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllServiceTagInformation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceTagInformation.DeserializeServiceTagInformation, ServiceTagInformationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAllServiceTagInformation", "value", "nextLink", cancellationToken); } /// @@ -2582,7 +2883,7 @@ public virtual Pageable GetAllServiceTagInformation(Azure { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceTagInformationRestClient.CreateListRequest(Id.SubscriptionId, location, noAddressPrefixes, tagName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceTagInformationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location, noAddressPrefixes, tagName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceTagInformation.DeserializeServiceTagInformation, ServiceTagInformationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllServiceTagInformation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceTagInformation.DeserializeServiceTagInformation, ServiceTagInformationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetAllServiceTagInformation", "value", "nextLink", cancellationToken); } /// @@ -2605,7 +2906,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NetworkUsage.DeserializeNetworkUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NetworkUsage.DeserializeNetworkUsage, UsagesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -2628,7 +2929,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NetworkUsage.DeserializeNetworkUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NetworkUsage.DeserializeNetworkUsage, UsagesClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -2650,7 +2951,7 @@ public virtual AsyncPageable GetVirtualNetworksAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -2672,7 +2973,7 @@ public virtual Pageable GetVirtualNetworks(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -2694,7 +2995,7 @@ public virtual AsyncPageable GetVirtualNetworkTapsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkTapRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkTapRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkTapResource(Client, VirtualNetworkTapData.DeserializeVirtualNetworkTapData(e)), VirtualNetworkTapClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworkTaps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkTapResource(Client, VirtualNetworkTapData.DeserializeVirtualNetworkTapData(e)), VirtualNetworkTapClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualNetworkTaps", "value", "nextLink", cancellationToken); } /// @@ -2716,7 +3017,7 @@ public virtual Pageable GetVirtualNetworkTaps(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkTapRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkTapRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkTapResource(Client, VirtualNetworkTapData.DeserializeVirtualNetworkTapData(e)), VirtualNetworkTapClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworkTaps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkTapResource(Client, VirtualNetworkTapData.DeserializeVirtualNetworkTapData(e)), VirtualNetworkTapClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualNetworkTaps", "value", "nextLink", cancellationToken); } /// @@ -2738,7 +3039,7 @@ public virtual AsyncPageable GetVirtualRoutersAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualRouterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualRouterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualRouterResource(Client, VirtualRouterData.DeserializeVirtualRouterData(e)), VirtualRouterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualRouters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualRouterResource(Client, VirtualRouterData.DeserializeVirtualRouterData(e)), VirtualRouterClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualRouters", "value", "nextLink", cancellationToken); } /// @@ -2760,7 +3061,7 @@ public virtual Pageable GetVirtualRouters(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualRouterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualRouterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualRouterResource(Client, VirtualRouterData.DeserializeVirtualRouterData(e)), VirtualRouterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualRouters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualRouterResource(Client, VirtualRouterData.DeserializeVirtualRouterData(e)), VirtualRouterClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualRouters", "value", "nextLink", cancellationToken); } /// @@ -2782,7 +3083,7 @@ public virtual AsyncPageable GetVirtualWansAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualWanRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualWanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualWanResource(Client, VirtualWanData.DeserializeVirtualWanData(e)), VirtualWanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualWans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualWanResource(Client, VirtualWanData.DeserializeVirtualWanData(e)), VirtualWanClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualWans", "value", "nextLink", cancellationToken); } /// @@ -2804,7 +3105,7 @@ public virtual Pageable GetVirtualWans(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualWanRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualWanRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualWanResource(Client, VirtualWanData.DeserializeVirtualWanData(e)), VirtualWanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualWans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualWanResource(Client, VirtualWanData.DeserializeVirtualWanData(e)), VirtualWanClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualWans", "value", "nextLink", cancellationToken); } /// @@ -2826,7 +3127,7 @@ public virtual AsyncPageable GetVpnSitesAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnSiteRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnSiteRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnSiteResource(Client, VpnSiteData.DeserializeVpnSiteData(e)), VpnSiteClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnSiteResource(Client, VpnSiteData.DeserializeVpnSiteData(e)), VpnSiteClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnSites", "value", "nextLink", cancellationToken); } /// @@ -2848,7 +3149,7 @@ public virtual Pageable GetVpnSites(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnSiteRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnSiteRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnSiteResource(Client, VpnSiteData.DeserializeVpnSiteData(e)), VpnSiteClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnSites", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnSiteResource(Client, VpnSiteData.DeserializeVpnSiteData(e)), VpnSiteClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnSites", "value", "nextLink", cancellationToken); } /// @@ -2870,7 +3171,7 @@ public virtual AsyncPageable GetVpnServerConfigu { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnServerConfigurationRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnServerConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnServerConfigurationResource(Client, VpnServerConfigurationData.DeserializeVpnServerConfigurationData(e)), VpnServerConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnServerConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnServerConfigurationResource(Client, VpnServerConfigurationData.DeserializeVpnServerConfigurationData(e)), VpnServerConfigurationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnServerConfigurations", "value", "nextLink", cancellationToken); } /// @@ -2892,7 +3193,7 @@ public virtual Pageable GetVpnServerConfiguratio { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnServerConfigurationRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnServerConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnServerConfigurationResource(Client, VpnServerConfigurationData.DeserializeVpnServerConfigurationData(e)), VpnServerConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnServerConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnServerConfigurationResource(Client, VpnServerConfigurationData.DeserializeVpnServerConfigurationData(e)), VpnServerConfigurationClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnServerConfigurations", "value", "nextLink", cancellationToken); } /// @@ -2914,7 +3215,7 @@ public virtual AsyncPageable GetVirtualHubsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualHubRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualHubRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualHubResource(Client, VirtualHubData.DeserializeVirtualHubData(e)), VirtualHubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualHubResource(Client, VirtualHubData.DeserializeVirtualHubData(e)), VirtualHubClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualHubs", "value", "nextLink", cancellationToken); } /// @@ -2936,7 +3237,7 @@ public virtual Pageable GetVirtualHubs(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualHubRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualHubRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualHubResource(Client, VirtualHubData.DeserializeVirtualHubData(e)), VirtualHubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualHubResource(Client, VirtualHubData.DeserializeVirtualHubData(e)), VirtualHubClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVirtualHubs", "value", "nextLink", cancellationToken); } /// @@ -2958,7 +3259,7 @@ public virtual AsyncPageable GetVpnGatewaysAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnGatewayRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnGatewayRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnGatewayResource(Client, VpnGatewayData.DeserializeVpnGatewayData(e)), VpnGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VpnGatewayResource(Client, VpnGatewayData.DeserializeVpnGatewayData(e)), VpnGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnGateways", "value", "nextLink", cancellationToken); } /// @@ -2980,7 +3281,7 @@ public virtual Pageable GetVpnGateways(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => VpnGatewayRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VpnGatewayRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnGatewayResource(Client, VpnGatewayData.DeserializeVpnGatewayData(e)), VpnGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVpnGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VpnGatewayResource(Client, VpnGatewayData.DeserializeVpnGatewayData(e)), VpnGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetVpnGateways", "value", "nextLink", cancellationToken); } /// @@ -3002,7 +3303,7 @@ public virtual AsyncPageable GetP2SVpnGatewaysAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => P2SVpnGatewayP2sVpnGatewaysRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => P2SVpnGatewayP2sVpnGatewaysRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new P2SVpnGatewayResource(Client, P2SVpnGatewayData.DeserializeP2SVpnGatewayData(e)), P2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetP2SVpnGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new P2SVpnGatewayResource(Client, P2SVpnGatewayData.DeserializeP2SVpnGatewayData(e)), P2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetP2SVpnGateways", "value", "nextLink", cancellationToken); } /// @@ -3024,7 +3325,7 @@ public virtual Pageable GetP2SVpnGateways(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => P2SVpnGatewayP2sVpnGatewaysRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => P2SVpnGatewayP2sVpnGatewaysRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new P2SVpnGatewayResource(Client, P2SVpnGatewayData.DeserializeP2SVpnGatewayData(e)), P2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetP2SVpnGateways", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new P2SVpnGatewayResource(Client, P2SVpnGatewayData.DeserializeP2SVpnGatewayData(e)), P2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetP2SVpnGateways", "value", "nextLink", cancellationToken); } /// @@ -3045,7 +3346,7 @@ public virtual Pageable GetP2SVpnGateways(CancellationTok public virtual AsyncPageable GetExpressRouteGatewaysAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteGatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ExpressRouteGatewayResource(Client, ExpressRouteGatewayData.DeserializeExpressRouteGatewayData(e)), ExpressRouteGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteGateways", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ExpressRouteGatewayResource(Client, ExpressRouteGatewayData.DeserializeExpressRouteGatewayData(e)), ExpressRouteGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteGateways", "value", null, cancellationToken); } /// @@ -3066,7 +3367,7 @@ public virtual AsyncPageable GetExpressRouteGateway public virtual Pageable GetExpressRouteGateways(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ExpressRouteGatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ExpressRouteGatewayResource(Client, ExpressRouteGatewayData.DeserializeExpressRouteGatewayData(e)), ExpressRouteGatewayClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExpressRouteGateways", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ExpressRouteGatewayResource(Client, ExpressRouteGatewayData.DeserializeExpressRouteGatewayData(e)), ExpressRouteGatewayClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetExpressRouteGateways", "value", null, cancellationToken); } /// @@ -3088,7 +3389,7 @@ public virtual AsyncPageable GetWebApplica { HttpMessage FirstPageRequest(int? pageSizeHint) => WebApplicationFirewallPolicyRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebApplicationFirewallPolicyRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebApplicationFirewallPolicyResource(Client, WebApplicationFirewallPolicyData.DeserializeWebApplicationFirewallPolicyData(e)), WebApplicationFirewallPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebApplicationFirewallPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebApplicationFirewallPolicyResource(Client, WebApplicationFirewallPolicyData.DeserializeWebApplicationFirewallPolicyData(e)), WebApplicationFirewallPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetWebApplicationFirewallPolicies", "value", "nextLink", cancellationToken); } /// @@ -3110,7 +3411,7 @@ public virtual Pageable GetWebApplicationF { HttpMessage FirstPageRequest(int? pageSizeHint) => WebApplicationFirewallPolicyRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => WebApplicationFirewallPolicyRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebApplicationFirewallPolicyResource(Client, WebApplicationFirewallPolicyData.DeserializeWebApplicationFirewallPolicyData(e)), WebApplicationFirewallPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetWebApplicationFirewallPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebApplicationFirewallPolicyResource(Client, WebApplicationFirewallPolicyData.DeserializeWebApplicationFirewallPolicyData(e)), WebApplicationFirewallPolicyClientDiagnostics, Pipeline, "NetworkSubscriptionMockingExtension.GetWebApplicationFirewallPolicies", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 417b8f76d9c9..000000000000 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Network.Models; - -namespace Azure.ResourceManager.Network -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _availableResourceGroupDelegationsClientDiagnostics; - private AvailableResourceGroupDelegationsRestOperations _availableResourceGroupDelegationsRestClient; - private ClientDiagnostics _availableServiceAliasesClientDiagnostics; - private AvailableServiceAliasesRestOperations _availableServiceAliasesRestClient; - private ClientDiagnostics _availablePrivateEndpointTypesClientDiagnostics; - private AvailablePrivateEndpointTypesRestOperations _availablePrivateEndpointTypesRestClient; - private ClientDiagnostics _privateLinkServicesClientDiagnostics; - private PrivateLinkServicesRestOperations _privateLinkServicesRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics AvailableResourceGroupDelegationsClientDiagnostics => _availableResourceGroupDelegationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AvailableResourceGroupDelegationsRestOperations AvailableResourceGroupDelegationsRestClient => _availableResourceGroupDelegationsRestClient ??= new AvailableResourceGroupDelegationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics AvailableServiceAliasesClientDiagnostics => _availableServiceAliasesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AvailableServiceAliasesRestOperations AvailableServiceAliasesRestClient => _availableServiceAliasesRestClient ??= new AvailableServiceAliasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics AvailablePrivateEndpointTypesClientDiagnostics => _availablePrivateEndpointTypesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AvailablePrivateEndpointTypesRestOperations AvailablePrivateEndpointTypesRestClient => _availablePrivateEndpointTypesRestClient ??= new AvailablePrivateEndpointTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics PrivateLinkServicesClientDiagnostics => _privateLinkServicesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Network", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PrivateLinkServicesRestOperations PrivateLinkServicesRestClient => _privateLinkServicesRestClient ??= new PrivateLinkServicesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ApplicationGatewayResources in the ResourceGroupResource. - /// An object representing collection of ApplicationGatewayResources and their operations over a ApplicationGatewayResource. - public virtual ApplicationGatewayCollection GetApplicationGateways() - { - return GetCachedClient(Client => new ApplicationGatewayCollection(Client, Id)); - } - - /// Gets a collection of ApplicationSecurityGroupResources in the ResourceGroupResource. - /// An object representing collection of ApplicationSecurityGroupResources and their operations over a ApplicationSecurityGroupResource. - public virtual ApplicationSecurityGroupCollection GetApplicationSecurityGroups() - { - return GetCachedClient(Client => new ApplicationSecurityGroupCollection(Client, Id)); - } - - /// Gets a collection of AzureFirewallResources in the ResourceGroupResource. - /// An object representing collection of AzureFirewallResources and their operations over a AzureFirewallResource. - public virtual AzureFirewallCollection GetAzureFirewalls() - { - return GetCachedClient(Client => new AzureFirewallCollection(Client, Id)); - } - - /// Gets a collection of BastionHostResources in the ResourceGroupResource. - /// An object representing collection of BastionHostResources and their operations over a BastionHostResource. - public virtual BastionHostCollection GetBastionHosts() - { - return GetCachedClient(Client => new BastionHostCollection(Client, Id)); - } - - /// Gets a collection of CloudServiceSwapResources in the ResourceGroupResource. - /// The name of the cloud service. - /// An object representing collection of CloudServiceSwapResources and their operations over a CloudServiceSwapResource. - public virtual CloudServiceSwapCollection GetCloudServiceSwaps(string resourceName) - { - return new CloudServiceSwapCollection(Client, Id, resourceName); - } - - /// Gets a collection of CustomIPPrefixResources in the ResourceGroupResource. - /// An object representing collection of CustomIPPrefixResources and their operations over a CustomIPPrefixResource. - public virtual CustomIPPrefixCollection GetCustomIPPrefixes() - { - return GetCachedClient(Client => new CustomIPPrefixCollection(Client, Id)); - } - - /// Gets a collection of DdosCustomPolicyResources in the ResourceGroupResource. - /// An object representing collection of DdosCustomPolicyResources and their operations over a DdosCustomPolicyResource. - public virtual DdosCustomPolicyCollection GetDdosCustomPolicies() - { - return GetCachedClient(Client => new DdosCustomPolicyCollection(Client, Id)); - } - - /// Gets a collection of DdosProtectionPlanResources in the ResourceGroupResource. - /// An object representing collection of DdosProtectionPlanResources and their operations over a DdosProtectionPlanResource. - public virtual DdosProtectionPlanCollection GetDdosProtectionPlans() - { - return GetCachedClient(Client => new DdosProtectionPlanCollection(Client, Id)); - } - - /// Gets a collection of DscpConfigurationResources in the ResourceGroupResource. - /// An object representing collection of DscpConfigurationResources and their operations over a DscpConfigurationResource. - public virtual DscpConfigurationCollection GetDscpConfigurations() - { - return GetCachedClient(Client => new DscpConfigurationCollection(Client, Id)); - } - - /// Gets a collection of ExpressRouteCircuitResources in the ResourceGroupResource. - /// An object representing collection of ExpressRouteCircuitResources and their operations over a ExpressRouteCircuitResource. - public virtual ExpressRouteCircuitCollection GetExpressRouteCircuits() - { - return GetCachedClient(Client => new ExpressRouteCircuitCollection(Client, Id)); - } - - /// Gets a collection of ExpressRouteCrossConnectionResources in the ResourceGroupResource. - /// An object representing collection of ExpressRouteCrossConnectionResources and their operations over a ExpressRouteCrossConnectionResource. - public virtual ExpressRouteCrossConnectionCollection GetExpressRouteCrossConnections() - { - return GetCachedClient(Client => new ExpressRouteCrossConnectionCollection(Client, Id)); - } - - /// Gets a collection of ExpressRoutePortResources in the ResourceGroupResource. - /// An object representing collection of ExpressRoutePortResources and their operations over a ExpressRoutePortResource. - public virtual ExpressRoutePortCollection GetExpressRoutePorts() - { - return GetCachedClient(Client => new ExpressRoutePortCollection(Client, Id)); - } - - /// Gets a collection of FirewallPolicyResources in the ResourceGroupResource. - /// An object representing collection of FirewallPolicyResources and their operations over a FirewallPolicyResource. - public virtual FirewallPolicyCollection GetFirewallPolicies() - { - return GetCachedClient(Client => new FirewallPolicyCollection(Client, Id)); - } - - /// Gets a collection of IPAllocationResources in the ResourceGroupResource. - /// An object representing collection of IPAllocationResources and their operations over a IPAllocationResource. - public virtual IPAllocationCollection GetIPAllocations() - { - return GetCachedClient(Client => new IPAllocationCollection(Client, Id)); - } - - /// Gets a collection of IPGroupResources in the ResourceGroupResource. - /// An object representing collection of IPGroupResources and their operations over a IPGroupResource. - public virtual IPGroupCollection GetIPGroups() - { - return GetCachedClient(Client => new IPGroupCollection(Client, Id)); - } - - /// Gets a collection of LoadBalancerResources in the ResourceGroupResource. - /// An object representing collection of LoadBalancerResources and their operations over a LoadBalancerResource. - public virtual LoadBalancerCollection GetLoadBalancers() - { - return GetCachedClient(Client => new LoadBalancerCollection(Client, Id)); - } - - /// Gets a collection of NatGatewayResources in the ResourceGroupResource. - /// An object representing collection of NatGatewayResources and their operations over a NatGatewayResource. - public virtual NatGatewayCollection GetNatGateways() - { - return GetCachedClient(Client => new NatGatewayCollection(Client, Id)); - } - - /// Gets a collection of NetworkInterfaceResources in the ResourceGroupResource. - /// An object representing collection of NetworkInterfaceResources and their operations over a NetworkInterfaceResource. - public virtual NetworkInterfaceCollection GetNetworkInterfaces() - { - return GetCachedClient(Client => new NetworkInterfaceCollection(Client, Id)); - } - - /// Gets a collection of NetworkManagerResources in the ResourceGroupResource. - /// An object representing collection of NetworkManagerResources and their operations over a NetworkManagerResource. - public virtual NetworkManagerCollection GetNetworkManagers() - { - return GetCachedClient(Client => new NetworkManagerCollection(Client, Id)); - } - - /// Gets a collection of NetworkProfileResources in the ResourceGroupResource. - /// An object representing collection of NetworkProfileResources and their operations over a NetworkProfileResource. - public virtual NetworkProfileCollection GetNetworkProfiles() - { - return GetCachedClient(Client => new NetworkProfileCollection(Client, Id)); - } - - /// Gets a collection of NetworkSecurityGroupResources in the ResourceGroupResource. - /// An object representing collection of NetworkSecurityGroupResources and their operations over a NetworkSecurityGroupResource. - public virtual NetworkSecurityGroupCollection GetNetworkSecurityGroups() - { - return GetCachedClient(Client => new NetworkSecurityGroupCollection(Client, Id)); - } - - /// Gets a collection of NetworkVirtualApplianceResources in the ResourceGroupResource. - /// An object representing collection of NetworkVirtualApplianceResources and their operations over a NetworkVirtualApplianceResource. - public virtual NetworkVirtualApplianceCollection GetNetworkVirtualAppliances() - { - return GetCachedClient(Client => new NetworkVirtualApplianceCollection(Client, Id)); - } - - /// Gets a collection of NetworkWatcherResources in the ResourceGroupResource. - /// An object representing collection of NetworkWatcherResources and their operations over a NetworkWatcherResource. - public virtual NetworkWatcherCollection GetNetworkWatchers() - { - return GetCachedClient(Client => new NetworkWatcherCollection(Client, Id)); - } - - /// Gets a collection of PrivateEndpointResources in the ResourceGroupResource. - /// An object representing collection of PrivateEndpointResources and their operations over a PrivateEndpointResource. - public virtual PrivateEndpointCollection GetPrivateEndpoints() - { - return GetCachedClient(Client => new PrivateEndpointCollection(Client, Id)); - } - - /// Gets a collection of PrivateLinkServiceResources in the ResourceGroupResource. - /// An object representing collection of PrivateLinkServiceResources and their operations over a PrivateLinkServiceResource. - public virtual PrivateLinkServiceCollection GetPrivateLinkServices() - { - return GetCachedClient(Client => new PrivateLinkServiceCollection(Client, Id)); - } - - /// Gets a collection of PublicIPAddressResources in the ResourceGroupResource. - /// An object representing collection of PublicIPAddressResources and their operations over a PublicIPAddressResource. - public virtual PublicIPAddressCollection GetPublicIPAddresses() - { - return GetCachedClient(Client => new PublicIPAddressCollection(Client, Id)); - } - - /// Gets a collection of PublicIPPrefixResources in the ResourceGroupResource. - /// An object representing collection of PublicIPPrefixResources and their operations over a PublicIPPrefixResource. - public virtual PublicIPPrefixCollection GetPublicIPPrefixes() - { - return GetCachedClient(Client => new PublicIPPrefixCollection(Client, Id)); - } - - /// Gets a collection of RouteFilterResources in the ResourceGroupResource. - /// An object representing collection of RouteFilterResources and their operations over a RouteFilterResource. - public virtual RouteFilterCollection GetRouteFilters() - { - return GetCachedClient(Client => new RouteFilterCollection(Client, Id)); - } - - /// Gets a collection of RouteTableResources in the ResourceGroupResource. - /// An object representing collection of RouteTableResources and their operations over a RouteTableResource. - public virtual RouteTableCollection GetRouteTables() - { - return GetCachedClient(Client => new RouteTableCollection(Client, Id)); - } - - /// Gets a collection of SecurityPartnerProviderResources in the ResourceGroupResource. - /// An object representing collection of SecurityPartnerProviderResources and their operations over a SecurityPartnerProviderResource. - public virtual SecurityPartnerProviderCollection GetSecurityPartnerProviders() - { - return GetCachedClient(Client => new SecurityPartnerProviderCollection(Client, Id)); - } - - /// Gets a collection of ServiceEndpointPolicyResources in the ResourceGroupResource. - /// An object representing collection of ServiceEndpointPolicyResources and their operations over a ServiceEndpointPolicyResource. - public virtual ServiceEndpointPolicyCollection GetServiceEndpointPolicies() - { - return GetCachedClient(Client => new ServiceEndpointPolicyCollection(Client, Id)); - } - - /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. - /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. - public virtual VirtualNetworkCollection GetVirtualNetworks() - { - return GetCachedClient(Client => new VirtualNetworkCollection(Client, Id)); - } - - /// Gets a collection of VirtualNetworkGatewayResources in the ResourceGroupResource. - /// An object representing collection of VirtualNetworkGatewayResources and their operations over a VirtualNetworkGatewayResource. - public virtual VirtualNetworkGatewayCollection GetVirtualNetworkGateways() - { - return GetCachedClient(Client => new VirtualNetworkGatewayCollection(Client, Id)); - } - - /// Gets a collection of VirtualNetworkGatewayConnectionResources in the ResourceGroupResource. - /// An object representing collection of VirtualNetworkGatewayConnectionResources and their operations over a VirtualNetworkGatewayConnectionResource. - public virtual VirtualNetworkGatewayConnectionCollection GetVirtualNetworkGatewayConnections() - { - return GetCachedClient(Client => new VirtualNetworkGatewayConnectionCollection(Client, Id)); - } - - /// Gets a collection of LocalNetworkGatewayResources in the ResourceGroupResource. - /// An object representing collection of LocalNetworkGatewayResources and their operations over a LocalNetworkGatewayResource. - public virtual LocalNetworkGatewayCollection GetLocalNetworkGateways() - { - return GetCachedClient(Client => new LocalNetworkGatewayCollection(Client, Id)); - } - - /// Gets a collection of VirtualNetworkTapResources in the ResourceGroupResource. - /// An object representing collection of VirtualNetworkTapResources and their operations over a VirtualNetworkTapResource. - public virtual VirtualNetworkTapCollection GetVirtualNetworkTaps() - { - return GetCachedClient(Client => new VirtualNetworkTapCollection(Client, Id)); - } - - /// Gets a collection of VirtualRouterResources in the ResourceGroupResource. - /// An object representing collection of VirtualRouterResources and their operations over a VirtualRouterResource. - public virtual VirtualRouterCollection GetVirtualRouters() - { - return GetCachedClient(Client => new VirtualRouterCollection(Client, Id)); - } - - /// Gets a collection of VirtualWanResources in the ResourceGroupResource. - /// An object representing collection of VirtualWanResources and their operations over a VirtualWanResource. - public virtual VirtualWanCollection GetVirtualWans() - { - return GetCachedClient(Client => new VirtualWanCollection(Client, Id)); - } - - /// Gets a collection of VpnSiteResources in the ResourceGroupResource. - /// An object representing collection of VpnSiteResources and their operations over a VpnSiteResource. - public virtual VpnSiteCollection GetVpnSites() - { - return GetCachedClient(Client => new VpnSiteCollection(Client, Id)); - } - - /// Gets a collection of VpnServerConfigurationResources in the ResourceGroupResource. - /// An object representing collection of VpnServerConfigurationResources and their operations over a VpnServerConfigurationResource. - public virtual VpnServerConfigurationCollection GetVpnServerConfigurations() - { - return GetCachedClient(Client => new VpnServerConfigurationCollection(Client, Id)); - } - - /// Gets a collection of VirtualHubResources in the ResourceGroupResource. - /// An object representing collection of VirtualHubResources and their operations over a VirtualHubResource. - public virtual VirtualHubCollection GetVirtualHubs() - { - return GetCachedClient(Client => new VirtualHubCollection(Client, Id)); - } - - /// Gets a collection of VpnGatewayResources in the ResourceGroupResource. - /// An object representing collection of VpnGatewayResources and their operations over a VpnGatewayResource. - public virtual VpnGatewayCollection GetVpnGateways() - { - return GetCachedClient(Client => new VpnGatewayCollection(Client, Id)); - } - - /// Gets a collection of P2SVpnGatewayResources in the ResourceGroupResource. - /// An object representing collection of P2SVpnGatewayResources and their operations over a P2SVpnGatewayResource. - public virtual P2SVpnGatewayCollection GetP2SVpnGateways() - { - return GetCachedClient(Client => new P2SVpnGatewayCollection(Client, Id)); - } - - /// Gets a collection of ExpressRouteGatewayResources in the ResourceGroupResource. - /// An object representing collection of ExpressRouteGatewayResources and their operations over a ExpressRouteGatewayResource. - public virtual ExpressRouteGatewayCollection GetExpressRouteGateways() - { - return GetCachedClient(Client => new ExpressRouteGatewayCollection(Client, Id)); - } - - /// Gets a collection of WebApplicationFirewallPolicyResources in the ResourceGroupResource. - /// An object representing collection of WebApplicationFirewallPolicyResources and their operations over a WebApplicationFirewallPolicyResource. - public virtual WebApplicationFirewallPolicyCollection GetWebApplicationFirewallPolicies() - { - return GetCachedClient(Client => new WebApplicationFirewallPolicyCollection(Client, Id)); - } - - /// - /// Gets all of the available subnet delegations for this resource group in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations - /// - /// - /// Operation Id - /// AvailableResourceGroupDelegations_List - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAvailableResourceGroupDelegationsAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableResourceGroupDelegationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableResourceGroupDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableResourceGroupDelegationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableResourceGroupDelegations", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all of the available subnet delegations for this resource group in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations - /// - /// - /// Operation Id - /// AvailableResourceGroupDelegations_List - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAvailableResourceGroupDelegations(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableResourceGroupDelegationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableResourceGroupDelegationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDelegation.DeserializeAvailableDelegation, AvailableResourceGroupDelegationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableResourceGroupDelegations", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases - /// - /// - /// Operation Id - /// AvailableServiceAliases_ListByResourceGroup - /// - /// - /// - /// The location. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAvailableServiceAliasesByResourceGroupAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableServiceAliasesByResourceGroup", "value", "nextLink", cancellationToken); - } - - /// - /// Gets all available service aliases for this resource group in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases - /// - /// - /// Operation Id - /// AvailableServiceAliases_ListByResourceGroup - /// - /// - /// - /// The location. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAvailableServiceAliasesByResourceGroup(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableServiceAliasesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableServiceAliasesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableServiceAlias.DeserializeAvailableServiceAlias, AvailableServiceAliasesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableServiceAliasesByResourceGroup", "value", "nextLink", cancellationToken); - } - - /// - /// Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes - /// - /// - /// Operation Id - /// AvailablePrivateEndpointTypes_ListByResourceGroup - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAvailablePrivateEndpointTypesByResourceGroupAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailablePrivateEndpointTypesByResourceGroup", "value", "nextLink", cancellationToken); - } - - /// - /// Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes - /// - /// - /// Operation Id - /// AvailablePrivateEndpointTypes_ListByResourceGroup - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAvailablePrivateEndpointTypesByResourceGroup(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailablePrivateEndpointTypesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailablePrivateEndpointType.DeserializeAvailablePrivateEndpointType, AvailablePrivateEndpointTypesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailablePrivateEndpointTypesByResourceGroup", "value", "nextLink", cancellationToken); - } - - /// - /// Checks whether the subscription is visible to private link service in the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility - /// - /// - /// Operation Id - /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup - /// - /// - /// - /// 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 location of the domain name. - /// The request body of CheckPrivateLinkService API call. - /// The cancellation token to use. - public virtual async Task> CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkServiceAsync(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) - { - using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService"); - scope.Start(); - try - { - var response = await PrivateLinkServicesRestClient.CheckPrivateLinkServiceVisibilityByResourceGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken).ConfigureAwait(false); - var operation = new NetworkArmOperation(new PrivateLinkServiceVisibilityOperationSource(), PrivateLinkServicesClientDiagnostics, Pipeline, PrivateLinkServicesRestClient.CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks whether the subscription is visible to private link service in the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility - /// - /// - /// Operation Id - /// PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup - /// - /// - /// - /// 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 location of the domain name. - /// The request body of CheckPrivateLinkService API call. - /// The cancellation token to use. - public virtual ArmOperation CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService(WaitUntil waitUntil, AzureLocation location, CheckPrivateLinkServiceVisibilityRequest checkPrivateLinkServiceVisibilityRequest, CancellationToken cancellationToken = default) - { - using var scope = PrivateLinkServicesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckPrivateLinkServiceVisibilityByResourceGroupPrivateLinkService"); - scope.Start(); - try - { - var response = PrivateLinkServicesRestClient.CheckPrivateLinkServiceVisibilityByResourceGroup(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest, cancellationToken); - var operation = new NetworkArmOperation(new PrivateLinkServiceVisibilityOperationSource(), PrivateLinkServicesClientDiagnostics, Pipeline, PrivateLinkServicesRestClient.CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, checkPrivateLinkServiceVisibilityRequest).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices - /// - /// - /// Operation Id - /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServicesAsync(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices", "value", "nextLink", cancellationToken); - } - - /// - /// Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices - /// - /// - /// Operation Id - /// PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup - /// - /// - /// - /// The location of the domain name. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices(AzureLocation location, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateLinkServicesRestClient.CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AutoApprovedPrivateLinkService.DeserializeAutoApprovedPrivateLinkService, PrivateLinkServicesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAutoApprovedPrivateLinkServicesByResourceGroupPrivateLinkServices", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/FirewallPolicyResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/FirewallPolicyResource.cs index d19afa7be5e5..7af535c1d299 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/FirewallPolicyResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/FirewallPolicyResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FirewallPolicyRuleCollectionGroupResources and their operations over a FirewallPolicyRuleCollectionGroupResource. public virtual FirewallPolicyRuleCollectionGroupCollection GetFirewallPolicyRuleCollectionGroups() { - return GetCachedClient(Client => new FirewallPolicyRuleCollectionGroupCollection(Client, Id)); + return GetCachedClient(client => new FirewallPolicyRuleCollectionGroupCollection(client, Id)); } /// @@ -119,8 +119,8 @@ public virtual FirewallPolicyRuleCollectionGroupCollection GetFirewallPolicyRule /// /// The name of the FirewallPolicyRuleCollectionGroup. /// The cancellation token to use. - /// 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> GetFirewallPolicyRuleCollectionGroupAsync(string ruleCollectionGroupName, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> G /// /// The name of the FirewallPolicyRuleCollectionGroup. /// The cancellation token to use. - /// 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 GetFirewallPolicyRuleCollectionGroup(string ruleCollectionGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancerResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancerResource.cs index f81ee70080ef..344c67b632c8 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancerResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/LoadBalancerResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BackendAddressPoolResources and their operations over a BackendAddressPoolResource. public virtual BackendAddressPoolCollection GetBackendAddressPools() { - return GetCachedClient(Client => new BackendAddressPoolCollection(Client, Id)); + return GetCachedClient(client => new BackendAddressPoolCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual BackendAddressPoolCollection GetBackendAddressPools() /// /// The name of the backend address pool. /// The cancellation token to use. - /// 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> GetBackendAddressPoolAsync(string backendAddressPoolName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetBackendAddres /// /// The name of the backend address pool. /// The cancellation token to use. - /// 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 GetBackendAddressPool(string backendAddressPoolName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetBackendAddressPool(string /// An object representing collection of FrontendIPConfigurationResources and their operations over a FrontendIPConfigurationResource. public virtual FrontendIPConfigurationCollection GetFrontendIPConfigurations() { - return GetCachedClient(Client => new FrontendIPConfigurationCollection(Client, Id)); + return GetCachedClient(client => new FrontendIPConfigurationCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual FrontendIPConfigurationCollection GetFrontendIPConfigurations() /// /// The name of the frontend IP configuration. /// The cancellation token to use. - /// 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> GetFrontendIPConfigurationAsync(string frontendIPConfigurationName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetFrontend /// /// The name of the frontend IP configuration. /// The cancellation token to use. - /// 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 GetFrontendIPConfiguration(string frontendIPConfigurationName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetFrontendIPConfigurat /// An object representing collection of InboundNatRuleResources and their operations over a InboundNatRuleResource. public virtual InboundNatRuleCollection GetInboundNatRules() { - return GetCachedClient(Client => new InboundNatRuleCollection(Client, Id)); + return GetCachedClient(client => new InboundNatRuleCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual InboundNatRuleCollection GetInboundNatRules() /// The name of the inbound NAT rule. /// Expands referenced resources. /// The cancellation token to use. - /// 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> GetInboundNatRuleAsync(string inboundNatRuleName, string expand = null, CancellationToken cancellationToken = default) { @@ -247,8 +247,8 @@ public virtual async Task> GetInboundNatRuleAsy /// The name of the inbound NAT rule. /// Expands referenced resources. /// The cancellation token to use. - /// 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 GetInboundNatRule(string inboundNatRuleName, string expand = null, CancellationToken cancellationToken = default) { @@ -259,7 +259,7 @@ public virtual Response GetInboundNatRule(string inbound /// An object representing collection of LoadBalancingRuleResources and their operations over a LoadBalancingRuleResource. public virtual LoadBalancingRuleCollection GetLoadBalancingRules() { - return GetCachedClient(Client => new LoadBalancingRuleCollection(Client, Id)); + return GetCachedClient(client => new LoadBalancingRuleCollection(client, Id)); } /// @@ -277,8 +277,8 @@ public virtual LoadBalancingRuleCollection GetLoadBalancingRules() /// /// The name of the load balancing rule. /// The cancellation token to use. - /// 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> GetLoadBalancingRuleAsync(string loadBalancingRuleName, CancellationToken cancellationToken = default) { @@ -300,8 +300,8 @@ public virtual async Task> GetLoadBalancingR /// /// The name of the load balancing rule. /// The cancellation token to use. - /// 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 GetLoadBalancingRule(string loadBalancingRuleName, CancellationToken cancellationToken = default) { @@ -312,7 +312,7 @@ public virtual Response GetLoadBalancingRule(string l /// An object representing collection of OutboundRuleResources and their operations over a OutboundRuleResource. public virtual OutboundRuleCollection GetOutboundRules() { - return GetCachedClient(Client => new OutboundRuleCollection(Client, Id)); + return GetCachedClient(client => new OutboundRuleCollection(client, Id)); } /// @@ -330,8 +330,8 @@ public virtual OutboundRuleCollection GetOutboundRules() /// /// The name of the outbound rule. /// The cancellation token to use. - /// 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> GetOutboundRuleAsync(string outboundRuleName, CancellationToken cancellationToken = default) { @@ -353,8 +353,8 @@ public virtual async Task> GetOutboundRuleAsync(s /// /// The name of the outbound rule. /// The cancellation token to use. - /// 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 GetOutboundRule(string outboundRuleName, CancellationToken cancellationToken = default) { @@ -365,7 +365,7 @@ public virtual Response GetOutboundRule(string outboundRul /// An object representing collection of ProbeResources and their operations over a ProbeResource. public virtual ProbeCollection GetProbes() { - return GetCachedClient(Client => new ProbeCollection(Client, Id)); + return GetCachedClient(client => new ProbeCollection(client, Id)); } /// @@ -383,8 +383,8 @@ public virtual ProbeCollection GetProbes() /// /// The name of the probe. /// The cancellation token to use. - /// 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> GetProbeAsync(string probeName, CancellationToken cancellationToken = default) { @@ -406,8 +406,8 @@ public virtual async Task> GetProbeAsync(string probeNam /// /// The name of the probe. /// The cancellation token to use. - /// 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 GetProbe(string probeName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkGroupResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkGroupResource.cs index 964daa40daf4..f6d983c8bb0e 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkGroupResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkGroupResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkGroupStaticMemberResources and their operations over a NetworkGroupStaticMemberResource. public virtual NetworkGroupStaticMemberCollection GetNetworkGroupStaticMembers() { - return GetCachedClient(Client => new NetworkGroupStaticMemberCollection(Client, Id)); + return GetCachedClient(client => new NetworkGroupStaticMemberCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual NetworkGroupStaticMemberCollection GetNetworkGroupStaticMembers() /// /// The name of the static member. /// The cancellation token to use. - /// 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> GetNetworkGroupStaticMemberAsync(string staticMemberName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetNetwork /// /// The name of the static member. /// The cancellation token to use. - /// 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 GetNetworkGroupStaticMember(string staticMemberName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkInterfaceResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkInterfaceResource.cs index 448b4ffd5e8d..a9af16675b98 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkInterfaceResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkInterfaceResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkInterfaceIPConfigurationResources and their operations over a NetworkInterfaceIPConfigurationResource. public virtual NetworkInterfaceIPConfigurationCollection GetNetworkInterfaceIPConfigurations() { - return GetCachedClient(Client => new NetworkInterfaceIPConfigurationCollection(Client, Id)); + return GetCachedClient(client => new NetworkInterfaceIPConfigurationCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual NetworkInterfaceIPConfigurationCollection GetNetworkInterfaceIPCo /// /// The name of the ip configuration name. /// The cancellation token to use. - /// 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> GetNetworkInterfaceIPConfigurationAsync(string ipConfigurationName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> Get /// /// The name of the ip configuration name. /// The cancellation token to use. - /// 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 GetNetworkInterfaceIPConfiguration(string ipConfigurationName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetNetworkInter /// An object representing collection of NetworkInterfaceTapConfigurationResources and their operations over a NetworkInterfaceTapConfigurationResource. public virtual NetworkInterfaceTapConfigurationCollection GetNetworkInterfaceTapConfigurations() { - return GetCachedClient(Client => new NetworkInterfaceTapConfigurationCollection(Client, Id)); + return GetCachedClient(client => new NetworkInterfaceTapConfigurationCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual NetworkInterfaceTapConfigurationCollection GetNetworkInterfaceTap /// /// The name of the tap configuration. /// The cancellation token to use. - /// 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> GetNetworkInterfaceTapConfigurationAsync(string tapConfigurationName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> Ge /// /// The name of the tap configuration. /// The cancellation token to use. - /// 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 GetNetworkInterfaceTapConfiguration(string tapConfigurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkManagerResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkManagerResource.cs index 647f2f66b585..c0b42c56357e 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkManagerResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkManagerResource.cs @@ -107,7 +107,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ConnectivityConfigurationResources and their operations over a ConnectivityConfigurationResource. public virtual ConnectivityConfigurationCollection GetConnectivityConfigurations() { - return GetCachedClient(Client => new ConnectivityConfigurationCollection(Client, Id)); + return GetCachedClient(client => new ConnectivityConfigurationCollection(client, Id)); } /// @@ -125,8 +125,8 @@ public virtual ConnectivityConfigurationCollection GetConnectivityConfigurations /// /// The name of the network manager connectivity configuration. /// The cancellation token to use. - /// 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> GetConnectivityConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -148,8 +148,8 @@ public virtual async Task> GetConnec /// /// The name of the network manager connectivity configuration. /// The cancellation token to use. - /// 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 GetConnectivityConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -160,7 +160,7 @@ public virtual Response GetConnectivityConfig /// An object representing collection of NetworkGroupResources and their operations over a NetworkGroupResource. public virtual NetworkGroupCollection GetNetworkGroups() { - return GetCachedClient(Client => new NetworkGroupCollection(Client, Id)); + return GetCachedClient(client => new NetworkGroupCollection(client, Id)); } /// @@ -178,8 +178,8 @@ public virtual NetworkGroupCollection GetNetworkGroups() /// /// The name of the network group. /// The cancellation token to use. - /// 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> GetNetworkGroupAsync(string networkGroupName, CancellationToken cancellationToken = default) { @@ -201,8 +201,8 @@ public virtual async Task> GetNetworkGroupAsync(s /// /// The name of the network group. /// The cancellation token to use. - /// 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 GetNetworkGroup(string networkGroupName, CancellationToken cancellationToken = default) { @@ -213,7 +213,7 @@ public virtual Response GetNetworkGroup(string networkGrou /// An object representing collection of ScopeConnectionResources and their operations over a ScopeConnectionResource. public virtual ScopeConnectionCollection GetScopeConnections() { - return GetCachedClient(Client => new ScopeConnectionCollection(Client, Id)); + return GetCachedClient(client => new ScopeConnectionCollection(client, Id)); } /// @@ -231,8 +231,8 @@ public virtual ScopeConnectionCollection GetScopeConnections() /// /// Name for the cross-tenant connection. /// The cancellation token to use. - /// 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> GetScopeConnectionAsync(string scopeConnectionName, CancellationToken cancellationToken = default) { @@ -254,8 +254,8 @@ public virtual async Task> GetScopeConnectionA /// /// Name for the cross-tenant connection. /// The cancellation token to use. - /// 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 GetScopeConnection(string scopeConnectionName, CancellationToken cancellationToken = default) { @@ -266,7 +266,7 @@ public virtual Response GetScopeConnection(string scope /// An object representing collection of SecurityAdminConfigurationResources and their operations over a SecurityAdminConfigurationResource. public virtual SecurityAdminConfigurationCollection GetSecurityAdminConfigurations() { - return GetCachedClient(Client => new SecurityAdminConfigurationCollection(Client, Id)); + return GetCachedClient(client => new SecurityAdminConfigurationCollection(client, Id)); } /// @@ -284,8 +284,8 @@ public virtual SecurityAdminConfigurationCollection GetSecurityAdminConfiguratio /// /// The name of the network manager Security Configuration. /// The cancellation token to use. - /// 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> GetSecurityAdminConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -307,8 +307,8 @@ public virtual async Task> GetSecur /// /// The name of the network manager Security Configuration. /// The cancellation token to use. - /// 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 GetSecurityAdminConfiguration(string configurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkSecurityGroupResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkSecurityGroupResource.cs index 49489f611c16..8ea893d56f4f 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkSecurityGroupResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkSecurityGroupResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityRuleResources and their operations over a SecurityRuleResource. public virtual SecurityRuleCollection GetSecurityRules() { - return GetCachedClient(Client => new SecurityRuleCollection(Client, Id)); + return GetCachedClient(client => new SecurityRuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SecurityRuleCollection GetSecurityRules() /// /// The name of the security rule. /// The cancellation token to use. - /// 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> GetSecurityRuleAsync(string securityRuleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSecurityRuleAsync(s /// /// The name of the security rule. /// The cancellation token to use. - /// 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 GetSecurityRule(string securityRuleName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetSecurityRule(string securityRul /// An object representing collection of DefaultSecurityRuleResources and their operations over a DefaultSecurityRuleResource. public virtual DefaultSecurityRuleCollection GetDefaultSecurityRules() { - return GetCachedClient(Client => new DefaultSecurityRuleCollection(Client, Id)); + return GetCachedClient(client => new DefaultSecurityRuleCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DefaultSecurityRuleCollection GetDefaultSecurityRules() /// /// The name of the default security rule. /// The cancellation token to use. - /// 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> GetDefaultSecurityRuleAsync(string defaultSecurityRuleName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetDefaultSecur /// /// The name of the default security rule. /// The cancellation token to use. - /// 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 GetDefaultSecurityRule(string defaultSecurityRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs index f6535deffd28..b7ee53c7f9a2 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualApplianceSiteResources and their operations over a VirtualApplianceSiteResource. public virtual VirtualApplianceSiteCollection GetVirtualApplianceSites() { - return GetCachedClient(Client => new VirtualApplianceSiteCollection(Client, Id)); + return GetCachedClient(client => new VirtualApplianceSiteCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual VirtualApplianceSiteCollection GetVirtualApplianceSites() /// /// The name of the site. /// The cancellation token to use. - /// 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> GetVirtualApplianceSiteAsync(string siteName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetVirtualAppl /// /// The name of the site. /// The cancellation token to use. - /// 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 GetVirtualApplianceSite(string siteName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetVirtualApplianceSite(st /// An object representing collection of NetworkVirtualApplianceConnectionResources and their operations over a NetworkVirtualApplianceConnectionResource. public virtual NetworkVirtualApplianceConnectionCollection GetNetworkVirtualApplianceConnections() { - return GetCachedClient(Client => new NetworkVirtualApplianceConnectionCollection(Client, Id)); + return GetCachedClient(client => new NetworkVirtualApplianceConnectionCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual NetworkVirtualApplianceConnectionCollection GetNetworkVirtualAppl /// /// The name of the NVA connection. /// The cancellation token to use. - /// 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> GetNetworkVirtualApplianceConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> G /// /// The name of the NVA connection. /// The cancellation token to use. - /// 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 GetNetworkVirtualApplianceConnection(string connectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkWatcherResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkWatcherResource.cs index f080ad4c3d56..1c5c431878ea 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkWatcherResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkWatcherResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PacketCaptureResources and their operations over a PacketCaptureResource. public virtual PacketCaptureCollection GetPacketCaptures() { - return GetCachedClient(Client => new PacketCaptureCollection(Client, Id)); + return GetCachedClient(client => new PacketCaptureCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual PacketCaptureCollection GetPacketCaptures() /// /// The name of the packet capture session. /// The cancellation token to use. - /// 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> GetPacketCaptureAsync(string packetCaptureName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetPacketCaptureAsync /// /// The name of the packet capture session. /// The cancellation token to use. - /// 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 GetPacketCapture(string packetCaptureName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetPacketCapture(string packetCap /// An object representing collection of ConnectionMonitorResources and their operations over a ConnectionMonitorResource. public virtual ConnectionMonitorCollection GetConnectionMonitors() { - return GetCachedClient(Client => new ConnectionMonitorCollection(Client, Id)); + return GetCachedClient(client => new ConnectionMonitorCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ConnectionMonitorCollection GetConnectionMonitors() /// /// The name of the connection monitor. /// The cancellation token to use. - /// 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> GetConnectionMonitorAsync(string connectionMonitorName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetConnectionMoni /// /// The name of the connection monitor. /// The cancellation token to use. - /// 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 GetConnectionMonitor(string connectionMonitorName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetConnectionMonitor(string c /// An object representing collection of FlowLogResources and their operations over a FlowLogResource. public virtual FlowLogCollection GetFlowLogs() { - return GetCachedClient(Client => new FlowLogCollection(Client, Id)); + return GetCachedClient(client => new FlowLogCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual FlowLogCollection GetFlowLogs() /// /// The name of the flow log resource. /// The cancellation token to use. - /// 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> GetFlowLogAsync(string flowLogName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetFlowLogAsync(string flow /// /// The name of the flow log resource. /// The cancellation token to use. - /// 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 GetFlowLog(string flowLogName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateEndpointResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateEndpointResource.cs index c49e2a233828..f7c78296f7cc 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateEndpointResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateEndpointResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PrivateDnsZoneGroupResources and their operations over a PrivateDnsZoneGroupResource. public virtual PrivateDnsZoneGroupCollection GetPrivateDnsZoneGroups() { - return GetCachedClient(Client => new PrivateDnsZoneGroupCollection(Client, Id)); + return GetCachedClient(client => new PrivateDnsZoneGroupCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual PrivateDnsZoneGroupCollection GetPrivateDnsZoneGroups() /// /// The name of the private dns zone group. /// The cancellation token to use. - /// 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> GetPrivateDnsZoneGroupAsync(string privateDnsZoneGroupName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetPrivateDnsZo /// /// The name of the private dns zone group. /// The cancellation token to use. - /// 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 GetPrivateDnsZoneGroup(string privateDnsZoneGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateLinkServiceResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateLinkServiceResource.cs index cb305739b114..d32f5ac4888a 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateLinkServiceResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/PrivateLinkServiceResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkPrivateEndpointConnectionResources and their operations over a NetworkPrivateEndpointConnectionResource. public virtual NetworkPrivateEndpointConnectionCollection GetNetworkPrivateEndpointConnections() { - return GetCachedClient(Client => new NetworkPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new NetworkPrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkPrivateEndpointConnectionCollection GetNetworkPrivateEndpo /// The name of the private end point connection. /// Expands referenced resources. /// The cancellation token to use. - /// 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> GetNetworkPrivateEndpointConnectionAsync(string peConnectionName, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> Ge /// The name of the private end point connection. /// Expands referenced resources. /// The cancellation token to use. - /// 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 GetNetworkPrivateEndpointConnection(string peConnectionName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteFilterResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteFilterResource.cs index b85932b50990..5ed3beaeaba5 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteFilterResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteFilterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RouteFilterRuleResources and their operations over a RouteFilterRuleResource. public virtual RouteFilterRuleCollection GetRouteFilterRules() { - return GetCachedClient(Client => new RouteFilterRuleCollection(Client, Id)); + return GetCachedClient(client => new RouteFilterRuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual RouteFilterRuleCollection GetRouteFilterRules() /// /// The name of the rule. /// The cancellation token to use. - /// 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> GetRouteFilterRuleAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetRouteFilterRuleA /// /// The name of the rule. /// The cancellation token to use. - /// 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 GetRouteFilterRule(string ruleName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteTableResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteTableResource.cs index 8908ea0b8284..6a5e46f6f9f1 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteTableResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/RouteTableResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RouteResources and their operations over a RouteResource. public virtual RouteCollection GetRoutes() { - return GetCachedClient(Client => new RouteCollection(Client, Id)); + return GetCachedClient(client => new RouteCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual RouteCollection GetRoutes() /// /// The name of the route. /// The cancellation token to use. - /// 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> GetRouteAsync(string routeName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetRouteAsync(string routeNam /// /// The name of the route. /// The cancellation token to use. - /// 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 GetRoute(string routeName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/SecurityAdminConfigurationResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/SecurityAdminConfigurationResource.cs index b7b869f6c40a..23320dded85c 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/SecurityAdminConfigurationResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/SecurityAdminConfigurationResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AdminRuleGroupResources and their operations over a AdminRuleGroupResource. public virtual AdminRuleGroupCollection GetAdminRuleGroups() { - return GetCachedClient(Client => new AdminRuleGroupCollection(Client, Id)); + return GetCachedClient(client => new AdminRuleGroupCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AdminRuleGroupCollection GetAdminRuleGroups() /// /// The name of the network manager security Configuration rule collection. /// The cancellation token to use. - /// 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> GetAdminRuleGroupAsync(string ruleCollectionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetAdminRuleGroupAsy /// /// The name of the network manager security Configuration rule collection. /// The cancellation token to use. - /// 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 GetAdminRuleGroup(string ruleCollectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ServiceEndpointPolicyResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ServiceEndpointPolicyResource.cs index ab579cc8e1d9..d1a673e9cbde 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ServiceEndpointPolicyResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ServiceEndpointPolicyResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceEndpointPolicyDefinitionResources and their operations over a ServiceEndpointPolicyDefinitionResource. public virtual ServiceEndpointPolicyDefinitionCollection GetServiceEndpointPolicyDefinitions() { - return GetCachedClient(Client => new ServiceEndpointPolicyDefinitionCollection(Client, Id)); + return GetCachedClient(client => new ServiceEndpointPolicyDefinitionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ServiceEndpointPolicyDefinitionCollection GetServiceEndpointPolic /// /// The name of the service endpoint policy definition name. /// The cancellation token to use. - /// 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> GetServiceEndpointPolicyDefinitionAsync(string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Get /// /// The name of the service endpoint policy definition name. /// The cancellation token to use. - /// 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 GetServiceEndpointPolicyDefinition(string serviceEndpointPolicyDefinitionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualHubResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualHubResource.cs index 42fa48037156..2a02453329d8 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualHubResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualHubResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RouteMapResources and their operations over a RouteMapResource. public virtual RouteMapCollection GetRouteMaps() { - return GetCachedClient(Client => new RouteMapCollection(Client, Id)); + return GetCachedClient(client => new RouteMapCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual RouteMapCollection GetRouteMaps() /// /// The name of the RouteMap. /// The cancellation token to use. - /// 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> GetRouteMapAsync(string routeMapName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetRouteMapAsync(string ro /// /// The name of the RouteMap. /// The cancellation token to use. - /// 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 GetRouteMap(string routeMapName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetRouteMap(string routeMapName, Cance /// An object representing collection of HubVirtualNetworkConnectionResources and their operations over a HubVirtualNetworkConnectionResource. public virtual HubVirtualNetworkConnectionCollection GetHubVirtualNetworkConnections() { - return GetCachedClient(Client => new HubVirtualNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new HubVirtualNetworkConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual HubVirtualNetworkConnectionCollection GetHubVirtualNetworkConnect /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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> GetHubVirtualNetworkConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetHubV /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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 GetHubVirtualNetworkConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetHubVirtualNetwor /// An object representing collection of VirtualHubRouteTableV2Resources and their operations over a VirtualHubRouteTableV2Resource. public virtual VirtualHubRouteTableV2Collection GetVirtualHubRouteTableV2s() { - return GetCachedClient(Client => new VirtualHubRouteTableV2Collection(Client, Id)); + return GetCachedClient(client => new VirtualHubRouteTableV2Collection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual VirtualHubRouteTableV2Collection GetVirtualHubRouteTableV2s() /// /// The name of the VirtualHubRouteTableV2. /// The cancellation token to use. - /// 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> GetVirtualHubRouteTableV2Async(string routeTableName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetVirtualHu /// /// The name of the VirtualHubRouteTableV2. /// The cancellation token to use. - /// 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 GetVirtualHubRouteTableV2(string routeTableName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetVirtualHubRouteTableV /// An object representing collection of BgpConnectionResources and their operations over a BgpConnectionResource. public virtual BgpConnectionCollection GetBgpConnections() { - return GetCachedClient(Client => new BgpConnectionCollection(Client, Id)); + return GetCachedClient(client => new BgpConnectionCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual BgpConnectionCollection GetBgpConnections() /// /// The name of the connection. /// The cancellation token to use. - /// 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> GetBgpConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetBgpConnectionAsync /// /// The name of the connection. /// The cancellation token to use. - /// 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 GetBgpConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetBgpConnection(string connectio /// An object representing collection of HubIPConfigurationResources and their operations over a HubIPConfigurationResource. public virtual HubIPConfigurationCollection GetHubIPConfigurations() { - return GetCachedClient(Client => new HubIPConfigurationCollection(Client, Id)); + return GetCachedClient(client => new HubIPConfigurationCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual HubIPConfigurationCollection GetHubIPConfigurations() /// /// The name of the ipconfig. /// The cancellation token to use. - /// 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> GetHubIPConfigurationAsync(string ipConfigName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetHubIPConfigur /// /// The name of the ipconfig. /// The cancellation token to use. - /// 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 GetHubIPConfiguration(string ipConfigName, CancellationToken cancellationToken = default) { @@ -358,7 +358,7 @@ public virtual Response GetHubIPConfiguration(string /// An object representing collection of HubRouteTableResources and their operations over a HubRouteTableResource. public virtual HubRouteTableCollection GetHubRouteTables() { - return GetCachedClient(Client => new HubRouteTableCollection(Client, Id)); + return GetCachedClient(client => new HubRouteTableCollection(client, Id)); } /// @@ -376,8 +376,8 @@ public virtual HubRouteTableCollection GetHubRouteTables() /// /// The name of the RouteTable. /// The cancellation token to use. - /// 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> GetHubRouteTableAsync(string routeTableName, CancellationToken cancellationToken = default) { @@ -399,8 +399,8 @@ public virtual async Task> GetHubRouteTableAsync /// /// The name of the RouteTable. /// The cancellation token to use. - /// 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 GetHubRouteTable(string routeTableName, CancellationToken cancellationToken = default) { @@ -411,7 +411,7 @@ public virtual Response GetHubRouteTable(string routeTabl /// An object representing collection of RoutingIntentResources and their operations over a RoutingIntentResource. public virtual RoutingIntentCollection GetRoutingIntents() { - return GetCachedClient(Client => new RoutingIntentCollection(Client, Id)); + return GetCachedClient(client => new RoutingIntentCollection(client, Id)); } /// @@ -429,8 +429,8 @@ public virtual RoutingIntentCollection GetRoutingIntents() /// /// The name of the RoutingIntent. /// The cancellation token to use. - /// 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> GetRoutingIntentAsync(string routingIntentName, CancellationToken cancellationToken = default) { @@ -452,8 +452,8 @@ public virtual async Task> GetRoutingIntentAsync /// /// The name of the RoutingIntent. /// The cancellation token to use. - /// 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 GetRoutingIntent(string routingIntentName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkGatewayResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkGatewayResource.cs index 853876592f19..4d09048232df 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkGatewayResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkGatewayResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualNetworkGatewayNatRuleResources and their operations over a VirtualNetworkGatewayNatRuleResource. public virtual VirtualNetworkGatewayNatRuleCollection GetVirtualNetworkGatewayNatRules() { - return GetCachedClient(Client => new VirtualNetworkGatewayNatRuleCollection(Client, Id)); + return GetCachedClient(client => new VirtualNetworkGatewayNatRuleCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual VirtualNetworkGatewayNatRuleCollection GetVirtualNetworkGatewayNa /// /// The name of the nat rule. /// The cancellation token to use. - /// 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> GetVirtualNetworkGatewayNatRuleAsync(string natRuleName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetVir /// /// The name of the nat rule. /// The cancellation token to use. - /// 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 GetVirtualNetworkGatewayNatRule(string natRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkResource.cs index 204fb1267494..828e5a8ec9b6 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualNetworkResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SubnetResources and their operations over a SubnetResource. public virtual SubnetCollection GetSubnets() { - return GetCachedClient(Client => new SubnetCollection(Client, Id)); + return GetCachedClient(client => new SubnetCollection(client, Id)); } /// @@ -118,8 +118,8 @@ public virtual SubnetCollection GetSubnets() /// The name of the subnet. /// Expands referenced resources. /// The cancellation token to use. - /// 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> GetSubnetAsync(string subnetName, string expand = null, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> GetSubnetAsync(string subnet /// The name of the subnet. /// Expands referenced resources. /// The cancellation token to use. - /// 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 GetSubnet(string subnetName, string expand = null, CancellationToken cancellationToken = default) { @@ -154,7 +154,7 @@ public virtual Response GetSubnet(string subnetName, string expa /// An object representing collection of VirtualNetworkPeeringResources and their operations over a VirtualNetworkPeeringResource. public virtual VirtualNetworkPeeringCollection GetVirtualNetworkPeerings() { - return GetCachedClient(Client => new VirtualNetworkPeeringCollection(Client, Id)); + return GetCachedClient(client => new VirtualNetworkPeeringCollection(client, Id)); } /// @@ -172,8 +172,8 @@ public virtual VirtualNetworkPeeringCollection GetVirtualNetworkPeerings() /// /// The name of the virtual network peering. /// The cancellation token to use. - /// 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> GetVirtualNetworkPeeringAsync(string virtualNetworkPeeringName, CancellationToken cancellationToken = default) { @@ -195,8 +195,8 @@ public virtual async Task> GetVirtualNet /// /// The name of the virtual network peering. /// The cancellation token to use. - /// 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 GetVirtualNetworkPeering(string virtualNetworkPeeringName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualRouterResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualRouterResource.cs index 6b044ff765d2..ac422beafaa6 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualRouterResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VirtualRouterResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualRouterPeeringResources and their operations over a VirtualRouterPeeringResource. public virtual VirtualRouterPeeringCollection GetVirtualRouterPeerings() { - return GetCachedClient(Client => new VirtualRouterPeeringCollection(Client, Id)); + return GetCachedClient(client => new VirtualRouterPeeringCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual VirtualRouterPeeringCollection GetVirtualRouterPeerings() /// /// The name of the Virtual Router Peering. /// The cancellation token to use. - /// 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> GetVirtualRouterPeeringAsync(string peeringName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetVirtualRout /// /// The name of the Virtual Router Peering. /// The cancellation token to use. - /// 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 GetVirtualRouterPeering(string peeringName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnConnectionResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnConnectionResource.cs index 6c2f9ec24030..25aec3af4260 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnConnectionResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnConnectionResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VpnSiteLinkConnectionResources and their operations over a VpnSiteLinkConnectionResource. public virtual VpnSiteLinkConnectionCollection GetVpnSiteLinkConnections() { - return GetCachedClient(Client => new VpnSiteLinkConnectionCollection(Client, Id)); + return GetCachedClient(client => new VpnSiteLinkConnectionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual VpnSiteLinkConnectionCollection GetVpnSiteLinkConnections() /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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> GetVpnSiteLinkConnectionAsync(string linkConnectionName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetVpnSiteLin /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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 GetVpnSiteLinkConnection(string linkConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnGatewayResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnGatewayResource.cs index 40c61ca245ef..5868f5987bf6 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnGatewayResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnGatewayResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VpnConnectionResources and their operations over a VpnConnectionResource. public virtual VpnConnectionCollection GetVpnConnections() { - return GetCachedClient(Client => new VpnConnectionCollection(Client, Id)); + return GetCachedClient(client => new VpnConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual VpnConnectionCollection GetVpnConnections() /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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> GetVpnConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetVpnConnectionAsync /// /// The name of the vpn connection. /// The cancellation token to use. - /// 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 GetVpnConnection(string connectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetVpnConnection(string connectio /// An object representing collection of VpnGatewayNatRuleResources and their operations over a VpnGatewayNatRuleResource. public virtual VpnGatewayNatRuleCollection GetVpnGatewayNatRules() { - return GetCachedClient(Client => new VpnGatewayNatRuleCollection(Client, Id)); + return GetCachedClient(client => new VpnGatewayNatRuleCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual VpnGatewayNatRuleCollection GetVpnGatewayNatRules() /// /// The name of the nat rule. /// The cancellation token to use. - /// 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> GetVpnGatewayNatRuleAsync(string natRuleName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetVpnGatewayNatR /// /// The name of the nat rule. /// The cancellation token to use. - /// 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 GetVpnGatewayNatRule(string natRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnServerConfigurationResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnServerConfigurationResource.cs index 5d766ecef5fe..36f12151b31a 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnServerConfigurationResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnServerConfigurationResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VpnServerConfigurationPolicyGroupResources and their operations over a VpnServerConfigurationPolicyGroupResource. public virtual VpnServerConfigurationPolicyGroupCollection GetVpnServerConfigurationPolicyGroups() { - return GetCachedClient(Client => new VpnServerConfigurationPolicyGroupCollection(Client, Id)); + return GetCachedClient(client => new VpnServerConfigurationPolicyGroupCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual VpnServerConfigurationPolicyGroupCollection GetVpnServerConfigura /// /// The name of the ConfigurationPolicyGroup being retrieved. /// The cancellation token to use. - /// 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> GetVpnServerConfigurationPolicyGroupAsync(string configurationPolicyGroupName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> G /// /// The name of the ConfigurationPolicyGroup being retrieved. /// The cancellation token to use. - /// 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 GetVpnServerConfigurationPolicyGroup(string configurationPolicyGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnSiteResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnSiteResource.cs index 15a54f52291e..ff942978bdbe 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnSiteResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/VpnSiteResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VpnSiteLinkResources and their operations over a VpnSiteLinkResource. public virtual VpnSiteLinkCollection GetVpnSiteLinks() { - return GetCachedClient(Client => new VpnSiteLinkCollection(Client, Id)); + return GetCachedClient(client => new VpnSiteLinkCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual VpnSiteLinkCollection GetVpnSiteLinks() /// /// The name of the VpnSiteLink being retrieved. /// The cancellation token to use. - /// 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> GetVpnSiteLinkAsync(string vpnSiteLinkName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetVpnSiteLinkAsync(str /// /// The name of the VpnSiteLink being retrieved. /// The cancellation token to use. - /// 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 GetVpnSiteLink(string vpnSiteLinkName, CancellationToken cancellationToken = default) { diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudArmClientMockingExtension.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudArmClientMockingExtension.cs new file mode 100644 index 000000000000..6605b6527f96 --- /dev/null +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudArmClientMockingExtension.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetworkCloud; + +namespace Azure.ResourceManager.NetworkCloud.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NetworkCloudArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkCloudArmClientMockingExtension() + { + } + + /// 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 NetworkCloudArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NetworkCloudArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkCloudBareMetalMachineResource GetNetworkCloudBareMetalMachineResource(ResourceIdentifier id) + { + NetworkCloudBareMetalMachineResource.ValidateResourceId(id); + return new NetworkCloudBareMetalMachineResource(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 NetworkCloudCloudServicesNetworkResource GetNetworkCloudCloudServicesNetworkResource(ResourceIdentifier id) + { + NetworkCloudCloudServicesNetworkResource.ValidateResourceId(id); + return new NetworkCloudCloudServicesNetworkResource(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 NetworkCloudClusterManagerResource GetNetworkCloudClusterManagerResource(ResourceIdentifier id) + { + NetworkCloudClusterManagerResource.ValidateResourceId(id); + return new NetworkCloudClusterManagerResource(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 NetworkCloudClusterResource GetNetworkCloudClusterResource(ResourceIdentifier id) + { + NetworkCloudClusterResource.ValidateResourceId(id); + return new NetworkCloudClusterResource(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 NetworkCloudKubernetesClusterResource GetNetworkCloudKubernetesClusterResource(ResourceIdentifier id) + { + NetworkCloudKubernetesClusterResource.ValidateResourceId(id); + return new NetworkCloudKubernetesClusterResource(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 NetworkCloudL2NetworkResource GetNetworkCloudL2NetworkResource(ResourceIdentifier id) + { + NetworkCloudL2NetworkResource.ValidateResourceId(id); + return new NetworkCloudL2NetworkResource(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 NetworkCloudL3NetworkResource GetNetworkCloudL3NetworkResource(ResourceIdentifier id) + { + NetworkCloudL3NetworkResource.ValidateResourceId(id); + return new NetworkCloudL3NetworkResource(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 NetworkCloudRackSkuResource GetNetworkCloudRackSkuResource(ResourceIdentifier id) + { + NetworkCloudRackSkuResource.ValidateResourceId(id); + return new NetworkCloudRackSkuResource(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 NetworkCloudRackResource GetNetworkCloudRackResource(ResourceIdentifier id) + { + NetworkCloudRackResource.ValidateResourceId(id); + return new NetworkCloudRackResource(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 NetworkCloudStorageApplianceResource GetNetworkCloudStorageApplianceResource(ResourceIdentifier id) + { + NetworkCloudStorageApplianceResource.ValidateResourceId(id); + return new NetworkCloudStorageApplianceResource(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 NetworkCloudTrunkedNetworkResource GetNetworkCloudTrunkedNetworkResource(ResourceIdentifier id) + { + NetworkCloudTrunkedNetworkResource.ValidateResourceId(id); + return new NetworkCloudTrunkedNetworkResource(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 NetworkCloudVirtualMachineResource GetNetworkCloudVirtualMachineResource(ResourceIdentifier id) + { + NetworkCloudVirtualMachineResource.ValidateResourceId(id); + return new NetworkCloudVirtualMachineResource(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 NetworkCloudVolumeResource GetNetworkCloudVolumeResource(ResourceIdentifier id) + { + NetworkCloudVolumeResource.ValidateResourceId(id); + return new NetworkCloudVolumeResource(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 NetworkCloudBareMetalMachineKeySetResource GetNetworkCloudBareMetalMachineKeySetResource(ResourceIdentifier id) + { + NetworkCloudBareMetalMachineKeySetResource.ValidateResourceId(id); + return new NetworkCloudBareMetalMachineKeySetResource(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 NetworkCloudBmcKeySetResource GetNetworkCloudBmcKeySetResource(ResourceIdentifier id) + { + NetworkCloudBmcKeySetResource.ValidateResourceId(id); + return new NetworkCloudBmcKeySetResource(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 NetworkCloudClusterMetricsConfigurationResource GetNetworkCloudClusterMetricsConfigurationResource(ResourceIdentifier id) + { + NetworkCloudClusterMetricsConfigurationResource.ValidateResourceId(id); + return new NetworkCloudClusterMetricsConfigurationResource(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 NetworkCloudAgentPoolResource GetNetworkCloudAgentPoolResource(ResourceIdentifier id) + { + NetworkCloudAgentPoolResource.ValidateResourceId(id); + return new NetworkCloudAgentPoolResource(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 NetworkCloudVirtualMachineConsoleResource GetNetworkCloudVirtualMachineConsoleResource(ResourceIdentifier id) + { + NetworkCloudVirtualMachineConsoleResource.ValidateResourceId(id); + return new NetworkCloudVirtualMachineConsoleResource(Client, id); + } + } +} diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudExtensions.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudExtensions.cs index 8d626c63a823..903be7efb927 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudExtensions.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.NetworkCloud.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.NetworkCloud @@ -18,385 +19,321 @@ namespace Azure.ResourceManager.NetworkCloud /// A class to add extension methods to Azure.ResourceManager.NetworkCloud. public static partial class NetworkCloudExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NetworkCloudArmClientMockingExtension GetNetworkCloudArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NetworkCloudArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NetworkCloudResourceGroupMockingExtension GetNetworkCloudResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NetworkCloudResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NetworkCloudSubscriptionMockingExtension GetNetworkCloudSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NetworkCloudSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NetworkCloudBareMetalMachineResource /// /// 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. /// Returns a object. public static NetworkCloudBareMetalMachineResource GetNetworkCloudBareMetalMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudBareMetalMachineResource.ValidateResourceId(id); - return new NetworkCloudBareMetalMachineResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudBareMetalMachineResource(id); } - #endregion - #region NetworkCloudCloudServicesNetworkResource /// /// 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. /// Returns a object. public static NetworkCloudCloudServicesNetworkResource GetNetworkCloudCloudServicesNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudCloudServicesNetworkResource.ValidateResourceId(id); - return new NetworkCloudCloudServicesNetworkResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudCloudServicesNetworkResource(id); } - #endregion - #region NetworkCloudClusterManagerResource /// /// 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. /// Returns a object. public static NetworkCloudClusterManagerResource GetNetworkCloudClusterManagerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudClusterManagerResource.ValidateResourceId(id); - return new NetworkCloudClusterManagerResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudClusterManagerResource(id); } - #endregion - #region NetworkCloudClusterResource /// /// 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. /// Returns a object. public static NetworkCloudClusterResource GetNetworkCloudClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudClusterResource.ValidateResourceId(id); - return new NetworkCloudClusterResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudClusterResource(id); } - #endregion - #region NetworkCloudKubernetesClusterResource /// /// 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. /// Returns a object. public static NetworkCloudKubernetesClusterResource GetNetworkCloudKubernetesClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudKubernetesClusterResource.ValidateResourceId(id); - return new NetworkCloudKubernetesClusterResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudKubernetesClusterResource(id); } - #endregion - #region NetworkCloudL2NetworkResource /// /// 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. /// Returns a object. public static NetworkCloudL2NetworkResource GetNetworkCloudL2NetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudL2NetworkResource.ValidateResourceId(id); - return new NetworkCloudL2NetworkResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudL2NetworkResource(id); } - #endregion - #region NetworkCloudL3NetworkResource /// /// 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. /// Returns a object. public static NetworkCloudL3NetworkResource GetNetworkCloudL3NetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudL3NetworkResource.ValidateResourceId(id); - return new NetworkCloudL3NetworkResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudL3NetworkResource(id); } - #endregion - #region NetworkCloudRackSkuResource /// /// 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. /// Returns a object. public static NetworkCloudRackSkuResource GetNetworkCloudRackSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudRackSkuResource.ValidateResourceId(id); - return new NetworkCloudRackSkuResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudRackSkuResource(id); } - #endregion - #region NetworkCloudRackResource /// /// 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. /// Returns a object. public static NetworkCloudRackResource GetNetworkCloudRackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudRackResource.ValidateResourceId(id); - return new NetworkCloudRackResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudRackResource(id); } - #endregion - #region NetworkCloudStorageApplianceResource /// /// 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. /// Returns a object. public static NetworkCloudStorageApplianceResource GetNetworkCloudStorageApplianceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudStorageApplianceResource.ValidateResourceId(id); - return new NetworkCloudStorageApplianceResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudStorageApplianceResource(id); } - #endregion - #region NetworkCloudTrunkedNetworkResource /// /// 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. /// Returns a object. public static NetworkCloudTrunkedNetworkResource GetNetworkCloudTrunkedNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudTrunkedNetworkResource.ValidateResourceId(id); - return new NetworkCloudTrunkedNetworkResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudTrunkedNetworkResource(id); } - #endregion - #region NetworkCloudVirtualMachineResource /// /// 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. /// Returns a object. public static NetworkCloudVirtualMachineResource GetNetworkCloudVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudVirtualMachineResource.ValidateResourceId(id); - return new NetworkCloudVirtualMachineResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudVirtualMachineResource(id); } - #endregion - #region NetworkCloudVolumeResource /// /// 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. /// Returns a object. public static NetworkCloudVolumeResource GetNetworkCloudVolumeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudVolumeResource.ValidateResourceId(id); - return new NetworkCloudVolumeResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudVolumeResource(id); } - #endregion - #region NetworkCloudBareMetalMachineKeySetResource /// /// 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. /// Returns a object. public static NetworkCloudBareMetalMachineKeySetResource GetNetworkCloudBareMetalMachineKeySetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudBareMetalMachineKeySetResource.ValidateResourceId(id); - return new NetworkCloudBareMetalMachineKeySetResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudBareMetalMachineKeySetResource(id); } - #endregion - #region NetworkCloudBmcKeySetResource /// /// 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. /// Returns a object. public static NetworkCloudBmcKeySetResource GetNetworkCloudBmcKeySetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudBmcKeySetResource.ValidateResourceId(id); - return new NetworkCloudBmcKeySetResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudBmcKeySetResource(id); } - #endregion - #region NetworkCloudClusterMetricsConfigurationResource /// /// 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. /// Returns a object. public static NetworkCloudClusterMetricsConfigurationResource GetNetworkCloudClusterMetricsConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudClusterMetricsConfigurationResource.ValidateResourceId(id); - return new NetworkCloudClusterMetricsConfigurationResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudClusterMetricsConfigurationResource(id); } - #endregion - #region NetworkCloudAgentPoolResource /// /// 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. /// Returns a object. public static NetworkCloudAgentPoolResource GetNetworkCloudAgentPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudAgentPoolResource.ValidateResourceId(id); - return new NetworkCloudAgentPoolResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudAgentPoolResource(id); } - #endregion - #region NetworkCloudVirtualMachineConsoleResource /// /// 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. /// Returns a object. public static NetworkCloudVirtualMachineConsoleResource GetNetworkCloudVirtualMachineConsoleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NetworkCloudVirtualMachineConsoleResource.ValidateResourceId(id); - return new NetworkCloudVirtualMachineConsoleResource(client, id); - } - ); + return GetNetworkCloudArmClientMockingExtension(client).GetNetworkCloudVirtualMachineConsoleResource(id); } - #endregion - /// Gets a collection of NetworkCloudBareMetalMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudBareMetalMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudBareMetalMachineResources and their operations over a NetworkCloudBareMetalMachineResource. public static NetworkCloudBareMetalMachineCollection GetNetworkCloudBareMetalMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudBareMetalMachines(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudBareMetalMachines(); } /// @@ -411,16 +348,20 @@ public static NetworkCloudBareMetalMachineCollection GetNetworkCloudBareMetalMac /// BareMetalMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the bare metal machine. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudBareMetalMachineAsync(this ResourceGroupResource resourceGroupResource, string bareMetalMachineName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudBareMetalMachines().GetAsync(bareMetalMachineName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudBareMetalMachineAsync(bareMetalMachineName, cancellationToken).ConfigureAwait(false); } /// @@ -435,24 +376,34 @@ public static async Task> GetNetw /// BareMetalMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the bare metal machine. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudBareMetalMachine(this ResourceGroupResource resourceGroupResource, string bareMetalMachineName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudBareMetalMachines().Get(bareMetalMachineName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudBareMetalMachine(bareMetalMachineName, cancellationToken); } - /// Gets a collection of NetworkCloudCloudServicesNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudCloudServicesNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudCloudServicesNetworkResources and their operations over a NetworkCloudCloudServicesNetworkResource. public static NetworkCloudCloudServicesNetworkCollection GetNetworkCloudCloudServicesNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudCloudServicesNetworks(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudCloudServicesNetworks(); } /// @@ -467,16 +418,20 @@ public static NetworkCloudCloudServicesNetworkCollection GetNetworkCloudCloudSer /// CloudServicesNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cloud services network. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudCloudServicesNetworkAsync(this ResourceGroupResource resourceGroupResource, string cloudServicesNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudCloudServicesNetworks().GetAsync(cloudServicesNetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudCloudServicesNetworkAsync(cloudServicesNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -491,24 +446,34 @@ public static async Task> Get /// CloudServicesNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cloud services network. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudCloudServicesNetwork(this ResourceGroupResource resourceGroupResource, string cloudServicesNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudCloudServicesNetworks().Get(cloudServicesNetworkName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudCloudServicesNetwork(cloudServicesNetworkName, cancellationToken); } - /// Gets a collection of NetworkCloudClusterManagerResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudClusterManagerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudClusterManagerResources and their operations over a NetworkCloudClusterManagerResource. public static NetworkCloudClusterManagerCollection GetNetworkCloudClusterManagers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudClusterManagers(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudClusterManagers(); } /// @@ -523,16 +488,20 @@ public static NetworkCloudClusterManagerCollection GetNetworkCloudClusterManager /// ClusterManagers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster manager. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudClusterManagerAsync(this ResourceGroupResource resourceGroupResource, string clusterManagerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudClusterManagers().GetAsync(clusterManagerName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudClusterManagerAsync(clusterManagerName, cancellationToken).ConfigureAwait(false); } /// @@ -547,24 +516,34 @@ public static async Task> GetNetwor /// ClusterManagers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster manager. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudClusterManager(this ResourceGroupResource resourceGroupResource, string clusterManagerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudClusterManagers().Get(clusterManagerName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudClusterManager(clusterManagerName, cancellationToken); } - /// Gets a collection of NetworkCloudClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudClusterResources and their operations over a NetworkCloudClusterResource. public static NetworkCloudClusterCollection GetNetworkCloudClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudClusters(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudClusters(); } /// @@ -579,16 +558,20 @@ public static NetworkCloudClusterCollection GetNetworkCloudClusters(this Resourc /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -603,24 +586,34 @@ public static async Task> GetNetworkCloudC /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudClusters().Get(clusterName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudCluster(clusterName, cancellationToken); } - /// Gets a collection of NetworkCloudKubernetesClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudKubernetesClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudKubernetesClusterResources and their operations over a NetworkCloudKubernetesClusterResource. public static NetworkCloudKubernetesClusterCollection GetNetworkCloudKubernetesClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudKubernetesClusters(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudKubernetesClusters(); } /// @@ -635,16 +628,20 @@ public static NetworkCloudKubernetesClusterCollection GetNetworkCloudKubernetesC /// KubernetesClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kubernetes cluster. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudKubernetesClusterAsync(this ResourceGroupResource resourceGroupResource, string kubernetesClusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudKubernetesClusters().GetAsync(kubernetesClusterName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudKubernetesClusterAsync(kubernetesClusterName, cancellationToken).ConfigureAwait(false); } /// @@ -659,24 +656,34 @@ public static async Task> GetNet /// KubernetesClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Kubernetes cluster. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudKubernetesCluster(this ResourceGroupResource resourceGroupResource, string kubernetesClusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudKubernetesClusters().Get(kubernetesClusterName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudKubernetesCluster(kubernetesClusterName, cancellationToken); } - /// Gets a collection of NetworkCloudL2NetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudL2NetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudL2NetworkResources and their operations over a NetworkCloudL2NetworkResource. public static NetworkCloudL2NetworkCollection GetNetworkCloudL2Networks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudL2Networks(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL2Networks(); } /// @@ -691,16 +698,20 @@ public static NetworkCloudL2NetworkCollection GetNetworkCloudL2Networks(this Res /// L2Networks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the L2 network. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudL2NetworkAsync(this ResourceGroupResource resourceGroupResource, string l2NetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudL2Networks().GetAsync(l2NetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL2NetworkAsync(l2NetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -715,24 +726,34 @@ public static async Task> GetNetworkClou /// L2Networks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the L2 network. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudL2Network(this ResourceGroupResource resourceGroupResource, string l2NetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudL2Networks().Get(l2NetworkName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL2Network(l2NetworkName, cancellationToken); } - /// Gets a collection of NetworkCloudL3NetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudL3NetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudL3NetworkResources and their operations over a NetworkCloudL3NetworkResource. public static NetworkCloudL3NetworkCollection GetNetworkCloudL3Networks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudL3Networks(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL3Networks(); } /// @@ -747,16 +768,20 @@ public static NetworkCloudL3NetworkCollection GetNetworkCloudL3Networks(this Res /// L3Networks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the L3 network. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudL3NetworkAsync(this ResourceGroupResource resourceGroupResource, string l3NetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudL3Networks().GetAsync(l3NetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL3NetworkAsync(l3NetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -771,24 +796,34 @@ public static async Task> GetNetworkClou /// L3Networks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the L3 network. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudL3Network(this ResourceGroupResource resourceGroupResource, string l3NetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudL3Networks().Get(l3NetworkName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudL3Network(l3NetworkName, cancellationToken); } - /// Gets a collection of NetworkCloudRackResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudRackResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudRackResources and their operations over a NetworkCloudRackResource. public static NetworkCloudRackCollection GetNetworkCloudRacks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudRacks(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudRacks(); } /// @@ -803,16 +838,20 @@ public static NetworkCloudRackCollection GetNetworkCloudRacks(this ResourceGroup /// Racks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rack. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudRackAsync(this ResourceGroupResource resourceGroupResource, string rackName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudRacks().GetAsync(rackName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudRackAsync(rackName, cancellationToken).ConfigureAwait(false); } /// @@ -827,24 +866,34 @@ public static async Task> GetNetworkCloudRack /// Racks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rack. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudRack(this ResourceGroupResource resourceGroupResource, string rackName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudRacks().Get(rackName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudRack(rackName, cancellationToken); } - /// Gets a collection of NetworkCloudStorageApplianceResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudStorageApplianceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudStorageApplianceResources and their operations over a NetworkCloudStorageApplianceResource. public static NetworkCloudStorageApplianceCollection GetNetworkCloudStorageAppliances(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudStorageAppliances(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudStorageAppliances(); } /// @@ -859,16 +908,20 @@ public static NetworkCloudStorageApplianceCollection GetNetworkCloudStorageAppli /// StorageAppliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage appliance. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudStorageApplianceAsync(this ResourceGroupResource resourceGroupResource, string storageApplianceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudStorageAppliances().GetAsync(storageApplianceName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudStorageApplianceAsync(storageApplianceName, cancellationToken).ConfigureAwait(false); } /// @@ -883,24 +936,34 @@ public static async Task> GetNetw /// StorageAppliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the storage appliance. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudStorageAppliance(this ResourceGroupResource resourceGroupResource, string storageApplianceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudStorageAppliances().Get(storageApplianceName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudStorageAppliance(storageApplianceName, cancellationToken); } - /// Gets a collection of NetworkCloudTrunkedNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudTrunkedNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudTrunkedNetworkResources and their operations over a NetworkCloudTrunkedNetworkResource. public static NetworkCloudTrunkedNetworkCollection GetNetworkCloudTrunkedNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudTrunkedNetworks(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudTrunkedNetworks(); } /// @@ -915,16 +978,20 @@ public static NetworkCloudTrunkedNetworkCollection GetNetworkCloudTrunkedNetwork /// TrunkedNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the trunked network. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudTrunkedNetworkAsync(this ResourceGroupResource resourceGroupResource, string trunkedNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudTrunkedNetworks().GetAsync(trunkedNetworkName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudTrunkedNetworkAsync(trunkedNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -939,24 +1006,34 @@ public static async Task> GetNetwor /// TrunkedNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the trunked network. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudTrunkedNetwork(this ResourceGroupResource resourceGroupResource, string trunkedNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudTrunkedNetworks().Get(trunkedNetworkName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudTrunkedNetwork(trunkedNetworkName, cancellationToken); } - /// Gets a collection of NetworkCloudVirtualMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudVirtualMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudVirtualMachineResources and their operations over a NetworkCloudVirtualMachineResource. public static NetworkCloudVirtualMachineCollection GetNetworkCloudVirtualMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudVirtualMachines(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVirtualMachines(); } /// @@ -971,16 +1048,20 @@ public static NetworkCloudVirtualMachineCollection GetNetworkCloudVirtualMachine /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual machine. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudVirtualMachineAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVirtualMachineAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); } /// @@ -995,24 +1076,34 @@ public static async Task> GetNetwor /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual machine. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudVirtualMachine(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudVirtualMachines().Get(virtualMachineName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVirtualMachine(virtualMachineName, cancellationToken); } - /// Gets a collection of NetworkCloudVolumeResources in the ResourceGroupResource. + /// + /// Gets a collection of NetworkCloudVolumeResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudVolumeResources and their operations over a NetworkCloudVolumeResource. public static NetworkCloudVolumeCollection GetNetworkCloudVolumes(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNetworkCloudVolumes(); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVolumes(); } /// @@ -1027,16 +1118,20 @@ public static NetworkCloudVolumeCollection GetNetworkCloudVolumes(this ResourceG /// Volumes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the volume. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudVolumeAsync(this ResourceGroupResource resourceGroupResource, string volumeName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNetworkCloudVolumes().GetAsync(volumeName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVolumeAsync(volumeName, cancellationToken).ConfigureAwait(false); } /// @@ -1051,24 +1146,34 @@ public static async Task> GetNetworkCloudVo /// Volumes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the volume. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudVolume(this ResourceGroupResource resourceGroupResource, string volumeName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNetworkCloudVolumes().Get(volumeName, cancellationToken); + return GetNetworkCloudResourceGroupMockingExtension(resourceGroupResource).GetNetworkCloudVolume(volumeName, cancellationToken); } - /// Gets a collection of NetworkCloudRackSkuResources in the SubscriptionResource. + /// + /// Gets a collection of NetworkCloudRackSkuResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NetworkCloudRackSkuResources and their operations over a NetworkCloudRackSkuResource. public static NetworkCloudRackSkuCollection GetNetworkCloudRackSkus(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudRackSkus(); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudRackSkus(); } /// @@ -1083,16 +1188,20 @@ public static NetworkCloudRackSkuCollection GetNetworkCloudRackSkus(this Subscri /// RackSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rack SKU. /// The cancellation token to use. - /// 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 static async Task> GetNetworkCloudRackSkuAsync(this SubscriptionResource subscriptionResource, string rackSkuName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetNetworkCloudRackSkus().GetAsync(rackSkuName, cancellationToken).ConfigureAwait(false); + return await GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudRackSkuAsync(rackSkuName, cancellationToken).ConfigureAwait(false); } /// @@ -1107,16 +1216,20 @@ public static async Task> GetNetworkCloudR /// RackSkus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the rack SKU. /// The cancellation token to use. - /// 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 static Response GetNetworkCloudRackSku(this SubscriptionResource subscriptionResource, string rackSkuName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetNetworkCloudRackSkus().Get(rackSkuName, cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudRackSku(rackSkuName, cancellationToken); } /// @@ -1131,13 +1244,17 @@ public static Response GetNetworkCloudRackSku(this /// BareMetalMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudBareMetalMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudBareMetalMachinesAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudBareMetalMachinesAsync(cancellationToken); } /// @@ -1152,13 +1269,17 @@ public static AsyncPageable GetNetworkClou /// BareMetalMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudBareMetalMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudBareMetalMachines(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudBareMetalMachines(cancellationToken); } /// @@ -1173,13 +1294,17 @@ public static Pageable GetNetworkCloudBare /// CloudServicesNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudCloudServicesNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudCloudServicesNetworksAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudCloudServicesNetworksAsync(cancellationToken); } /// @@ -1194,13 +1319,17 @@ public static AsyncPageable GetNetwork /// CloudServicesNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudCloudServicesNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudCloudServicesNetworks(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudCloudServicesNetworks(cancellationToken); } /// @@ -1215,13 +1344,17 @@ public static Pageable GetNetworkCloud /// ClusterManagers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudClusterManagersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudClusterManagersAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudClusterManagersAsync(cancellationToken); } /// @@ -1236,13 +1369,17 @@ public static AsyncPageable GetNetworkCloudC /// ClusterManagers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudClusterManagers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudClusterManagers(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudClusterManagers(cancellationToken); } /// @@ -1257,13 +1394,17 @@ public static Pageable GetNetworkCloudCluste /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudClustersAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudClustersAsync(cancellationToken); } /// @@ -1278,13 +1419,17 @@ public static AsyncPageable GetNetworkCloudClusters /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudClusters(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudClusters(cancellationToken); } /// @@ -1299,13 +1444,17 @@ public static Pageable GetNetworkCloudClusters(this /// KubernetesClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudKubernetesClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudKubernetesClustersAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudKubernetesClustersAsync(cancellationToken); } /// @@ -1320,13 +1469,17 @@ public static AsyncPageable GetNetworkClo /// KubernetesClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudKubernetesClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudKubernetesClusters(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudKubernetesClusters(cancellationToken); } /// @@ -1341,13 +1494,17 @@ public static Pageable GetNetworkCloudKub /// L2Networks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudL2NetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudL2NetworksAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudL2NetworksAsync(cancellationToken); } /// @@ -1362,13 +1519,17 @@ public static AsyncPageable GetNetworkCloudL2Netw /// L2Networks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudL2Networks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudL2Networks(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudL2Networks(cancellationToken); } /// @@ -1383,13 +1544,17 @@ public static Pageable GetNetworkCloudL2Networks( /// L3Networks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudL3NetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudL3NetworksAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudL3NetworksAsync(cancellationToken); } /// @@ -1404,13 +1569,17 @@ public static AsyncPageable GetNetworkCloudL3Netw /// L3Networks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudL3Networks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudL3Networks(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudL3Networks(cancellationToken); } /// @@ -1425,13 +1594,17 @@ public static Pageable GetNetworkCloudL3Networks( /// Racks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudRacksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudRacksAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudRacksAsync(cancellationToken); } /// @@ -1446,13 +1619,17 @@ public static AsyncPageable GetNetworkCloudRacksAsync( /// Racks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudRacks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudRacks(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudRacks(cancellationToken); } /// @@ -1467,13 +1644,17 @@ public static Pageable GetNetworkCloudRacks(this Subsc /// StorageAppliances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudStorageAppliancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudStorageAppliancesAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudStorageAppliancesAsync(cancellationToken); } /// @@ -1488,13 +1669,17 @@ public static AsyncPageable GetNetworkClou /// StorageAppliances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudStorageAppliances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudStorageAppliances(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudStorageAppliances(cancellationToken); } /// @@ -1509,13 +1694,17 @@ public static Pageable GetNetworkCloudStor /// TrunkedNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudTrunkedNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudTrunkedNetworksAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudTrunkedNetworksAsync(cancellationToken); } /// @@ -1530,13 +1719,17 @@ public static AsyncPageable GetNetworkCloudT /// TrunkedNetworks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudTrunkedNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudTrunkedNetworks(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudTrunkedNetworks(cancellationToken); } /// @@ -1551,13 +1744,17 @@ public static Pageable GetNetworkCloudTrunke /// VirtualMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudVirtualMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudVirtualMachinesAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudVirtualMachinesAsync(cancellationToken); } /// @@ -1572,13 +1769,17 @@ public static AsyncPageable GetNetworkCloudV /// VirtualMachines_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudVirtualMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudVirtualMachines(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudVirtualMachines(cancellationToken); } /// @@ -1593,13 +1794,17 @@ public static Pageable GetNetworkCloudVirtua /// Volumes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNetworkCloudVolumesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudVolumesAsync(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudVolumesAsync(cancellationToken); } /// @@ -1614,13 +1819,17 @@ public static AsyncPageable GetNetworkCloudVolumesAs /// Volumes_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNetworkCloudVolumes(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNetworkCloudVolumes(cancellationToken); + return GetNetworkCloudSubscriptionMockingExtension(subscriptionResource).GetNetworkCloudVolumes(cancellationToken); } } } diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudResourceGroupMockingExtension.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..157b33040420 --- /dev/null +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudResourceGroupMockingExtension.cs @@ -0,0 +1,675 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetworkCloud; + +namespace Azure.ResourceManager.NetworkCloud.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NetworkCloudResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkCloudResourceGroupMockingExtension() + { + } + + /// 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 NetworkCloudResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NetworkCloudBareMetalMachineResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudBareMetalMachineResources and their operations over a NetworkCloudBareMetalMachineResource. + public virtual NetworkCloudBareMetalMachineCollection GetNetworkCloudBareMetalMachines() + { + return GetCachedClient(client => new NetworkCloudBareMetalMachineCollection(client, Id)); + } + + /// + /// Get properties of the provided bare metal machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName} + /// + /// + /// Operation Id + /// BareMetalMachines_Get + /// + /// + /// + /// The name of the bare metal machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudBareMetalMachineAsync(string bareMetalMachineName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudBareMetalMachines().GetAsync(bareMetalMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided bare metal machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName} + /// + /// + /// Operation Id + /// BareMetalMachines_Get + /// + /// + /// + /// The name of the bare metal machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudBareMetalMachine(string bareMetalMachineName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudBareMetalMachines().Get(bareMetalMachineName, cancellationToken); + } + + /// Gets a collection of NetworkCloudCloudServicesNetworkResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudCloudServicesNetworkResources and their operations over a NetworkCloudCloudServicesNetworkResource. + public virtual NetworkCloudCloudServicesNetworkCollection GetNetworkCloudCloudServicesNetworks() + { + return GetCachedClient(client => new NetworkCloudCloudServicesNetworkCollection(client, Id)); + } + + /// + /// Get properties of the provided cloud services network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName} + /// + /// + /// Operation Id + /// CloudServicesNetworks_Get + /// + /// + /// + /// The name of the cloud services network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudCloudServicesNetworkAsync(string cloudServicesNetworkName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudCloudServicesNetworks().GetAsync(cloudServicesNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided cloud services network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName} + /// + /// + /// Operation Id + /// CloudServicesNetworks_Get + /// + /// + /// + /// The name of the cloud services network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudCloudServicesNetwork(string cloudServicesNetworkName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudCloudServicesNetworks().Get(cloudServicesNetworkName, cancellationToken); + } + + /// Gets a collection of NetworkCloudClusterManagerResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudClusterManagerResources and their operations over a NetworkCloudClusterManagerResource. + public virtual NetworkCloudClusterManagerCollection GetNetworkCloudClusterManagers() + { + return GetCachedClient(client => new NetworkCloudClusterManagerCollection(client, Id)); + } + + /// + /// Get the properties of the provided cluster manager. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName} + /// + /// + /// Operation Id + /// ClusterManagers_Get + /// + /// + /// + /// The name of the cluster manager. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudClusterManagerAsync(string clusterManagerName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudClusterManagers().GetAsync(clusterManagerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of the provided cluster manager. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName} + /// + /// + /// Operation Id + /// ClusterManagers_Get + /// + /// + /// + /// The name of the cluster manager. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudClusterManager(string clusterManagerName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudClusterManagers().Get(clusterManagerName, cancellationToken); + } + + /// Gets a collection of NetworkCloudClusterResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudClusterResources and their operations over a NetworkCloudClusterResource. + public virtual NetworkCloudClusterCollection GetNetworkCloudClusters() + { + return GetCachedClient(client => new NetworkCloudClusterCollection(client, Id)); + } + + /// + /// Get properties of the provided cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudClusters().Get(clusterName, cancellationToken); + } + + /// Gets a collection of NetworkCloudKubernetesClusterResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudKubernetesClusterResources and their operations over a NetworkCloudKubernetesClusterResource. + public virtual NetworkCloudKubernetesClusterCollection GetNetworkCloudKubernetesClusters() + { + return GetCachedClient(client => new NetworkCloudKubernetesClusterCollection(client, Id)); + } + + /// + /// Get properties of the provided the Kubernetes cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName} + /// + /// + /// Operation Id + /// KubernetesClusters_Get + /// + /// + /// + /// The name of the Kubernetes cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudKubernetesClusterAsync(string kubernetesClusterName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudKubernetesClusters().GetAsync(kubernetesClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided the Kubernetes cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName} + /// + /// + /// Operation Id + /// KubernetesClusters_Get + /// + /// + /// + /// The name of the Kubernetes cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudKubernetesCluster(string kubernetesClusterName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudKubernetesClusters().Get(kubernetesClusterName, cancellationToken); + } + + /// Gets a collection of NetworkCloudL2NetworkResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudL2NetworkResources and their operations over a NetworkCloudL2NetworkResource. + public virtual NetworkCloudL2NetworkCollection GetNetworkCloudL2Networks() + { + return GetCachedClient(client => new NetworkCloudL2NetworkCollection(client, Id)); + } + + /// + /// Get properties of the provided layer 2 (L2) network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName} + /// + /// + /// Operation Id + /// L2Networks_Get + /// + /// + /// + /// The name of the L2 network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudL2NetworkAsync(string l2NetworkName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudL2Networks().GetAsync(l2NetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided layer 2 (L2) network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName} + /// + /// + /// Operation Id + /// L2Networks_Get + /// + /// + /// + /// The name of the L2 network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudL2Network(string l2NetworkName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudL2Networks().Get(l2NetworkName, cancellationToken); + } + + /// Gets a collection of NetworkCloudL3NetworkResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudL3NetworkResources and their operations over a NetworkCloudL3NetworkResource. + public virtual NetworkCloudL3NetworkCollection GetNetworkCloudL3Networks() + { + return GetCachedClient(client => new NetworkCloudL3NetworkCollection(client, Id)); + } + + /// + /// Get properties of the provided layer 3 (L3) network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName} + /// + /// + /// Operation Id + /// L3Networks_Get + /// + /// + /// + /// The name of the L3 network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudL3NetworkAsync(string l3NetworkName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudL3Networks().GetAsync(l3NetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided layer 3 (L3) network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName} + /// + /// + /// Operation Id + /// L3Networks_Get + /// + /// + /// + /// The name of the L3 network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudL3Network(string l3NetworkName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudL3Networks().Get(l3NetworkName, cancellationToken); + } + + /// Gets a collection of NetworkCloudRackResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudRackResources and their operations over a NetworkCloudRackResource. + public virtual NetworkCloudRackCollection GetNetworkCloudRacks() + { + return GetCachedClient(client => new NetworkCloudRackCollection(client, Id)); + } + + /// + /// Get properties of the provided rack. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName} + /// + /// + /// Operation Id + /// Racks_Get + /// + /// + /// + /// The name of the rack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudRackAsync(string rackName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudRacks().GetAsync(rackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided rack. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName} + /// + /// + /// Operation Id + /// Racks_Get + /// + /// + /// + /// The name of the rack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudRack(string rackName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudRacks().Get(rackName, cancellationToken); + } + + /// Gets a collection of NetworkCloudStorageApplianceResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudStorageApplianceResources and their operations over a NetworkCloudStorageApplianceResource. + public virtual NetworkCloudStorageApplianceCollection GetNetworkCloudStorageAppliances() + { + return GetCachedClient(client => new NetworkCloudStorageApplianceCollection(client, Id)); + } + + /// + /// Get properties of the provided storage appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName} + /// + /// + /// Operation Id + /// StorageAppliances_Get + /// + /// + /// + /// The name of the storage appliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudStorageApplianceAsync(string storageApplianceName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudStorageAppliances().GetAsync(storageApplianceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided storage appliance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName} + /// + /// + /// Operation Id + /// StorageAppliances_Get + /// + /// + /// + /// The name of the storage appliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudStorageAppliance(string storageApplianceName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudStorageAppliances().Get(storageApplianceName, cancellationToken); + } + + /// Gets a collection of NetworkCloudTrunkedNetworkResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudTrunkedNetworkResources and their operations over a NetworkCloudTrunkedNetworkResource. + public virtual NetworkCloudTrunkedNetworkCollection GetNetworkCloudTrunkedNetworks() + { + return GetCachedClient(client => new NetworkCloudTrunkedNetworkCollection(client, Id)); + } + + /// + /// Get properties of the provided trunked network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName} + /// + /// + /// Operation Id + /// TrunkedNetworks_Get + /// + /// + /// + /// The name of the trunked network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudTrunkedNetworkAsync(string trunkedNetworkName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudTrunkedNetworks().GetAsync(trunkedNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided trunked network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName} + /// + /// + /// Operation Id + /// TrunkedNetworks_Get + /// + /// + /// + /// The name of the trunked network. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudTrunkedNetwork(string trunkedNetworkName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudTrunkedNetworks().Get(trunkedNetworkName, cancellationToken); + } + + /// Gets a collection of NetworkCloudVirtualMachineResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudVirtualMachineResources and their operations over a NetworkCloudVirtualMachineResource. + public virtual NetworkCloudVirtualMachineCollection GetNetworkCloudVirtualMachines() + { + return GetCachedClient(client => new NetworkCloudVirtualMachineCollection(client, Id)); + } + + /// + /// Get properties of the provided virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// The name of the virtual machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudVirtualMachineAsync(string virtualMachineName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// The name of the virtual machine. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudVirtualMachine(string virtualMachineName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudVirtualMachines().Get(virtualMachineName, cancellationToken); + } + + /// Gets a collection of NetworkCloudVolumeResources in the ResourceGroupResource. + /// An object representing collection of NetworkCloudVolumeResources and their operations over a NetworkCloudVolumeResource. + public virtual NetworkCloudVolumeCollection GetNetworkCloudVolumes() + { + return GetCachedClient(client => new NetworkCloudVolumeCollection(client, Id)); + } + + /// + /// Get properties of the provided volume. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName} + /// + /// + /// Operation Id + /// Volumes_Get + /// + /// + /// + /// The name of the volume. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudVolumeAsync(string volumeName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudVolumes().GetAsync(volumeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of the provided volume. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName} + /// + /// + /// Operation Id + /// Volumes_Get + /// + /// + /// + /// The name of the volume. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudVolume(string volumeName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudVolumes().Get(volumeName, cancellationToken); + } + } +} diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudSubscriptionMockingExtension.cs similarity index 88% rename from sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudSubscriptionMockingExtension.cs index b05e250e63aa..c17effeaaf71 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/NetworkCloudSubscriptionMockingExtension.cs @@ -5,17 +5,20 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.NetworkCloud; -namespace Azure.ResourceManager.NetworkCloud +namespace Azure.ResourceManager.NetworkCloud.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NetworkCloudSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _networkCloudBareMetalMachineBareMetalMachinesClientDiagnostics; private BareMetalMachinesRestOperations _networkCloudBareMetalMachineBareMetalMachinesRestClient; @@ -42,15 +45,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _networkCloudVolumeVolumesClientDiagnostics; private VolumesRestOperations _networkCloudVolumeVolumesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NetworkCloudSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NetworkCloudSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -89,7 +92,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of NetworkCloudRackSkuResources and their operations over a NetworkCloudRackSkuResource. public virtual NetworkCloudRackSkuCollection GetNetworkCloudRackSkus() { - return GetCachedClient(Client => new NetworkCloudRackSkuCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudRackSkuCollection(client, Id)); + } + + /// + /// Get the properties of the provided rack SKU. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName} + /// + /// + /// Operation Id + /// RackSkus_Get + /// + /// + /// + /// The name of the rack SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkCloudRackSkuAsync(string rackSkuName, CancellationToken cancellationToken = default) + { + return await GetNetworkCloudRackSkus().GetAsync(rackSkuName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of the provided rack SKU. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName} + /// + /// + /// Operation Id + /// RackSkus_Get + /// + /// + /// + /// The name of the rack SKU. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkCloudRackSku(string rackSkuName, CancellationToken cancellationToken = default) + { + return GetNetworkCloudRackSkus().Get(rackSkuName, cancellationToken); } /// @@ -111,7 +160,7 @@ public virtual AsyncPageable GetNetworkClo { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudBareMetalMachineBareMetalMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudBareMetalMachineBareMetalMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudBareMetalMachineResource(Client, NetworkCloudBareMetalMachineData.DeserializeNetworkCloudBareMetalMachineData(e)), NetworkCloudBareMetalMachineBareMetalMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudBareMetalMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudBareMetalMachineResource(Client, NetworkCloudBareMetalMachineData.DeserializeNetworkCloudBareMetalMachineData(e)), NetworkCloudBareMetalMachineBareMetalMachinesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudBareMetalMachines", "value", "nextLink", cancellationToken); } /// @@ -133,7 +182,7 @@ public virtual Pageable GetNetworkCloudBar { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudBareMetalMachineBareMetalMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudBareMetalMachineBareMetalMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudBareMetalMachineResource(Client, NetworkCloudBareMetalMachineData.DeserializeNetworkCloudBareMetalMachineData(e)), NetworkCloudBareMetalMachineBareMetalMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudBareMetalMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudBareMetalMachineResource(Client, NetworkCloudBareMetalMachineData.DeserializeNetworkCloudBareMetalMachineData(e)), NetworkCloudBareMetalMachineBareMetalMachinesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudBareMetalMachines", "value", "nextLink", cancellationToken); } /// @@ -155,7 +204,7 @@ public virtual AsyncPageable GetNetwor { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudCloudServicesNetworkCloudServicesNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudCloudServicesNetworkCloudServicesNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudCloudServicesNetworkResource(Client, NetworkCloudCloudServicesNetworkData.DeserializeNetworkCloudCloudServicesNetworkData(e)), NetworkCloudCloudServicesNetworkCloudServicesNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudCloudServicesNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudCloudServicesNetworkResource(Client, NetworkCloudCloudServicesNetworkData.DeserializeNetworkCloudCloudServicesNetworkData(e)), NetworkCloudCloudServicesNetworkCloudServicesNetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudCloudServicesNetworks", "value", "nextLink", cancellationToken); } /// @@ -177,7 +226,7 @@ public virtual Pageable GetNetworkClou { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudCloudServicesNetworkCloudServicesNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudCloudServicesNetworkCloudServicesNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudCloudServicesNetworkResource(Client, NetworkCloudCloudServicesNetworkData.DeserializeNetworkCloudCloudServicesNetworkData(e)), NetworkCloudCloudServicesNetworkCloudServicesNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudCloudServicesNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudCloudServicesNetworkResource(Client, NetworkCloudCloudServicesNetworkData.DeserializeNetworkCloudCloudServicesNetworkData(e)), NetworkCloudCloudServicesNetworkCloudServicesNetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudCloudServicesNetworks", "value", "nextLink", cancellationToken); } /// @@ -199,7 +248,7 @@ public virtual AsyncPageable GetNetworkCloud { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudClusterManagerClusterManagersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudClusterManagerClusterManagersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterManagerResource(Client, NetworkCloudClusterManagerData.DeserializeNetworkCloudClusterManagerData(e)), NetworkCloudClusterManagerClusterManagersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudClusterManagers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterManagerResource(Client, NetworkCloudClusterManagerData.DeserializeNetworkCloudClusterManagerData(e)), NetworkCloudClusterManagerClusterManagersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudClusterManagers", "value", "nextLink", cancellationToken); } /// @@ -221,7 +270,7 @@ public virtual Pageable GetNetworkCloudClust { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudClusterManagerClusterManagersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudClusterManagerClusterManagersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterManagerResource(Client, NetworkCloudClusterManagerData.DeserializeNetworkCloudClusterManagerData(e)), NetworkCloudClusterManagerClusterManagersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudClusterManagers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterManagerResource(Client, NetworkCloudClusterManagerData.DeserializeNetworkCloudClusterManagerData(e)), NetworkCloudClusterManagerClusterManagersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudClusterManagers", "value", "nextLink", cancellationToken); } /// @@ -243,7 +292,7 @@ public virtual AsyncPageable GetNetworkCloudCluster { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterResource(Client, NetworkCloudClusterData.DeserializeNetworkCloudClusterData(e)), NetworkCloudClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterResource(Client, NetworkCloudClusterData.DeserializeNetworkCloudClusterData(e)), NetworkCloudClusterClustersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudClusters", "value", "nextLink", cancellationToken); } /// @@ -265,7 +314,7 @@ public virtual Pageable GetNetworkCloudClusters(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterResource(Client, NetworkCloudClusterData.DeserializeNetworkCloudClusterData(e)), NetworkCloudClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudClusterResource(Client, NetworkCloudClusterData.DeserializeNetworkCloudClusterData(e)), NetworkCloudClusterClustersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudClusters", "value", "nextLink", cancellationToken); } /// @@ -287,7 +336,7 @@ public virtual AsyncPageable GetNetworkCl { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudKubernetesClusterKubernetesClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudKubernetesClusterKubernetesClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudKubernetesClusterResource(Client, NetworkCloudKubernetesClusterData.DeserializeNetworkCloudKubernetesClusterData(e)), NetworkCloudKubernetesClusterKubernetesClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudKubernetesClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudKubernetesClusterResource(Client, NetworkCloudKubernetesClusterData.DeserializeNetworkCloudKubernetesClusterData(e)), NetworkCloudKubernetesClusterKubernetesClustersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudKubernetesClusters", "value", "nextLink", cancellationToken); } /// @@ -309,7 +358,7 @@ public virtual Pageable GetNetworkCloudKu { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudKubernetesClusterKubernetesClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudKubernetesClusterKubernetesClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudKubernetesClusterResource(Client, NetworkCloudKubernetesClusterData.DeserializeNetworkCloudKubernetesClusterData(e)), NetworkCloudKubernetesClusterKubernetesClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudKubernetesClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudKubernetesClusterResource(Client, NetworkCloudKubernetesClusterData.DeserializeNetworkCloudKubernetesClusterData(e)), NetworkCloudKubernetesClusterKubernetesClustersClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudKubernetesClusters", "value", "nextLink", cancellationToken); } /// @@ -331,7 +380,7 @@ public virtual AsyncPageable GetNetworkCloudL2Net { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudL2NetworkL2NetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudL2NetworkL2NetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL2NetworkResource(Client, NetworkCloudL2NetworkData.DeserializeNetworkCloudL2NetworkData(e)), NetworkCloudL2NetworkL2NetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudL2Networks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL2NetworkResource(Client, NetworkCloudL2NetworkData.DeserializeNetworkCloudL2NetworkData(e)), NetworkCloudL2NetworkL2NetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudL2Networks", "value", "nextLink", cancellationToken); } /// @@ -353,7 +402,7 @@ public virtual Pageable GetNetworkCloudL2Networks { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudL2NetworkL2NetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudL2NetworkL2NetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL2NetworkResource(Client, NetworkCloudL2NetworkData.DeserializeNetworkCloudL2NetworkData(e)), NetworkCloudL2NetworkL2NetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudL2Networks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL2NetworkResource(Client, NetworkCloudL2NetworkData.DeserializeNetworkCloudL2NetworkData(e)), NetworkCloudL2NetworkL2NetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudL2Networks", "value", "nextLink", cancellationToken); } /// @@ -375,7 +424,7 @@ public virtual AsyncPageable GetNetworkCloudL3Net { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudL3NetworkL3NetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudL3NetworkL3NetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL3NetworkResource(Client, NetworkCloudL3NetworkData.DeserializeNetworkCloudL3NetworkData(e)), NetworkCloudL3NetworkL3NetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudL3Networks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL3NetworkResource(Client, NetworkCloudL3NetworkData.DeserializeNetworkCloudL3NetworkData(e)), NetworkCloudL3NetworkL3NetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudL3Networks", "value", "nextLink", cancellationToken); } /// @@ -397,7 +446,7 @@ public virtual Pageable GetNetworkCloudL3Networks { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudL3NetworkL3NetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudL3NetworkL3NetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL3NetworkResource(Client, NetworkCloudL3NetworkData.DeserializeNetworkCloudL3NetworkData(e)), NetworkCloudL3NetworkL3NetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudL3Networks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudL3NetworkResource(Client, NetworkCloudL3NetworkData.DeserializeNetworkCloudL3NetworkData(e)), NetworkCloudL3NetworkL3NetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudL3Networks", "value", "nextLink", cancellationToken); } /// @@ -419,7 +468,7 @@ public virtual AsyncPageable GetNetworkCloudRacksAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudRackRacksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudRackRacksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudRackResource(Client, NetworkCloudRackData.DeserializeNetworkCloudRackData(e)), NetworkCloudRackRacksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudRacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudRackResource(Client, NetworkCloudRackData.DeserializeNetworkCloudRackData(e)), NetworkCloudRackRacksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudRacks", "value", "nextLink", cancellationToken); } /// @@ -441,7 +490,7 @@ public virtual Pageable GetNetworkCloudRacks(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudRackRacksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudRackRacksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudRackResource(Client, NetworkCloudRackData.DeserializeNetworkCloudRackData(e)), NetworkCloudRackRacksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudRacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudRackResource(Client, NetworkCloudRackData.DeserializeNetworkCloudRackData(e)), NetworkCloudRackRacksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudRacks", "value", "nextLink", cancellationToken); } /// @@ -463,7 +512,7 @@ public virtual AsyncPageable GetNetworkClo { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudStorageApplianceStorageAppliancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudStorageApplianceStorageAppliancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudStorageApplianceResource(Client, NetworkCloudStorageApplianceData.DeserializeNetworkCloudStorageApplianceData(e)), NetworkCloudStorageApplianceStorageAppliancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudStorageAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudStorageApplianceResource(Client, NetworkCloudStorageApplianceData.DeserializeNetworkCloudStorageApplianceData(e)), NetworkCloudStorageApplianceStorageAppliancesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudStorageAppliances", "value", "nextLink", cancellationToken); } /// @@ -485,7 +534,7 @@ public virtual Pageable GetNetworkCloudSto { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudStorageApplianceStorageAppliancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudStorageApplianceStorageAppliancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudStorageApplianceResource(Client, NetworkCloudStorageApplianceData.DeserializeNetworkCloudStorageApplianceData(e)), NetworkCloudStorageApplianceStorageAppliancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudStorageAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudStorageApplianceResource(Client, NetworkCloudStorageApplianceData.DeserializeNetworkCloudStorageApplianceData(e)), NetworkCloudStorageApplianceStorageAppliancesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudStorageAppliances", "value", "nextLink", cancellationToken); } /// @@ -507,7 +556,7 @@ public virtual AsyncPageable GetNetworkCloud { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudTrunkedNetworkTrunkedNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudTrunkedNetworkTrunkedNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudTrunkedNetworkResource(Client, NetworkCloudTrunkedNetworkData.DeserializeNetworkCloudTrunkedNetworkData(e)), NetworkCloudTrunkedNetworkTrunkedNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudTrunkedNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudTrunkedNetworkResource(Client, NetworkCloudTrunkedNetworkData.DeserializeNetworkCloudTrunkedNetworkData(e)), NetworkCloudTrunkedNetworkTrunkedNetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudTrunkedNetworks", "value", "nextLink", cancellationToken); } /// @@ -529,7 +578,7 @@ public virtual Pageable GetNetworkCloudTrunk { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudTrunkedNetworkTrunkedNetworksRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudTrunkedNetworkTrunkedNetworksRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudTrunkedNetworkResource(Client, NetworkCloudTrunkedNetworkData.DeserializeNetworkCloudTrunkedNetworkData(e)), NetworkCloudTrunkedNetworkTrunkedNetworksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudTrunkedNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudTrunkedNetworkResource(Client, NetworkCloudTrunkedNetworkData.DeserializeNetworkCloudTrunkedNetworkData(e)), NetworkCloudTrunkedNetworkTrunkedNetworksClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudTrunkedNetworks", "value", "nextLink", cancellationToken); } /// @@ -551,7 +600,7 @@ public virtual AsyncPageable GetNetworkCloud { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVirtualMachineResource(Client, NetworkCloudVirtualMachineData.DeserializeNetworkCloudVirtualMachineData(e)), NetworkCloudVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVirtualMachineResource(Client, NetworkCloudVirtualMachineData.DeserializeNetworkCloudVirtualMachineData(e)), NetworkCloudVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -573,7 +622,7 @@ public virtual Pageable GetNetworkCloudVirtu { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudVirtualMachineVirtualMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVirtualMachineResource(Client, NetworkCloudVirtualMachineData.DeserializeNetworkCloudVirtualMachineData(e)), NetworkCloudVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVirtualMachineResource(Client, NetworkCloudVirtualMachineData.DeserializeNetworkCloudVirtualMachineData(e)), NetworkCloudVirtualMachineVirtualMachinesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -595,7 +644,7 @@ public virtual AsyncPageable GetNetworkCloudVolumesA { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudVolumeVolumesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudVolumeVolumesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVolumeResource(Client, NetworkCloudVolumeData.DeserializeNetworkCloudVolumeData(e)), NetworkCloudVolumeVolumesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudVolumes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVolumeResource(Client, NetworkCloudVolumeData.DeserializeNetworkCloudVolumeData(e)), NetworkCloudVolumeVolumesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudVolumes", "value", "nextLink", cancellationToken); } /// @@ -617,7 +666,7 @@ public virtual Pageable GetNetworkCloudVolumes(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => NetworkCloudVolumeVolumesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NetworkCloudVolumeVolumesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVolumeResource(Client, NetworkCloudVolumeData.DeserializeNetworkCloudVolumeData(e)), NetworkCloudVolumeVolumesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNetworkCloudVolumes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkCloudVolumeResource(Client, NetworkCloudVolumeData.DeserializeNetworkCloudVolumeData(e)), NetworkCloudVolumeVolumesClientDiagnostics, Pipeline, "NetworkCloudSubscriptionMockingExtension.GetNetworkCloudVolumes", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 99171835b9cb..000000000000 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.NetworkCloud -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NetworkCloudBareMetalMachineResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudBareMetalMachineResources and their operations over a NetworkCloudBareMetalMachineResource. - public virtual NetworkCloudBareMetalMachineCollection GetNetworkCloudBareMetalMachines() - { - return GetCachedClient(Client => new NetworkCloudBareMetalMachineCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudCloudServicesNetworkResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudCloudServicesNetworkResources and their operations over a NetworkCloudCloudServicesNetworkResource. - public virtual NetworkCloudCloudServicesNetworkCollection GetNetworkCloudCloudServicesNetworks() - { - return GetCachedClient(Client => new NetworkCloudCloudServicesNetworkCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudClusterManagerResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudClusterManagerResources and their operations over a NetworkCloudClusterManagerResource. - public virtual NetworkCloudClusterManagerCollection GetNetworkCloudClusterManagers() - { - return GetCachedClient(Client => new NetworkCloudClusterManagerCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudClusterResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudClusterResources and their operations over a NetworkCloudClusterResource. - public virtual NetworkCloudClusterCollection GetNetworkCloudClusters() - { - return GetCachedClient(Client => new NetworkCloudClusterCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudKubernetesClusterResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudKubernetesClusterResources and their operations over a NetworkCloudKubernetesClusterResource. - public virtual NetworkCloudKubernetesClusterCollection GetNetworkCloudKubernetesClusters() - { - return GetCachedClient(Client => new NetworkCloudKubernetesClusterCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudL2NetworkResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudL2NetworkResources and their operations over a NetworkCloudL2NetworkResource. - public virtual NetworkCloudL2NetworkCollection GetNetworkCloudL2Networks() - { - return GetCachedClient(Client => new NetworkCloudL2NetworkCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudL3NetworkResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudL3NetworkResources and their operations over a NetworkCloudL3NetworkResource. - public virtual NetworkCloudL3NetworkCollection GetNetworkCloudL3Networks() - { - return GetCachedClient(Client => new NetworkCloudL3NetworkCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudRackResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudRackResources and their operations over a NetworkCloudRackResource. - public virtual NetworkCloudRackCollection GetNetworkCloudRacks() - { - return GetCachedClient(Client => new NetworkCloudRackCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudStorageApplianceResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudStorageApplianceResources and their operations over a NetworkCloudStorageApplianceResource. - public virtual NetworkCloudStorageApplianceCollection GetNetworkCloudStorageAppliances() - { - return GetCachedClient(Client => new NetworkCloudStorageApplianceCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudTrunkedNetworkResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudTrunkedNetworkResources and their operations over a NetworkCloudTrunkedNetworkResource. - public virtual NetworkCloudTrunkedNetworkCollection GetNetworkCloudTrunkedNetworks() - { - return GetCachedClient(Client => new NetworkCloudTrunkedNetworkCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudVirtualMachineResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudVirtualMachineResources and their operations over a NetworkCloudVirtualMachineResource. - public virtual NetworkCloudVirtualMachineCollection GetNetworkCloudVirtualMachines() - { - return GetCachedClient(Client => new NetworkCloudVirtualMachineCollection(Client, Id)); - } - - /// Gets a collection of NetworkCloudVolumeResources in the ResourceGroupResource. - /// An object representing collection of NetworkCloudVolumeResources and their operations over a NetworkCloudVolumeResource. - public virtual NetworkCloudVolumeCollection GetNetworkCloudVolumes() - { - return GetCachedClient(Client => new NetworkCloudVolumeCollection(Client, Id)); - } - } -} diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudClusterResource.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudClusterResource.cs index e1669745e9e5..8c252e370fa3 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudClusterResource.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkCloudBareMetalMachineKeySetResources and their operations over a NetworkCloudBareMetalMachineKeySetResource. public virtual NetworkCloudBareMetalMachineKeySetCollection GetNetworkCloudBareMetalMachineKeySets() { - return GetCachedClient(Client => new NetworkCloudBareMetalMachineKeySetCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudBareMetalMachineKeySetCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkCloudBareMetalMachineKeySetCollection GetNetworkCloudBareM /// /// The name of the bare metal machine key set. /// The cancellation token to use. - /// 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> GetNetworkCloudBareMetalMachineKeySetAsync(string bareMetalMachineKeySetName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> /// /// The name of the bare metal machine key set. /// The cancellation token to use. - /// 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 GetNetworkCloudBareMetalMachineKeySet(string bareMetalMachineKeySetName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetNetworkCl /// An object representing collection of NetworkCloudBmcKeySetResources and their operations over a NetworkCloudBmcKeySetResource. public virtual NetworkCloudBmcKeySetCollection GetNetworkCloudBmcKeySets() { - return GetCachedClient(Client => new NetworkCloudBmcKeySetCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudBmcKeySetCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual NetworkCloudBmcKeySetCollection GetNetworkCloudBmcKeySets() /// /// The name of the baseboard management controller key set. /// The cancellation token to use. - /// 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> GetNetworkCloudBmcKeySetAsync(string bmcKeySetName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetNetworkClo /// /// The name of the baseboard management controller key set. /// The cancellation token to use. - /// 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 GetNetworkCloudBmcKeySet(string bmcKeySetName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetNetworkCloudBmcKeySet( /// An object representing collection of NetworkCloudClusterMetricsConfigurationResources and their operations over a NetworkCloudClusterMetricsConfigurationResource. public virtual NetworkCloudClusterMetricsConfigurationCollection GetNetworkCloudClusterMetricsConfigurations() { - return GetCachedClient(Client => new NetworkCloudClusterMetricsConfigurationCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudClusterMetricsConfigurationCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual NetworkCloudClusterMetricsConfigurationCollection GetNetworkCloud /// /// The name of the metrics configuration for the cluster. /// The cancellation token to use. - /// 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> GetNetworkCloudClusterMetricsConfigurationAsync(string metricsConfigurationName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// The name of the metrics configuration for the cluster. /// The cancellation token to use. - /// 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 GetNetworkCloudClusterMetricsConfiguration(string metricsConfigurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudKubernetesClusterResource.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudKubernetesClusterResource.cs index e4e93223528b..796ef8e028bd 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudKubernetesClusterResource.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudKubernetesClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkCloudAgentPoolResources and their operations over a NetworkCloudAgentPoolResource. public virtual NetworkCloudAgentPoolCollection GetNetworkCloudAgentPools() { - return GetCachedClient(Client => new NetworkCloudAgentPoolCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudAgentPoolCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkCloudAgentPoolCollection GetNetworkCloudAgentPools() /// /// The name of the Kubernetes cluster agent pool. /// The cancellation token to use. - /// 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> GetNetworkCloudAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetNetworkClo /// /// The name of the Kubernetes cluster agent pool. /// The cancellation token to use. - /// 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 GetNetworkCloudAgentPool(string agentPoolName, CancellationToken cancellationToken = default) { diff --git a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudVirtualMachineResource.cs b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudVirtualMachineResource.cs index fee8d99c22c6..cb7e1279b891 100644 --- a/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudVirtualMachineResource.cs +++ b/sdk/networkcloud/Azure.ResourceManager.NetworkCloud/src/Generated/NetworkCloudVirtualMachineResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NetworkCloudVirtualMachineConsoleResources and their operations over a NetworkCloudVirtualMachineConsoleResource. public virtual NetworkCloudVirtualMachineConsoleCollection GetNetworkCloudVirtualMachineConsoles() { - return GetCachedClient(Client => new NetworkCloudVirtualMachineConsoleCollection(Client, Id)); + return GetCachedClient(client => new NetworkCloudVirtualMachineConsoleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NetworkCloudVirtualMachineConsoleCollection GetNetworkCloudVirtua /// /// The name of the virtual machine console. /// The cancellation token to use. - /// 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> GetNetworkCloudVirtualMachineConsoleAsync(string consoleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> G /// /// The name of the virtual machine console. /// The cancellation token to use. - /// 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 GetNetworkCloudVirtualMachineConsole(string consoleName, CancellationToken cancellationToken = default) { diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/AzureTrafficCollectorResource.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/AzureTrafficCollectorResource.cs index b981b6e701d8..a51e047e0464 100644 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/AzureTrafficCollectorResource.cs +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/AzureTrafficCollectorResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CollectorPolicyResources and their operations over a CollectorPolicyResource. public virtual CollectorPolicyCollection GetCollectorPolicies() { - return GetCachedClient(Client => new CollectorPolicyCollection(Client, Id)); + return GetCachedClient(client => new CollectorPolicyCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CollectorPolicyCollection GetCollectorPolicies() /// /// Collector Policy Name. /// The cancellation token to use. - /// 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> GetCollectorPolicyAsync(string collectorPolicyName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCollectorPolicyA /// /// Collector Policy Name. /// The cancellation token to use. - /// 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 GetCollectorPolicy(string collectorPolicyName, CancellationToken cancellationToken = default) { diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionArmClientMockingExtension.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionArmClientMockingExtension.cs new file mode 100644 index 000000000000..9fe479303588 --- /dev/null +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetworkFunction; + +namespace Azure.ResourceManager.NetworkFunction.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NetworkFunctionArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkFunctionArmClientMockingExtension() + { + } + + /// 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 NetworkFunctionArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NetworkFunctionArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureTrafficCollectorResource GetAzureTrafficCollectorResource(ResourceIdentifier id) + { + AzureTrafficCollectorResource.ValidateResourceId(id); + return new AzureTrafficCollectorResource(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 CollectorPolicyResource GetCollectorPolicyResource(ResourceIdentifier id) + { + CollectorPolicyResource.ValidateResourceId(id); + return new CollectorPolicyResource(Client, id); + } + } +} diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionExtensions.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionExtensions.cs index 4a1aadd97d96..880cd0cc4853 100644 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionExtensions.cs +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.NetworkFunction.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.NetworkFunction @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.NetworkFunction /// A class to add extension methods to Azure.ResourceManager.NetworkFunction. public static partial class NetworkFunctionExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NetworkFunctionArmClientMockingExtension GetNetworkFunctionArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NetworkFunctionArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NetworkFunctionResourceGroupMockingExtension GetNetworkFunctionResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NetworkFunctionResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NetworkFunctionSubscriptionMockingExtension GetNetworkFunctionSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NetworkFunctionSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AzureTrafficCollectorResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureTrafficCollectorResource GetAzureTrafficCollectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureTrafficCollectorResource.ValidateResourceId(id); - return new AzureTrafficCollectorResource(client, id); - } - ); + return GetNetworkFunctionArmClientMockingExtension(client).GetAzureTrafficCollectorResource(id); } - #endregion - #region CollectorPolicyResource /// /// 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. /// Returns a object. public static CollectorPolicyResource GetCollectorPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CollectorPolicyResource.ValidateResourceId(id); - return new CollectorPolicyResource(client, id); - } - ); + return GetNetworkFunctionArmClientMockingExtension(client).GetCollectorPolicyResource(id); } - #endregion - /// Gets a collection of AzureTrafficCollectorResources in the ResourceGroupResource. + /// + /// Gets a collection of AzureTrafficCollectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AzureTrafficCollectorResources and their operations over a AzureTrafficCollectorResource. public static AzureTrafficCollectorCollection GetAzureTrafficCollectors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzureTrafficCollectors(); + return GetNetworkFunctionResourceGroupMockingExtension(resourceGroupResource).GetAzureTrafficCollectors(); } /// @@ -107,16 +92,20 @@ public static AzureTrafficCollectorCollection GetAzureTrafficCollectors(this Res /// AzureTrafficCollectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure Traffic Collector name. /// The cancellation token to use. - /// 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 static async Task> GetAzureTrafficCollectorAsync(this ResourceGroupResource resourceGroupResource, string azureTrafficCollectorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAzureTrafficCollectors().GetAsync(azureTrafficCollectorName, cancellationToken).ConfigureAwait(false); + return await GetNetworkFunctionResourceGroupMockingExtension(resourceGroupResource).GetAzureTrafficCollectorAsync(azureTrafficCollectorName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetAzureTraffi /// AzureTrafficCollectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure Traffic Collector name. /// The cancellation token to use. - /// 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 static Response GetAzureTrafficCollector(this ResourceGroupResource resourceGroupResource, string azureTrafficCollectorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAzureTrafficCollectors().Get(azureTrafficCollectorName, cancellationToken); + return GetNetworkFunctionResourceGroupMockingExtension(resourceGroupResource).GetAzureTrafficCollector(azureTrafficCollectorName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetAzureTrafficCollector(t /// AzureTrafficCollectorsBySubscription_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzureTrafficCollectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureTrafficCollectorsAsync(cancellationToken); + return GetNetworkFunctionSubscriptionMockingExtension(subscriptionResource).GetAzureTrafficCollectorsAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetAzureTrafficCollec /// AzureTrafficCollectorsBySubscription_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzureTrafficCollectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureTrafficCollectors(cancellationToken); + return GetNetworkFunctionSubscriptionMockingExtension(subscriptionResource).GetAzureTrafficCollectors(cancellationToken); } } } diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionResourceGroupMockingExtension.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c8b8b7387aaf --- /dev/null +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NetworkFunction; + +namespace Azure.ResourceManager.NetworkFunction.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NetworkFunctionResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NetworkFunctionResourceGroupMockingExtension() + { + } + + /// 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 NetworkFunctionResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AzureTrafficCollectorResources in the ResourceGroupResource. + /// An object representing collection of AzureTrafficCollectorResources and their operations over a AzureTrafficCollectorResource. + public virtual AzureTrafficCollectorCollection GetAzureTrafficCollectors() + { + return GetCachedClient(client => new AzureTrafficCollectorCollection(client, Id)); + } + + /// + /// Gets the specified Azure Traffic Collector in a specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName} + /// + /// + /// Operation Id + /// AzureTrafficCollectors_Get + /// + /// + /// + /// Azure Traffic Collector name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAzureTrafficCollectorAsync(string azureTrafficCollectorName, CancellationToken cancellationToken = default) + { + return await GetAzureTrafficCollectors().GetAsync(azureTrafficCollectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Azure Traffic Collector in a specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName} + /// + /// + /// Operation Id + /// AzureTrafficCollectors_Get + /// + /// + /// + /// Azure Traffic Collector name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAzureTrafficCollector(string azureTrafficCollectorName, CancellationToken cancellationToken = default) + { + return GetAzureTrafficCollectors().Get(azureTrafficCollectorName, cancellationToken); + } + } +} diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionSubscriptionMockingExtension.cs similarity index 85% rename from sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionSubscriptionMockingExtension.cs index 1ebf2dc0c8d3..1b0ca6ce1470 100644 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/NetworkFunctionSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.NetworkFunction; -namespace Azure.ResourceManager.NetworkFunction +namespace Azure.ResourceManager.NetworkFunction.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NetworkFunctionSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _azureTrafficCollectorsBySubscriptionClientDiagnostics; private AzureTrafficCollectorsBySubscriptionRestOperations _azureTrafficCollectorsBySubscriptionRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NetworkFunctionSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NetworkFunctionSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetAzureTrafficColle { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureTrafficCollectorsBySubscriptionRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureTrafficCollectorsBySubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureTrafficCollectorResource(Client, AzureTrafficCollectorData.DeserializeAzureTrafficCollectorData(e)), AzureTrafficCollectorsBySubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureTrafficCollectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureTrafficCollectorResource(Client, AzureTrafficCollectorData.DeserializeAzureTrafficCollectorData(e)), AzureTrafficCollectorsBySubscriptionClientDiagnostics, Pipeline, "NetworkFunctionSubscriptionMockingExtension.GetAzureTrafficCollectors", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetAzureTrafficCollectors { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureTrafficCollectorsBySubscriptionRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureTrafficCollectorsBySubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureTrafficCollectorResource(Client, AzureTrafficCollectorData.DeserializeAzureTrafficCollectorData(e)), AzureTrafficCollectorsBySubscriptionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureTrafficCollectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureTrafficCollectorResource(Client, AzureTrafficCollectorData.DeserializeAzureTrafficCollectorData(e)), AzureTrafficCollectorsBySubscriptionClientDiagnostics, Pipeline, "NetworkFunctionSubscriptionMockingExtension.GetAzureTrafficCollectors", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f6da75c891d9..000000000000 --- a/sdk/networkfunction/Azure.ResourceManager.NetworkFunction/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.NetworkFunction -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AzureTrafficCollectorResources in the ResourceGroupResource. - /// An object representing collection of AzureTrafficCollectorResources and their operations over a AzureTrafficCollectorResource. - public virtual AzureTrafficCollectorCollection GetAzureTrafficCollectors() - { - return GetCachedClient(Client => new AzureTrafficCollectorCollection(Client, Id)); - } - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityArmClientMockingExtension.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityArmClientMockingExtension.cs new file mode 100644 index 000000000000..c5c563e992dc --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NewRelicObservability; + +namespace Azure.ResourceManager.NewRelicObservability.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NewRelicObservabilityArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NewRelicObservabilityArmClientMockingExtension() + { + } + + /// 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 NewRelicObservabilityArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NewRelicObservabilityArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NewRelicMonitorResource GetNewRelicMonitorResource(ResourceIdentifier id) + { + NewRelicMonitorResource.ValidateResourceId(id); + return new NewRelicMonitorResource(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 NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRuleResource(ResourceIdentifier id) + { + NewRelicObservabilityTagRuleResource.ValidateResourceId(id); + return new NewRelicObservabilityTagRuleResource(Client, id); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs index 63ed3148b37a..a65e1151d7d1 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.NewRelicObservability.Mocking; using Azure.ResourceManager.NewRelicObservability.Models; using Azure.ResourceManager.Resources; @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.NewRelicObservability /// A class to add extension methods to Azure.ResourceManager.NewRelicObservability. public static partial class NewRelicObservabilityExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NewRelicObservabilityArmClientMockingExtension GetNewRelicObservabilityArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NewRelicObservabilityArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NewRelicObservabilityResourceGroupMockingExtension GetNewRelicObservabilityResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NewRelicObservabilityResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NewRelicObservabilitySubscriptionMockingExtension GetNewRelicObservabilitySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NewRelicObservabilitySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NewRelicMonitorResource /// /// 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. /// Returns a object. public static NewRelicMonitorResource GetNewRelicMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NewRelicMonitorResource.ValidateResourceId(id); - return new NewRelicMonitorResource(client, id); - } - ); + return GetNewRelicObservabilityArmClientMockingExtension(client).GetNewRelicMonitorResource(id); } - #endregion - #region NewRelicObservabilityTagRuleResource /// /// 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. /// Returns a object. public static NewRelicObservabilityTagRuleResource GetNewRelicObservabilityTagRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NewRelicObservabilityTagRuleResource.ValidateResourceId(id); - return new NewRelicObservabilityTagRuleResource(client, id); - } - ); + return GetNewRelicObservabilityArmClientMockingExtension(client).GetNewRelicObservabilityTagRuleResource(id); } - #endregion - /// Gets a collection of NewRelicMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of NewRelicMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NewRelicMonitorResources and their operations over a NewRelicMonitorResource. public static NewRelicMonitorResourceCollection GetNewRelicMonitorResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNewRelicMonitorResources(); + return GetNewRelicObservabilityResourceGroupMockingExtension(resourceGroupResource).GetNewRelicMonitorResources(); } /// @@ -108,16 +93,20 @@ public static NewRelicMonitorResourceCollection GetNewRelicMonitorResources(this /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Monitors resource. /// The cancellation token to use. - /// 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 static async Task> GetNewRelicMonitorResourceAsync(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNewRelicMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + return await GetNewRelicObservabilityResourceGroupMockingExtension(resourceGroupResource).GetNewRelicMonitorResourceAsync(monitorName, cancellationToken).ConfigureAwait(false); } /// @@ -132,16 +121,20 @@ public static async Task> GetNewRelicMonitorRe /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Monitors resource. /// The cancellation token to use. - /// 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 static Response GetNewRelicMonitorResource(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNewRelicMonitorResources().Get(monitorName, cancellationToken); + return GetNewRelicObservabilityResourceGroupMockingExtension(resourceGroupResource).GetNewRelicMonitorResource(monitorName, cancellationToken); } /// @@ -156,6 +149,10 @@ public static Response GetNewRelicMonitorResource(this /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// User Email. @@ -165,9 +162,7 @@ public static Response GetNewRelicMonitorResource(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNewRelicAccountsAsync(this SubscriptionResource subscriptionResource, string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(userEmail, nameof(userEmail)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicAccountsAsync(userEmail, location, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicAccountsAsync(userEmail, location, cancellationToken); } /// @@ -182,6 +177,10 @@ public static AsyncPageable GetNewRelicAccountsAsyn /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// User Email. @@ -191,9 +190,7 @@ public static AsyncPageable GetNewRelicAccountsAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNewRelicAccounts(this SubscriptionResource subscriptionResource, string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(userEmail, nameof(userEmail)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicAccounts(userEmail, location, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicAccounts(userEmail, location, cancellationToken); } /// @@ -208,13 +205,17 @@ public static Pageable GetNewRelicAccounts(this Sub /// Monitors_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNewRelicMonitorResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicMonitorResourcesAsync(cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicMonitorResourcesAsync(cancellationToken); } /// @@ -229,13 +230,17 @@ public static AsyncPageable GetNewRelicMonitorResources /// Monitors_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNewRelicMonitorResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicMonitorResources(cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicMonitorResources(cancellationToken); } /// @@ -250,6 +255,10 @@ public static Pageable GetNewRelicMonitorResources(this /// Organizations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// User Email. @@ -259,9 +268,7 @@ public static Pageable GetNewRelicMonitorResources(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNewRelicOrganizationsAsync(this SubscriptionResource subscriptionResource, string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(userEmail, nameof(userEmail)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicOrganizationsAsync(userEmail, location, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicOrganizationsAsync(userEmail, location, cancellationToken); } /// @@ -276,6 +283,10 @@ public static AsyncPageable GetNewRelicOrganiz /// Organizations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// User Email. @@ -285,9 +296,7 @@ public static AsyncPageable GetNewRelicOrganiz /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNewRelicOrganizations(this SubscriptionResource subscriptionResource, string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(userEmail, nameof(userEmail)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicOrganizations(userEmail, location, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicOrganizations(userEmail, location, cancellationToken); } /// @@ -302,6 +311,10 @@ public static Pageable GetNewRelicOrganization /// Plans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Account Id. @@ -310,7 +323,7 @@ public static Pageable GetNewRelicOrganization /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNewRelicPlansAsync(this SubscriptionResource subscriptionResource, string accountId = null, string organizationId = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicPlansAsync(accountId, organizationId, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicPlansAsync(accountId, organizationId, cancellationToken); } /// @@ -325,6 +338,10 @@ public static AsyncPageable GetNewRelicPlansAsync(this Subscri /// Plans_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Account Id. @@ -333,7 +350,7 @@ public static AsyncPageable GetNewRelicPlansAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNewRelicPlans(this SubscriptionResource subscriptionResource, string accountId = null, string organizationId = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNewRelicPlans(accountId, organizationId, cancellationToken); + return GetNewRelicObservabilitySubscriptionMockingExtension(subscriptionResource).GetNewRelicPlans(accountId, organizationId, cancellationToken); } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityResourceGroupMockingExtension.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..e9dfcecf5f1e --- /dev/null +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilityResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NewRelicObservability; + +namespace Azure.ResourceManager.NewRelicObservability.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NewRelicObservabilityResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NewRelicObservabilityResourceGroupMockingExtension() + { + } + + /// 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 NewRelicObservabilityResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NewRelicMonitorResources in the ResourceGroupResource. + /// An object representing collection of NewRelicMonitorResources and their operations over a NewRelicMonitorResource. + public virtual NewRelicMonitorResourceCollection GetNewRelicMonitorResources() + { + return GetCachedClient(client => new NewRelicMonitorResourceCollection(client, Id)); + } + + /// + /// Get a NewRelicMonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Name of the Monitors resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNewRelicMonitorResourceAsync(string monitorName, CancellationToken cancellationToken = default) + { + return await GetNewRelicMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a NewRelicMonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Name of the Monitors resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNewRelicMonitorResource(string monitorName, CancellationToken cancellationToken = default) + { + return GetNewRelicMonitorResources().Get(monitorName, cancellationToken); + } + } +} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilitySubscriptionMockingExtension.cs similarity index 86% rename from sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilitySubscriptionMockingExtension.cs index 8d314857ef89..d41d456a1020 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/NewRelicObservabilitySubscriptionMockingExtension.cs @@ -5,18 +5,20 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.NewRelicObservability; using Azure.ResourceManager.NewRelicObservability.Models; -namespace Azure.ResourceManager.NewRelicObservability +namespace Azure.ResourceManager.NewRelicObservability.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NewRelicObservabilitySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _accountsClientDiagnostics; private AccountsRestOperations _accountsRestClient; @@ -27,15 +29,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _plansClientDiagnostics; private PlansRestOperations _plansRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NewRelicObservabilitySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NewRelicObservabilitySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,12 +72,15 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// User Email. /// Location for NewRelic. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetNewRelicAccountsAsync(string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(userEmail, nameof(userEmail)); + HttpMessage FirstPageRequest(int? pageSizeHint) => AccountsRestClient.CreateListRequest(Id.SubscriptionId, userEmail, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, userEmail, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicAccountResourceData.DeserializeNewRelicAccountResourceData, AccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicAccountResourceData.DeserializeNewRelicAccountResourceData, AccountsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicAccounts", "value", "nextLink", cancellationToken); } /// @@ -94,12 +99,15 @@ public virtual AsyncPageable GetNewRelicAccountsAsy /// User Email. /// Location for NewRelic. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetNewRelicAccounts(string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(userEmail, nameof(userEmail)); + HttpMessage FirstPageRequest(int? pageSizeHint) => AccountsRestClient.CreateListRequest(Id.SubscriptionId, userEmail, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, userEmail, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicAccountResourceData.DeserializeNewRelicAccountResourceData, AccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicAccountResourceData.DeserializeNewRelicAccountResourceData, AccountsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicAccounts", "value", "nextLink", cancellationToken); } /// @@ -121,7 +129,7 @@ public virtual AsyncPageable GetNewRelicMonitorResource { HttpMessage FirstPageRequest(int? pageSizeHint) => NewRelicMonitorResourceMonitorsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NewRelicMonitorResourceMonitorsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitorResource(Client, NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(e)), NewRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitorResource(Client, NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(e)), NewRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicMonitorResources", "value", "nextLink", cancellationToken); } /// @@ -143,7 +151,7 @@ public virtual Pageable GetNewRelicMonitorResources(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => NewRelicMonitorResourceMonitorsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NewRelicMonitorResourceMonitorsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitorResource(Client, NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(e)), NewRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NewRelicMonitorResource(Client, NewRelicMonitorResourceData.DeserializeNewRelicMonitorResourceData(e)), NewRelicMonitorResourceMonitorsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicMonitorResources", "value", "nextLink", cancellationToken); } /// @@ -162,12 +170,15 @@ public virtual Pageable GetNewRelicMonitorResources(Can /// User Email. /// Location for NewRelic. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetNewRelicOrganizationsAsync(string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(userEmail, nameof(userEmail)); + HttpMessage FirstPageRequest(int? pageSizeHint) => OrganizationsRestClient.CreateListRequest(Id.SubscriptionId, userEmail, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrganizationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, userEmail, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicOrganizationResourceData.DeserializeNewRelicOrganizationResourceData, OrganizationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicOrganizations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicOrganizationResourceData.DeserializeNewRelicOrganizationResourceData, OrganizationsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicOrganizations", "value", "nextLink", cancellationToken); } /// @@ -186,12 +197,15 @@ public virtual AsyncPageable GetNewRelicOrgani /// User Email. /// Location for NewRelic. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetNewRelicOrganizations(string userEmail, AzureLocation location, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(userEmail, nameof(userEmail)); + HttpMessage FirstPageRequest(int? pageSizeHint) => OrganizationsRestClient.CreateListRequest(Id.SubscriptionId, userEmail, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrganizationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, userEmail, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicOrganizationResourceData.DeserializeNewRelicOrganizationResourceData, OrganizationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicOrganizations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicOrganizationResourceData.DeserializeNewRelicOrganizationResourceData, OrganizationsClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicOrganizations", "value", "nextLink", cancellationToken); } /// @@ -215,7 +229,7 @@ public virtual AsyncPageable GetNewRelicPlansAsync(string acco { HttpMessage FirstPageRequest(int? pageSizeHint) => PlansRestClient.CreateListRequest(Id.SubscriptionId, accountId, organizationId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PlansRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, accountId, organizationId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicPlanData.DeserializeNewRelicPlanData, PlansClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, NewRelicPlanData.DeserializeNewRelicPlanData, PlansClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicPlans", "value", "nextLink", cancellationToken); } /// @@ -239,7 +253,7 @@ public virtual Pageable GetNewRelicPlans(string accountId = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => PlansRestClient.CreateListRequest(Id.SubscriptionId, accountId, organizationId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PlansRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, accountId, organizationId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicPlanData.DeserializeNewRelicPlanData, PlansClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNewRelicPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, NewRelicPlanData.DeserializeNewRelicPlanData, PlansClientDiagnostics, Pipeline, "NewRelicObservabilitySubscriptionMockingExtension.GetNewRelicPlans", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f50e139d5122..000000000000 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.NewRelicObservability -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NewRelicMonitorResources in the ResourceGroupResource. - /// An object representing collection of NewRelicMonitorResources and their operations over a NewRelicMonitorResource. - public virtual NewRelicMonitorResourceCollection GetNewRelicMonitorResources() - { - return GetCachedClient(Client => new NewRelicMonitorResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs index fec613a795ab..f0dd8367dba6 100644 --- a/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs +++ b/sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/src/Generated/NewRelicMonitorResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NewRelicObservabilityTagRuleResources and their operations over a NewRelicObservabilityTagRuleResource. public virtual NewRelicObservabilityTagRuleCollection GetNewRelicObservabilityTagRules() { - return GetCachedClient(Client => new NewRelicObservabilityTagRuleCollection(Client, Id)); + return GetCachedClient(client => new NewRelicObservabilityTagRuleCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual NewRelicObservabilityTagRuleCollection GetNewRelicObservabilityTa /// /// Name of the TagRule. /// The cancellation token to use. - /// 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> GetNewRelicObservabilityTagRuleAsync(string ruleSetName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetNew /// /// Name of the TagRule. /// The cancellation token to use. - /// 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 GetNewRelicObservabilityTagRule(string ruleSetName, CancellationToken cancellationToken = default) { diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxArmClientMockingExtension.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxArmClientMockingExtension.cs new file mode 100644 index 000000000000..0c3dd3270f34 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NginxArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NginxArmClientMockingExtension() + { + } + + /// 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 NginxArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NginxArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NginxCertificateResource GetNginxCertificateResource(ResourceIdentifier id) + { + NginxCertificateResource.ValidateResourceId(id); + return new NginxCertificateResource(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 NginxConfigurationResource GetNginxConfigurationResource(ResourceIdentifier id) + { + NginxConfigurationResource.ValidateResourceId(id); + return new NginxConfigurationResource(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 NginxDeploymentResource GetNginxDeploymentResource(ResourceIdentifier id) + { + NginxDeploymentResource.ValidateResourceId(id); + return new NginxDeploymentResource(Client, id); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs index 0bd9e7839fa4..e76d7af73bd4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Nginx.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Nginx @@ -18,100 +19,81 @@ namespace Azure.ResourceManager.Nginx /// A class to add extension methods to Azure.ResourceManager.Nginx. public static partial class NginxExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NginxArmClientMockingExtension GetNginxArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NginxArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NginxResourceGroupMockingExtension GetNginxResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NginxResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NginxSubscriptionMockingExtension GetNginxSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NginxSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NginxCertificateResource /// /// 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. /// Returns a object. public static NginxCertificateResource GetNginxCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NginxCertificateResource.ValidateResourceId(id); - return new NginxCertificateResource(client, id); - } - ); + return GetNginxArmClientMockingExtension(client).GetNginxCertificateResource(id); } - #endregion - #region NginxConfigurationResource /// /// 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. /// Returns a object. public static NginxConfigurationResource GetNginxConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NginxConfigurationResource.ValidateResourceId(id); - return new NginxConfigurationResource(client, id); - } - ); + return GetNginxArmClientMockingExtension(client).GetNginxConfigurationResource(id); } - #endregion - #region NginxDeploymentResource /// /// 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. /// Returns a object. public static NginxDeploymentResource GetNginxDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NginxDeploymentResource.ValidateResourceId(id); - return new NginxDeploymentResource(client, id); - } - ); + return GetNginxArmClientMockingExtension(client).GetNginxDeploymentResource(id); } - #endregion - /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. + /// + /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NginxDeploymentResources and their operations over a NginxDeploymentResource. public static NginxDeploymentCollection GetNginxDeployments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNginxDeployments(); + return GetNginxResourceGroupMockingExtension(resourceGroupResource).GetNginxDeployments(); } /// @@ -126,16 +108,20 @@ public static NginxDeploymentCollection GetNginxDeployments(this ResourceGroupRe /// Deployments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of targeted Nginx deployment. /// The cancellation token to use. - /// 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 static async Task> GetNginxDeploymentAsync(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNginxDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + return await GetNginxResourceGroupMockingExtension(resourceGroupResource).GetNginxDeploymentAsync(deploymentName, cancellationToken).ConfigureAwait(false); } /// @@ -150,16 +136,20 @@ public static async Task> GetNginxDeploymentAs /// Deployments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of targeted Nginx deployment. /// The cancellation token to use. - /// 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 static Response GetNginxDeployment(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNginxDeployments().Get(deploymentName, cancellationToken); + return GetNginxResourceGroupMockingExtension(resourceGroupResource).GetNginxDeployment(deploymentName, cancellationToken); } /// @@ -174,13 +164,17 @@ public static Response GetNginxDeployment(this Resource /// Deployments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNginxDeploymentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNginxDeploymentsAsync(cancellationToken); + return GetNginxSubscriptionMockingExtension(subscriptionResource).GetNginxDeploymentsAsync(cancellationToken); } /// @@ -195,13 +189,17 @@ public static AsyncPageable GetNginxDeploymentsAsync(th /// Deployments_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNginxDeployments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNginxDeployments(cancellationToken); + return GetNginxSubscriptionMockingExtension(subscriptionResource).GetNginxDeployments(cancellationToken); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxResourceGroupMockingExtension.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..6fe5bd4a15aa --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NginxResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NginxResourceGroupMockingExtension() + { + } + + /// 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 NginxResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. + /// An object representing collection of NginxDeploymentResources and their operations over a NginxDeploymentResource. + public virtual NginxDeploymentCollection GetNginxDeployments() + { + return GetCachedClient(client => new NginxDeploymentCollection(client, Id)); + } + + /// + /// Get the Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_Get + /// + /// + /// + /// The name of targeted Nginx deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNginxDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetNginxDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_Get + /// + /// + /// + /// The name of targeted Nginx deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNginxDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetNginxDeployments().Get(deploymentName, cancellationToken); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxSubscriptionMockingExtension.cs similarity index 85% rename from sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxSubscriptionMockingExtension.cs index 6e2b42c2587a..c4775037957a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; -namespace Azure.ResourceManager.Nginx +namespace Azure.ResourceManager.Nginx.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NginxSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; private DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NginxSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NginxSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetNginxDeploymentsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentDeploymentsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentDeploymentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNginxDeployments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "NginxSubscriptionMockingExtension.GetNginxDeployments", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetNginxDeployments(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentDeploymentsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentDeploymentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNginxDeployments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "NginxSubscriptionMockingExtension.GetNginxDeployments", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3bdaae57228b..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Nginx -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. - /// An object representing collection of NginxDeploymentResources and their operations over a NginxDeploymentResource. - public virtual NginxDeploymentCollection GetNginxDeployments() - { - return GetCachedClient(Client => new NginxDeploymentCollection(Client, Id)); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs index 42f4795d0cd5..1110ac7c8e82 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NginxCertificateResources and their operations over a NginxCertificateResource. public virtual NginxCertificateCollection GetNginxCertificates() { - return GetCachedClient(Client => new NginxCertificateCollection(Client, Id)); + return GetCachedClient(client => new NginxCertificateCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual NginxCertificateCollection GetNginxCertificates() /// /// The name of certificate. /// The cancellation token to use. - /// 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> GetNginxCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetNginxCertificat /// /// The name of certificate. /// The cancellation token to use. - /// 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 GetNginxCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetNginxCertificate(string cer /// An object representing collection of NginxConfigurationResources and their operations over a NginxConfigurationResource. public virtual NginxConfigurationCollection GetNginxConfigurations() { - return GetCachedClient(Client => new NginxConfigurationCollection(Client, Id)); + return GetCachedClient(client => new NginxConfigurationCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual NginxConfigurationCollection GetNginxConfigurations() /// /// The name of configuration, only 'default' is supported value due to the singleton of Nginx conf. /// The cancellation token to use. - /// 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> GetNginxConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetNginxConfigur /// /// The name of configuration, only 'default' is supported value due to the singleton of Nginx conf. /// The cancellation token to use. - /// 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 GetNginxConfiguration(string configurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsArmClientMockingExtension.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsArmClientMockingExtension.cs new file mode 100644 index 000000000000..7b382b796aca --- /dev/null +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NotificationHubs; + +namespace Azure.ResourceManager.NotificationHubs.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class NotificationHubsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NotificationHubsArmClientMockingExtension() + { + } + + /// 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 NotificationHubsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal NotificationHubsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NotificationHubNamespaceResource GetNotificationHubNamespaceResource(ResourceIdentifier id) + { + NotificationHubNamespaceResource.ValidateResourceId(id); + return new NotificationHubNamespaceResource(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 NotificationHubNamespaceAuthorizationRuleResource GetNotificationHubNamespaceAuthorizationRuleResource(ResourceIdentifier id) + { + NotificationHubNamespaceAuthorizationRuleResource.ValidateResourceId(id); + return new NotificationHubNamespaceAuthorizationRuleResource(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 NotificationHubAuthorizationRuleResource GetNotificationHubAuthorizationRuleResource(ResourceIdentifier id) + { + NotificationHubAuthorizationRuleResource.ValidateResourceId(id); + return new NotificationHubAuthorizationRuleResource(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 NotificationHubResource GetNotificationHubResource(ResourceIdentifier id) + { + NotificationHubResource.ValidateResourceId(id); + return new NotificationHubResource(Client, id); + } + } +} diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsExtensions.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsExtensions.cs index abb488051ec2..4699a04c8bff 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsExtensions.cs +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.NotificationHubs.Mocking; using Azure.ResourceManager.NotificationHubs.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.NotificationHubs /// A class to add extension methods to Azure.ResourceManager.NotificationHubs. public static partial class NotificationHubsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static NotificationHubsArmClientMockingExtension GetNotificationHubsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new NotificationHubsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static NotificationHubsResourceGroupMockingExtension GetNotificationHubsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new NotificationHubsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static NotificationHubsSubscriptionMockingExtension GetNotificationHubsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new NotificationHubsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region NotificationHubNamespaceResource /// /// 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. /// Returns a object. public static NotificationHubNamespaceResource GetNotificationHubNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NotificationHubNamespaceResource.ValidateResourceId(id); - return new NotificationHubNamespaceResource(client, id); - } - ); + return GetNotificationHubsArmClientMockingExtension(client).GetNotificationHubNamespaceResource(id); } - #endregion - #region NotificationHubNamespaceAuthorizationRuleResource /// /// 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. /// Returns a object. public static NotificationHubNamespaceAuthorizationRuleResource GetNotificationHubNamespaceAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NotificationHubNamespaceAuthorizationRuleResource.ValidateResourceId(id); - return new NotificationHubNamespaceAuthorizationRuleResource(client, id); - } - ); + return GetNotificationHubsArmClientMockingExtension(client).GetNotificationHubNamespaceAuthorizationRuleResource(id); } - #endregion - #region NotificationHubAuthorizationRuleResource /// /// 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. /// Returns a object. public static NotificationHubAuthorizationRuleResource GetNotificationHubAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NotificationHubAuthorizationRuleResource.ValidateResourceId(id); - return new NotificationHubAuthorizationRuleResource(client, id); - } - ); + return GetNotificationHubsArmClientMockingExtension(client).GetNotificationHubAuthorizationRuleResource(id); } - #endregion - #region NotificationHubResource /// /// 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. /// Returns a object. public static NotificationHubResource GetNotificationHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NotificationHubResource.ValidateResourceId(id); - return new NotificationHubResource(client, id); - } - ); + return GetNotificationHubsArmClientMockingExtension(client).GetNotificationHubResource(id); } - #endregion - /// Gets a collection of NotificationHubNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of NotificationHubNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of NotificationHubNamespaceResources and their operations over a NotificationHubNamespaceResource. public static NotificationHubNamespaceCollection GetNotificationHubNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetNotificationHubNamespaces(); + return GetNotificationHubsResourceGroupMockingExtension(resourceGroupResource).GetNotificationHubNamespaces(); } /// @@ -146,16 +125,20 @@ public static NotificationHubNamespaceCollection GetNotificationHubNamespaces(th /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static async Task> GetNotificationHubNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetNotificationHubNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetNotificationHubsResourceGroupMockingExtension(resourceGroupResource).GetNotificationHubNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetNotifica /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static Response GetNotificationHubNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetNotificationHubNamespaces().Get(namespaceName, cancellationToken); + return GetNotificationHubsResourceGroupMockingExtension(resourceGroupResource).GetNotificationHubNamespace(namespaceName, cancellationToken); } /// @@ -194,6 +181,10 @@ public static Response GetNotificationHubNames /// Namespaces_CheckAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. @@ -201,9 +192,7 @@ public static Response GetNotificationHubNames /// is null. public static async Task> CheckNotificationHubNamespaceAvailabilityAsync(this SubscriptionResource subscriptionResource, NotificationHubAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNotificationHubNamespaceAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetNotificationHubsSubscriptionMockingExtension(subscriptionResource).CheckNotificationHubNamespaceAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -218,6 +207,10 @@ public static async Task> CheckNotif /// Namespaces_CheckAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. @@ -225,9 +218,7 @@ public static async Task> CheckNotif /// is null. public static Response CheckNotificationHubNamespaceAvailability(this SubscriptionResource subscriptionResource, NotificationHubAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNotificationHubNamespaceAvailability(content, cancellationToken); + return GetNotificationHubsSubscriptionMockingExtension(subscriptionResource).CheckNotificationHubNamespaceAvailability(content, cancellationToken); } /// @@ -242,13 +233,17 @@ public static Response CheckNotificationHubNa /// Namespaces_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNotificationHubNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNotificationHubNamespacesAsync(cancellationToken); + return GetNotificationHubsSubscriptionMockingExtension(subscriptionResource).GetNotificationHubNamespacesAsync(cancellationToken); } /// @@ -263,13 +258,17 @@ public static AsyncPageable GetNotificationHub /// Namespaces_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetNotificationHubNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetNotificationHubNamespaces(cancellationToken); + return GetNotificationHubsSubscriptionMockingExtension(subscriptionResource).GetNotificationHubNamespaces(cancellationToken); } } } diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsResourceGroupMockingExtension.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f4d492e1038f --- /dev/null +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.NotificationHubs; + +namespace Azure.ResourceManager.NotificationHubs.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class NotificationHubsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected NotificationHubsResourceGroupMockingExtension() + { + } + + /// 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 NotificationHubsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of NotificationHubNamespaceResources in the ResourceGroupResource. + /// An object representing collection of NotificationHubNamespaceResources and their operations over a NotificationHubNamespaceResource. + public virtual NotificationHubNamespaceCollection GetNotificationHubNamespaces() + { + return GetCachedClient(client => new NotificationHubNamespaceCollection(client, Id)); + } + + /// + /// Returns the description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNotificationHubNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + { + return await GetNotificationHubNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNotificationHubNamespace(string namespaceName, CancellationToken cancellationToken = default) + { + return GetNotificationHubNamespaces().Get(namespaceName, cancellationToken); + } + } +} diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsSubscriptionMockingExtension.cs similarity index 84% rename from sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsSubscriptionMockingExtension.cs index d7306a039ab7..e19cb9979993 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/NotificationHubsSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.NotificationHubs; using Azure.ResourceManager.NotificationHubs.Models; -namespace Azure.ResourceManager.NotificationHubs +namespace Azure.ResourceManager.NotificationHubs.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class NotificationHubsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _notificationHubNamespaceNamespacesClientDiagnostics; private NamespacesRestOperations _notificationHubNamespaceNamespacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected NotificationHubsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal NotificationHubsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,9 +60,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// The namespace name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNotificationHubNamespaceAvailabilityAsync(NotificationHubAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NotificationHubNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNotificationHubNamespaceAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NotificationHubNamespaceNamespacesClientDiagnostics.CreateScope("NotificationHubsSubscriptionMockingExtension.CheckNotificationHubNamespaceAvailability"); scope.Start(); try { @@ -90,9 +94,12 @@ public virtual async Task> CheckNoti /// /// The namespace name. /// The cancellation token to use. + /// is null. public virtual Response CheckNotificationHubNamespaceAvailability(NotificationHubAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = NotificationHubNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNotificationHubNamespaceAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = NotificationHubNamespaceNamespacesClientDiagnostics.CreateScope("NotificationHubsSubscriptionMockingExtension.CheckNotificationHubNamespaceAvailability"); scope.Start(); try { @@ -125,7 +132,7 @@ public virtual AsyncPageable GetNotificationHu { HttpMessage FirstPageRequest(int? pageSizeHint) => NotificationHubNamespaceNamespacesRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NotificationHubNamespaceNamespacesRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NotificationHubNamespaceResource(Client, NotificationHubNamespaceData.DeserializeNotificationHubNamespaceData(e)), NotificationHubNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNotificationHubNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NotificationHubNamespaceResource(Client, NotificationHubNamespaceData.DeserializeNotificationHubNamespaceData(e)), NotificationHubNamespaceNamespacesClientDiagnostics, Pipeline, "NotificationHubsSubscriptionMockingExtension.GetNotificationHubNamespaces", "value", "nextLink", cancellationToken); } /// @@ -147,7 +154,7 @@ public virtual Pageable GetNotificationHubName { HttpMessage FirstPageRequest(int? pageSizeHint) => NotificationHubNamespaceNamespacesRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NotificationHubNamespaceNamespacesRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NotificationHubNamespaceResource(Client, NotificationHubNamespaceData.DeserializeNotificationHubNamespaceData(e)), NotificationHubNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetNotificationHubNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NotificationHubNamespaceResource(Client, NotificationHubNamespaceData.DeserializeNotificationHubNamespaceData(e)), NotificationHubNamespaceNamespacesClientDiagnostics, Pipeline, "NotificationHubsSubscriptionMockingExtension.GetNotificationHubNamespaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6ed679de8b08..000000000000 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.NotificationHubs -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NotificationHubNamespaceResources in the ResourceGroupResource. - /// An object representing collection of NotificationHubNamespaceResources and their operations over a NotificationHubNamespaceResource. - public virtual NotificationHubNamespaceCollection GetNotificationHubNamespaces() - { - return GetCachedClient(Client => new NotificationHubNamespaceCollection(Client, Id)); - } - } -} diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubNamespaceResource.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubNamespaceResource.cs index 65dbf24a50c4..d0c38b9a4de5 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubNamespaceResource.cs +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubNamespaceResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NotificationHubNamespaceAuthorizationRuleResources and their operations over a NotificationHubNamespaceAuthorizationRuleResource. public virtual NotificationHubNamespaceAuthorizationRuleCollection GetNotificationHubNamespaceAuthorizationRules() { - return GetCachedClient(Client => new NotificationHubNamespaceAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new NotificationHubNamespaceAuthorizationRuleCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual NotificationHubNamespaceAuthorizationRuleCollection GetNotificati /// /// Authorization rule name. /// The cancellation token to use. - /// 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> GetNotificationHubNamespaceAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task /// Authorization rule name. /// The cancellation token to use. - /// 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 GetNotificationHubNamespaceAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetNo /// An object representing collection of NotificationHubResources and their operations over a NotificationHubResource. public virtual NotificationHubCollection GetNotificationHubs() { - return GetCachedClient(Client => new NotificationHubCollection(Client, Id)); + return GetCachedClient(client => new NotificationHubCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual NotificationHubCollection GetNotificationHubs() /// /// The notification hub name. /// The cancellation token to use. - /// 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> GetNotificationHubAsync(string notificationHubName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> GetNotificationHubA /// /// The notification hub name. /// The cancellation token to use. - /// 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 GetNotificationHub(string notificationHubName, CancellationToken cancellationToken = default) { diff --git a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubResource.cs b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubResource.cs index f0b407adc62e..bfc4471d8421 100644 --- a/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubResource.cs +++ b/sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/src/Generated/NotificationHubResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NotificationHubAuthorizationRuleResources and their operations over a NotificationHubAuthorizationRuleResource. public virtual NotificationHubAuthorizationRuleCollection GetNotificationHubAuthorizationRules() { - return GetCachedClient(Client => new NotificationHubAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new NotificationHubAuthorizationRuleCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual NotificationHubAuthorizationRuleCollection GetNotificationHubAuth /// /// authorization rule name. /// The cancellation token to use. - /// 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> GetNotificationHubAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Ge /// /// authorization rule name. /// The cancellation token to use. - /// 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 GetNotificationHubAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesArmClientMockingExtension.cs b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..5248eb8fe558 --- /dev/null +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EnergyServices; + +namespace Azure.ResourceManager.EnergyServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class EnergyServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EnergyServicesArmClientMockingExtension() + { + } + + /// 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 EnergyServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal EnergyServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EnergyServiceResource GetEnergyServiceResource(ResourceIdentifier id) + { + EnergyServiceResource.ValidateResourceId(id); + return new EnergyServiceResource(Client, id); + } + } +} diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesExtensions.cs b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesExtensions.cs index 28f24985b0f8..62016577e291 100644 --- a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesExtensions.cs +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.EnergyServices.Mocking; using Azure.ResourceManager.EnergyServices.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.EnergyServices /// A class to add extension methods to Azure.ResourceManager.EnergyServices. public static partial class EnergyServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static EnergyServicesArmClientMockingExtension GetEnergyServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new EnergyServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static EnergyServicesResourceGroupMockingExtension GetEnergyServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new EnergyServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static EnergyServicesSubscriptionMockingExtension GetEnergyServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new EnergyServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region EnergyServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EnergyServiceResource GetEnergyServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EnergyServiceResource.ValidateResourceId(id); - return new EnergyServiceResource(client, id); - } - ); + return GetEnergyServicesArmClientMockingExtension(client).GetEnergyServiceResource(id); } - #endregion - /// Gets a collection of EnergyServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of EnergyServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EnergyServiceResources and their operations over a EnergyServiceResource. public static EnergyServiceCollection GetEnergyServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEnergyServices(); + return GetEnergyServicesResourceGroupMockingExtension(resourceGroupResource).GetEnergyServices(); } /// @@ -89,16 +77,20 @@ public static EnergyServiceCollection GetEnergyServices(this ResourceGroupResour /// EnergyServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource name. /// The cancellation token to use. - /// 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 static async Task> GetEnergyServiceAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEnergyServices().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetEnergyServicesResourceGroupMockingExtension(resourceGroupResource).GetEnergyServiceAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetEnergyServiceAsync( /// EnergyServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource name. /// The cancellation token to use. - /// 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 static Response GetEnergyService(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEnergyServices().Get(resourceName, cancellationToken); + return GetEnergyServicesResourceGroupMockingExtension(resourceGroupResource).GetEnergyService(resourceName, cancellationToken); } /// @@ -137,6 +133,10 @@ public static Response GetEnergyService(this ResourceGrou /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// NameAvailabilityRequest object. @@ -144,9 +144,7 @@ public static Response GetEnergyService(this ResourceGrou /// is null. public static async Task> CheckNameAvailabilityLocationAsync(this SubscriptionResource subscriptionResource, EnergyServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityLocationAsync(content, cancellationToken).ConfigureAwait(false); + return await GetEnergyServicesSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityLocationAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -161,6 +159,10 @@ public static async Task> CheckNam /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// NameAvailabilityRequest object. @@ -168,9 +170,7 @@ public static async Task> CheckNam /// is null. public static Response CheckNameAvailabilityLocation(this SubscriptionResource subscriptionResource, EnergyServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityLocation(content, cancellationToken); + return GetEnergyServicesSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityLocation(content, cancellationToken); } /// @@ -185,13 +185,17 @@ public static Response CheckNameAvailabilit /// EnergyServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEnergyServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEnergyServicesAsync(cancellationToken); + return GetEnergyServicesSubscriptionMockingExtension(subscriptionResource).GetEnergyServicesAsync(cancellationToken); } /// @@ -206,13 +210,17 @@ public static AsyncPageable GetEnergyServicesAsync(this S /// EnergyServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEnergyServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEnergyServices(cancellationToken); + return GetEnergyServicesSubscriptionMockingExtension(subscriptionResource).GetEnergyServices(cancellationToken); } } } diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesResourceGroupMockingExtension.cs b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..ae3dd12ea771 --- /dev/null +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EnergyServices; + +namespace Azure.ResourceManager.EnergyServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class EnergyServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EnergyServicesResourceGroupMockingExtension() + { + } + + /// 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 EnergyServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EnergyServiceResources in the ResourceGroupResource. + /// An object representing collection of EnergyServiceResources and their operations over a EnergyServiceResource. + public virtual EnergyServiceCollection GetEnergyServices() + { + return GetCachedClient(client => new EnergyServiceCollection(client, Id)); + } + + /// + /// Returns oep resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OpenEnergyPlatform/energyServices/{resourceName} + /// + /// + /// Operation Id + /// EnergyServices_Get + /// + /// + /// + /// The resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEnergyServiceAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetEnergyServices().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns oep resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OpenEnergyPlatform/energyServices/{resourceName} + /// + /// + /// Operation Id + /// EnergyServices_Get + /// + /// + /// + /// The resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEnergyService(string resourceName, CancellationToken cancellationToken = default) + { + return GetEnergyServices().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesSubscriptionMockingExtension.cs similarity index 85% rename from sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesSubscriptionMockingExtension.cs index f64fa14a9605..0262f2eb1821 100644 --- a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/EnergyServicesSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.EnergyServices; using Azure.ResourceManager.EnergyServices.Models; -namespace Azure.ResourceManager.EnergyServices +namespace Azure.ResourceManager.EnergyServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class EnergyServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; private ClientDiagnostics _energyServiceClientDiagnostics; private EnergyServicesRestOperations _energyServiceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected EnergyServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal EnergyServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,9 +64,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// NameAvailabilityRequest object. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNameAvailabilityLocationAsync(EnergyServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("EnergyServicesSubscriptionMockingExtension.CheckNameAvailabilityLocation"); scope.Start(); try { @@ -94,9 +98,12 @@ public virtual async Task> CheckNa /// /// NameAvailabilityRequest object. /// The cancellation token to use. + /// is null. public virtual Response CheckNameAvailabilityLocation(EnergyServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("EnergyServicesSubscriptionMockingExtension.CheckNameAvailabilityLocation"); scope.Start(); try { @@ -129,7 +136,7 @@ public virtual AsyncPageable GetEnergyServicesAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => EnergyServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EnergyServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EnergyServiceResource(Client, EnergyServiceData.DeserializeEnergyServiceData(e)), EnergyServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEnergyServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EnergyServiceResource(Client, EnergyServiceData.DeserializeEnergyServiceData(e)), EnergyServiceClientDiagnostics, Pipeline, "EnergyServicesSubscriptionMockingExtension.GetEnergyServices", "value", "nextLink", cancellationToken); } /// @@ -151,7 +158,7 @@ public virtual Pageable GetEnergyServices(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => EnergyServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EnergyServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EnergyServiceResource(Client, EnergyServiceData.DeserializeEnergyServiceData(e)), EnergyServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEnergyServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EnergyServiceResource(Client, EnergyServiceData.DeserializeEnergyServiceData(e)), EnergyServiceClientDiagnostics, Pipeline, "EnergyServicesSubscriptionMockingExtension.GetEnergyServices", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index b9f0b6bae032..000000000000 --- a/sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.EnergyServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EnergyServiceResources in the ResourceGroupResource. - /// An object representing collection of EnergyServiceResources and their operations over a EnergyServiceResource. - public virtual EnergyServiceCollection GetEnergyServices() - { - return GetCachedClient(Client => new EnergyServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsArmClientMockingExtension.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsArmClientMockingExtension.cs new file mode 100644 index 000000000000..bab5de2b3e21 --- /dev/null +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsArmClientMockingExtension.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.OperationalInsights; + +namespace Azure.ResourceManager.OperationalInsights.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class OperationalInsightsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected OperationalInsightsArmClientMockingExtension() + { + } + + /// 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 OperationalInsightsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal OperationalInsightsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual LogAnalyticsQueryPackResource GetLogAnalyticsQueryPackResource(ResourceIdentifier id) + { + LogAnalyticsQueryPackResource.ValidateResourceId(id); + return new LogAnalyticsQueryPackResource(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 LogAnalyticsQueryResource GetLogAnalyticsQueryResource(ResourceIdentifier id) + { + LogAnalyticsQueryResource.ValidateResourceId(id); + return new LogAnalyticsQueryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsDataExportResource GetOperationalInsightsDataExportResource(ResourceIdentifier id) + { + OperationalInsightsDataExportResource.ValidateResourceId(id); + return new OperationalInsightsDataExportResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsDataSourceResource GetOperationalInsightsDataSourceResource(ResourceIdentifier id) + { + OperationalInsightsDataSourceResource.ValidateResourceId(id); + return new OperationalInsightsDataSourceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsLinkedServiceResource GetOperationalInsightsLinkedServiceResource(ResourceIdentifier id) + { + OperationalInsightsLinkedServiceResource.ValidateResourceId(id); + return new OperationalInsightsLinkedServiceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsLinkedStorageAccountsResource GetOperationalInsightsLinkedStorageAccountsResource(ResourceIdentifier id) + { + OperationalInsightsLinkedStorageAccountsResource.ValidateResourceId(id); + return new OperationalInsightsLinkedStorageAccountsResource(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 StorageInsightResource GetStorageInsightResource(ResourceIdentifier id) + { + StorageInsightResource.ValidateResourceId(id); + return new StorageInsightResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsSavedSearchResource GetOperationalInsightsSavedSearchResource(ResourceIdentifier id) + { + OperationalInsightsSavedSearchResource.ValidateResourceId(id); + return new OperationalInsightsSavedSearchResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsClusterResource GetOperationalInsightsClusterResource(ResourceIdentifier id) + { + OperationalInsightsClusterResource.ValidateResourceId(id); + return new OperationalInsightsClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsWorkspaceResource GetOperationalInsightsWorkspaceResource(ResourceIdentifier id) + { + OperationalInsightsWorkspaceResource.ValidateResourceId(id); + return new OperationalInsightsWorkspaceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsTableResource GetOperationalInsightsTableResource(ResourceIdentifier id) + { + OperationalInsightsTableResource.ValidateResourceId(id); + return new OperationalInsightsTableResource(Client, id); + } + } +} diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsExtensions.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsExtensions.cs index 2469b03bd6af..fa3931635821 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsExtensions.cs +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.OperationalInsights.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.OperationalInsights @@ -18,252 +19,209 @@ namespace Azure.ResourceManager.OperationalInsights /// A class to add extension methods to Azure.ResourceManager.OperationalInsights. public static partial class OperationalInsightsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static OperationalInsightsArmClientMockingExtension GetOperationalInsightsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new OperationalInsightsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static OperationalInsightsResourceGroupMockingExtension GetOperationalInsightsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new OperationalInsightsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static OperationalInsightsSubscriptionMockingExtension GetOperationalInsightsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new OperationalInsightsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region LogAnalyticsQueryPackResource /// /// 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. /// Returns a object. public static LogAnalyticsQueryPackResource GetLogAnalyticsQueryPackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogAnalyticsQueryPackResource.ValidateResourceId(id); - return new LogAnalyticsQueryPackResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetLogAnalyticsQueryPackResource(id); } - #endregion - #region LogAnalyticsQueryResource /// /// 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. /// Returns a object. public static LogAnalyticsQueryResource GetLogAnalyticsQueryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogAnalyticsQueryResource.ValidateResourceId(id); - return new LogAnalyticsQueryResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetLogAnalyticsQueryResource(id); } - #endregion - #region OperationalInsightsDataExportResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsDataExportResource GetOperationalInsightsDataExportResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsDataExportResource.ValidateResourceId(id); - return new OperationalInsightsDataExportResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsDataExportResource(id); } - #endregion - #region OperationalInsightsDataSourceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsDataSourceResource GetOperationalInsightsDataSourceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsDataSourceResource.ValidateResourceId(id); - return new OperationalInsightsDataSourceResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsDataSourceResource(id); } - #endregion - #region OperationalInsightsLinkedServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsLinkedServiceResource GetOperationalInsightsLinkedServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsLinkedServiceResource.ValidateResourceId(id); - return new OperationalInsightsLinkedServiceResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsLinkedServiceResource(id); } - #endregion - #region OperationalInsightsLinkedStorageAccountsResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsLinkedStorageAccountsResource GetOperationalInsightsLinkedStorageAccountsResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsLinkedStorageAccountsResource.ValidateResourceId(id); - return new OperationalInsightsLinkedStorageAccountsResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsLinkedStorageAccountsResource(id); } - #endregion - #region StorageInsightResource /// /// 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. /// Returns a object. public static StorageInsightResource GetStorageInsightResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageInsightResource.ValidateResourceId(id); - return new StorageInsightResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetStorageInsightResource(id); } - #endregion - #region OperationalInsightsSavedSearchResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsSavedSearchResource GetOperationalInsightsSavedSearchResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsSavedSearchResource.ValidateResourceId(id); - return new OperationalInsightsSavedSearchResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsSavedSearchResource(id); } - #endregion - #region OperationalInsightsClusterResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsClusterResource GetOperationalInsightsClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsClusterResource.ValidateResourceId(id); - return new OperationalInsightsClusterResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsClusterResource(id); } - #endregion - #region OperationalInsightsWorkspaceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsWorkspaceResource GetOperationalInsightsWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsWorkspaceResource.ValidateResourceId(id); - return new OperationalInsightsWorkspaceResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsWorkspaceResource(id); } - #endregion - #region OperationalInsightsTableResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsTableResource GetOperationalInsightsTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsTableResource.ValidateResourceId(id); - return new OperationalInsightsTableResource(client, id); - } - ); + return GetOperationalInsightsArmClientMockingExtension(client).GetOperationalInsightsTableResource(id); } - #endregion - /// Gets a collection of LogAnalyticsQueryPackResources in the ResourceGroupResource. + /// + /// Gets a collection of LogAnalyticsQueryPackResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LogAnalyticsQueryPackResources and their operations over a LogAnalyticsQueryPackResource. public static LogAnalyticsQueryPackCollection GetLogAnalyticsQueryPacks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLogAnalyticsQueryPacks(); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetLogAnalyticsQueryPacks(); } /// @@ -278,16 +236,20 @@ public static LogAnalyticsQueryPackCollection GetLogAnalyticsQueryPacks(this Res /// QueryPacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Log Analytics QueryPack resource. /// The cancellation token to use. - /// 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 static async Task> GetLogAnalyticsQueryPackAsync(this ResourceGroupResource resourceGroupResource, string queryPackName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLogAnalyticsQueryPacks().GetAsync(queryPackName, cancellationToken).ConfigureAwait(false); + return await GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetLogAnalyticsQueryPackAsync(queryPackName, cancellationToken).ConfigureAwait(false); } /// @@ -302,24 +264,34 @@ public static async Task> GetLogAnalytic /// QueryPacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Log Analytics QueryPack resource. /// The cancellation token to use. - /// 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 static Response GetLogAnalyticsQueryPack(this ResourceGroupResource resourceGroupResource, string queryPackName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLogAnalyticsQueryPacks().Get(queryPackName, cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetLogAnalyticsQueryPack(queryPackName, cancellationToken); } - /// Gets a collection of OperationalInsightsClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of OperationalInsightsClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of OperationalInsightsClusterResources and their operations over a OperationalInsightsClusterResource. public static OperationalInsightsClusterCollection GetOperationalInsightsClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetOperationalInsightsClusters(); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsClusters(); } /// @@ -334,16 +306,20 @@ public static OperationalInsightsClusterCollection GetOperationalInsightsCluster /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Log Analytics Cluster. /// The cancellation token to use. - /// 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 static async Task> GetOperationalInsightsClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetOperationalInsightsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -358,24 +334,34 @@ public static async Task> GetOperat /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Log Analytics Cluster. /// The cancellation token to use. - /// 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 static Response GetOperationalInsightsCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetOperationalInsightsClusters().Get(clusterName, cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsCluster(clusterName, cancellationToken); } - /// Gets a collection of OperationalInsightsWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of OperationalInsightsWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of OperationalInsightsWorkspaceResources and their operations over a OperationalInsightsWorkspaceResource. public static OperationalInsightsWorkspaceCollection GetOperationalInsightsWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetOperationalInsightsWorkspaces(); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsWorkspaces(); } /// @@ -390,16 +376,20 @@ public static OperationalInsightsWorkspaceCollection GetOperationalInsightsWorks /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static async Task> GetOperationalInsightsWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetOperationalInsightsWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -414,16 +404,20 @@ public static async Task> GetOper /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static Response GetOperationalInsightsWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetOperationalInsightsWorkspaces().Get(workspaceName, cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetOperationalInsightsWorkspace(workspaceName, cancellationToken); } /// @@ -438,6 +432,10 @@ public static Response GetOperationalInsig /// QueryPacks_CreateOrUpdateWithoutName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Properties that need to be specified to create or update a Log Analytics QueryPack. @@ -445,9 +443,7 @@ public static Response GetOperationalInsig /// is null. public static async Task> CreateOrUpdateWithoutNameQueryPackAsync(this ResourceGroupResource resourceGroupResource, LogAnalyticsQueryPackData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateWithoutNameQueryPackAsync(data, cancellationToken).ConfigureAwait(false); + return await GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateWithoutNameQueryPackAsync(data, cancellationToken).ConfigureAwait(false); } /// @@ -462,6 +458,10 @@ public static async Task> CreateOrUpdate /// QueryPacks_CreateOrUpdateWithoutName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Properties that need to be specified to create or update a Log Analytics QueryPack. @@ -469,9 +469,7 @@ public static async Task> CreateOrUpdate /// is null. public static Response CreateOrUpdateWithoutNameQueryPack(this ResourceGroupResource resourceGroupResource, LogAnalyticsQueryPackData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CreateOrUpdateWithoutNameQueryPack(data, cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).CreateOrUpdateWithoutNameQueryPack(data, cancellationToken); } /// @@ -486,13 +484,17 @@ public static Response CreateOrUpdateWithoutNameQ /// DeletedWorkspaces_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedWorkspacesAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDeletedWorkspacesAsync(cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetDeletedWorkspacesAsync(cancellationToken); } /// @@ -507,13 +509,17 @@ public static AsyncPageable GetDeletedWork /// DeletedWorkspaces_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedWorkspaces(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDeletedWorkspaces(cancellationToken); + return GetOperationalInsightsResourceGroupMockingExtension(resourceGroupResource).GetDeletedWorkspaces(cancellationToken); } /// @@ -528,13 +534,17 @@ public static Pageable GetDeletedWorkspace /// QueryPacks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLogAnalyticsQueryPacksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLogAnalyticsQueryPacksAsync(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetLogAnalyticsQueryPacksAsync(cancellationToken); } /// @@ -549,13 +559,17 @@ public static AsyncPageable GetLogAnalyticsQueryP /// QueryPacks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLogAnalyticsQueryPacks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLogAnalyticsQueryPacks(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetLogAnalyticsQueryPacks(cancellationToken); } /// @@ -570,13 +584,17 @@ public static Pageable GetLogAnalyticsQueryPacks( /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationalInsightsClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalInsightsClustersAsync(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetOperationalInsightsClustersAsync(cancellationToken); } /// @@ -591,13 +609,17 @@ public static AsyncPageable GetOperationalIn /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationalInsightsClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalInsightsClusters(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetOperationalInsightsClusters(cancellationToken); } /// @@ -612,13 +634,17 @@ public static Pageable GetOperationalInsight /// Workspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationalInsightsWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalInsightsWorkspacesAsync(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetOperationalInsightsWorkspacesAsync(cancellationToken); } /// @@ -633,13 +659,17 @@ public static AsyncPageable GetOperational /// Workspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationalInsightsWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOperationalInsightsWorkspaces(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetOperationalInsightsWorkspaces(cancellationToken); } /// @@ -654,13 +684,17 @@ public static Pageable GetOperationalInsig /// DeletedWorkspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedWorkspacesAsync(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetDeletedWorkspacesAsync(cancellationToken); } /// @@ -675,13 +709,17 @@ public static AsyncPageable GetDeletedWork /// DeletedWorkspaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedWorkspaces(cancellationToken); + return GetOperationalInsightsSubscriptionMockingExtension(subscriptionResource).GetDeletedWorkspaces(cancellationToken); } } } diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsResourceGroupMockingExtension.cs similarity index 50% rename from sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsResourceGroupMockingExtension.cs index 8c6af96c7980..746f83b4c674 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsResourceGroupMockingExtension.cs @@ -13,26 +13,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.OperationalInsights; -namespace Azure.ResourceManager.OperationalInsights +namespace Azure.ResourceManager.OperationalInsights.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class OperationalInsightsResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _logAnalyticsQueryPackQueryPacksClientDiagnostics; private QueryPacksRestOperations _logAnalyticsQueryPackQueryPacksRestClient; private ClientDiagnostics _deletedWorkspacesClientDiagnostics; private DeletedWorkspacesRestOperations _deletedWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected OperationalInsightsResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal OperationalInsightsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -51,21 +52,159 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of LogAnalyticsQueryPackResources and their operations over a LogAnalyticsQueryPackResource. public virtual LogAnalyticsQueryPackCollection GetLogAnalyticsQueryPacks() { - return GetCachedClient(Client => new LogAnalyticsQueryPackCollection(Client, Id)); + return GetCachedClient(client => new LogAnalyticsQueryPackCollection(client, Id)); + } + + /// + /// Returns a Log Analytics QueryPack. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName} + /// + /// + /// Operation Id + /// QueryPacks_Get + /// + /// + /// + /// The name of the Log Analytics QueryPack resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLogAnalyticsQueryPackAsync(string queryPackName, CancellationToken cancellationToken = default) + { + return await GetLogAnalyticsQueryPacks().GetAsync(queryPackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Log Analytics QueryPack. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName} + /// + /// + /// Operation Id + /// QueryPacks_Get + /// + /// + /// + /// The name of the Log Analytics QueryPack resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLogAnalyticsQueryPack(string queryPackName, CancellationToken cancellationToken = default) + { + return GetLogAnalyticsQueryPacks().Get(queryPackName, cancellationToken); } /// Gets a collection of OperationalInsightsClusterResources in the ResourceGroupResource. /// An object representing collection of OperationalInsightsClusterResources and their operations over a OperationalInsightsClusterResource. public virtual OperationalInsightsClusterCollection GetOperationalInsightsClusters() { - return GetCachedClient(Client => new OperationalInsightsClusterCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsClusterCollection(client, Id)); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// Name of the Log Analytics Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOperationalInsightsClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetOperationalInsightsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// Name of the Log Analytics Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOperationalInsightsCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetOperationalInsightsClusters().Get(clusterName, cancellationToken); } /// Gets a collection of OperationalInsightsWorkspaceResources in the ResourceGroupResource. /// An object representing collection of OperationalInsightsWorkspaceResources and their operations over a OperationalInsightsWorkspaceResource. public virtual OperationalInsightsWorkspaceCollection GetOperationalInsightsWorkspaces() { - return GetCachedClient(Client => new OperationalInsightsWorkspaceCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsWorkspaceCollection(client, Id)); + } + + /// + /// Gets a workspace instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOperationalInsightsWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetOperationalInsightsWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a workspace instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOperationalInsightsWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetOperationalInsightsWorkspaces().Get(workspaceName, cancellationToken); } /// @@ -83,9 +222,12 @@ public virtual OperationalInsightsWorkspaceCollection GetOperationalInsightsWork /// /// Properties that need to be specified to create or update a Log Analytics QueryPack. /// The cancellation token to use. + /// is null. public virtual async Task> CreateOrUpdateWithoutNameQueryPackAsync(LogAnalyticsQueryPackData data, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsQueryPackQueryPacksClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateWithoutNameQueryPack"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = LogAnalyticsQueryPackQueryPacksClientDiagnostics.CreateScope("OperationalInsightsResourceGroupMockingExtension.CreateOrUpdateWithoutNameQueryPack"); scope.Start(); try { @@ -114,9 +256,12 @@ public virtual async Task> CreateOrUpdat /// /// Properties that need to be specified to create or update a Log Analytics QueryPack. /// The cancellation token to use. + /// is null. public virtual Response CreateOrUpdateWithoutNameQueryPack(LogAnalyticsQueryPackData data, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsQueryPackQueryPacksClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateOrUpdateWithoutNameQueryPack"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = LogAnalyticsQueryPackQueryPacksClientDiagnostics.CreateScope("OperationalInsightsResourceGroupMockingExtension.CreateOrUpdateWithoutNameQueryPack"); scope.Start(); try { @@ -148,7 +293,7 @@ public virtual Response CreateOrUpdateWithoutName public virtual AsyncPageable GetDeletedWorkspacesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetDeletedWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsResourceGroupMockingExtension.GetDeletedWorkspaces", "value", null, cancellationToken); } /// @@ -169,7 +314,7 @@ public virtual AsyncPageable GetDeletedWor public virtual Pageable GetDeletedWorkspaces(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetDeletedWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsResourceGroupMockingExtension.GetDeletedWorkspaces", "value", null, cancellationToken); } } } diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsSubscriptionMockingExtension.cs similarity index 90% rename from sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsSubscriptionMockingExtension.cs index 8891deb9d526..f80501866bb3 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/Extensions/OperationalInsightsSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.OperationalInsights; -namespace Azure.ResourceManager.OperationalInsights +namespace Azure.ResourceManager.OperationalInsights.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class OperationalInsightsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _logAnalyticsQueryPackQueryPacksClientDiagnostics; private QueryPacksRestOperations _logAnalyticsQueryPackQueryPacksRestClient; @@ -26,15 +27,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _deletedWorkspacesClientDiagnostics; private DeletedWorkspacesRestOperations _deletedWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected OperationalInsightsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal OperationalInsightsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -72,7 +73,7 @@ public virtual AsyncPageable GetLogAnalyticsQuery { HttpMessage FirstPageRequest(int? pageSizeHint) => LogAnalyticsQueryPackQueryPacksRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LogAnalyticsQueryPackQueryPacksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LogAnalyticsQueryPackResource(Client, LogAnalyticsQueryPackData.DeserializeLogAnalyticsQueryPackData(e)), LogAnalyticsQueryPackQueryPacksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLogAnalyticsQueryPacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LogAnalyticsQueryPackResource(Client, LogAnalyticsQueryPackData.DeserializeLogAnalyticsQueryPackData(e)), LogAnalyticsQueryPackQueryPacksClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetLogAnalyticsQueryPacks", "value", "nextLink", cancellationToken); } /// @@ -94,7 +95,7 @@ public virtual Pageable GetLogAnalyticsQueryPacks { HttpMessage FirstPageRequest(int? pageSizeHint) => LogAnalyticsQueryPackQueryPacksRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LogAnalyticsQueryPackQueryPacksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LogAnalyticsQueryPackResource(Client, LogAnalyticsQueryPackData.DeserializeLogAnalyticsQueryPackData(e)), LogAnalyticsQueryPackQueryPacksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLogAnalyticsQueryPacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LogAnalyticsQueryPackResource(Client, LogAnalyticsQueryPackData.DeserializeLogAnalyticsQueryPackData(e)), LogAnalyticsQueryPackQueryPacksClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetLogAnalyticsQueryPacks", "value", "nextLink", cancellationToken); } /// @@ -116,7 +117,7 @@ public virtual AsyncPageable GetOperationalI { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalInsightsClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationalInsightsClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperationalInsightsClusterResource(Client, OperationalInsightsClusterData.DeserializeOperationalInsightsClusterData(e)), OperationalInsightsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalInsightsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperationalInsightsClusterResource(Client, OperationalInsightsClusterData.DeserializeOperationalInsightsClusterData(e)), OperationalInsightsClusterClustersClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetOperationalInsightsClusters", "value", "nextLink", cancellationToken); } /// @@ -138,7 +139,7 @@ public virtual Pageable GetOperationalInsigh { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalInsightsClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationalInsightsClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperationalInsightsClusterResource(Client, OperationalInsightsClusterData.DeserializeOperationalInsightsClusterData(e)), OperationalInsightsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalInsightsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperationalInsightsClusterResource(Client, OperationalInsightsClusterData.DeserializeOperationalInsightsClusterData(e)), OperationalInsightsClusterClustersClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetOperationalInsightsClusters", "value", "nextLink", cancellationToken); } /// @@ -159,7 +160,7 @@ public virtual Pageable GetOperationalInsigh public virtual AsyncPageable GetOperationalInsightsWorkspacesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalInsightsWorkspaceWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), OperationalInsightsWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalInsightsWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), OperationalInsightsWorkspaceWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetOperationalInsightsWorkspaces", "value", null, cancellationToken); } /// @@ -180,7 +181,7 @@ public virtual AsyncPageable GetOperationa public virtual Pageable GetOperationalInsightsWorkspaces(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationalInsightsWorkspaceWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), OperationalInsightsWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOperationalInsightsWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), OperationalInsightsWorkspaceWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetOperationalInsightsWorkspaces", "value", null, cancellationToken); } /// @@ -201,7 +202,7 @@ public virtual Pageable GetOperationalInsi public virtual AsyncPageable GetDeletedWorkspacesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetDeletedWorkspaces", "value", null, cancellationToken); } /// @@ -222,7 +223,7 @@ public virtual AsyncPageable GetDeletedWor public virtual Pageable GetDeletedWorkspaces(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedWorkspacesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedWorkspaces", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new OperationalInsightsWorkspaceResource(Client, OperationalInsightsWorkspaceData.DeserializeOperationalInsightsWorkspaceData(e)), DeletedWorkspacesClientDiagnostics, Pipeline, "OperationalInsightsSubscriptionMockingExtension.GetDeletedWorkspaces", "value", null, cancellationToken); } } } diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/LogAnalyticsQueryPackResource.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/LogAnalyticsQueryPackResource.cs index 41b88691c0d3..22e61271ed3d 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/LogAnalyticsQueryPackResource.cs +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/LogAnalyticsQueryPackResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LogAnalyticsQueryResources and their operations over a LogAnalyticsQueryResource. public virtual LogAnalyticsQueryCollection GetLogAnalyticsQueries() { - return GetCachedClient(Client => new LogAnalyticsQueryCollection(Client, Id)); + return GetCachedClient(client => new LogAnalyticsQueryCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual LogAnalyticsQueryCollection GetLogAnalyticsQueries() /// /// The id of a specific query defined in the Log Analytics QueryPack. /// The cancellation token to use. - /// 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> GetLogAnalyticsQueryAsync(string id, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetLogAnalyticsQu /// /// The id of a specific query defined in the Log Analytics QueryPack. /// The cancellation token to use. - /// 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 GetLogAnalyticsQuery(string id, CancellationToken cancellationToken = default) { diff --git a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/OperationalInsightsWorkspaceResource.cs b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/OperationalInsightsWorkspaceResource.cs index 95ad403fe13e..0a505ed9705f 100644 --- a/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/OperationalInsightsWorkspaceResource.cs +++ b/sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/src/Generated/OperationalInsightsWorkspaceResource.cs @@ -126,7 +126,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of OperationalInsightsDataExportResources and their operations over a OperationalInsightsDataExportResource. public virtual OperationalInsightsDataExportCollection GetOperationalInsightsDataExports() { - return GetCachedClient(Client => new OperationalInsightsDataExportCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsDataExportCollection(client, Id)); } /// @@ -144,8 +144,8 @@ public virtual OperationalInsightsDataExportCollection GetOperationalInsightsDat /// /// The data export rule name. /// The cancellation token to use. - /// 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> GetOperationalInsightsDataExportAsync(string dataExportName, CancellationToken cancellationToken = default) { @@ -167,8 +167,8 @@ public virtual async Task> GetOp /// /// The data export rule name. /// The cancellation token to use. - /// 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 GetOperationalInsightsDataExport(string dataExportName, CancellationToken cancellationToken = default) { @@ -179,7 +179,7 @@ public virtual Response GetOperationalIns /// An object representing collection of OperationalInsightsDataSourceResources and their operations over a OperationalInsightsDataSourceResource. public virtual OperationalInsightsDataSourceCollection GetOperationalInsightsDataSources() { - return GetCachedClient(Client => new OperationalInsightsDataSourceCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsDataSourceCollection(client, Id)); } /// @@ -197,8 +197,8 @@ public virtual OperationalInsightsDataSourceCollection GetOperationalInsightsDat /// /// Name of the datasource. /// The cancellation token to use. - /// 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> GetOperationalInsightsDataSourceAsync(string dataSourceName, CancellationToken cancellationToken = default) { @@ -220,8 +220,8 @@ public virtual async Task> GetOp /// /// Name of the datasource. /// The cancellation token to use. - /// 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 GetOperationalInsightsDataSource(string dataSourceName, CancellationToken cancellationToken = default) { @@ -232,7 +232,7 @@ public virtual Response GetOperationalIns /// An object representing collection of OperationalInsightsLinkedServiceResources and their operations over a OperationalInsightsLinkedServiceResource. public virtual OperationalInsightsLinkedServiceCollection GetOperationalInsightsLinkedServices() { - return GetCachedClient(Client => new OperationalInsightsLinkedServiceCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsLinkedServiceCollection(client, Id)); } /// @@ -250,8 +250,8 @@ public virtual OperationalInsightsLinkedServiceCollection GetOperationalInsights /// /// Name of the linked service. /// The cancellation token to use. - /// 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> GetOperationalInsightsLinkedServiceAsync(string linkedServiceName, CancellationToken cancellationToken = default) { @@ -273,8 +273,8 @@ public virtual async Task> Ge /// /// Name of the linked service. /// The cancellation token to use. - /// 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 GetOperationalInsightsLinkedService(string linkedServiceName, CancellationToken cancellationToken = default) { @@ -285,7 +285,7 @@ public virtual Response GetOperational /// An object representing collection of OperationalInsightsLinkedStorageAccountsResources and their operations over a OperationalInsightsLinkedStorageAccountsResource. public virtual OperationalInsightsLinkedStorageAccountsCollection GetAllOperationalInsightsLinkedStorageAccounts() { - return GetCachedClient(Client => new OperationalInsightsLinkedStorageAccountsCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsLinkedStorageAccountsCollection(client, Id)); } /// @@ -334,7 +334,7 @@ public virtual Response GetOpe /// An object representing collection of StorageInsightResources and their operations over a StorageInsightResource. public virtual StorageInsightCollection GetStorageInsights() { - return GetCachedClient(Client => new StorageInsightCollection(Client, Id)); + return GetCachedClient(client => new StorageInsightCollection(client, Id)); } /// @@ -352,8 +352,8 @@ public virtual StorageInsightCollection GetStorageInsights() /// /// Name of the storageInsightsConfigs resource. /// The cancellation token to use. - /// 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> GetStorageInsightAsync(string storageInsightName, CancellationToken cancellationToken = default) { @@ -375,8 +375,8 @@ public virtual async Task> GetStorageInsightAsy /// /// Name of the storageInsightsConfigs resource. /// The cancellation token to use. - /// 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 GetStorageInsight(string storageInsightName, CancellationToken cancellationToken = default) { @@ -387,7 +387,7 @@ public virtual Response GetStorageInsight(string storage /// An object representing collection of OperationalInsightsSavedSearchResources and their operations over a OperationalInsightsSavedSearchResource. public virtual OperationalInsightsSavedSearchCollection GetOperationalInsightsSavedSearches() { - return GetCachedClient(Client => new OperationalInsightsSavedSearchCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsSavedSearchCollection(client, Id)); } /// @@ -405,8 +405,8 @@ public virtual OperationalInsightsSavedSearchCollection GetOperationalInsightsSa /// /// The id of the saved search. /// The cancellation token to use. - /// 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> GetOperationalInsightsSavedSearchAsync(string savedSearchId, CancellationToken cancellationToken = default) { @@ -428,8 +428,8 @@ public virtual async Task> GetO /// /// The id of the saved search. /// The cancellation token to use. - /// 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 GetOperationalInsightsSavedSearch(string savedSearchId, CancellationToken cancellationToken = default) { @@ -440,7 +440,7 @@ public virtual Response GetOperationalIn /// An object representing collection of OperationalInsightsTableResources and their operations over a OperationalInsightsTableResource. public virtual OperationalInsightsTableCollection GetOperationalInsightsTables() { - return GetCachedClient(Client => new OperationalInsightsTableCollection(Client, Id)); + return GetCachedClient(client => new OperationalInsightsTableCollection(client, Id)); } /// @@ -458,8 +458,8 @@ public virtual OperationalInsightsTableCollection GetOperationalInsightsTables() /// /// The name of the table. /// The cancellation token to use. - /// 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> GetOperationalInsightsTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -481,8 +481,8 @@ public virtual async Task> GetOperati /// /// The name of the table. /// The cancellation token to use. - /// 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 GetOperationalInsightsTable(string tableName, CancellationToken cancellationToken = default) { diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalArmClientMockingExtension.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalArmClientMockingExtension.cs new file mode 100644 index 000000000000..e1ac2fb23300 --- /dev/null +++ b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Orbital; + +namespace Azure.ResourceManager.Orbital.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class OrbitalArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected OrbitalArmClientMockingExtension() + { + } + + /// 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 OrbitalArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal OrbitalArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OrbitalSpacecraftResource GetOrbitalSpacecraftResource(ResourceIdentifier id) + { + OrbitalSpacecraftResource.ValidateResourceId(id); + return new OrbitalSpacecraftResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OrbitalContactResource GetOrbitalContactResource(ResourceIdentifier id) + { + OrbitalContactResource.ValidateResourceId(id); + return new OrbitalContactResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OrbitalContactProfileResource GetOrbitalContactProfileResource(ResourceIdentifier id) + { + OrbitalContactProfileResource.ValidateResourceId(id); + return new OrbitalContactProfileResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvailableGroundStationResource GetAvailableGroundStationResource(ResourceIdentifier id) + { + AvailableGroundStationResource.ValidateResourceId(id); + return new AvailableGroundStationResource(Client, id); + } + } +} diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalExtensions.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalExtensions.cs index c358ea26e85f..969ff1e75a35 100644 --- a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalExtensions.cs +++ b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Orbital.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Orbital @@ -18,119 +19,97 @@ namespace Azure.ResourceManager.Orbital /// A class to add extension methods to Azure.ResourceManager.Orbital. public static partial class OrbitalExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static OrbitalArmClientMockingExtension GetOrbitalArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new OrbitalArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static OrbitalResourceGroupMockingExtension GetOrbitalResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new OrbitalResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static OrbitalSubscriptionMockingExtension GetOrbitalSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new OrbitalSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region OrbitalSpacecraftResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OrbitalSpacecraftResource GetOrbitalSpacecraftResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OrbitalSpacecraftResource.ValidateResourceId(id); - return new OrbitalSpacecraftResource(client, id); - } - ); + return GetOrbitalArmClientMockingExtension(client).GetOrbitalSpacecraftResource(id); } - #endregion - #region OrbitalContactResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OrbitalContactResource GetOrbitalContactResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OrbitalContactResource.ValidateResourceId(id); - return new OrbitalContactResource(client, id); - } - ); + return GetOrbitalArmClientMockingExtension(client).GetOrbitalContactResource(id); } - #endregion - #region OrbitalContactProfileResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OrbitalContactProfileResource GetOrbitalContactProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OrbitalContactProfileResource.ValidateResourceId(id); - return new OrbitalContactProfileResource(client, id); - } - ); + return GetOrbitalArmClientMockingExtension(client).GetOrbitalContactProfileResource(id); } - #endregion - #region AvailableGroundStationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvailableGroundStationResource GetAvailableGroundStationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvailableGroundStationResource.ValidateResourceId(id); - return new AvailableGroundStationResource(client, id); - } - ); + return GetOrbitalArmClientMockingExtension(client).GetAvailableGroundStationResource(id); } - #endregion - /// Gets a collection of OrbitalSpacecraftResources in the ResourceGroupResource. + /// + /// Gets a collection of OrbitalSpacecraftResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of OrbitalSpacecraftResources and their operations over a OrbitalSpacecraftResource. public static OrbitalSpacecraftCollection GetOrbitalSpacecrafts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetOrbitalSpacecrafts(); + return GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalSpacecrafts(); } /// @@ -145,16 +124,20 @@ public static OrbitalSpacecraftCollection GetOrbitalSpacecrafts(this ResourceGro /// Spacecrafts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Spacecraft ID. /// The cancellation token to use. - /// 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 static async Task> GetOrbitalSpacecraftAsync(this ResourceGroupResource resourceGroupResource, string spacecraftName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetOrbitalSpacecrafts().GetAsync(spacecraftName, cancellationToken).ConfigureAwait(false); + return await GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalSpacecraftAsync(spacecraftName, cancellationToken).ConfigureAwait(false); } /// @@ -169,24 +152,34 @@ public static async Task> GetOrbitalSpacecra /// Spacecrafts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Spacecraft ID. /// The cancellation token to use. - /// 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 static Response GetOrbitalSpacecraft(this ResourceGroupResource resourceGroupResource, string spacecraftName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetOrbitalSpacecrafts().Get(spacecraftName, cancellationToken); + return GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalSpacecraft(spacecraftName, cancellationToken); } - /// Gets a collection of OrbitalContactProfileResources in the ResourceGroupResource. + /// + /// Gets a collection of OrbitalContactProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of OrbitalContactProfileResources and their operations over a OrbitalContactProfileResource. public static OrbitalContactProfileCollection GetOrbitalContactProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetOrbitalContactProfiles(); + return GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalContactProfiles(); } /// @@ -201,16 +194,20 @@ public static OrbitalContactProfileCollection GetOrbitalContactProfiles(this Res /// ContactProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Contact Profile name. /// The cancellation token to use. - /// 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 static async Task> GetOrbitalContactProfileAsync(this ResourceGroupResource resourceGroupResource, string contactProfileName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetOrbitalContactProfiles().GetAsync(contactProfileName, cancellationToken).ConfigureAwait(false); + return await GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalContactProfileAsync(contactProfileName, cancellationToken).ConfigureAwait(false); } /// @@ -225,24 +222,34 @@ public static async Task> GetOrbitalCont /// ContactProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Contact Profile name. /// The cancellation token to use. - /// 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 static Response GetOrbitalContactProfile(this ResourceGroupResource resourceGroupResource, string contactProfileName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetOrbitalContactProfiles().Get(contactProfileName, cancellationToken); + return GetOrbitalResourceGroupMockingExtension(resourceGroupResource).GetOrbitalContactProfile(contactProfileName, cancellationToken); } - /// Gets a collection of AvailableGroundStationResources in the SubscriptionResource. + /// + /// Gets a collection of AvailableGroundStationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AvailableGroundStationResources and their operations over a AvailableGroundStationResource. public static AvailableGroundStationCollection GetAvailableGroundStations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableGroundStations(); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetAvailableGroundStations(); } /// @@ -257,16 +264,20 @@ public static AvailableGroundStationCollection GetAvailableGroundStations(this S /// AvailableGroundStations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Ground Station name. /// The cancellation token to use. - /// 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 static async Task> GetAvailableGroundStationAsync(this SubscriptionResource subscriptionResource, string groundStationName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAvailableGroundStations().GetAsync(groundStationName, cancellationToken).ConfigureAwait(false); + return await GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetAvailableGroundStationAsync(groundStationName, cancellationToken).ConfigureAwait(false); } /// @@ -281,16 +292,20 @@ public static async Task> GetAvailableG /// AvailableGroundStations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Ground Station name. /// The cancellation token to use. - /// 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 static Response GetAvailableGroundStation(this SubscriptionResource subscriptionResource, string groundStationName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAvailableGroundStations().Get(groundStationName, cancellationToken); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetAvailableGroundStation(groundStationName, cancellationToken); } /// @@ -305,6 +320,10 @@ public static Response GetAvailableGroundStation /// Spacecrafts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous list operation call returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -312,7 +331,7 @@ public static Response GetAvailableGroundStation /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOrbitalSpacecraftsAsync(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOrbitalSpacecraftsAsync(skiptoken, cancellationToken); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetOrbitalSpacecraftsAsync(skiptoken, cancellationToken); } /// @@ -327,6 +346,10 @@ public static AsyncPageable GetOrbitalSpacecraftsAsyn /// Spacecrafts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous list operation call returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -334,7 +357,7 @@ public static AsyncPageable GetOrbitalSpacecraftsAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOrbitalSpacecrafts(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOrbitalSpacecrafts(skiptoken, cancellationToken); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetOrbitalSpacecrafts(skiptoken, cancellationToken); } /// @@ -349,6 +372,10 @@ public static Pageable GetOrbitalSpacecrafts(this Sub /// ContactProfiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous list operation call returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -356,7 +383,7 @@ public static Pageable GetOrbitalSpacecrafts(this Sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOrbitalContactProfilesAsync(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOrbitalContactProfilesAsync(skiptoken, cancellationToken); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetOrbitalContactProfilesAsync(skiptoken, cancellationToken); } /// @@ -371,6 +398,10 @@ public static AsyncPageable GetOrbitalContactProf /// ContactProfiles_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous list operation call returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -378,7 +409,7 @@ public static AsyncPageable GetOrbitalContactProf /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOrbitalContactProfiles(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOrbitalContactProfiles(skiptoken, cancellationToken); + return GetOrbitalSubscriptionMockingExtension(subscriptionResource).GetOrbitalContactProfiles(skiptoken, cancellationToken); } } } diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalResourceGroupMockingExtension.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..360c33675b4d --- /dev/null +++ b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Orbital; + +namespace Azure.ResourceManager.Orbital.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class OrbitalResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected OrbitalResourceGroupMockingExtension() + { + } + + /// 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 OrbitalResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of OrbitalSpacecraftResources in the ResourceGroupResource. + /// An object representing collection of OrbitalSpacecraftResources and their operations over a OrbitalSpacecraftResource. + public virtual OrbitalSpacecraftCollection GetOrbitalSpacecrafts() + { + return GetCachedClient(client => new OrbitalSpacecraftCollection(client, Id)); + } + + /// + /// Gets the specified spacecraft in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName} + /// + /// + /// Operation Id + /// Spacecrafts_Get + /// + /// + /// + /// Spacecraft ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOrbitalSpacecraftAsync(string spacecraftName, CancellationToken cancellationToken = default) + { + return await GetOrbitalSpacecrafts().GetAsync(spacecraftName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified spacecraft in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName} + /// + /// + /// Operation Id + /// Spacecrafts_Get + /// + /// + /// + /// Spacecraft ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOrbitalSpacecraft(string spacecraftName, CancellationToken cancellationToken = default) + { + return GetOrbitalSpacecrafts().Get(spacecraftName, cancellationToken); + } + + /// Gets a collection of OrbitalContactProfileResources in the ResourceGroupResource. + /// An object representing collection of OrbitalContactProfileResources and their operations over a OrbitalContactProfileResource. + public virtual OrbitalContactProfileCollection GetOrbitalContactProfiles() + { + return GetCachedClient(client => new OrbitalContactProfileCollection(client, Id)); + } + + /// + /// Gets the specified contact Profile in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName} + /// + /// + /// Operation Id + /// ContactProfiles_Get + /// + /// + /// + /// Contact Profile name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOrbitalContactProfileAsync(string contactProfileName, CancellationToken cancellationToken = default) + { + return await GetOrbitalContactProfiles().GetAsync(contactProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified contact Profile in a specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName} + /// + /// + /// Operation Id + /// ContactProfiles_Get + /// + /// + /// + /// Contact Profile name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOrbitalContactProfile(string contactProfileName, CancellationToken cancellationToken = default) + { + return GetOrbitalContactProfiles().Get(contactProfileName, cancellationToken); + } + } +} diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalSubscriptionMockingExtension.cs similarity index 75% rename from sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalSubscriptionMockingExtension.cs index 68fbde0c3f7a..2b20f6d9551f 100644 --- a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/OrbitalSubscriptionMockingExtension.cs @@ -5,32 +5,35 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Orbital; -namespace Azure.ResourceManager.Orbital +namespace Azure.ResourceManager.Orbital.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class OrbitalSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _orbitalSpacecraftSpacecraftsClientDiagnostics; private SpacecraftsRestOperations _orbitalSpacecraftSpacecraftsRestClient; private ClientDiagnostics _orbitalContactProfileContactProfilesClientDiagnostics; private ContactProfilesRestOperations _orbitalContactProfileContactProfilesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected OrbitalSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal OrbitalSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -49,7 +52,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of AvailableGroundStationResources and their operations over a AvailableGroundStationResource. public virtual AvailableGroundStationCollection GetAvailableGroundStations() { - return GetCachedClient(Client => new AvailableGroundStationCollection(Client, Id)); + return GetCachedClient(client => new AvailableGroundStationCollection(client, Id)); + } + + /// + /// Gets the specified available ground station. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations/{groundStationName} + /// + /// + /// Operation Id + /// AvailableGroundStations_Get + /// + /// + /// + /// Ground Station name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvailableGroundStationAsync(string groundStationName, CancellationToken cancellationToken = default) + { + return await GetAvailableGroundStations().GetAsync(groundStationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified available ground station. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations/{groundStationName} + /// + /// + /// Operation Id + /// AvailableGroundStations_Get + /// + /// + /// + /// Ground Station name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvailableGroundStation(string groundStationName, CancellationToken cancellationToken = default) + { + return GetAvailableGroundStations().Get(groundStationName, cancellationToken); } /// @@ -72,7 +121,7 @@ public virtual AsyncPageable GetOrbitalSpacecraftsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => OrbitalSpacecraftSpacecraftsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrbitalSpacecraftSpacecraftsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OrbitalSpacecraftResource(Client, OrbitalSpacecraftData.DeserializeOrbitalSpacecraftData(e)), OrbitalSpacecraftSpacecraftsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOrbitalSpacecrafts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OrbitalSpacecraftResource(Client, OrbitalSpacecraftData.DeserializeOrbitalSpacecraftData(e)), OrbitalSpacecraftSpacecraftsClientDiagnostics, Pipeline, "OrbitalSubscriptionMockingExtension.GetOrbitalSpacecrafts", "value", "nextLink", cancellationToken); } /// @@ -95,7 +144,7 @@ public virtual Pageable GetOrbitalSpacecrafts(string { HttpMessage FirstPageRequest(int? pageSizeHint) => OrbitalSpacecraftSpacecraftsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrbitalSpacecraftSpacecraftsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OrbitalSpacecraftResource(Client, OrbitalSpacecraftData.DeserializeOrbitalSpacecraftData(e)), OrbitalSpacecraftSpacecraftsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOrbitalSpacecrafts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OrbitalSpacecraftResource(Client, OrbitalSpacecraftData.DeserializeOrbitalSpacecraftData(e)), OrbitalSpacecraftSpacecraftsClientDiagnostics, Pipeline, "OrbitalSubscriptionMockingExtension.GetOrbitalSpacecrafts", "value", "nextLink", cancellationToken); } /// @@ -118,7 +167,7 @@ public virtual AsyncPageable GetOrbitalContactPro { HttpMessage FirstPageRequest(int? pageSizeHint) => OrbitalContactProfileContactProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrbitalContactProfileContactProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OrbitalContactProfileResource(Client, OrbitalContactProfileData.DeserializeOrbitalContactProfileData(e)), OrbitalContactProfileContactProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOrbitalContactProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OrbitalContactProfileResource(Client, OrbitalContactProfileData.DeserializeOrbitalContactProfileData(e)), OrbitalContactProfileContactProfilesClientDiagnostics, Pipeline, "OrbitalSubscriptionMockingExtension.GetOrbitalContactProfiles", "value", "nextLink", cancellationToken); } /// @@ -141,7 +190,7 @@ public virtual Pageable GetOrbitalContactProfiles { HttpMessage FirstPageRequest(int? pageSizeHint) => OrbitalContactProfileContactProfilesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OrbitalContactProfileContactProfilesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OrbitalContactProfileResource(Client, OrbitalContactProfileData.DeserializeOrbitalContactProfileData(e)), OrbitalContactProfileContactProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOrbitalContactProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OrbitalContactProfileResource(Client, OrbitalContactProfileData.DeserializeOrbitalContactProfileData(e)), OrbitalContactProfileContactProfilesClientDiagnostics, Pipeline, "OrbitalSubscriptionMockingExtension.GetOrbitalContactProfiles", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e452e4ac0f9a..000000000000 --- a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Orbital -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of OrbitalSpacecraftResources in the ResourceGroupResource. - /// An object representing collection of OrbitalSpacecraftResources and their operations over a OrbitalSpacecraftResource. - public virtual OrbitalSpacecraftCollection GetOrbitalSpacecrafts() - { - return GetCachedClient(Client => new OrbitalSpacecraftCollection(Client, Id)); - } - - /// Gets a collection of OrbitalContactProfileResources in the ResourceGroupResource. - /// An object representing collection of OrbitalContactProfileResources and their operations over a OrbitalContactProfileResource. - public virtual OrbitalContactProfileCollection GetOrbitalContactProfiles() - { - return GetCachedClient(Client => new OrbitalContactProfileCollection(Client, Id)); - } - } -} diff --git a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/OrbitalSpacecraftResource.cs b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/OrbitalSpacecraftResource.cs index 0d5cc47dcd23..88e5a14a3719 100644 --- a/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/OrbitalSpacecraftResource.cs +++ b/sdk/orbital/Azure.ResourceManager.Orbital/src/Generated/OrbitalSpacecraftResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of OrbitalContactResources and their operations over a OrbitalContactResource. public virtual OrbitalContactCollection GetOrbitalContacts() { - return GetCachedClient(Client => new OrbitalContactCollection(Client, Id)); + return GetCachedClient(client => new OrbitalContactCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual OrbitalContactCollection GetOrbitalContacts() /// /// Contact name. /// The cancellation token to use. - /// 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> GetOrbitalContactAsync(string contactName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetOrbitalContactAsy /// /// Contact name. /// The cancellation token to use. - /// 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 GetOrbitalContact(string contactName, CancellationToken cancellationToken = default) { diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/NgfwExtensions.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/NgfwExtensions.cs index 6babf1d380ef..30fca4219b7c 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/NgfwExtensions.cs +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/NgfwExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.PaloAltoNetworks.Ngfw.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw @@ -18,306 +19,246 @@ namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw /// A class to add extension methods to Azure.ResourceManager.PaloAltoNetworks.Ngfw. public static partial class NgfwExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PaloAltoNetworksNgfwArmClientMockingExtension GetPaloAltoNetworksNgfwArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PaloAltoNetworksNgfwArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PaloAltoNetworksNgfwResourceGroupMockingExtension GetPaloAltoNetworksNgfwResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PaloAltoNetworksNgfwResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PaloAltoNetworksNgfwSubscriptionMockingExtension GetPaloAltoNetworksNgfwSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PaloAltoNetworksNgfwSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PaloAltoNetworksNgfwTenantMockingExtension GetPaloAltoNetworksNgfwTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PaloAltoNetworksNgfwTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region GlobalRulestackResource /// /// 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. /// Returns a object. public static GlobalRulestackResource GetGlobalRulestackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GlobalRulestackResource.ValidateResourceId(id); - return new GlobalRulestackResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetGlobalRulestackResource(id); } - #endregion - #region GlobalRulestackCertificateObjectResource /// /// 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. /// Returns a object. public static GlobalRulestackCertificateObjectResource GetGlobalRulestackCertificateObjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GlobalRulestackCertificateObjectResource.ValidateResourceId(id); - return new GlobalRulestackCertificateObjectResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetGlobalRulestackCertificateObjectResource(id); } - #endregion - #region GlobalRulestackFqdnResource /// /// 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. /// Returns a object. public static GlobalRulestackFqdnResource GetGlobalRulestackFqdnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GlobalRulestackFqdnResource.ValidateResourceId(id); - return new GlobalRulestackFqdnResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetGlobalRulestackFqdnResource(id); } - #endregion - #region PostRulestackRuleResource /// /// 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. /// Returns a object. public static PostRulestackRuleResource GetPostRulestackRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostRulestackRuleResource.ValidateResourceId(id); - return new PostRulestackRuleResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetPostRulestackRuleResource(id); } - #endregion - #region GlobalRulestackPrefixResource /// /// 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. /// Returns a object. public static GlobalRulestackPrefixResource GetGlobalRulestackPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GlobalRulestackPrefixResource.ValidateResourceId(id); - return new GlobalRulestackPrefixResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetGlobalRulestackPrefixResource(id); } - #endregion - #region PreRulestackRuleResource /// /// 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. /// Returns a object. public static PreRulestackRuleResource GetPreRulestackRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PreRulestackRuleResource.ValidateResourceId(id); - return new PreRulestackRuleResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetPreRulestackRuleResource(id); } - #endregion - #region PaloAltoNetworksFirewallResource /// /// 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. /// Returns a object. public static PaloAltoNetworksFirewallResource GetPaloAltoNetworksFirewallResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PaloAltoNetworksFirewallResource.ValidateResourceId(id); - return new PaloAltoNetworksFirewallResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetPaloAltoNetworksFirewallResource(id); } - #endregion - #region LocalRulestackResource /// /// 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. /// Returns a object. public static LocalRulestackResource GetLocalRulestackResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalRulestackResource.ValidateResourceId(id); - return new LocalRulestackResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetLocalRulestackResource(id); } - #endregion - #region PaloAltoNetworksFirewallStatusResource /// /// 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. /// Returns a object. public static PaloAltoNetworksFirewallStatusResource GetPaloAltoNetworksFirewallStatusResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PaloAltoNetworksFirewallStatusResource.ValidateResourceId(id); - return new PaloAltoNetworksFirewallStatusResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetPaloAltoNetworksFirewallStatusResource(id); } - #endregion - #region LocalRulestackCertificateObjectResource /// /// 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. /// Returns a object. public static LocalRulestackCertificateObjectResource GetLocalRulestackCertificateObjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalRulestackCertificateObjectResource.ValidateResourceId(id); - return new LocalRulestackCertificateObjectResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetLocalRulestackCertificateObjectResource(id); } - #endregion - #region LocalRulestackFqdnResource /// /// 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. /// Returns a object. public static LocalRulestackFqdnResource GetLocalRulestackFqdnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalRulestackFqdnResource.ValidateResourceId(id); - return new LocalRulestackFqdnResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetLocalRulestackFqdnResource(id); } - #endregion - #region LocalRulestackRuleResource /// /// 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. /// Returns a object. public static LocalRulestackRuleResource GetLocalRulestackRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalRulestackRuleResource.ValidateResourceId(id); - return new LocalRulestackRuleResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetLocalRulestackRuleResource(id); } - #endregion - #region LocalRulestackPrefixResource /// /// 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. /// Returns a object. public static LocalRulestackPrefixResource GetLocalRulestackPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LocalRulestackPrefixResource.ValidateResourceId(id); - return new LocalRulestackPrefixResource(client, id); - } - ); + return GetPaloAltoNetworksNgfwArmClientMockingExtension(client).GetLocalRulestackPrefixResource(id); } - #endregion - /// Gets a collection of PaloAltoNetworksFirewallResources in the ResourceGroupResource. + /// + /// Gets a collection of PaloAltoNetworksFirewallResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PaloAltoNetworksFirewallResources and their operations over a PaloAltoNetworksFirewallResource. public static PaloAltoNetworksFirewallCollection GetPaloAltoNetworksFirewalls(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPaloAltoNetworksFirewalls(); + return GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetPaloAltoNetworksFirewalls(); } /// @@ -332,16 +273,20 @@ public static PaloAltoNetworksFirewallCollection GetPaloAltoNetworksFirewalls(th /// Firewalls_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Firewall resource name. /// The cancellation token to use. - /// 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 static async Task> GetPaloAltoNetworksFirewallAsync(this ResourceGroupResource resourceGroupResource, string firewallName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPaloAltoNetworksFirewalls().GetAsync(firewallName, cancellationToken).ConfigureAwait(false); + return await GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetPaloAltoNetworksFirewallAsync(firewallName, cancellationToken).ConfigureAwait(false); } /// @@ -356,24 +301,34 @@ public static async Task> GetPaloAlto /// Firewalls_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Firewall resource name. /// The cancellation token to use. - /// 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 static Response GetPaloAltoNetworksFirewall(this ResourceGroupResource resourceGroupResource, string firewallName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPaloAltoNetworksFirewalls().Get(firewallName, cancellationToken); + return GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetPaloAltoNetworksFirewall(firewallName, cancellationToken); } - /// Gets a collection of LocalRulestackResources in the ResourceGroupResource. + /// + /// Gets a collection of LocalRulestackResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of LocalRulestackResources and their operations over a LocalRulestackResource. public static LocalRulestackCollection GetLocalRulestacks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLocalRulestacks(); + return GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetLocalRulestacks(); } /// @@ -388,16 +343,20 @@ public static LocalRulestackCollection GetLocalRulestacks(this ResourceGroupReso /// LocalRulestacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// LocalRulestack resource name. /// The cancellation token to use. - /// 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 static async Task> GetLocalRulestackAsync(this ResourceGroupResource resourceGroupResource, string localRulestackName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetLocalRulestacks().GetAsync(localRulestackName, cancellationToken).ConfigureAwait(false); + return await GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetLocalRulestackAsync(localRulestackName, cancellationToken).ConfigureAwait(false); } /// @@ -412,16 +371,20 @@ public static async Task> GetLocalRulestackAsyn /// LocalRulestacks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// LocalRulestack resource name. /// The cancellation token to use. - /// 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 static Response GetLocalRulestack(this ResourceGroupResource resourceGroupResource, string localRulestackName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetLocalRulestacks().Get(localRulestackName, cancellationToken); + return GetPaloAltoNetworksNgfwResourceGroupMockingExtension(resourceGroupResource).GetLocalRulestack(localRulestackName, cancellationToken); } /// @@ -436,13 +399,17 @@ public static Response GetLocalRulestack(this ResourceGr /// Firewalls_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPaloAltoNetworksFirewallsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPaloAltoNetworksFirewallsAsync(cancellationToken); + return GetPaloAltoNetworksNgfwSubscriptionMockingExtension(subscriptionResource).GetPaloAltoNetworksFirewallsAsync(cancellationToken); } /// @@ -457,13 +424,17 @@ public static AsyncPageable GetPaloAltoNetwork /// Firewalls_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPaloAltoNetworksFirewalls(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPaloAltoNetworksFirewalls(cancellationToken); + return GetPaloAltoNetworksNgfwSubscriptionMockingExtension(subscriptionResource).GetPaloAltoNetworksFirewalls(cancellationToken); } /// @@ -478,13 +449,17 @@ public static Pageable GetPaloAltoNetworksFire /// LocalRulestacks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLocalRulestacksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocalRulestacksAsync(cancellationToken); + return GetPaloAltoNetworksNgfwSubscriptionMockingExtension(subscriptionResource).GetLocalRulestacksAsync(cancellationToken); } /// @@ -499,21 +474,31 @@ public static AsyncPageable GetLocalRulestacksAsync(this /// LocalRulestacks_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLocalRulestacks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocalRulestacks(cancellationToken); + return GetPaloAltoNetworksNgfwSubscriptionMockingExtension(subscriptionResource).GetLocalRulestacks(cancellationToken); } - /// Gets a collection of GlobalRulestackResources in the TenantResource. + /// + /// Gets a collection of GlobalRulestackResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of GlobalRulestackResources and their operations over a GlobalRulestackResource. public static GlobalRulestackCollection GetGlobalRulestacks(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetGlobalRulestacks(); + return GetPaloAltoNetworksNgfwTenantMockingExtension(tenantResource).GetGlobalRulestacks(); } /// @@ -528,16 +513,20 @@ public static GlobalRulestackCollection GetGlobalRulestacks(this TenantResource /// GlobalRulestack_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// GlobalRulestack resource name. /// The cancellation token to use. - /// 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 static async Task> GetGlobalRulestackAsync(this TenantResource tenantResource, string globalRulestackName, CancellationToken cancellationToken = default) { - return await tenantResource.GetGlobalRulestacks().GetAsync(globalRulestackName, cancellationToken).ConfigureAwait(false); + return await GetPaloAltoNetworksNgfwTenantMockingExtension(tenantResource).GetGlobalRulestackAsync(globalRulestackName, cancellationToken).ConfigureAwait(false); } /// @@ -552,16 +541,20 @@ public static async Task> GetGlobalRulestackAs /// GlobalRulestack_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// GlobalRulestack resource name. /// The cancellation token to use. - /// 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 static Response GetGlobalRulestack(this TenantResource tenantResource, string globalRulestackName, CancellationToken cancellationToken = default) { - return tenantResource.GetGlobalRulestacks().Get(globalRulestackName, cancellationToken); + return GetPaloAltoNetworksNgfwTenantMockingExtension(tenantResource).GetGlobalRulestack(globalRulestackName, cancellationToken); } } } diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwArmClientMockingExtension.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwArmClientMockingExtension.cs new file mode 100644 index 000000000000..ecc85af54f92 --- /dev/null +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwArmClientMockingExtension.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PaloAltoNetworks.Ngfw; + +namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PaloAltoNetworksNgfwArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PaloAltoNetworksNgfwArmClientMockingExtension() + { + } + + /// 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 PaloAltoNetworksNgfwArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PaloAltoNetworksNgfwArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual GlobalRulestackResource GetGlobalRulestackResource(ResourceIdentifier id) + { + GlobalRulestackResource.ValidateResourceId(id); + return new GlobalRulestackResource(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 GlobalRulestackCertificateObjectResource GetGlobalRulestackCertificateObjectResource(ResourceIdentifier id) + { + GlobalRulestackCertificateObjectResource.ValidateResourceId(id); + return new GlobalRulestackCertificateObjectResource(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 GlobalRulestackFqdnResource GetGlobalRulestackFqdnResource(ResourceIdentifier id) + { + GlobalRulestackFqdnResource.ValidateResourceId(id); + return new GlobalRulestackFqdnResource(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 PostRulestackRuleResource GetPostRulestackRuleResource(ResourceIdentifier id) + { + PostRulestackRuleResource.ValidateResourceId(id); + return new PostRulestackRuleResource(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 GlobalRulestackPrefixResource GetGlobalRulestackPrefixResource(ResourceIdentifier id) + { + GlobalRulestackPrefixResource.ValidateResourceId(id); + return new GlobalRulestackPrefixResource(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 PreRulestackRuleResource GetPreRulestackRuleResource(ResourceIdentifier id) + { + PreRulestackRuleResource.ValidateResourceId(id); + return new PreRulestackRuleResource(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 PaloAltoNetworksFirewallResource GetPaloAltoNetworksFirewallResource(ResourceIdentifier id) + { + PaloAltoNetworksFirewallResource.ValidateResourceId(id); + return new PaloAltoNetworksFirewallResource(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 LocalRulestackResource GetLocalRulestackResource(ResourceIdentifier id) + { + LocalRulestackResource.ValidateResourceId(id); + return new LocalRulestackResource(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 PaloAltoNetworksFirewallStatusResource GetPaloAltoNetworksFirewallStatusResource(ResourceIdentifier id) + { + PaloAltoNetworksFirewallStatusResource.ValidateResourceId(id); + return new PaloAltoNetworksFirewallStatusResource(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 LocalRulestackCertificateObjectResource GetLocalRulestackCertificateObjectResource(ResourceIdentifier id) + { + LocalRulestackCertificateObjectResource.ValidateResourceId(id); + return new LocalRulestackCertificateObjectResource(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 LocalRulestackFqdnResource GetLocalRulestackFqdnResource(ResourceIdentifier id) + { + LocalRulestackFqdnResource.ValidateResourceId(id); + return new LocalRulestackFqdnResource(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 LocalRulestackRuleResource GetLocalRulestackRuleResource(ResourceIdentifier id) + { + LocalRulestackRuleResource.ValidateResourceId(id); + return new LocalRulestackRuleResource(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 LocalRulestackPrefixResource GetLocalRulestackPrefixResource(ResourceIdentifier id) + { + LocalRulestackPrefixResource.ValidateResourceId(id); + return new LocalRulestackPrefixResource(Client, id); + } + } +} diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwResourceGroupMockingExtension.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..55cda0ce2c41 --- /dev/null +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PaloAltoNetworks.Ngfw; + +namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PaloAltoNetworksNgfwResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PaloAltoNetworksNgfwResourceGroupMockingExtension() + { + } + + /// 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 PaloAltoNetworksNgfwResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PaloAltoNetworksFirewallResources in the ResourceGroupResource. + /// An object representing collection of PaloAltoNetworksFirewallResources and their operations over a PaloAltoNetworksFirewallResource. + public virtual PaloAltoNetworksFirewallCollection GetPaloAltoNetworksFirewalls() + { + return GetCachedClient(client => new PaloAltoNetworksFirewallCollection(client, Id)); + } + + /// + /// Get a FirewallResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName} + /// + /// + /// Operation Id + /// Firewalls_Get + /// + /// + /// + /// Firewall resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPaloAltoNetworksFirewallAsync(string firewallName, CancellationToken cancellationToken = default) + { + return await GetPaloAltoNetworksFirewalls().GetAsync(firewallName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FirewallResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/firewalls/{firewallName} + /// + /// + /// Operation Id + /// Firewalls_Get + /// + /// + /// + /// Firewall resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPaloAltoNetworksFirewall(string firewallName, CancellationToken cancellationToken = default) + { + return GetPaloAltoNetworksFirewalls().Get(firewallName, cancellationToken); + } + + /// Gets a collection of LocalRulestackResources in the ResourceGroupResource. + /// An object representing collection of LocalRulestackResources and their operations over a LocalRulestackResource. + public virtual LocalRulestackCollection GetLocalRulestacks() + { + return GetCachedClient(client => new LocalRulestackCollection(client, Id)); + } + + /// + /// Get a LocalRulestackResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName} + /// + /// + /// Operation Id + /// LocalRulestacks_Get + /// + /// + /// + /// LocalRulestack resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLocalRulestackAsync(string localRulestackName, CancellationToken cancellationToken = default) + { + return await GetLocalRulestacks().GetAsync(localRulestackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a LocalRulestackResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/{localRulestackName} + /// + /// + /// Operation Id + /// LocalRulestacks_Get + /// + /// + /// + /// LocalRulestack resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLocalRulestack(string localRulestackName, CancellationToken cancellationToken = default) + { + return GetLocalRulestacks().Get(localRulestackName, cancellationToken); + } + } +} diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwSubscriptionMockingExtension.cs similarity index 87% rename from sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwSubscriptionMockingExtension.cs index ff35ad18c2d0..475f80ecf0a2 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PaloAltoNetworks.Ngfw; -namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw +namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PaloAltoNetworksNgfwSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _paloAltoNetworksFirewallFirewallsClientDiagnostics; private FirewallsRestOperations _paloAltoNetworksFirewallFirewallsRestClient; private ClientDiagnostics _localRulestackClientDiagnostics; private LocalRulestacksRestOperations _localRulestackRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PaloAltoNetworksNgfwSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PaloAltoNetworksNgfwSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ public virtual AsyncPageable GetPaloAltoNetwor { HttpMessage FirstPageRequest(int? pageSizeHint) => PaloAltoNetworksFirewallFirewallsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PaloAltoNetworksFirewallFirewallsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PaloAltoNetworksFirewallResource(Client, PaloAltoNetworksFirewallData.DeserializePaloAltoNetworksFirewallData(e)), PaloAltoNetworksFirewallFirewallsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPaloAltoNetworksFirewalls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PaloAltoNetworksFirewallResource(Client, PaloAltoNetworksFirewallData.DeserializePaloAltoNetworksFirewallData(e)), PaloAltoNetworksFirewallFirewallsClientDiagnostics, Pipeline, "PaloAltoNetworksNgfwSubscriptionMockingExtension.GetPaloAltoNetworksFirewalls", "value", "nextLink", cancellationToken); } /// @@ -86,7 +87,7 @@ public virtual Pageable GetPaloAltoNetworksFir { HttpMessage FirstPageRequest(int? pageSizeHint) => PaloAltoNetworksFirewallFirewallsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PaloAltoNetworksFirewallFirewallsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PaloAltoNetworksFirewallResource(Client, PaloAltoNetworksFirewallData.DeserializePaloAltoNetworksFirewallData(e)), PaloAltoNetworksFirewallFirewallsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPaloAltoNetworksFirewalls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PaloAltoNetworksFirewallResource(Client, PaloAltoNetworksFirewallData.DeserializePaloAltoNetworksFirewallData(e)), PaloAltoNetworksFirewallFirewallsClientDiagnostics, Pipeline, "PaloAltoNetworksNgfwSubscriptionMockingExtension.GetPaloAltoNetworksFirewalls", "value", "nextLink", cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual AsyncPageable GetLocalRulestacksAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => LocalRulestackRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocalRulestackRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LocalRulestackResource(Client, LocalRulestackData.DeserializeLocalRulestackData(e)), LocalRulestackClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocalRulestacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LocalRulestackResource(Client, LocalRulestackData.DeserializeLocalRulestackData(e)), LocalRulestackClientDiagnostics, Pipeline, "PaloAltoNetworksNgfwSubscriptionMockingExtension.GetLocalRulestacks", "value", "nextLink", cancellationToken); } /// @@ -130,7 +131,7 @@ public virtual Pageable GetLocalRulestacks(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => LocalRulestackRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocalRulestackRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LocalRulestackResource(Client, LocalRulestackData.DeserializeLocalRulestackData(e)), LocalRulestackClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocalRulestacks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LocalRulestackResource(Client, LocalRulestackData.DeserializeLocalRulestackData(e)), LocalRulestackClientDiagnostics, Pipeline, "PaloAltoNetworksNgfwSubscriptionMockingExtension.GetLocalRulestacks", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwTenantMockingExtension.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwTenantMockingExtension.cs new file mode 100644 index 000000000000..703e2364b588 --- /dev/null +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/PaloAltoNetworksNgfwTenantMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PaloAltoNetworks.Ngfw; + +namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class PaloAltoNetworksNgfwTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PaloAltoNetworksNgfwTenantMockingExtension() + { + } + + /// 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 PaloAltoNetworksNgfwTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GlobalRulestackResources in the TenantResource. + /// An object representing collection of GlobalRulestackResources and their operations over a GlobalRulestackResource. + public virtual GlobalRulestackCollection GetGlobalRulestacks() + { + return GetCachedClient(client => new GlobalRulestackCollection(client, Id)); + } + + /// + /// Get a GlobalRulestackResource + /// + /// + /// Request Path + /// /providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName} + /// + /// + /// Operation Id + /// GlobalRulestack_Get + /// + /// + /// + /// GlobalRulestack resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGlobalRulestackAsync(string globalRulestackName, CancellationToken cancellationToken = default) + { + return await GetGlobalRulestacks().GetAsync(globalRulestackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GlobalRulestackResource + /// + /// + /// Request Path + /// /providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/{globalRulestackName} + /// + /// + /// Operation Id + /// GlobalRulestack_Get + /// + /// + /// + /// GlobalRulestack resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGlobalRulestack(string globalRulestackName, CancellationToken cancellationToken = default) + { + return GetGlobalRulestacks().Get(globalRulestackName, cancellationToken); + } + } +} diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 8115d9e6845a..000000000000 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PaloAltoNetworksFirewallResources in the ResourceGroupResource. - /// An object representing collection of PaloAltoNetworksFirewallResources and their operations over a PaloAltoNetworksFirewallResource. - public virtual PaloAltoNetworksFirewallCollection GetPaloAltoNetworksFirewalls() - { - return GetCachedClient(Client => new PaloAltoNetworksFirewallCollection(Client, Id)); - } - - /// Gets a collection of LocalRulestackResources in the ResourceGroupResource. - /// An object representing collection of LocalRulestackResources and their operations over a LocalRulestackResource. - public virtual LocalRulestackCollection GetLocalRulestacks() - { - return GetCachedClient(Client => new LocalRulestackCollection(Client, Id)); - } - } -} diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index d3c08f729398..000000000000 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PaloAltoNetworks.Ngfw -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of GlobalRulestackResources in the TenantResource. - /// An object representing collection of GlobalRulestackResources and their operations over a GlobalRulestackResource. - public virtual GlobalRulestackCollection GetGlobalRulestacks() - { - return GetCachedClient(Client => new GlobalRulestackCollection(Client, Id)); - } - } -} diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/GlobalRulestackResource.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/GlobalRulestackResource.cs index af0fab7f3683..c25b9e6adbba 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/GlobalRulestackResource.cs +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/GlobalRulestackResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GlobalRulestackCertificateObjectResources and their operations over a GlobalRulestackCertificateObjectResource. public virtual GlobalRulestackCertificateObjectCollection GetGlobalRulestackCertificateObjects() { - return GetCachedClient(Client => new GlobalRulestackCertificateObjectCollection(Client, Id)); + return GetCachedClient(client => new GlobalRulestackCertificateObjectCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual GlobalRulestackCertificateObjectCollection GetGlobalRulestackCert /// /// certificate name. /// The cancellation token to use. - /// 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> GetGlobalRulestackCertificateObjectAsync(string name, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// certificate name. /// The cancellation token to use. - /// 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 GetGlobalRulestackCertificateObject(string name, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetGlobalRules /// An object representing collection of GlobalRulestackFqdnResources and their operations over a GlobalRulestackFqdnResource. public virtual GlobalRulestackFqdnCollection GetGlobalRulestackFqdns() { - return GetCachedClient(Client => new GlobalRulestackFqdnCollection(Client, Id)); + return GetCachedClient(client => new GlobalRulestackFqdnCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual GlobalRulestackFqdnCollection GetGlobalRulestackFqdns() /// /// fqdn list name. /// The cancellation token to use. - /// 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> GetGlobalRulestackFqdnAsync(string name, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetGlobalRulest /// /// fqdn list name. /// The cancellation token to use. - /// 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 GetGlobalRulestackFqdn(string name, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetGlobalRulestackFqdn(stri /// An object representing collection of PostRulestackRuleResources and their operations over a PostRulestackRuleResource. public virtual PostRulestackRuleCollection GetPostRulestackRules() { - return GetCachedClient(Client => new PostRulestackRuleCollection(Client, Id)); + return GetCachedClient(client => new PostRulestackRuleCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual PostRulestackRuleCollection GetPostRulestackRules() /// /// Post Rule priority. /// The cancellation token to use. - /// 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> GetPostRulestackRuleAsync(string priority, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetPostRulestackR /// /// Post Rule priority. /// The cancellation token to use. - /// 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 GetPostRulestackRule(string priority, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetPostRulestackRule(string p /// An object representing collection of GlobalRulestackPrefixResources and their operations over a GlobalRulestackPrefixResource. public virtual GlobalRulestackPrefixCollection GetGlobalRulestackPrefixes() { - return GetCachedClient(Client => new GlobalRulestackPrefixCollection(Client, Id)); + return GetCachedClient(client => new GlobalRulestackPrefixCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual GlobalRulestackPrefixCollection GetGlobalRulestackPrefixes() /// /// Local Rule priority. /// The cancellation token to use. - /// 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> GetGlobalRulestackPrefixAsync(string name, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetGlobalRule /// /// Local Rule priority. /// The cancellation token to use. - /// 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 GetGlobalRulestackPrefix(string name, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetGlobalRulestackPrefix( /// An object representing collection of PreRulestackRuleResources and their operations over a PreRulestackRuleResource. public virtual PreRulestackRuleCollection GetPreRulestackRules() { - return GetCachedClient(Client => new PreRulestackRuleCollection(Client, Id)); + return GetCachedClient(client => new PreRulestackRuleCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual PreRulestackRuleCollection GetPreRulestackRules() /// /// Pre Rule priority. /// The cancellation token to use. - /// 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> GetPreRulestackRuleAsync(string priority, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetPreRulestackRul /// /// Pre Rule priority. /// The cancellation token to use. - /// 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 GetPreRulestackRule(string priority, CancellationToken cancellationToken = default) { diff --git a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/LocalRulestackResource.cs b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/LocalRulestackResource.cs index 1da0cb91e70f..07f0fdfe41d1 100644 --- a/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/LocalRulestackResource.cs +++ b/sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/src/Generated/LocalRulestackResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of LocalRulestackCertificateObjectResources and their operations over a LocalRulestackCertificateObjectResource. public virtual LocalRulestackCertificateObjectCollection GetLocalRulestackCertificateObjects() { - return GetCachedClient(Client => new LocalRulestackCertificateObjectCollection(Client, Id)); + return GetCachedClient(client => new LocalRulestackCertificateObjectCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual LocalRulestackCertificateObjectCollection GetLocalRulestackCertif /// /// certificate name. /// The cancellation token to use. - /// 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> GetLocalRulestackCertificateObjectAsync(string name, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> Get /// /// certificate name. /// The cancellation token to use. - /// 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 GetLocalRulestackCertificateObject(string name, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetLocalRulesta /// An object representing collection of LocalRulestackFqdnResources and their operations over a LocalRulestackFqdnResource. public virtual LocalRulestackFqdnCollection GetLocalRulestackFqdns() { - return GetCachedClient(Client => new LocalRulestackFqdnCollection(Client, Id)); + return GetCachedClient(client => new LocalRulestackFqdnCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual LocalRulestackFqdnCollection GetLocalRulestackFqdns() /// /// fqdn list name. /// The cancellation token to use. - /// 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> GetLocalRulestackFqdnAsync(string name, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetLocalRulestac /// /// fqdn list name. /// The cancellation token to use. - /// 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 GetLocalRulestackFqdn(string name, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetLocalRulestackFqdn(string /// An object representing collection of LocalRulestackRuleResources and their operations over a LocalRulestackRuleResource. public virtual LocalRulestackRuleCollection GetLocalRulestackRules() { - return GetCachedClient(Client => new LocalRulestackRuleCollection(Client, Id)); + return GetCachedClient(client => new LocalRulestackRuleCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual LocalRulestackRuleCollection GetLocalRulestackRules() /// /// Local Rule priority. /// The cancellation token to use. - /// 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> GetLocalRulestackRuleAsync(string priority, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetLocalRulestac /// /// Local Rule priority. /// The cancellation token to use. - /// 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 GetLocalRulestackRule(string priority, CancellationToken cancellationToken = default) { @@ -253,7 +253,7 @@ public virtual Response GetLocalRulestackRule(string /// An object representing collection of LocalRulestackPrefixResources and their operations over a LocalRulestackPrefixResource. public virtual LocalRulestackPrefixCollection GetLocalRulestackPrefixes() { - return GetCachedClient(Client => new LocalRulestackPrefixCollection(Client, Id)); + return GetCachedClient(client => new LocalRulestackPrefixCollection(client, Id)); } /// @@ -271,8 +271,8 @@ public virtual LocalRulestackPrefixCollection GetLocalRulestackPrefixes() /// /// Local Rule priority. /// The cancellation token to use. - /// 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> GetLocalRulestackPrefixAsync(string name, CancellationToken cancellationToken = default) { @@ -294,8 +294,8 @@ public virtual async Task> GetLocalRulest /// /// Local Rule priority. /// The cancellation token to use. - /// 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 GetLocalRulestackPrefix(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringArmClientMockingExtension.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringArmClientMockingExtension.cs new file mode 100644 index 000000000000..58a288944133 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Peering; + +namespace Azure.ResourceManager.Peering.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PeeringArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PeeringArmClientMockingExtension() + { + } + + /// 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 PeeringArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PeeringArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PeerAsnResource GetPeerAsnResource(ResourceIdentifier id) + { + PeerAsnResource.ValidateResourceId(id); + return new PeerAsnResource(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 PeeringRegisteredAsnResource GetPeeringRegisteredAsnResource(ResourceIdentifier id) + { + PeeringRegisteredAsnResource.ValidateResourceId(id); + return new PeeringRegisteredAsnResource(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 PeeringRegisteredPrefixResource GetPeeringRegisteredPrefixResource(ResourceIdentifier id) + { + PeeringRegisteredPrefixResource.ValidateResourceId(id); + return new PeeringRegisteredPrefixResource(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 PeeringResource GetPeeringResource(ResourceIdentifier id) + { + PeeringResource.ValidateResourceId(id); + return new PeeringResource(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 ConnectionMonitorTestResource GetConnectionMonitorTestResource(ResourceIdentifier id) + { + ConnectionMonitorTestResource.ValidateResourceId(id); + return new ConnectionMonitorTestResource(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 PeeringServicePrefixResource GetPeeringServicePrefixResource(ResourceIdentifier id) + { + PeeringServicePrefixResource.ValidateResourceId(id); + return new PeeringServicePrefixResource(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 PeeringServiceResource GetPeeringServiceResource(ResourceIdentifier id) + { + PeeringServiceResource.ValidateResourceId(id); + return new PeeringServiceResource(Client, id); + } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringExtensions.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringExtensions.cs index a46d8a056cb9..a0d324275b48 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringExtensions.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Peering.Mocking; using Azure.ResourceManager.Peering.Models; using Azure.ResourceManager.Resources; @@ -19,176 +20,145 @@ namespace Azure.ResourceManager.Peering /// A class to add extension methods to Azure.ResourceManager.Peering. public static partial class PeeringExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PeeringArmClientMockingExtension GetPeeringArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PeeringArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PeeringResourceGroupMockingExtension GetPeeringResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PeeringResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PeeringSubscriptionMockingExtension GetPeeringSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PeeringSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region PeerAsnResource /// /// 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. /// Returns a object. public static PeerAsnResource GetPeerAsnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeerAsnResource.ValidateResourceId(id); - return new PeerAsnResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeerAsnResource(id); } - #endregion - #region PeeringRegisteredAsnResource /// /// 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. /// Returns a object. public static PeeringRegisteredAsnResource GetPeeringRegisteredAsnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeeringRegisteredAsnResource.ValidateResourceId(id); - return new PeeringRegisteredAsnResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeeringRegisteredAsnResource(id); } - #endregion - #region PeeringRegisteredPrefixResource /// /// 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. /// Returns a object. public static PeeringRegisteredPrefixResource GetPeeringRegisteredPrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeeringRegisteredPrefixResource.ValidateResourceId(id); - return new PeeringRegisteredPrefixResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeeringRegisteredPrefixResource(id); } - #endregion - #region PeeringResource /// /// 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. /// Returns a object. public static PeeringResource GetPeeringResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeeringResource.ValidateResourceId(id); - return new PeeringResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeeringResource(id); } - #endregion - #region ConnectionMonitorTestResource /// /// 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. /// Returns a object. public static ConnectionMonitorTestResource GetConnectionMonitorTestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectionMonitorTestResource.ValidateResourceId(id); - return new ConnectionMonitorTestResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetConnectionMonitorTestResource(id); } - #endregion - #region PeeringServicePrefixResource /// /// 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. /// Returns a object. public static PeeringServicePrefixResource GetPeeringServicePrefixResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeeringServicePrefixResource.ValidateResourceId(id); - return new PeeringServicePrefixResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeeringServicePrefixResource(id); } - #endregion - #region PeeringServiceResource /// /// 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. /// Returns a object. public static PeeringServiceResource GetPeeringServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PeeringServiceResource.ValidateResourceId(id); - return new PeeringServiceResource(client, id); - } - ); + return GetPeeringArmClientMockingExtension(client).GetPeeringServiceResource(id); } - #endregion - /// Gets a collection of PeeringResources in the ResourceGroupResource. + /// + /// Gets a collection of PeeringResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PeeringResources and their operations over a PeeringResource. public static PeeringCollection GetPeerings(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPeerings(); + return GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeerings(); } /// @@ -203,16 +173,20 @@ public static PeeringCollection GetPeerings(this ResourceGroupResource resourceG /// Peerings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the peering. /// The cancellation token to use. - /// 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 static async Task> GetPeeringAsync(this ResourceGroupResource resourceGroupResource, string peeringName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPeerings().GetAsync(peeringName, cancellationToken).ConfigureAwait(false); + return await GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeeringAsync(peeringName, cancellationToken).ConfigureAwait(false); } /// @@ -227,24 +201,34 @@ public static async Task> GetPeeringAsync(this Resourc /// Peerings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the peering. /// The cancellation token to use. - /// 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 static Response GetPeering(this ResourceGroupResource resourceGroupResource, string peeringName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPeerings().Get(peeringName, cancellationToken); + return GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeering(peeringName, cancellationToken); } - /// Gets a collection of PeeringServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of PeeringServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PeeringServiceResources and their operations over a PeeringServiceResource. public static PeeringServiceCollection GetPeeringServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPeeringServices(); + return GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeeringServices(); } /// @@ -259,16 +243,20 @@ public static PeeringServiceCollection GetPeeringServices(this ResourceGroupReso /// PeeringServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the peering. /// The cancellation token to use. - /// 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 static async Task> GetPeeringServiceAsync(this ResourceGroupResource resourceGroupResource, string peeringServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPeeringServices().GetAsync(peeringServiceName, cancellationToken).ConfigureAwait(false); + return await GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeeringServiceAsync(peeringServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -283,24 +271,34 @@ public static async Task> GetPeeringServiceAsyn /// PeeringServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the peering. /// The cancellation token to use. - /// 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 static Response GetPeeringService(this ResourceGroupResource resourceGroupResource, string peeringServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPeeringServices().Get(peeringServiceName, cancellationToken); + return GetPeeringResourceGroupMockingExtension(resourceGroupResource).GetPeeringService(peeringServiceName, cancellationToken); } - /// Gets a collection of PeerAsnResources in the SubscriptionResource. + /// + /// Gets a collection of PeerAsnResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PeerAsnResources and their operations over a PeerAsnResource. public static PeerAsnCollection GetPeerAsns(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeerAsns(); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeerAsns(); } /// @@ -315,16 +313,20 @@ public static PeerAsnCollection GetPeerAsns(this SubscriptionResource subscripti /// PeerAsns_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The peer ASN name. /// The cancellation token to use. - /// 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 static async Task> GetPeerAsnAsync(this SubscriptionResource subscriptionResource, string peerAsnName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetPeerAsns().GetAsync(peerAsnName, cancellationToken).ConfigureAwait(false); + return await GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeerAsnAsync(peerAsnName, cancellationToken).ConfigureAwait(false); } /// @@ -339,16 +341,20 @@ public static async Task> GetPeerAsnAsync(this Subscri /// PeerAsns_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The peer ASN name. /// The cancellation token to use. - /// 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 static Response GetPeerAsn(this SubscriptionResource subscriptionResource, string peerAsnName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetPeerAsns().Get(peerAsnName, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeerAsn(peerAsnName, cancellationToken); } /// @@ -363,6 +369,10 @@ public static Response GetPeerAsn(this SubscriptionResource sub /// CdnPeeringPrefixes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The peering location. @@ -371,9 +381,7 @@ public static Response GetPeerAsn(this SubscriptionResource sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCdnPeeringPrefixesAsync(this SubscriptionResource subscriptionResource, string peeringLocation, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCdnPeeringPrefixesAsync(peeringLocation, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetCdnPeeringPrefixesAsync(peeringLocation, cancellationToken); } /// @@ -388,6 +396,10 @@ public static AsyncPageable GetCdnPeeringPrefixesAsync(this Su /// CdnPeeringPrefixes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The peering location. @@ -396,9 +408,7 @@ public static AsyncPageable GetCdnPeeringPrefixesAsync(this Su /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCdnPeeringPrefixes(this SubscriptionResource subscriptionResource, string peeringLocation, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCdnPeeringPrefixes(peeringLocation, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetCdnPeeringPrefixes(peeringLocation, cancellationToken); } /// @@ -413,6 +423,10 @@ public static Pageable GetCdnPeeringPrefixes(this Subscription /// CheckServiceProviderAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The CheckServiceProviderAvailabilityInput indicating customer location and service provider. @@ -420,9 +434,7 @@ public static Pageable GetCdnPeeringPrefixes(this Subscription /// is null. public static async Task> CheckPeeringServiceProviderAvailabilityAsync(this SubscriptionResource subscriptionResource, CheckPeeringServiceProviderAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPeeringServiceProviderAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPeeringSubscriptionMockingExtension(subscriptionResource).CheckPeeringServiceProviderAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -437,6 +449,10 @@ public static async Task> CheckPeer /// CheckServiceProviderAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The CheckServiceProviderAvailabilityInput indicating customer location and service provider. @@ -444,9 +460,7 @@ public static async Task> CheckPeer /// is null. public static Response CheckPeeringServiceProviderAvailability(this SubscriptionResource subscriptionResource, CheckPeeringServiceProviderAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPeeringServiceProviderAvailability(content, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).CheckPeeringServiceProviderAvailability(content, cancellationToken); } /// @@ -461,6 +475,10 @@ public static Response CheckPeeringServicePr /// LegacyPeerings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the peering. @@ -472,9 +490,7 @@ public static Response CheckPeeringServicePr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringsByLegacyPeeringAsync(this SubscriptionResource subscriptionResource, string peeringLocation, LegacyPeeringsKind kind, int? asn = null, DirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringsByLegacyPeeringAsync(peeringLocation, kind, asn, directPeeringType, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringsByLegacyPeeringAsync(peeringLocation, kind, asn, directPeeringType, cancellationToken); } /// @@ -489,6 +505,10 @@ public static AsyncPageable GetPeeringsByLegacyPeeringAsync(thi /// LegacyPeerings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the peering. @@ -500,9 +520,7 @@ public static AsyncPageable GetPeeringsByLegacyPeeringAsync(thi /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringsByLegacyPeering(this SubscriptionResource subscriptionResource, string peeringLocation, LegacyPeeringsKind kind, int? asn = null, DirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringsByLegacyPeering(peeringLocation, kind, asn, directPeeringType, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringsByLegacyPeering(peeringLocation, kind, asn, directPeeringType, cancellationToken); } /// @@ -517,6 +535,10 @@ public static Pageable GetPeeringsByLegacyPeering(this Subscrip /// LookingGlass_Invoke /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The command to be executed: ping, traceroute, bgpRoute. @@ -527,10 +549,7 @@ public static Pageable GetPeeringsByLegacyPeering(this Subscrip /// or is null. public static async Task> InvokeLookingGlassAsync(this SubscriptionResource subscriptionResource, LookingGlassCommand command, LookingGlassSourceType sourceType, string sourceLocation, string destinationIP, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(sourceLocation, nameof(sourceLocation)); - Argument.AssertNotNull(destinationIP, nameof(destinationIP)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).InvokeLookingGlassAsync(command, sourceType, sourceLocation, destinationIP, cancellationToken).ConfigureAwait(false); + return await GetPeeringSubscriptionMockingExtension(subscriptionResource).InvokeLookingGlassAsync(command, sourceType, sourceLocation, destinationIP, cancellationToken).ConfigureAwait(false); } /// @@ -545,6 +564,10 @@ public static async Task> InvokeLookingGlassAsync(t /// LookingGlass_Invoke /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The command to be executed: ping, traceroute, bgpRoute. @@ -555,10 +578,7 @@ public static async Task> InvokeLookingGlassAsync(t /// or is null. public static Response InvokeLookingGlass(this SubscriptionResource subscriptionResource, LookingGlassCommand command, LookingGlassSourceType sourceType, string sourceLocation, string destinationIP, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(sourceLocation, nameof(sourceLocation)); - Argument.AssertNotNull(destinationIP, nameof(destinationIP)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).InvokeLookingGlass(command, sourceType, sourceLocation, destinationIP, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).InvokeLookingGlass(command, sourceType, sourceLocation, destinationIP, cancellationToken); } /// @@ -573,6 +593,10 @@ public static Response InvokeLookingGlass(this SubscriptionR /// PeeringLocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The kind of the peering. @@ -581,7 +605,7 @@ public static Response InvokeLookingGlass(this SubscriptionR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringLocationsAsync(this SubscriptionResource subscriptionResource, PeeringLocationsKind kind, PeeringLocationsDirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringLocationsAsync(kind, directPeeringType, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringLocationsAsync(kind, directPeeringType, cancellationToken); } /// @@ -596,6 +620,10 @@ public static AsyncPageable GetPeeringLocationsAsync(this Subsc /// PeeringLocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The kind of the peering. @@ -604,7 +632,7 @@ public static AsyncPageable GetPeeringLocationsAsync(this Subsc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringLocations(this SubscriptionResource subscriptionResource, PeeringLocationsKind kind, PeeringLocationsDirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringLocations(kind, directPeeringType, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringLocations(kind, directPeeringType, cancellationToken); } /// @@ -619,13 +647,17 @@ public static Pageable GetPeeringLocations(this SubscriptionRes /// Peerings_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringsAsync(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringsAsync(cancellationToken); } /// @@ -640,13 +672,17 @@ public static AsyncPageable GetPeeringsAsync(this SubscriptionR /// Peerings_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeerings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeerings(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeerings(cancellationToken); } /// @@ -661,13 +697,17 @@ public static Pageable GetPeerings(this SubscriptionResource su /// PeeringServiceCountries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringServiceCountriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceCountriesAsync(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceCountriesAsync(cancellationToken); } /// @@ -682,13 +722,17 @@ public static AsyncPageable GetPeeringServiceCountriesAsy /// PeeringServiceCountries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringServiceCountries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceCountries(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceCountries(cancellationToken); } /// @@ -703,6 +747,10 @@ public static Pageable GetPeeringServiceCountries(this Su /// PeeringServiceLocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The country of interest, in which the locations are to be present. @@ -710,7 +758,7 @@ public static Pageable GetPeeringServiceCountries(this Su /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringServiceLocationsAsync(this SubscriptionResource subscriptionResource, string country = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceLocationsAsync(country, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceLocationsAsync(country, cancellationToken); } /// @@ -725,6 +773,10 @@ public static AsyncPageable GetPeeringServiceLocationsAs /// PeeringServiceLocations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The country of interest, in which the locations are to be present. @@ -732,7 +784,7 @@ public static AsyncPageable GetPeeringServiceLocationsAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringServiceLocations(this SubscriptionResource subscriptionResource, string country = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceLocations(country, cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceLocations(country, cancellationToken); } /// @@ -747,13 +799,17 @@ public static Pageable GetPeeringServiceLocations(this S /// PeeringServiceProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringServiceProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceProvidersAsync(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceProvidersAsync(cancellationToken); } /// @@ -768,13 +824,17 @@ public static AsyncPageable GetPeeringServiceProvidersAs /// PeeringServiceProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringServiceProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServiceProviders(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServiceProviders(cancellationToken); } /// @@ -789,13 +849,17 @@ public static Pageable GetPeeringServiceProviders(this S /// PeeringServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPeeringServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServicesAsync(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServicesAsync(cancellationToken); } /// @@ -810,13 +874,17 @@ public static AsyncPageable GetPeeringServicesAsync(this /// PeeringServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPeeringServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPeeringServices(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).GetPeeringServices(cancellationToken); } /// @@ -831,12 +899,16 @@ public static Pageable GetPeeringServices(this Subscript /// PeeringServices_InitializeConnectionMonitor /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task InitializePeeringServiceConnectionMonitorAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).InitializePeeringServiceConnectionMonitorAsync(cancellationToken).ConfigureAwait(false); + return await GetPeeringSubscriptionMockingExtension(subscriptionResource).InitializePeeringServiceConnectionMonitorAsync(cancellationToken).ConfigureAwait(false); } /// @@ -851,12 +923,16 @@ public static async Task InitializePeeringServiceConnectionMonitorAsyn /// PeeringServices_InitializeConnectionMonitor /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response InitializePeeringServiceConnectionMonitor(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).InitializePeeringServiceConnectionMonitor(cancellationToken); + return GetPeeringSubscriptionMockingExtension(subscriptionResource).InitializePeeringServiceConnectionMonitor(cancellationToken); } } } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringResourceGroupMockingExtension.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..37a41aa47876 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Peering; + +namespace Azure.ResourceManager.Peering.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PeeringResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PeeringResourceGroupMockingExtension() + { + } + + /// 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 PeeringResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PeeringResources in the ResourceGroupResource. + /// An object representing collection of PeeringResources and their operations over a PeeringResource. + public virtual PeeringCollection GetPeerings() + { + return GetCachedClient(client => new PeeringCollection(client, Id)); + } + + /// + /// Gets an existing peering with the specified name under the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName} + /// + /// + /// Operation Id + /// Peerings_Get + /// + /// + /// + /// The name of the peering. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPeeringAsync(string peeringName, CancellationToken cancellationToken = default) + { + return await GetPeerings().GetAsync(peeringName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an existing peering with the specified name under the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName} + /// + /// + /// Operation Id + /// Peerings_Get + /// + /// + /// + /// The name of the peering. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPeering(string peeringName, CancellationToken cancellationToken = default) + { + return GetPeerings().Get(peeringName, cancellationToken); + } + + /// Gets a collection of PeeringServiceResources in the ResourceGroupResource. + /// An object representing collection of PeeringServiceResources and their operations over a PeeringServiceResource. + public virtual PeeringServiceCollection GetPeeringServices() + { + return GetCachedClient(client => new PeeringServiceCollection(client, Id)); + } + + /// + /// Gets an existing peering service with the specified name under the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName} + /// + /// + /// Operation Id + /// PeeringServices_Get + /// + /// + /// + /// The name of the peering. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPeeringServiceAsync(string peeringServiceName, CancellationToken cancellationToken = default) + { + return await GetPeeringServices().GetAsync(peeringServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an existing peering service with the specified name under the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName} + /// + /// + /// Operation Id + /// PeeringServices_Get + /// + /// + /// + /// The name of the peering. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPeeringService(string peeringServiceName, CancellationToken cancellationToken = default) + { + return GetPeeringServices().Get(peeringServiceName, cancellationToken); + } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringSubscriptionMockingExtension.cs similarity index 86% rename from sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringSubscriptionMockingExtension.cs index d7e40bc28fd8..c338ab4ac5ff 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/PeeringSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Peering; using Azure.ResourceManager.Peering.Models; -namespace Azure.ResourceManager.Peering +namespace Azure.ResourceManager.Peering.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PeeringSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _cdnPeeringPrefixesClientDiagnostics; private CdnPeeringPrefixesRestOperations _cdnPeeringPrefixesRestClient; @@ -41,15 +42,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _peeringServiceClientDiagnostics; private PeeringServicesRestOperations _peeringServiceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PeeringSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PeeringSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -84,7 +85,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of PeerAsnResources and their operations over a PeerAsnResource. public virtual PeerAsnCollection GetPeerAsns() { - return GetCachedClient(Client => new PeerAsnCollection(Client, Id)); + return GetCachedClient(client => new PeerAsnCollection(client, Id)); + } + + /// + /// Gets the peer ASN with the specified name under the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName} + /// + /// + /// Operation Id + /// PeerAsns_Get + /// + /// + /// + /// The peer ASN name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPeerAsnAsync(string peerAsnName, CancellationToken cancellationToken = default) + { + return await GetPeerAsns().GetAsync(peerAsnName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the peer ASN with the specified name under the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName} + /// + /// + /// Operation Id + /// PeerAsns_Get + /// + /// + /// + /// The peer ASN name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPeerAsn(string peerAsnName, CancellationToken cancellationToken = default) + { + return GetPeerAsns().Get(peerAsnName, cancellationToken); } /// @@ -102,12 +149,15 @@ public virtual PeerAsnCollection GetPeerAsns() /// /// The peering location. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetCdnPeeringPrefixesAsync(string peeringLocation, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); + HttpMessage FirstPageRequest(int? pageSizeHint) => CdnPeeringPrefixesRestClient.CreateListRequest(Id.SubscriptionId, peeringLocation); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CdnPeeringPrefixesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, peeringLocation); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CdnPeeringPrefix.DeserializeCdnPeeringPrefix, CdnPeeringPrefixesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCdnPeeringPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CdnPeeringPrefix.DeserializeCdnPeeringPrefix, CdnPeeringPrefixesClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetCdnPeeringPrefixes", "value", "nextLink", cancellationToken); } /// @@ -125,12 +175,15 @@ public virtual AsyncPageable GetCdnPeeringPrefixesAsync(string /// /// The peering location. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetCdnPeeringPrefixes(string peeringLocation, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); + HttpMessage FirstPageRequest(int? pageSizeHint) => CdnPeeringPrefixesRestClient.CreateListRequest(Id.SubscriptionId, peeringLocation); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CdnPeeringPrefixesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, peeringLocation); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CdnPeeringPrefix.DeserializeCdnPeeringPrefix, CdnPeeringPrefixesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCdnPeeringPrefixes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CdnPeeringPrefix.DeserializeCdnPeeringPrefix, CdnPeeringPrefixesClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetCdnPeeringPrefixes", "value", "nextLink", cancellationToken); } /// @@ -148,9 +201,12 @@ public virtual Pageable GetCdnPeeringPrefixes(string peeringLo /// /// The CheckServiceProviderAvailabilityInput indicating customer location and service provider. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPeeringServiceProviderAvailabilityAsync(CheckPeeringServiceProviderAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPeeringServiceProviderAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.CheckPeeringServiceProviderAvailability"); scope.Start(); try { @@ -179,9 +235,12 @@ public virtual async Task> CheckPee /// /// The CheckServiceProviderAvailabilityInput indicating customer location and service provider. /// The cancellation token to use. + /// is null. public virtual Response CheckPeeringServiceProviderAvailability(CheckPeeringServiceProviderAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPeeringServiceProviderAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.CheckPeeringServiceProviderAvailability"); scope.Start(); try { @@ -213,12 +272,15 @@ public virtual Response CheckPeeringServiceP /// The ASN number associated with a legacy peering. /// The direct peering type. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetPeeringsByLegacyPeeringAsync(string peeringLocation, LegacyPeeringsKind kind, int? asn = null, DirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LegacyPeeringsRestClient.CreateListRequest(Id.SubscriptionId, peeringLocation, kind, asn, directPeeringType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LegacyPeeringsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, peeringLocation, kind, asn, directPeeringType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), LegacyPeeringsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringsByLegacyPeering", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), LegacyPeeringsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringsByLegacyPeering", "value", "nextLink", cancellationToken); } /// @@ -239,12 +301,15 @@ public virtual AsyncPageable GetPeeringsByLegacyPeeringAsync(st /// The ASN number associated with a legacy peering. /// The direct peering type. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetPeeringsByLegacyPeering(string peeringLocation, LegacyPeeringsKind kind, int? asn = null, DirectPeeringType? directPeeringType = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(peeringLocation, nameof(peeringLocation)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LegacyPeeringsRestClient.CreateListRequest(Id.SubscriptionId, peeringLocation, kind, asn, directPeeringType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LegacyPeeringsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, peeringLocation, kind, asn, directPeeringType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), LegacyPeeringsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringsByLegacyPeering", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), LegacyPeeringsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringsByLegacyPeering", "value", "nextLink", cancellationToken); } /// @@ -265,9 +330,13 @@ public virtual Pageable GetPeeringsByLegacyPeering(string peeri /// The location of the source. /// The IP address of the destination. /// The cancellation token to use. + /// or is null. public virtual async Task> InvokeLookingGlassAsync(LookingGlassCommand command, LookingGlassSourceType sourceType, string sourceLocation, string destinationIP, CancellationToken cancellationToken = default) { - using var scope = LookingGlassClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.InvokeLookingGlass"); + Argument.AssertNotNull(sourceLocation, nameof(sourceLocation)); + Argument.AssertNotNull(destinationIP, nameof(destinationIP)); + + using var scope = LookingGlassClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.InvokeLookingGlass"); scope.Start(); try { @@ -299,9 +368,13 @@ public virtual async Task> InvokeLookingGlassAsync( /// The location of the source. /// The IP address of the destination. /// The cancellation token to use. + /// or is null. public virtual Response InvokeLookingGlass(LookingGlassCommand command, LookingGlassSourceType sourceType, string sourceLocation, string destinationIP, CancellationToken cancellationToken = default) { - using var scope = LookingGlassClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.InvokeLookingGlass"); + Argument.AssertNotNull(sourceLocation, nameof(sourceLocation)); + Argument.AssertNotNull(destinationIP, nameof(destinationIP)); + + using var scope = LookingGlassClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.InvokeLookingGlass"); scope.Start(); try { @@ -336,7 +409,7 @@ public virtual AsyncPageable GetPeeringLocationsAsync(PeeringLo { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringLocationsRestClient.CreateListRequest(Id.SubscriptionId, kind, directPeeringType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, kind, directPeeringType); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringLocation.DeserializePeeringLocation, PeeringLocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringLocation.DeserializePeeringLocation, PeeringLocationsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringLocations", "value", "nextLink", cancellationToken); } /// @@ -360,7 +433,7 @@ public virtual Pageable GetPeeringLocations(PeeringLocationsKin { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringLocationsRestClient.CreateListRequest(Id.SubscriptionId, kind, directPeeringType); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, kind, directPeeringType); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringLocation.DeserializePeeringLocation, PeeringLocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringLocation.DeserializePeeringLocation, PeeringLocationsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringLocations", "value", "nextLink", cancellationToken); } /// @@ -382,7 +455,7 @@ public virtual AsyncPageable GetPeeringsAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), PeeringClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeerings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), PeeringClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeerings", "value", "nextLink", cancellationToken); } /// @@ -404,7 +477,7 @@ public virtual Pageable GetPeerings(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), PeeringClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeerings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringResource(Client, PeeringData.DeserializePeeringData(e)), PeeringClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeerings", "value", "nextLink", cancellationToken); } /// @@ -426,7 +499,7 @@ public virtual AsyncPageable GetPeeringServiceCountriesAs { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceCountriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceCountriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceCountry.DeserializePeeringServiceCountry, PeeringServiceCountriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceCountries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceCountry.DeserializePeeringServiceCountry, PeeringServiceCountriesClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceCountries", "value", "nextLink", cancellationToken); } /// @@ -448,7 +521,7 @@ public virtual Pageable GetPeeringServiceCountries(Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceCountriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceCountriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceCountry.DeserializePeeringServiceCountry, PeeringServiceCountriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceCountries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceCountry.DeserializePeeringServiceCountry, PeeringServiceCountriesClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceCountries", "value", "nextLink", cancellationToken); } /// @@ -471,7 +544,7 @@ public virtual AsyncPageable GetPeeringServiceLocationsA { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceLocationsRestClient.CreateListRequest(Id.SubscriptionId, country); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, country); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceLocation.DeserializePeeringServiceLocation, PeeringServiceLocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceLocation.DeserializePeeringServiceLocation, PeeringServiceLocationsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceLocations", "value", "nextLink", cancellationToken); } /// @@ -494,7 +567,7 @@ public virtual Pageable GetPeeringServiceLocations(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceLocationsRestClient.CreateListRequest(Id.SubscriptionId, country); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, country); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceLocation.DeserializePeeringServiceLocation, PeeringServiceLocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceLocation.DeserializePeeringServiceLocation, PeeringServiceLocationsClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceLocations", "value", "nextLink", cancellationToken); } /// @@ -516,7 +589,7 @@ public virtual AsyncPageable GetPeeringServiceProvidersA { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceProvidersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceProvider.DeserializePeeringServiceProvider, PeeringServiceProvidersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PeeringServiceProvider.DeserializePeeringServiceProvider, PeeringServiceProvidersClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceProviders", "value", "nextLink", cancellationToken); } /// @@ -538,7 +611,7 @@ public virtual Pageable GetPeeringServiceProviders(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceProvidersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceProvider.DeserializePeeringServiceProvider, PeeringServiceProvidersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServiceProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PeeringServiceProvider.DeserializePeeringServiceProvider, PeeringServiceProvidersClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServiceProviders", "value", "nextLink", cancellationToken); } /// @@ -560,7 +633,7 @@ public virtual AsyncPageable GetPeeringServicesAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringServiceResource(Client, PeeringServiceData.DeserializePeeringServiceData(e)), PeeringServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PeeringServiceResource(Client, PeeringServiceData.DeserializePeeringServiceData(e)), PeeringServiceClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServices", "value", "nextLink", cancellationToken); } /// @@ -582,7 +655,7 @@ public virtual Pageable GetPeeringServices(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => PeeringServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PeeringServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringServiceResource(Client, PeeringServiceData.DeserializePeeringServiceData(e)), PeeringServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPeeringServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PeeringServiceResource(Client, PeeringServiceData.DeserializePeeringServiceData(e)), PeeringServiceClientDiagnostics, Pipeline, "PeeringSubscriptionMockingExtension.GetPeeringServices", "value", "nextLink", cancellationToken); } /// @@ -601,7 +674,7 @@ public virtual Pageable GetPeeringServices(CancellationT /// The cancellation token to use. public virtual async Task InitializePeeringServiceConnectionMonitorAsync(CancellationToken cancellationToken = default) { - using var scope = PeeringServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.InitializePeeringServiceConnectionMonitor"); + using var scope = PeeringServiceClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.InitializePeeringServiceConnectionMonitor"); scope.Start(); try { @@ -631,7 +704,7 @@ public virtual async Task InitializePeeringServiceConnectionMonitorAsy /// The cancellation token to use. public virtual Response InitializePeeringServiceConnectionMonitor(CancellationToken cancellationToken = default) { - using var scope = PeeringServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.InitializePeeringServiceConnectionMonitor"); + using var scope = PeeringServiceClientDiagnostics.CreateScope("PeeringSubscriptionMockingExtension.InitializePeeringServiceConnectionMonitor"); scope.Start(); try { diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 7af68a7a83c5..000000000000 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Peering -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PeeringResources in the ResourceGroupResource. - /// An object representing collection of PeeringResources and their operations over a PeeringResource. - public virtual PeeringCollection GetPeerings() - { - return GetCachedClient(Client => new PeeringCollection(Client, Id)); - } - - /// Gets a collection of PeeringServiceResources in the ResourceGroupResource. - /// An object representing collection of PeeringServiceResources and their operations over a PeeringServiceResource. - public virtual PeeringServiceCollection GetPeeringServices() - { - return GetCachedClient(Client => new PeeringServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs index 127769602746..a66a8ce6a554 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PeeringRegisteredAsnResources and their operations over a PeeringRegisteredAsnResource. public virtual PeeringRegisteredAsnCollection GetPeeringRegisteredAsns() { - return GetCachedClient(Client => new PeeringRegisteredAsnCollection(Client, Id)); + return GetCachedClient(client => new PeeringRegisteredAsnCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual PeeringRegisteredAsnCollection GetPeeringRegisteredAsns() /// /// The name of the registered ASN. /// The cancellation token to use. - /// 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> GetPeeringRegisteredAsnAsync(string registeredAsnName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> GetPeeringRegi /// /// The name of the registered ASN. /// The cancellation token to use. - /// 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 GetPeeringRegisteredAsn(string registeredAsnName, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual Response GetPeeringRegisteredAsn(st /// An object representing collection of PeeringRegisteredPrefixResources and their operations over a PeeringRegisteredPrefixResource. public virtual PeeringRegisteredPrefixCollection GetPeeringRegisteredPrefixes() { - return GetCachedClient(Client => new PeeringRegisteredPrefixCollection(Client, Id)); + return GetCachedClient(client => new PeeringRegisteredPrefixCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual PeeringRegisteredPrefixCollection GetPeeringRegisteredPrefixes() /// /// The name of the registered prefix. /// The cancellation token to use. - /// 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> GetPeeringRegisteredPrefixAsync(string registeredPrefixName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task> GetPeeringR /// /// The name of the registered prefix. /// The cancellation token to use. - /// 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 GetPeeringRegisteredPrefix(string registeredPrefixName, CancellationToken cancellationToken = default) { diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringServiceResource.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringServiceResource.cs index ef48ad4f0e6f..3d54163120a7 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringServiceResource.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringServiceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ConnectionMonitorTestResources and their operations over a ConnectionMonitorTestResource. public virtual ConnectionMonitorTestCollection GetConnectionMonitorTests() { - return GetCachedClient(Client => new ConnectionMonitorTestCollection(Client, Id)); + return GetCachedClient(client => new ConnectionMonitorTestCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ConnectionMonitorTestCollection GetConnectionMonitorTests() /// /// The name of the connection monitor test. /// The cancellation token to use. - /// 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> GetConnectionMonitorTestAsync(string connectionMonitorTestName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetConnection /// /// The name of the connection monitor test. /// The cancellation token to use. - /// 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 GetConnectionMonitorTest(string connectionMonitorTestName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetConnectionMonitorTest( /// An object representing collection of PeeringServicePrefixResources and their operations over a PeeringServicePrefixResource. public virtual PeeringServicePrefixCollection GetPeeringServicePrefixes() { - return GetCachedClient(Client => new PeeringServicePrefixCollection(Client, Id)); + return GetCachedClient(client => new PeeringServicePrefixCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual PeeringServicePrefixCollection GetPeeringServicePrefixes() /// The name of the prefix. /// The properties to be expanded. /// The cancellation token to use. - /// 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> GetPeeringServicePrefixAsync(string prefixName, string expand = null, CancellationToken cancellationToken = default) { @@ -189,8 +189,8 @@ public virtual async Task> GetPeeringServ /// The name of the prefix. /// The properties to be expanded. /// The cancellation token to use. - /// 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 GetPeeringServicePrefix(string prefixName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsArmClientMockingExtension.cs similarity index 51% rename from sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs rename to sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsArmClientMockingExtension.cs index 0d3c9db5117b..0fa4069f70eb 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsArmClientMockingExtension.cs @@ -5,18 +5,21 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PolicyInsights; using Azure.ResourceManager.PolicyInsights.Models; -namespace Azure.ResourceManager.PolicyInsights +namespace Azure.ResourceManager.PolicyInsights.Mocking { - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource + /// A class to add extension methods to ArmClient. + public partial class PolicyInsightsArmClientMockingExtension : ArmResource { private ClientDiagnostics _policyTrackedResourcesClientDiagnostics; private PolicyTrackedResourcesRestOperations _policyTrackedResourcesRestClient; @@ -25,15 +28,19 @@ internal partial class ArmResourceExtensionClient : ArmResource private ClientDiagnostics _policyStatesClientDiagnostics; private PolicyStatesRestOperations _policyStatesRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PolicyInsightsArmClientMockingExtension() { } - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PolicyInsightsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PolicyInsightsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) { } @@ -50,18 +57,116 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of PolicyRemediationResources in the ArmResource. + /// Gets a collection of PolicyRemediationResources in the ArmClient. + /// The scope that the resource will apply against. /// An object representing collection of PolicyRemediationResources and their operations over a PolicyRemediationResource. - public virtual PolicyRemediationCollection GetPolicyRemediations() + public virtual PolicyRemediationCollection GetPolicyRemediations(ResourceIdentifier scope) { - return GetCachedClient(Client => new PolicyRemediationCollection(Client, Id)); + return new PolicyRemediationCollection(Client, scope); } - /// Gets a collection of PolicyAttestationResources in the ArmResource. + /// + /// Gets an existing remediation at resource scope. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName} + /// + /// + /// Operation Id + /// Remediations_GetAtResource + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the remediation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPolicyRemediationAsync(ResourceIdentifier scope, string remediationName, CancellationToken cancellationToken = default) + { + return await GetPolicyRemediations(scope).GetAsync(remediationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an existing remediation at resource scope. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.PolicyInsights/remediations/{remediationName} + /// + /// + /// Operation Id + /// Remediations_GetAtResource + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the remediation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPolicyRemediation(ResourceIdentifier scope, string remediationName, CancellationToken cancellationToken = default) + { + return GetPolicyRemediations(scope).Get(remediationName, cancellationToken); + } + + /// Gets a collection of PolicyAttestationResources in the ArmClient. + /// The scope that the resource will apply against. /// An object representing collection of PolicyAttestationResources and their operations over a PolicyAttestationResource. - public virtual PolicyAttestationCollection GetPolicyAttestations() + public virtual PolicyAttestationCollection GetPolicyAttestations(ResourceIdentifier scope) { - return GetCachedClient(Client => new PolicyAttestationCollection(Client, Id)); + return new PolicyAttestationCollection(Client, scope); + } + + /// + /// Gets an existing attestation at resource scope. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName} + /// + /// + /// Operation Id + /// Attestations_GetAtResource + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the attestation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPolicyAttestationAsync(ResourceIdentifier scope, string attestationName, CancellationToken cancellationToken = default) + { + return await GetPolicyAttestations(scope).GetAsync(attestationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an existing attestation at resource scope. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName} + /// + /// + /// Operation Id + /// Attestations_GetAtResource + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the attestation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPolicyAttestation(ResourceIdentifier scope, string attestationName, CancellationToken cancellationToken = default) + { + return GetPolicyAttestations(scope).Get(attestationName, cancellationToken); } /// @@ -77,15 +182,16 @@ public virtual PolicyAttestationCollection GetPolicyAttestations() /// /// /// + /// The scope to use. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. /// Parameter group. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(ResourceIdentifier scope, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceRequest(Id, policyTrackedResourceType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceRequest(scope, policyTrackedResourceType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyTrackedResourceType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -101,15 +207,16 @@ public virtual AsyncPageable GetPolicyTrackedResour /// /// /// + /// The scope to use. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. /// Parameter group. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyTrackedResourceQueryResults(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual Pageable GetPolicyTrackedResourceQueryResults(ResourceIdentifier scope, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceRequest(Id, policyTrackedResourceType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceRequest(scope, policyTrackedResourceType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyTrackedResourceType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -125,15 +232,16 @@ public virtual Pageable GetPolicyTrackedResourceQue /// /// /// + /// The scope to use. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. /// Parameter group. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyEventQueryResultsAsync(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetPolicyEventQueryResultsAsync(ResourceIdentifier scope, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceRequest(Id, policyEventType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceRequest(scope, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -149,15 +257,16 @@ public virtual AsyncPageable GetPolicyEventQueryResultsAsync(Policy /// /// /// + /// The scope to use. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. /// Parameter group. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyEventQueryResults(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual Pageable GetPolicyEventQueryResults(ResourceIdentifier scope, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceRequest(Id, policyEventType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceRequest(scope, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -173,15 +282,16 @@ public virtual Pageable GetPolicyEventQueryResults(PolicyEventType /// /// /// + /// The scope to use. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). /// Parameter group. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyStateQueryResultsAsync(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetPolicyStateQueryResultsAsync(ResourceIdentifier scope, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceRequest(Id, policyStateType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceRequest(scope, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -197,15 +307,16 @@ public virtual AsyncPageable GetPolicyStateQueryResultsAsync(Policy /// /// /// + /// The scope to use. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). /// Parameter group. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyStateQueryResults(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual Pageable GetPolicyStateQueryResults(ResourceIdentifier scope, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceRequest(Id, policyStateType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, Id, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceRequest(scope, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceNextPageRequest(nextLink, scope, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -221,14 +332,15 @@ public virtual Pageable GetPolicyStateQueryResults(PolicyStateType /// /// /// + /// The scope to use. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. /// Parameter group. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable SummarizePolicyStatesAsync(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable SummarizePolicyStatesAsync(ResourceIdentifier scope, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceRequest(Id, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceRequest(scope, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); } /// @@ -244,14 +356,50 @@ public virtual AsyncPageable SummarizePolicyStatesAsync(PolicySta /// /// /// + /// The scope to use. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. /// Parameter group. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable SummarizePolicyStates(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + public virtual Pageable SummarizePolicyStates(ResourceIdentifier scope, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceRequest(scope, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsArmClientMockingExtension.SummarizePolicyStates", "value", null, 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 PolicyRemediationResource GetPolicyRemediationResource(ResourceIdentifier id) + { + PolicyRemediationResource.ValidateResourceId(id); + return new PolicyRemediationResource(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 PolicyMetadataResource GetPolicyMetadataResource(ResourceIdentifier id) + { + PolicyMetadataResource.ValidateResourceId(id); + return new PolicyMetadataResource(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 PolicyAttestationResource GetPolicyAttestationResource(ResourceIdentifier id) { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceRequest(Id, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + PolicyAttestationResource.ValidateResourceId(id); + return new PolicyAttestationResource(Client, id); } } } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsExtensions.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsExtensions.cs index 6daca714d386..66614822a7a5 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsExtensions.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.ManagementGroups; +using Azure.ResourceManager.PolicyInsights.Mocking; using Azure.ResourceManager.PolicyInsights.Models; using Azure.ResourceManager.Resources; @@ -20,149 +21,44 @@ namespace Azure.ResourceManager.PolicyInsights /// A class to add extension methods to Azure.ResourceManager.PolicyInsights. public static partial class PolicyInsightsExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static PolicyInsightsArmClientMockingExtension GetPolicyInsightsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PolicyInsightsArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PolicyInsightsManagementGroupMockingExtension GetPolicyInsightsManagementGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PolicyInsightsManagementGroupMockingExtension(client, resource.Id)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmResource resource) + private static PolicyInsightsResourceGroupMockingExtension GetPolicyInsightsResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ManagementGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PolicyInsightsResourceGroupMockingExtension(client, resource.Id)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PolicyInsightsSubscriptionMockingExtension GetPolicyInsightsSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ManagementGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PolicyInsightsSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PolicyInsightsTenantMockingExtension GetPolicyInsightsTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PolicyInsightsTenantMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region PolicyRemediationResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static PolicyRemediationResource GetPolicyRemediationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - PolicyRemediationResource.ValidateResourceId(id); - return new PolicyRemediationResource(client, id); - } - ); - } - #endregion - - #region PolicyMetadataResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static PolicyMetadataResource GetPolicyMetadataResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - PolicyMetadataResource.ValidateResourceId(id); - return new PolicyMetadataResource(client, id); - } - ); - } - #endregion - - #region PolicyAttestationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of PolicyRemediationResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static PolicyAttestationResource GetPolicyAttestationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - PolicyAttestationResource.ValidateResourceId(id); - return new PolicyAttestationResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of PolicyRemediationResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of PolicyRemediationResources and their operations over a PolicyRemediationResource. public static PolicyRemediationCollection GetPolicyRemediations(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetPolicyRemediations(); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyRemediations(scope); } /// @@ -177,17 +73,21 @@ public static PolicyRemediationCollection GetPolicyRemediations(this ArmClient c /// Remediations_GetAtResource /// /// + /// + /// 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 remediation. /// The cancellation token to use. - /// 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 static async Task> GetPolicyRemediationAsync(this ArmClient client, ResourceIdentifier scope, string remediationName, CancellationToken cancellationToken = default) { - return await client.GetPolicyRemediations(scope).GetAsync(remediationName, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsArmClientMockingExtension(client).GetPolicyRemediationAsync(scope, remediationName, cancellationToken).ConfigureAwait(false); } /// @@ -202,26 +102,36 @@ public static async Task> GetPolicyRemediati /// Remediations_GetAtResource /// /// + /// + /// 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 remediation. /// The cancellation token to use. - /// 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 static Response GetPolicyRemediation(this ArmClient client, ResourceIdentifier scope, string remediationName, CancellationToken cancellationToken = default) { - return client.GetPolicyRemediations(scope).Get(remediationName, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyRemediation(scope, remediationName, cancellationToken); } - /// Gets a collection of PolicyAttestationResources in the ArmResource. + /// + /// Gets a collection of PolicyAttestationResources 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. /// An object representing collection of PolicyAttestationResources and their operations over a PolicyAttestationResource. public static PolicyAttestationCollection GetPolicyAttestations(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetPolicyAttestations(); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyAttestations(scope); } /// @@ -236,17 +146,21 @@ public static PolicyAttestationCollection GetPolicyAttestations(this ArmClient c /// Attestations_GetAtResource /// /// + /// + /// 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 attestation. /// The cancellation token to use. - /// 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 static async Task> GetPolicyAttestationAsync(this ArmClient client, ResourceIdentifier scope, string attestationName, CancellationToken cancellationToken = default) { - return await client.GetPolicyAttestations(scope).GetAsync(attestationName, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsArmClientMockingExtension(client).GetPolicyAttestationAsync(scope, attestationName, cancellationToken).ConfigureAwait(false); } /// @@ -261,17 +175,21 @@ public static async Task> GetPolicyAttestati /// Attestations_GetAtResource /// /// + /// + /// 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 attestation. /// The cancellation token to use. - /// 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 static Response GetPolicyAttestation(this ArmClient client, ResourceIdentifier scope, string attestationName, CancellationToken cancellationToken = default) { - return client.GetPolicyAttestations(scope).Get(attestationName, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyAttestation(scope, attestationName, cancellationToken); } /// @@ -286,6 +204,10 @@ public static Response GetPolicyAttestation(this ArmC /// PolicyTrackedResources_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -294,7 +216,7 @@ public static Response GetPolicyAttestation(this ArmC /// The cancellation token to use. public static AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(this ArmClient client, ResourceIdentifier scope, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyTrackedResourceQueryResultsAsync(scope, policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -309,6 +231,10 @@ public static AsyncPageable GetPolicyTrackedResourc /// PolicyTrackedResources_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -317,7 +243,7 @@ public static AsyncPageable GetPolicyTrackedResourc /// The cancellation token to use. public static Pageable GetPolicyTrackedResourceQueryResults(this ArmClient client, ResourceIdentifier scope, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyTrackedResourceQueryResults(scope, policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -332,6 +258,10 @@ public static Pageable GetPolicyTrackedResourceQuer /// PolicyEvents_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -340,7 +270,7 @@ public static Pageable GetPolicyTrackedResourceQuer /// The cancellation token to use. public static AsyncPageable GetPolicyEventQueryResultsAsync(this ArmClient client, ResourceIdentifier scope, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyEventQueryResultsAsync(scope, policyEventType, policyQuerySettings, cancellationToken); } /// @@ -355,6 +285,10 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Ar /// PolicyEvents_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -363,7 +297,7 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Ar /// The cancellation token to use. public static Pageable GetPolicyEventQueryResults(this ArmClient client, ResourceIdentifier scope, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyEventQueryResults(scope, policyEventType, policyQuerySettings, cancellationToken); } /// @@ -378,6 +312,10 @@ public static Pageable GetPolicyEventQueryResults(this ArmClient cl /// PolicyStates_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -386,7 +324,7 @@ public static Pageable GetPolicyEventQueryResults(this ArmClient cl /// The cancellation token to use. public static AsyncPageable GetPolicyStateQueryResultsAsync(this ArmClient client, ResourceIdentifier scope, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyStateQueryResultsAsync(scope, policyStateType, policyQuerySettings, cancellationToken); } /// @@ -401,6 +339,10 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Ar /// PolicyStates_ListQueryResultsForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -409,7 +351,7 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Ar /// The cancellation token to use. public static Pageable GetPolicyStateQueryResults(this ArmClient client, ResourceIdentifier scope, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyStateQueryResults(scope, policyStateType, policyQuerySettings, cancellationToken); } /// @@ -424,6 +366,10 @@ public static Pageable GetPolicyStateQueryResults(this ArmClient cl /// PolicyStates_SummarizeForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -432,7 +378,7 @@ public static Pageable GetPolicyStateQueryResults(this ArmClient cl /// The cancellation token to use. public static AsyncPageable SummarizePolicyStatesAsync(this ArmClient client, ResourceIdentifier scope, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).SummarizePolicyStatesAsync(scope, policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -447,6 +393,10 @@ public static AsyncPageable SummarizePolicyStatesAsync(this ArmCl /// PolicyStates_SummarizeForResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -455,7 +405,55 @@ public static AsyncPageable SummarizePolicyStatesAsync(this ArmCl /// The cancellation token to use. public static Pageable SummarizePolicyStates(this ArmClient client, ResourceIdentifier scope, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsArmClientMockingExtension(client).SummarizePolicyStates(scope, policyStateSummaryType, policyQuerySettings, 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. + /// Returns a object. + public static PolicyRemediationResource GetPolicyRemediationResource(this ArmClient client, ResourceIdentifier id) + { + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyRemediationResource(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. + /// Returns a object. + public static PolicyMetadataResource GetPolicyMetadataResource(this ArmClient client, ResourceIdentifier id) + { + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyMetadataResource(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. + /// Returns a object. + public static PolicyAttestationResource GetPolicyAttestationResource(this ArmClient client, ResourceIdentifier id) + { + return GetPolicyInsightsArmClientMockingExtension(client).GetPolicyAttestationResource(id); } /// @@ -470,6 +468,10 @@ public static Pageable SummarizePolicyStates(this ArmClient clien /// PolicyTrackedResources_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -478,7 +480,7 @@ public static Pageable SummarizePolicyStates(this ArmClient clien /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(this ManagementGroupResource managementGroupResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -493,6 +495,10 @@ public static AsyncPageable GetPolicyTrackedResourc /// PolicyTrackedResources_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -501,7 +507,7 @@ public static AsyncPageable GetPolicyTrackedResourc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyTrackedResourceQueryResults(this ManagementGroupResource managementGroupResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -516,6 +522,10 @@ public static Pageable GetPolicyTrackedResourceQuer /// PolicyEvents_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -524,7 +534,7 @@ public static Pageable GetPolicyTrackedResourceQuer /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyEventQueryResultsAsync(this ManagementGroupResource managementGroupResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -539,6 +549,10 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Ma /// PolicyEvents_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -547,7 +561,7 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Ma /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyEventQueryResults(this ManagementGroupResource managementGroupResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -562,6 +576,10 @@ public static Pageable GetPolicyEventQueryResults(this ManagementGr /// PolicyStates_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -570,7 +588,7 @@ public static Pageable GetPolicyEventQueryResults(this ManagementGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyStateQueryResultsAsync(this ManagementGroupResource managementGroupResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -585,6 +603,10 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Ma /// PolicyStates_ListQueryResultsForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -593,7 +615,7 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Ma /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyStateQueryResults(this ManagementGroupResource managementGroupResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -608,6 +630,10 @@ public static Pageable GetPolicyStateQueryResults(this ManagementGr /// PolicyStates_SummarizeForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -616,7 +642,7 @@ public static Pageable GetPolicyStateQueryResults(this ManagementGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable SummarizePolicyStatesAsync(this ManagementGroupResource managementGroupResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -631,6 +657,10 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Manag /// PolicyStates_SummarizeForManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -639,7 +669,7 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Manag /// A collection of that may take multiple service requests to iterate over. public static Pageable SummarizePolicyStates(this ManagementGroupResource managementGroupResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -654,6 +684,10 @@ public static Pageable SummarizePolicyStates(this ManagementGroup /// PolicyRestrictions_CheckAtManagementGroupScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -661,9 +695,7 @@ public static Pageable SummarizePolicyStates(this ManagementGroup /// is null. public static async Task> CheckPolicyRestrictionsAsync(this ManagementGroupResource managementGroupResource, CheckManagementGroupPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetManagementGroupResourceExtensionClient(managementGroupResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -678,6 +710,10 @@ public static async Task> CheckPolicyRes /// PolicyRestrictions_CheckAtManagementGroupScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -685,9 +721,7 @@ public static async Task> CheckPolicyRes /// is null. public static Response CheckPolicyRestrictions(this ManagementGroupResource managementGroupResource, CheckManagementGroupPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetManagementGroupResourceExtensionClient(managementGroupResource).CheckPolicyRestrictions(content, cancellationToken); + return GetPolicyInsightsManagementGroupMockingExtension(managementGroupResource).CheckPolicyRestrictions(content, cancellationToken); } /// @@ -702,6 +736,10 @@ public static Response CheckPolicyRestrictions(th /// PolicyTrackedResources_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -710,7 +748,7 @@ public static Response CheckPolicyRestrictions(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(this ResourceGroupResource resourceGroupResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -725,6 +763,10 @@ public static AsyncPageable GetPolicyTrackedResourc /// PolicyTrackedResources_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -733,7 +775,7 @@ public static AsyncPageable GetPolicyTrackedResourc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyTrackedResourceQueryResults(this ResourceGroupResource resourceGroupResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -748,6 +790,10 @@ public static Pageable GetPolicyTrackedResourceQuer /// PolicyEvents_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -756,7 +802,7 @@ public static Pageable GetPolicyTrackedResourceQuer /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyEventQueryResultsAsync(this ResourceGroupResource resourceGroupResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -771,6 +817,10 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Re /// PolicyEvents_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -779,7 +829,7 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Re /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyEventQueryResults(this ResourceGroupResource resourceGroupResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -794,6 +844,10 @@ public static Pageable GetPolicyEventQueryResults(this ResourceGrou /// PolicyStates_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -802,7 +856,7 @@ public static Pageable GetPolicyEventQueryResults(this ResourceGrou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyStateQueryResultsAsync(this ResourceGroupResource resourceGroupResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -817,6 +871,10 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Re /// PolicyStates_ListQueryResultsForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -825,7 +883,7 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Re /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyStateQueryResults(this ResourceGroupResource resourceGroupResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -840,6 +898,10 @@ public static Pageable GetPolicyStateQueryResults(this ResourceGrou /// PolicyStates_SummarizeForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -848,7 +910,7 @@ public static Pageable GetPolicyStateQueryResults(this ResourceGrou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable SummarizePolicyStatesAsync(this ResourceGroupResource resourceGroupResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -863,6 +925,10 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Resou /// PolicyStates_SummarizeForResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -871,7 +937,7 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Resou /// A collection of that may take multiple service requests to iterate over. public static Pageable SummarizePolicyStates(this ResourceGroupResource resourceGroupResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -886,13 +952,17 @@ public static Pageable SummarizePolicyStates(this ResourceGroupRe /// PolicyStates_TriggerResourceGroupEvaluation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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 static async Task TriggerPolicyStateEvaluationAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, CancellationToken cancellationToken = default) { - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).TriggerPolicyStateEvaluationAsync(waitUntil, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).TriggerPolicyStateEvaluationAsync(waitUntil, cancellationToken).ConfigureAwait(false); } /// @@ -907,13 +977,17 @@ public static async Task TriggerPolicyStateEvaluationAsync(this Re /// PolicyStates_TriggerResourceGroupEvaluation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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 static ArmOperation TriggerPolicyStateEvaluation(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).TriggerPolicyStateEvaluation(waitUntil, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).TriggerPolicyStateEvaluation(waitUntil, cancellationToken); } /// @@ -928,6 +1002,10 @@ public static ArmOperation TriggerPolicyStateEvaluation(this ResourceGroupResour /// PolicyRestrictions_CheckAtResourceGroupScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -935,9 +1013,7 @@ public static ArmOperation TriggerPolicyStateEvaluation(this ResourceGroupResour /// is null. public static async Task> CheckPolicyRestrictionsAsync(this ResourceGroupResource resourceGroupResource, CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -952,6 +1028,10 @@ public static async Task> CheckPolicyRes /// PolicyRestrictions_CheckAtResourceGroupScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -959,9 +1039,7 @@ public static async Task> CheckPolicyRes /// is null. public static Response CheckPolicyRestrictions(this ResourceGroupResource resourceGroupResource, CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckPolicyRestrictions(content, cancellationToken); + return GetPolicyInsightsResourceGroupMockingExtension(resourceGroupResource).CheckPolicyRestrictions(content, cancellationToken); } /// @@ -976,6 +1054,10 @@ public static Response CheckPolicyRestrictions(th /// PolicyTrackedResources_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -984,7 +1066,7 @@ public static Response CheckPolicyRestrictions(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(this SubscriptionResource subscriptionResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyTrackedResourceQueryResultsAsync(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -999,6 +1081,10 @@ public static AsyncPageable GetPolicyTrackedResourc /// PolicyTrackedResources_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. @@ -1007,7 +1093,7 @@ public static AsyncPageable GetPolicyTrackedResourc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyTrackedResourceQueryResults(this SubscriptionResource subscriptionResource, PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyTrackedResourceQueryResults(policyTrackedResourceType, policyQuerySettings, cancellationToken); } /// @@ -1022,6 +1108,10 @@ public static Pageable GetPolicyTrackedResourceQuer /// PolicyEvents_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -1030,7 +1120,7 @@ public static Pageable GetPolicyTrackedResourceQuer /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyEventQueryResultsAsync(this SubscriptionResource subscriptionResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyEventQueryResultsAsync(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -1045,6 +1135,10 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Su /// PolicyEvents_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. @@ -1053,7 +1147,7 @@ public static AsyncPageable GetPolicyEventQueryResultsAsync(this Su /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyEventQueryResults(this SubscriptionResource subscriptionResource, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyEventQueryResults(policyEventType, policyQuerySettings, cancellationToken); } /// @@ -1068,6 +1162,10 @@ public static Pageable GetPolicyEventQueryResults(this Subscription /// PolicyStates_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -1076,7 +1174,7 @@ public static Pageable GetPolicyEventQueryResults(this Subscription /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPolicyStateQueryResultsAsync(this SubscriptionResource subscriptionResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyStateQueryResultsAsync(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -1091,6 +1189,10 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Su /// PolicyStates_ListQueryResultsForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). @@ -1099,7 +1201,7 @@ public static AsyncPageable GetPolicyStateQueryResultsAsync(this Su /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPolicyStateQueryResults(this SubscriptionResource subscriptionResource, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).GetPolicyStateQueryResults(policyStateType, policyQuerySettings, cancellationToken); } /// @@ -1114,6 +1216,10 @@ public static Pageable GetPolicyStateQueryResults(this Subscription /// PolicyStates_SummarizeForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -1122,7 +1228,7 @@ public static Pageable GetPolicyStateQueryResults(this Subscription /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable SummarizePolicyStatesAsync(this SubscriptionResource subscriptionResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).SummarizePolicyStatesAsync(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -1137,6 +1243,10 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Subsc /// PolicyStates_SummarizeForSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. @@ -1145,7 +1255,7 @@ public static AsyncPageable SummarizePolicyStatesAsync(this Subsc /// A collection of that may take multiple service requests to iterate over. public static Pageable SummarizePolicyStates(this SubscriptionResource subscriptionResource, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).SummarizePolicyStates(policyStateSummaryType, policyQuerySettings, cancellationToken); } /// @@ -1160,13 +1270,17 @@ public static Pageable SummarizePolicyStates(this SubscriptionRes /// PolicyStates_TriggerSubscriptionEvaluation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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 static async Task TriggerPolicyStateEvaluationAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).TriggerPolicyStateEvaluationAsync(waitUntil, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).TriggerPolicyStateEvaluationAsync(waitUntil, cancellationToken).ConfigureAwait(false); } /// @@ -1181,13 +1295,17 @@ public static async Task TriggerPolicyStateEvaluationAsync(this Su /// PolicyStates_TriggerSubscriptionEvaluation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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 static ArmOperation TriggerPolicyStateEvaluation(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).TriggerPolicyStateEvaluation(waitUntil, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).TriggerPolicyStateEvaluation(waitUntil, cancellationToken); } /// @@ -1202,6 +1320,10 @@ public static ArmOperation TriggerPolicyStateEvaluation(this SubscriptionResourc /// PolicyRestrictions_CheckAtSubscriptionScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -1209,9 +1331,7 @@ public static ArmOperation TriggerPolicyStateEvaluation(this SubscriptionResourc /// is null. public static async Task> CheckPolicyRestrictionsAsync(this SubscriptionResource subscriptionResource, CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).CheckPolicyRestrictionsAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -1226,6 +1346,10 @@ public static async Task> CheckPolicyRes /// PolicyRestrictions_CheckAtSubscriptionScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check policy restrictions parameters. @@ -1233,17 +1357,21 @@ public static async Task> CheckPolicyRes /// is null. public static Response CheckPolicyRestrictions(this SubscriptionResource subscriptionResource, CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPolicyRestrictions(content, cancellationToken); + return GetPolicyInsightsSubscriptionMockingExtension(subscriptionResource).CheckPolicyRestrictions(content, cancellationToken); } - /// Gets a collection of PolicyMetadataResources in the TenantResource. + /// + /// Gets a collection of PolicyMetadataResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PolicyMetadataResources and their operations over a PolicyMetadataResource. public static PolicyMetadataCollection GetAllPolicyMetadata(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAllPolicyMetadata(); + return GetPolicyInsightsTenantMockingExtension(tenantResource).GetAllPolicyMetadata(); } /// @@ -1258,6 +1386,10 @@ public static PolicyMetadataCollection GetAllPolicyMetadata(this TenantResource /// PolicyMetadata_GetResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the policy metadata resource. @@ -1266,7 +1398,7 @@ public static PolicyMetadataCollection GetAllPolicyMetadata(this TenantResource [ForwardsClientCalls] public static async Task> GetPolicyMetadataAsync(this TenantResource tenantResource, string resourceName, CancellationToken cancellationToken = default) { - return await tenantResource.GetAllPolicyMetadata().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetPolicyInsightsTenantMockingExtension(tenantResource).GetPolicyMetadataAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1281,6 +1413,10 @@ public static async Task> GetPolicyMetadataAsyn /// PolicyMetadata_GetResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the policy metadata resource. @@ -1289,7 +1425,7 @@ public static async Task> GetPolicyMetadataAsyn [ForwardsClientCalls] public static Response GetPolicyMetadata(this TenantResource tenantResource, string resourceName, CancellationToken cancellationToken = default) { - return tenantResource.GetAllPolicyMetadata().Get(resourceName, cancellationToken); + return GetPolicyInsightsTenantMockingExtension(tenantResource).GetPolicyMetadata(resourceName, cancellationToken); } } } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsManagementGroupMockingExtension.cs similarity index 90% rename from sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs rename to sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsManagementGroupMockingExtension.cs index aa11be80a77b..daa0346b3c05 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsManagementGroupMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PolicyInsights; using Azure.ResourceManager.PolicyInsights.Models; -namespace Azure.ResourceManager.PolicyInsights +namespace Azure.ResourceManager.PolicyInsights.Mocking { /// A class to add extension methods to ManagementGroupResource. - internal partial class ManagementGroupResourceExtensionClient : ArmResource + public partial class PolicyInsightsManagementGroupMockingExtension : ArmResource { private ClientDiagnostics _policyTrackedResourcesClientDiagnostics; private PolicyTrackedResourcesRestOperations _policyTrackedResourcesRestClient; @@ -29,15 +30,15 @@ internal partial class ManagementGroupResourceExtensionClient : ArmResource private ClientDiagnostics _policyRestrictionsClientDiagnostics; private PolicyRestrictionsRestOperations _policyRestrictionsRestClient; - /// Initializes a new instance of the class for mocking. - protected ManagementGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PolicyInsightsManagementGroupMockingExtension() { } - /// 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 ManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PolicyInsightsManagementGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -77,7 +78,7 @@ public virtual AsyncPageable GetPolicyTrackedResour { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyTrackedResourceType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -101,7 +102,7 @@ public virtual Pageable GetPolicyTrackedResourceQue { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyTrackedResourceType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -125,7 +126,7 @@ public virtual AsyncPageable GetPolicyEventQueryResultsAsync(Policy { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyEventType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -149,7 +150,7 @@ public virtual Pageable GetPolicyEventQueryResults(PolicyEventType { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyEventType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -173,7 +174,7 @@ public virtual AsyncPageable GetPolicyStateQueryResultsAsync(Policy { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyStateType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -197,7 +198,7 @@ public virtual Pageable GetPolicyStateQueryResults(PolicyStateType { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForManagementGroupRequest(Id.Name, policyStateType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForManagementGroupNextPageRequest(nextLink, Id.Name, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -220,7 +221,7 @@ public virtual Pageable GetPolicyStateQueryResults(PolicyStateType public virtual AsyncPageable SummarizePolicyStatesAsync(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForManagementGroupRequest(Id.Name, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); } /// @@ -243,7 +244,7 @@ public virtual AsyncPageable SummarizePolicyStatesAsync(PolicySta public virtual Pageable SummarizePolicyStates(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForManagementGroupRequest(Id.Name, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ManagementGroupResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsManagementGroupMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); } /// @@ -261,9 +262,12 @@ public virtual Pageable SummarizePolicyStates(PolicyStateSummaryT /// /// The check policy restrictions parameters. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPolicyRestrictionsAsync(CheckManagementGroupPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("ManagementGroupResourceExtensionClient.CheckPolicyRestrictions"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsManagementGroupMockingExtension.CheckPolicyRestrictions"); scope.Start(); try { @@ -292,9 +296,12 @@ public virtual async Task> CheckPolicyRe /// /// The check policy restrictions parameters. /// The cancellation token to use. + /// is null. public virtual Response CheckPolicyRestrictions(CheckManagementGroupPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("ManagementGroupResourceExtensionClient.CheckPolicyRestrictions"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsManagementGroupMockingExtension.CheckPolicyRestrictions"); scope.Start(); try { diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsResourceGroupMockingExtension.cs similarity index 58% rename from sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsResourceGroupMockingExtension.cs index 1fa1255266aa..ee4d2650a7a8 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsResourceGroupMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PolicyInsights; using Azure.ResourceManager.PolicyInsights.Models; -namespace Azure.ResourceManager.PolicyInsights +namespace Azure.ResourceManager.PolicyInsights.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class PolicyInsightsResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _policyTrackedResourcesClientDiagnostics; private PolicyTrackedResourcesRestOperations _policyTrackedResourcesRestClient; @@ -29,15 +30,15 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource private ClientDiagnostics _policyRestrictionsClientDiagnostics; private PolicyRestrictionsRestOperations _policyRestrictionsRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PolicyInsightsResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PolicyInsightsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -77,7 +78,7 @@ public virtual AsyncPageable GetPolicyTrackedResour { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyTrackedResourceType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -101,7 +102,7 @@ public virtual Pageable GetPolicyTrackedResourceQue { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyTrackedResourceType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); } /// @@ -125,7 +126,7 @@ public virtual AsyncPageable GetPolicyEventQueryResultsAsync(Policy { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyEventType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -149,7 +150,65 @@ public virtual Pageable GetPolicyEventQueryResults(PolicyEventType { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyEventType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyEventsAsync(string policyAssignmentName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyEvents(string policyAssignmentName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyEvents", "value", "@odata.nextLink", cancellationToken); } /// @@ -173,7 +232,7 @@ public virtual AsyncPageable GetPolicyStateQueryResultsAsync(Policy { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyStateType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -197,7 +256,7 @@ public virtual Pageable GetPolicyStateQueryResults(PolicyStateType { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyStateType, policyQuerySettings); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); } /// @@ -220,7 +279,7 @@ public virtual Pageable GetPolicyStateQueryResults(PolicyStateType public virtual AsyncPageable SummarizePolicyStatesAsync(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); } /// @@ -243,7 +302,7 @@ public virtual AsyncPageable SummarizePolicyStatesAsync(PolicySta public virtual Pageable SummarizePolicyStates(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); } /// @@ -263,7 +322,7 @@ public virtual Pageable SummarizePolicyStates(PolicyStateSummaryT /// The cancellation token to use. public virtual async Task TriggerPolicyStateEvaluationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = PolicyStatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.TriggerPolicyStateEvaluation"); + using var scope = PolicyStatesClientDiagnostics.CreateScope("PolicyInsightsResourceGroupMockingExtension.TriggerPolicyStateEvaluation"); scope.Start(); try { @@ -297,7 +356,7 @@ public virtual async Task TriggerPolicyStateEvaluationAsync(WaitUn /// The cancellation token to use. public virtual ArmOperation TriggerPolicyStateEvaluation(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = PolicyStatesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.TriggerPolicyStateEvaluation"); + using var scope = PolicyStatesClientDiagnostics.CreateScope("PolicyInsightsResourceGroupMockingExtension.TriggerPolicyStateEvaluation"); scope.Start(); try { @@ -314,6 +373,120 @@ public virtual ArmOperation TriggerPolicyStateEvaluation(WaitUntil waitUntil, Ca } } + /// + /// Queries policy states for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyStatesAsync(string policyAssignmentName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyStates(string policyAssignmentName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForResourceGroupLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.GetQueryResultsForResourceGroupLevelPolicyAssignmentPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Summarizes policy states for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable SummarizeForResourceGroupLevelPolicyAssignmentPolicyStatesAsync(string policyAssignmentName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.SummarizeForResourceGroupLevelPolicyAssignmentPolicyStates", "value", null, cancellationToken); + } + + /// + /// Summarizes policy states for the resource group level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForResourceGroupLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable SummarizeForResourceGroupLevelPolicyAssignmentPolicyStates(string policyAssignmentName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForResourceGroupLevelPolicyAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, policyAssignmentName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsResourceGroupMockingExtension.SummarizeForResourceGroupLevelPolicyAssignmentPolicyStates", "value", null, cancellationToken); + } + /// /// Checks what restrictions Azure Policy will place on a resource within a resource group. Use this when the resource group the resource will be created in is already known. /// @@ -329,9 +502,12 @@ public virtual ArmOperation TriggerPolicyStateEvaluation(WaitUntil waitUntil, Ca /// /// The check policy restrictions parameters. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPolicyRestrictionsAsync(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckPolicyRestrictions"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsResourceGroupMockingExtension.CheckPolicyRestrictions"); scope.Start(); try { @@ -360,9 +536,12 @@ public virtual async Task> CheckPolicyRe /// /// The check policy restrictions parameters. /// The cancellation token to use. + /// is null. public virtual Response CheckPolicyRestrictions(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckPolicyRestrictions"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsResourceGroupMockingExtension.CheckPolicyRestrictions"); scope.Start(); try { diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsSubscriptionMockingExtension.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsSubscriptionMockingExtension.cs new file mode 100644 index 000000000000..e96c7bf34bfd --- /dev/null +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsSubscriptionMockingExtension.cs @@ -0,0 +1,902 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.PolicyInsights; +using Azure.ResourceManager.PolicyInsights.Models; + +namespace Azure.ResourceManager.PolicyInsights.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class PolicyInsightsSubscriptionMockingExtension : ArmResource + { + private ClientDiagnostics _policyTrackedResourcesClientDiagnostics; + private PolicyTrackedResourcesRestOperations _policyTrackedResourcesRestClient; + private ClientDiagnostics _policyEventsClientDiagnostics; + private PolicyEventsRestOperations _policyEventsRestClient; + private ClientDiagnostics _policyStatesClientDiagnostics; + private PolicyStatesRestOperations _policyStatesRestClient; + private ClientDiagnostics _policyRestrictionsClientDiagnostics; + private PolicyRestrictionsRestOperations _policyRestrictionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected PolicyInsightsSubscriptionMockingExtension() + { + } + + /// 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 PolicyInsightsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics PolicyTrackedResourcesClientDiagnostics => _policyTrackedResourcesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PolicyTrackedResourcesRestOperations PolicyTrackedResourcesRestClient => _policyTrackedResourcesRestClient ??= new PolicyTrackedResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics PolicyEventsClientDiagnostics => _policyEventsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PolicyEventsRestOperations PolicyEventsRestClient => _policyEventsRestClient ??= new PolicyEventsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics PolicyStatesClientDiagnostics => _policyStatesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PolicyStatesRestOperations PolicyStatesRestClient => _policyStatesRestClient ??= new PolicyStatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics PolicyRestrictionsClientDiagnostics => _policyRestrictionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private PolicyRestrictionsRestOperations PolicyRestrictionsRestClient => _policyRestrictionsRestClient ??= new PolicyRestrictionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Queries policy tracked resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyTrackedResources_ListQueryResultsForSubscription + /// + /// + /// + /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + } + + /// + /// Queries policy tracked resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyTrackedResources_ListQueryResultsForSubscription + /// + /// + /// + /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPolicyTrackedResourceQueryResults(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); + } + + /// + /// Queries policy events for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForSubscription + /// + /// + /// + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPolicyEventQueryResultsAsync(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForSubscription + /// + /// + /// + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPolicyEventQueryResults(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForPolicySetDefinitionPolicyEventsAsync(string policySetDefinitionName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForPolicySetDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policySetDefinitionName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicySetDefinitionPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForPolicySetDefinitionPolicyEvents(string policySetDefinitionName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForPolicySetDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policySetDefinitionName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicySetDefinitionPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForPolicyDefinitionPolicyEventsAsync(string policyDefinitionName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForPolicyDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policyDefinitionName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicyDefinitionPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForPolicyDefinitionPolicyEvents(string policyDefinitionName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForPolicyDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policyDefinitionName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicyDefinitionPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyEventsAsync(string policyAssignmentName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, policyAssignmentName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy events for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults + /// + /// + /// Operation Id + /// PolicyEvents_ListQueryResultsForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyEvents(string policyAssignmentName, PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyEventType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, policyAssignmentName, policyEventType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyEvents", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForSubscription + /// + /// + /// + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPolicyStateQueryResultsAsync(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForSubscription + /// + /// + /// + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPolicyStateQueryResults(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Summarizes policy states for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForSubscription + /// + /// + /// + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable SummarizePolicyStatesAsync(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionRequest(Id.SubscriptionId, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); + } + + /// + /// Summarizes policy states for the resources under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForSubscription + /// + /// + /// + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable SummarizePolicyStates(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionRequest(Id.SubscriptionId, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizePolicyStates", "value", null, cancellationToken); + } + + /// + /// Triggers a policy evaluation scan for all the resources under the subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation + /// + /// + /// Operation Id + /// PolicyStates_TriggerSubscriptionEvaluation + /// + /// + /// + /// 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 TriggerPolicyStateEvaluationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = PolicyStatesClientDiagnostics.CreateScope("PolicyInsightsSubscriptionMockingExtension.TriggerPolicyStateEvaluation"); + scope.Start(); + try + { + var response = await PolicyStatesRestClient.TriggerSubscriptionEvaluationAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var operation = new PolicyInsightsArmOperation(PolicyStatesClientDiagnostics, Pipeline, PolicyStatesRestClient.CreateTriggerSubscriptionEvaluationRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Triggers a policy evaluation scan for all the resources under the subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation + /// + /// + /// Operation Id + /// PolicyStates_TriggerSubscriptionEvaluation + /// + /// + /// + /// 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 TriggerPolicyStateEvaluation(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = PolicyStatesClientDiagnostics.CreateScope("PolicyInsightsSubscriptionMockingExtension.TriggerPolicyStateEvaluation"); + scope.Start(); + try + { + var response = PolicyStatesRestClient.TriggerSubscriptionEvaluation(Id.SubscriptionId, cancellationToken); + var operation = new PolicyInsightsArmOperation(PolicyStatesClientDiagnostics, Pipeline, PolicyStatesRestClient.CreateTriggerSubscriptionEvaluationRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Queries policy states for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForPolicySetDefinitionPolicyStatesAsync(string policySetDefinitionName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForPolicySetDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policySetDefinitionName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicySetDefinitionPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForPolicySetDefinitionPolicyStates(string policySetDefinitionName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForPolicySetDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policySetDefinitionName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicySetDefinitionPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable SummarizeForPolicySetDefinitionPolicyStatesAsync(string policySetDefinitionName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForPolicySetDefinitionPolicyStates", "value", null, cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy set definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForPolicySetDefinition + /// + /// + /// + /// Policy set definition name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable SummarizeForPolicySetDefinitionPolicyStates(string policySetDefinitionName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policySetDefinitionName, nameof(policySetDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForPolicySetDefinitionRequest(Id.SubscriptionId, policySetDefinitionName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForPolicySetDefinitionPolicyStates", "value", null, cancellationToken); + } + + /// + /// Queries policy states for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForPolicyDefinitionPolicyStatesAsync(string policyDefinitionName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForPolicyDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policyDefinitionName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicyDefinitionPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForPolicyDefinitionPolicyStates(string policyDefinitionName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForPolicyDefinitionNextPageRequest(nextLink, Id.SubscriptionId, policyDefinitionName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForPolicyDefinitionPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable SummarizeForPolicyDefinitionPolicyStatesAsync(string policyDefinitionName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForPolicyDefinitionPolicyStates", "value", null, cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForPolicyDefinition + /// + /// + /// + /// Policy definition name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable SummarizeForPolicyDefinitionPolicyStates(string policyDefinitionName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyDefinitionName, nameof(policyDefinitionName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForPolicyDefinitionRequest(Id.SubscriptionId, policyDefinitionName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForPolicyDefinitionPolicyStates", "value", null, cancellationToken); + } + + /// + /// Queries policy states for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyStatesAsync(string policyAssignmentName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, policyAssignmentName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Queries policy states for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults + /// + /// + /// Operation Id + /// PolicyStates_ListQueryResultsForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyStates(string policyAssignmentName, PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyStateType, policyQuerySettings); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionLevelPolicyAssignmentNextPageRequest(nextLink, Id.SubscriptionId, policyAssignmentName, policyStateType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.GetQueryResultsForSubscriptionLevelPolicyAssignmentPolicyStates", "value", "@odata.nextLink", cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable SummarizeForSubscriptionLevelPolicyAssignmentPolicyStatesAsync(string policyAssignmentName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForSubscriptionLevelPolicyAssignmentPolicyStates", "value", null, cancellationToken); + } + + /// + /// Summarizes policy states for the subscription level policy assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize + /// + /// + /// Operation Id + /// PolicyStates_SummarizeForSubscriptionLevelPolicyAssignment + /// + /// + /// + /// Policy assignment name. + /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. + /// Parameter group. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable SummarizeForSubscriptionLevelPolicyAssignmentPolicyStates(string policyAssignmentName, PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyAssignmentName, nameof(policyAssignmentName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionLevelPolicyAssignmentRequest(Id.SubscriptionId, policyAssignmentName, policyStateSummaryType, policyQuerySettings); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "PolicyInsightsSubscriptionMockingExtension.SummarizeForSubscriptionLevelPolicyAssignmentPolicyStates", "value", null, cancellationToken); + } + + /// + /// Checks what restrictions Azure Policy will place on a resource within a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions + /// + /// + /// Operation Id + /// PolicyRestrictions_CheckAtSubscriptionScope + /// + /// + /// + /// The check policy restrictions parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckPolicyRestrictionsAsync(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsSubscriptionMockingExtension.CheckPolicyRestrictions"); + scope.Start(); + try + { + var response = await PolicyRestrictionsRestClient.CheckAtSubscriptionScopeAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks what restrictions Azure Policy will place on a resource within a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions + /// + /// + /// Operation Id + /// PolicyRestrictions_CheckAtSubscriptionScope + /// + /// + /// + /// The check policy restrictions parameters. + /// The cancellation token to use. + /// is null. + public virtual Response CheckPolicyRestrictions(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("PolicyInsightsSubscriptionMockingExtension.CheckPolicyRestrictions"); + scope.Start(); + try + { + var response = PolicyRestrictionsRestClient.CheckAtSubscriptionScope(Id.SubscriptionId, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsTenantMockingExtension.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsTenantMockingExtension.cs new file mode 100644 index 000000000000..cbd939e6605d --- /dev/null +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/PolicyInsightsTenantMockingExtension.cs @@ -0,0 +1,90 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PolicyInsights; + +namespace Azure.ResourceManager.PolicyInsights.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class PolicyInsightsTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PolicyInsightsTenantMockingExtension() + { + } + + /// 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 PolicyInsightsTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PolicyMetadataResources in the TenantResource. + /// An object representing collection of PolicyMetadataResources and their operations over a PolicyMetadataResource. + public virtual PolicyMetadataCollection GetAllPolicyMetadata() + { + return GetCachedClient(client => new PolicyMetadataCollection(client, Id)); + } + + /// + /// Get policy metadata resource. + /// + /// + /// Request Path + /// /providers/Microsoft.PolicyInsights/policyMetadata/{resourceName} + /// + /// + /// Operation Id + /// PolicyMetadata_GetResource + /// + /// + /// + /// The name of the policy metadata resource. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetPolicyMetadataAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetAllPolicyMetadata().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get policy metadata resource. + /// + /// + /// Request Path + /// /providers/Microsoft.PolicyInsights/policyMetadata/{resourceName} + /// + /// + /// Operation Id + /// PolicyMetadata_GetResource + /// + /// + /// + /// The name of the policy metadata resource. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetPolicyMetadata(string resourceName, CancellationToken cancellationToken = default) + { + return GetAllPolicyMetadata().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs deleted file mode 100644 index 0362d28004ea..000000000000 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.PolicyInsights.Models; - -namespace Azure.ResourceManager.PolicyInsights -{ - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource - { - private ClientDiagnostics _policyTrackedResourcesClientDiagnostics; - private PolicyTrackedResourcesRestOperations _policyTrackedResourcesRestClient; - private ClientDiagnostics _policyEventsClientDiagnostics; - private PolicyEventsRestOperations _policyEventsRestClient; - private ClientDiagnostics _policyStatesClientDiagnostics; - private PolicyStatesRestOperations _policyStatesRestClient; - private ClientDiagnostics _policyRestrictionsClientDiagnostics; - private PolicyRestrictionsRestOperations _policyRestrictionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() - { - } - - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics PolicyTrackedResourcesClientDiagnostics => _policyTrackedResourcesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PolicyTrackedResourcesRestOperations PolicyTrackedResourcesRestClient => _policyTrackedResourcesRestClient ??= new PolicyTrackedResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics PolicyEventsClientDiagnostics => _policyEventsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PolicyEventsRestOperations PolicyEventsRestClient => _policyEventsRestClient ??= new PolicyEventsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics PolicyStatesClientDiagnostics => _policyStatesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PolicyStatesRestOperations PolicyStatesRestClient => _policyStatesRestClient ??= new PolicyStatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics PolicyRestrictionsClientDiagnostics => _policyRestrictionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PolicyInsights", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private PolicyRestrictionsRestOperations PolicyRestrictionsRestClient => _policyRestrictionsRestClient ??= new PolicyRestrictionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Queries policy tracked resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults - /// - /// - /// Operation Id - /// PolicyTrackedResources_ListQueryResultsForSubscription - /// - /// - /// - /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. - /// Parameter group. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyTrackedResourceQueryResultsAsync(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); - } - - /// - /// Queries policy tracked resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyTrackedResources/{policyTrackedResourcesResource}/queryResults - /// - /// - /// Operation Id - /// PolicyTrackedResources_ListQueryResultsForSubscription - /// - /// - /// - /// The name of the virtual resource under PolicyTrackedResources resource type; only "default" is allowed. - /// Parameter group. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyTrackedResourceQueryResults(PolicyTrackedResourceType policyTrackedResourceType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyTrackedResourcesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyTrackedResourceType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyTrackedResourceRecord.DeserializePolicyTrackedResourceRecord, PolicyTrackedResourcesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyTrackedResourceQueryResults", "value", "nextLink", cancellationToken); - } - - /// - /// Queries policy events for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults - /// - /// - /// Operation Id - /// PolicyEvents_ListQueryResultsForSubscription - /// - /// - /// - /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. - /// Parameter group. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyEventQueryResultsAsync(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyEventType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); - } - - /// - /// Queries policy events for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults - /// - /// - /// Operation Id - /// PolicyEvents_ListQueryResultsForSubscription - /// - /// - /// - /// The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. - /// Parameter group. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyEventQueryResults(PolicyEventType policyEventType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyEventType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyEventsRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyEventType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyEvent.DeserializePolicyEvent, PolicyEventsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyEventQueryResults", "value", "@odata.nextLink", cancellationToken); - } - - /// - /// Queries policy states for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults - /// - /// - /// Operation Id - /// PolicyStates_ListQueryResultsForSubscription - /// - /// - /// - /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). - /// Parameter group. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPolicyStateQueryResultsAsync(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyStateType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); - } - - /// - /// Queries policy states for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults - /// - /// - /// Operation Id - /// PolicyStates_ListQueryResultsForSubscription - /// - /// - /// - /// The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). - /// Parameter group. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPolicyStateQueryResults(PolicyStateType policyStateType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionRequest(Id.SubscriptionId, policyStateType, policyQuerySettings); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PolicyStatesRestClient.CreateListQueryResultsForSubscriptionNextPageRequest(nextLink, Id.SubscriptionId, policyStateType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PolicyState.DeserializePolicyState, PolicyStatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPolicyStateQueryResults", "value", "@odata.nextLink", cancellationToken); - } - - /// - /// Summarizes policy states for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize - /// - /// - /// Operation Id - /// PolicyStates_SummarizeForSubscription - /// - /// - /// - /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. - /// Parameter group. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable SummarizePolicyStatesAsync(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionRequest(Id.SubscriptionId, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); - } - - /// - /// Summarizes policy states for the resources under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize - /// - /// - /// Operation Id - /// PolicyStates_SummarizeForSubscription - /// - /// - /// - /// The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. - /// Parameter group. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable SummarizePolicyStates(PolicyStateSummaryType policyStateSummaryType, PolicyQuerySettings policyQuerySettings = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => PolicyStatesRestClient.CreateSummarizeForSubscriptionRequest(Id.SubscriptionId, policyStateSummaryType, policyQuerySettings); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PolicySummary.DeserializePolicySummary, PolicyStatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.SummarizePolicyStates", "value", null, cancellationToken); - } - - /// - /// Triggers a policy evaluation scan for all the resources under the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation - /// - /// - /// Operation Id - /// PolicyStates_TriggerSubscriptionEvaluation - /// - /// - /// - /// 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 TriggerPolicyStateEvaluationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = PolicyStatesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TriggerPolicyStateEvaluation"); - scope.Start(); - try - { - var response = await PolicyStatesRestClient.TriggerSubscriptionEvaluationAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); - var operation = new PolicyInsightsArmOperation(PolicyStatesClientDiagnostics, Pipeline, PolicyStatesRestClient.CreateTriggerSubscriptionEvaluationRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Triggers a policy evaluation scan for all the resources under the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation - /// - /// - /// Operation Id - /// PolicyStates_TriggerSubscriptionEvaluation - /// - /// - /// - /// 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 TriggerPolicyStateEvaluation(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = PolicyStatesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.TriggerPolicyStateEvaluation"); - scope.Start(); - try - { - var response = PolicyStatesRestClient.TriggerSubscriptionEvaluation(Id.SubscriptionId, cancellationToken); - var operation = new PolicyInsightsArmOperation(PolicyStatesClientDiagnostics, Pipeline, PolicyStatesRestClient.CreateTriggerSubscriptionEvaluationRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks what restrictions Azure Policy will place on a resource within a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions - /// - /// - /// Operation Id - /// PolicyRestrictions_CheckAtSubscriptionScope - /// - /// - /// - /// The check policy restrictions parameters. - /// The cancellation token to use. - public virtual async Task> CheckPolicyRestrictionsAsync(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) - { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPolicyRestrictions"); - scope.Start(); - try - { - var response = await PolicyRestrictionsRestClient.CheckAtSubscriptionScopeAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks what restrictions Azure Policy will place on a resource within a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions - /// - /// - /// Operation Id - /// PolicyRestrictions_CheckAtSubscriptionScope - /// - /// - /// - /// The check policy restrictions parameters. - /// The cancellation token to use. - public virtual Response CheckPolicyRestrictions(CheckPolicyRestrictionsContent content, CancellationToken cancellationToken = default) - { - using var scope = PolicyRestrictionsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPolicyRestrictions"); - scope.Start(); - try - { - var response = PolicyRestrictionsRestClient.CheckAtSubscriptionScope(Id.SubscriptionId, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index adfc9a5d3fd4..000000000000 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PolicyInsights -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PolicyMetadataResources in the TenantResource. - /// An object representing collection of PolicyMetadataResources and their operations over a PolicyMetadataResource. - public virtual PolicyMetadataCollection GetAllPolicyMetadata() - { - return GetCachedClient(Client => new PolicyMetadataCollection(Client, Id)); - } - } -} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlArmClientMockingExtension.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlArmClientMockingExtension.cs new file mode 100644 index 000000000000..646d8e351012 --- /dev/null +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql; + +namespace Azure.ResourceManager.PostgreSql.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PostgreSqlArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PostgreSqlArmClientMockingExtension() + { + } + + /// 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 PostgreSqlArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PostgreSqlArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PostgreSqlServerResource GetPostgreSqlServerResource(ResourceIdentifier id) + { + PostgreSqlServerResource.ValidateResourceId(id); + return new PostgreSqlServerResource(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 PostgreSqlFirewallRuleResource GetPostgreSqlFirewallRuleResource(ResourceIdentifier id) + { + PostgreSqlFirewallRuleResource.ValidateResourceId(id); + return new PostgreSqlFirewallRuleResource(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 PostgreSqlVirtualNetworkRuleResource GetPostgreSqlVirtualNetworkRuleResource(ResourceIdentifier id) + { + PostgreSqlVirtualNetworkRuleResource.ValidateResourceId(id); + return new PostgreSqlVirtualNetworkRuleResource(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 PostgreSqlDatabaseResource GetPostgreSqlDatabaseResource(ResourceIdentifier id) + { + PostgreSqlDatabaseResource.ValidateResourceId(id); + return new PostgreSqlDatabaseResource(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 PostgreSqlConfigurationResource GetPostgreSqlConfigurationResource(ResourceIdentifier id) + { + PostgreSqlConfigurationResource.ValidateResourceId(id); + return new PostgreSqlConfigurationResource(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 PostgreSqlServerAdministratorResource GetPostgreSqlServerAdministratorResource(ResourceIdentifier id) + { + PostgreSqlServerAdministratorResource.ValidateResourceId(id); + return new PostgreSqlServerAdministratorResource(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 PostgreSqlServerSecurityAlertPolicyResource GetPostgreSqlServerSecurityAlertPolicyResource(ResourceIdentifier id) + { + PostgreSqlServerSecurityAlertPolicyResource.ValidateResourceId(id); + return new PostgreSqlServerSecurityAlertPolicyResource(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 PostgreSqlPrivateEndpointConnectionResource GetPostgreSqlPrivateEndpointConnectionResource(ResourceIdentifier id) + { + PostgreSqlPrivateEndpointConnectionResource.ValidateResourceId(id); + return new PostgreSqlPrivateEndpointConnectionResource(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 PostgreSqlPrivateLinkResource GetPostgreSqlPrivateLinkResource(ResourceIdentifier id) + { + PostgreSqlPrivateLinkResource.ValidateResourceId(id); + return new PostgreSqlPrivateLinkResource(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 PostgreSqlServerKeyResource GetPostgreSqlServerKeyResource(ResourceIdentifier id) + { + PostgreSqlServerKeyResource.ValidateResourceId(id); + return new PostgreSqlServerKeyResource(Client, id); + } + } +} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlExtensions.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlExtensions.cs index 8a3289f9fa39..28b70c24b8c3 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlExtensions.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.Mocking; using Azure.ResourceManager.PostgreSql.Models; using Azure.ResourceManager.Resources; @@ -19,233 +20,193 @@ namespace Azure.ResourceManager.PostgreSql /// A class to add extension methods to Azure.ResourceManager.PostgreSql. public static partial class PostgreSqlExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PostgreSqlArmClientMockingExtension GetPostgreSqlArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PostgreSqlArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PostgreSqlResourceGroupMockingExtension GetPostgreSqlResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PostgreSqlResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PostgreSqlSubscriptionMockingExtension GetPostgreSqlSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PostgreSqlSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region PostgreSqlServerResource /// /// 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. /// Returns a object. public static PostgreSqlServerResource GetPostgreSqlServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlServerResource.ValidateResourceId(id); - return new PostgreSqlServerResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlServerResource(id); } - #endregion - #region PostgreSqlFirewallRuleResource /// /// 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. /// Returns a object. public static PostgreSqlFirewallRuleResource GetPostgreSqlFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFirewallRuleResource.ValidateResourceId(id); - return new PostgreSqlFirewallRuleResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlFirewallRuleResource(id); } - #endregion - #region PostgreSqlVirtualNetworkRuleResource /// /// 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. /// Returns a object. public static PostgreSqlVirtualNetworkRuleResource GetPostgreSqlVirtualNetworkRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlVirtualNetworkRuleResource.ValidateResourceId(id); - return new PostgreSqlVirtualNetworkRuleResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlVirtualNetworkRuleResource(id); } - #endregion - #region PostgreSqlDatabaseResource /// /// 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. /// Returns a object. public static PostgreSqlDatabaseResource GetPostgreSqlDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlDatabaseResource.ValidateResourceId(id); - return new PostgreSqlDatabaseResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlDatabaseResource(id); } - #endregion - #region PostgreSqlConfigurationResource /// /// 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. /// Returns a object. public static PostgreSqlConfigurationResource GetPostgreSqlConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlConfigurationResource.ValidateResourceId(id); - return new PostgreSqlConfigurationResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlConfigurationResource(id); } - #endregion - #region PostgreSqlServerAdministratorResource /// /// 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. /// Returns a object. public static PostgreSqlServerAdministratorResource GetPostgreSqlServerAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlServerAdministratorResource.ValidateResourceId(id); - return new PostgreSqlServerAdministratorResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlServerAdministratorResource(id); } - #endregion - #region PostgreSqlServerSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static PostgreSqlServerSecurityAlertPolicyResource GetPostgreSqlServerSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlServerSecurityAlertPolicyResource.ValidateResourceId(id); - return new PostgreSqlServerSecurityAlertPolicyResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlServerSecurityAlertPolicyResource(id); } - #endregion - #region PostgreSqlPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static PostgreSqlPrivateEndpointConnectionResource GetPostgreSqlPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlPrivateEndpointConnectionResource.ValidateResourceId(id); - return new PostgreSqlPrivateEndpointConnectionResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlPrivateEndpointConnectionResource(id); } - #endregion - #region PostgreSqlPrivateLinkResource /// /// 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. /// Returns a object. public static PostgreSqlPrivateLinkResource GetPostgreSqlPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlPrivateLinkResource.ValidateResourceId(id); - return new PostgreSqlPrivateLinkResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlPrivateLinkResource(id); } - #endregion - #region PostgreSqlServerKeyResource /// /// 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. /// Returns a object. public static PostgreSqlServerKeyResource GetPostgreSqlServerKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlServerKeyResource.ValidateResourceId(id); - return new PostgreSqlServerKeyResource(client, id); - } - ); + return GetPostgreSqlArmClientMockingExtension(client).GetPostgreSqlServerKeyResource(id); } - #endregion - /// Gets a collection of PostgreSqlServerResources in the ResourceGroupResource. + /// + /// Gets a collection of PostgreSqlServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PostgreSqlServerResources and their operations over a PostgreSqlServerResource. public static PostgreSqlServerCollection GetPostgreSqlServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPostgreSqlServers(); + return GetPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlServers(); } /// @@ -260,16 +221,20 @@ public static PostgreSqlServerCollection GetPostgreSqlServers(this ResourceGroup /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static async Task> GetPostgreSqlServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPostgreSqlServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlServerAsync(serverName, cancellationToken).ConfigureAwait(false); } /// @@ -284,16 +249,20 @@ public static async Task> GetPostgreSqlServer /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static Response GetPostgreSqlServer(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPostgreSqlServers().Get(serverName, cancellationToken); + return GetPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlServer(serverName, cancellationToken); } /// @@ -308,13 +277,17 @@ public static Response GetPostgreSqlServer(this Resour /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPostgreSqlServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPostgreSqlServersAsync(cancellationToken); + return GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetPostgreSqlServersAsync(cancellationToken); } /// @@ -329,13 +302,17 @@ public static AsyncPageable GetPostgreSqlServersAsync( /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPostgreSqlServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPostgreSqlServers(cancellationToken); + return GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetPostgreSqlServers(cancellationToken); } /// @@ -350,6 +327,10 @@ public static Pageable GetPostgreSqlServers(this Subsc /// LocationBasedPerformanceTier_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -357,7 +338,7 @@ public static Pageable GetPostgreSqlServers(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLocationBasedPerformanceTiersAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedPerformanceTiersAsync(locationName, cancellationToken); + return GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetLocationBasedPerformanceTiersAsync(locationName, cancellationToken); } /// @@ -372,6 +353,10 @@ public static AsyncPageable GetLocationBase /// LocationBasedPerformanceTier_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -379,7 +364,7 @@ public static AsyncPageable GetLocationBase /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLocationBasedPerformanceTiers(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLocationBasedPerformanceTiers(locationName, cancellationToken); + return GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetLocationBasedPerformanceTiers(locationName, cancellationToken); } /// @@ -394,6 +379,10 @@ public static Pageable GetLocationBasedPerf /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -401,9 +390,7 @@ public static Pageable GetLocationBasedPerf /// is null. public static async Task> CheckPostgreSqlNameAvailabilityAsync(this SubscriptionResource subscriptionResource, PostgreSqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -418,6 +405,10 @@ public static async Task> CheckPostgr /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -425,9 +416,7 @@ public static async Task> CheckPostgr /// is null. public static Response CheckPostgreSqlNameAvailability(this SubscriptionResource subscriptionResource, PostgreSqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlNameAvailability(content, cancellationToken); + return GetPostgreSqlSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlNameAvailability(content, cancellationToken); } } } diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlResourceGroupMockingExtension.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..cf9f77a8b7e7 --- /dev/null +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql; + +namespace Azure.ResourceManager.PostgreSql.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PostgreSqlResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PostgreSqlResourceGroupMockingExtension() + { + } + + /// 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 PostgreSqlResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PostgreSqlServerResources in the ResourceGroupResource. + /// An object representing collection of PostgreSqlServerResources and their operations over a PostgreSqlServerResource. + public virtual PostgreSqlServerCollection GetPostgreSqlServers() + { + return GetCachedClient(client => new PostgreSqlServerCollection(client, Id)); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPostgreSqlServerAsync(string serverName, CancellationToken cancellationToken = default) + { + return await GetPostgreSqlServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPostgreSqlServer(string serverName, CancellationToken cancellationToken = default) + { + return GetPostgreSqlServers().Get(serverName, cancellationToken); + } + } +} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlSubscriptionMockingExtension.cs similarity index 87% rename from sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlSubscriptionMockingExtension.cs index c5f8c73b20ab..7945ec308243 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/PostgreSqlSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql; using Azure.ResourceManager.PostgreSql.Models; -namespace Azure.ResourceManager.PostgreSql +namespace Azure.ResourceManager.PostgreSql.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PostgreSqlSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _postgreSqlServerServersClientDiagnostics; private ServersRestOperations _postgreSqlServerServersRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _checkNameAvailabilityClientDiagnostics; private CheckNameAvailabilityRestOperations _checkNameAvailabilityRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PostgreSqlSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PostgreSqlSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,7 +71,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetPostgreSqlServersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PostgreSqlServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new PostgreSqlServerResource(Client, PostgreSqlServerData.DeserializePostgreSqlServerData(e)), PostgreSqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPostgreSqlServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new PostgreSqlServerResource(Client, PostgreSqlServerData.DeserializePostgreSqlServerData(e)), PostgreSqlServerServersClientDiagnostics, Pipeline, "PostgreSqlSubscriptionMockingExtension.GetPostgreSqlServers", "value", null, cancellationToken); } /// @@ -91,7 +92,7 @@ public virtual AsyncPageable GetPostgreSqlServersAsync public virtual Pageable GetPostgreSqlServers(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => PostgreSqlServerServersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new PostgreSqlServerResource(Client, PostgreSqlServerData.DeserializePostgreSqlServerData(e)), PostgreSqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPostgreSqlServers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new PostgreSqlServerResource(Client, PostgreSqlServerData.DeserializePostgreSqlServerData(e)), PostgreSqlServerServersClientDiagnostics, Pipeline, "PostgreSqlSubscriptionMockingExtension.GetPostgreSqlServers", "value", null, cancellationToken); } /// @@ -113,7 +114,7 @@ public virtual Pageable GetPostgreSqlServers(Cancellat public virtual AsyncPageable GetLocationBasedPerformanceTiersAsync(AzureLocation locationName, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedPerformanceTierRestClient.CreateListRequest(Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PostgreSqlPerformanceTierProperties.DeserializePostgreSqlPerformanceTierProperties, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, PostgreSqlPerformanceTierProperties.DeserializePostgreSqlPerformanceTierProperties, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "PostgreSqlSubscriptionMockingExtension.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); } /// @@ -135,7 +136,7 @@ public virtual AsyncPageable GetLocationBas public virtual Pageable GetLocationBasedPerformanceTiers(AzureLocation locationName, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedPerformanceTierRestClient.CreateListRequest(Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PostgreSqlPerformanceTierProperties.DeserializePostgreSqlPerformanceTierProperties, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, PostgreSqlPerformanceTierProperties.DeserializePostgreSqlPerformanceTierProperties, LocationBasedPerformanceTierClientDiagnostics, Pipeline, "PostgreSqlSubscriptionMockingExtension.GetLocationBasedPerformanceTiers", "value", null, cancellationToken); } /// @@ -153,9 +154,12 @@ public virtual Pageable GetLocationBasedPer /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPostgreSqlNameAvailabilityAsync(PostgreSqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("PostgreSqlSubscriptionMockingExtension.CheckPostgreSqlNameAvailability"); scope.Start(); try { @@ -184,9 +188,12 @@ public virtual async Task> CheckPostg /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckPostgreSqlNameAvailability(PostgreSqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("PostgreSqlSubscriptionMockingExtension.CheckPostgreSqlNameAvailability"); scope.Start(); try { diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 46cd056c429b..000000000000 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PostgreSql -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PostgreSqlServerResources in the ResourceGroupResource. - /// An object representing collection of PostgreSqlServerResources and their operations over a PostgreSqlServerResource. - public virtual PostgreSqlServerCollection GetPostgreSqlServers() - { - return GetCachedClient(Client => new PostgreSqlServerCollection(Client, Id)); - } - } -} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/PostgreSqlServerResource.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/PostgreSqlServerResource.cs index a7efb75139ae..cdd84fddfed1 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/PostgreSqlServerResource.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSql/Generated/PostgreSqlServerResource.cs @@ -110,7 +110,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PostgreSqlFirewallRuleResources and their operations over a PostgreSqlFirewallRuleResource. public virtual PostgreSqlFirewallRuleCollection GetPostgreSqlFirewallRules() { - return GetCachedClient(Client => new PostgreSqlFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFirewallRuleCollection(client, Id)); } /// @@ -128,8 +128,8 @@ public virtual PostgreSqlFirewallRuleCollection GetPostgreSqlFirewallRules() /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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> GetPostgreSqlFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task> GetPostgreSq /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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 GetPostgreSqlFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -163,7 +163,7 @@ public virtual Response GetPostgreSqlFirewallRul /// An object representing collection of PostgreSqlVirtualNetworkRuleResources and their operations over a PostgreSqlVirtualNetworkRuleResource. public virtual PostgreSqlVirtualNetworkRuleCollection GetPostgreSqlVirtualNetworkRules() { - return GetCachedClient(Client => new PostgreSqlVirtualNetworkRuleCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlVirtualNetworkRuleCollection(client, Id)); } /// @@ -181,8 +181,8 @@ public virtual PostgreSqlVirtualNetworkRuleCollection GetPostgreSqlVirtualNetwor /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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> GetPostgreSqlVirtualNetworkRuleAsync(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetPos /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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 GetPostgreSqlVirtualNetworkRule(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -216,7 +216,7 @@ public virtual Response GetPostgreSqlVirtu /// An object representing collection of PostgreSqlDatabaseResources and their operations over a PostgreSqlDatabaseResource. public virtual PostgreSqlDatabaseCollection GetPostgreSqlDatabases() { - return GetCachedClient(Client => new PostgreSqlDatabaseCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlDatabaseCollection(client, Id)); } /// @@ -234,8 +234,8 @@ public virtual PostgreSqlDatabaseCollection GetPostgreSqlDatabases() /// /// The name of the database. /// The cancellation token to use. - /// 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> GetPostgreSqlDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -257,8 +257,8 @@ public virtual async Task> GetPostgreSqlDat /// /// The name of the database. /// The cancellation token to use. - /// 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 GetPostgreSqlDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -269,7 +269,7 @@ public virtual Response GetPostgreSqlDatabase(string /// An object representing collection of PostgreSqlConfigurationResources and their operations over a PostgreSqlConfigurationResource. public virtual PostgreSqlConfigurationCollection GetPostgreSqlConfigurations() { - return GetCachedClient(Client => new PostgreSqlConfigurationCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlConfigurationCollection(client, Id)); } /// @@ -287,8 +287,8 @@ public virtual PostgreSqlConfigurationCollection GetPostgreSqlConfigurations() /// /// The name of the server configuration. /// The cancellation token to use. - /// 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> GetPostgreSqlConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -310,8 +310,8 @@ public virtual async Task> GetPostgreS /// /// The name of the server configuration. /// The cancellation token to use. - /// 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 GetPostgreSqlConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -329,7 +329,7 @@ public virtual PostgreSqlServerAdministratorResource GetPostgreSqlServerAdminist /// An object representing collection of PostgreSqlServerSecurityAlertPolicyResources and their operations over a PostgreSqlServerSecurityAlertPolicyResource. public virtual PostgreSqlServerSecurityAlertPolicyCollection GetPostgreSqlServerSecurityAlertPolicies() { - return GetCachedClient(Client => new PostgreSqlServerSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlServerSecurityAlertPolicyCollection(client, Id)); } /// @@ -378,7 +378,7 @@ public virtual Response GetPostgreS /// An object representing collection of PostgreSqlPrivateEndpointConnectionResources and their operations over a PostgreSqlPrivateEndpointConnectionResource. public virtual PostgreSqlPrivateEndpointConnectionCollection GetPostgreSqlPrivateEndpointConnections() { - return GetCachedClient(Client => new PostgreSqlPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlPrivateEndpointConnectionCollection(client, Id)); } /// @@ -396,8 +396,8 @@ public virtual PostgreSqlPrivateEndpointConnectionCollection GetPostgreSqlPrivat /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetPostgreSqlPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -419,8 +419,8 @@ public virtual async Task> /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetPostgreSqlPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -431,7 +431,7 @@ public virtual Response GetPostgreS /// An object representing collection of PostgreSqlPrivateLinkResources and their operations over a PostgreSqlPrivateLinkResource. public virtual PostgreSqlPrivateLinkResourceCollection GetPostgreSqlPrivateLinkResources() { - return GetCachedClient(Client => new PostgreSqlPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlPrivateLinkResourceCollection(client, Id)); } /// @@ -449,8 +449,8 @@ public virtual PostgreSqlPrivateLinkResourceCollection GetPostgreSqlPrivateLinkR /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetPostgreSqlPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -472,8 +472,8 @@ public virtual async Task> GetPostgreSql /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetPostgreSqlPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -484,7 +484,7 @@ public virtual Response GetPostgreSqlPrivateLinkR /// An object representing collection of PostgreSqlServerKeyResources and their operations over a PostgreSqlServerKeyResource. public virtual PostgreSqlServerKeyCollection GetPostgreSqlServerKeys() { - return GetCachedClient(Client => new PostgreSqlServerKeyCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlServerKeyCollection(client, Id)); } /// @@ -502,8 +502,8 @@ public virtual PostgreSqlServerKeyCollection GetPostgreSqlServerKeys() /// /// The name of the PostgreSQL Server key to be retrieved. /// The cancellation token to use. - /// 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> GetPostgreSqlServerKeyAsync(string keyName, CancellationToken cancellationToken = default) { @@ -525,8 +525,8 @@ public virtual async Task> GetPostgreSqlSe /// /// The name of the PostgreSQL Server key to be retrieved. /// The cancellation token to use. - /// 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 GetPostgreSqlServerKey(string keyName, CancellationToken cancellationToken = default) { diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs index 929c823d9440..68195e442c07 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/FlexibleServersExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.FlexibleServers.Mocking; using Azure.ResourceManager.PostgreSql.FlexibleServers.Models; using Azure.ResourceManager.Resources; @@ -19,211 +20,166 @@ namespace Azure.ResourceManager.PostgreSql.FlexibleServers /// A class to add extension methods to Azure.ResourceManager.PostgreSql.FlexibleServers. public static partial class FlexibleServersExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PostgreSqlFlexibleServersArmClientMockingExtension GetPostgreSqlFlexibleServersArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PostgreSqlFlexibleServersArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PostgreSqlFlexibleServersResourceGroupMockingExtension GetPostgreSqlFlexibleServersResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PostgreSqlFlexibleServersResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PostgreSqlFlexibleServersSubscriptionMockingExtension GetPostgreSqlFlexibleServersSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PostgreSqlFlexibleServersSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PostgreSqlFlexibleServersTenantMockingExtension GetPostgreSqlFlexibleServersTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PostgreSqlFlexibleServersTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region PostgreSqlFlexibleServerActiveDirectoryAdministratorResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerActiveDirectoryAdministratorResource GetPostgreSqlFlexibleServerActiveDirectoryAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerActiveDirectoryAdministratorResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerActiveDirectoryAdministratorResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerActiveDirectoryAdministratorResource(id); } - #endregion - #region PostgreSqlFlexibleServerBackupResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerBackupResource GetPostgreSqlFlexibleServerBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerBackupResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerBackupResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerBackupResource(id); } - #endregion - #region PostgreSqlFlexibleServerConfigurationResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerConfigurationResource GetPostgreSqlFlexibleServerConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerConfigurationResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerConfigurationResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerConfigurationResource(id); } - #endregion - #region PostgreSqlFlexibleServerDatabaseResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerDatabaseResource GetPostgreSqlFlexibleServerDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerDatabaseResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerDatabaseResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerDatabaseResource(id); } - #endregion - #region PostgreSqlFlexibleServerFirewallRuleResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerFirewallRuleResource GetPostgreSqlFlexibleServerFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerFirewallRuleResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerFirewallRuleResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerFirewallRuleResource(id); } - #endregion - #region PostgreSqlFlexibleServerResource /// /// 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. /// Returns a object. public static PostgreSqlFlexibleServerResource GetPostgreSqlFlexibleServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlFlexibleServerResource.ValidateResourceId(id); - return new PostgreSqlFlexibleServerResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlFlexibleServerResource(id); } - #endregion - #region PostgreSqlMigrationResource /// /// 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. /// Returns a object. public static PostgreSqlMigrationResource GetPostgreSqlMigrationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlMigrationResource.ValidateResourceId(id); - return new PostgreSqlMigrationResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlMigrationResource(id); } - #endregion - #region PostgreSqlLtrServerBackupOperationResource /// /// 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. /// Returns a object. public static PostgreSqlLtrServerBackupOperationResource GetPostgreSqlLtrServerBackupOperationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PostgreSqlLtrServerBackupOperationResource.ValidateResourceId(id); - return new PostgreSqlLtrServerBackupOperationResource(client, id); - } - ); + return GetPostgreSqlFlexibleServersArmClientMockingExtension(client).GetPostgreSqlLtrServerBackupOperationResource(id); } - #endregion - /// Gets a collection of PostgreSqlFlexibleServerResources in the ResourceGroupResource. + /// + /// Gets a collection of PostgreSqlFlexibleServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PostgreSqlFlexibleServerResources and their operations over a PostgreSqlFlexibleServerResource. public static PostgreSqlFlexibleServerCollection GetPostgreSqlFlexibleServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPostgreSqlFlexibleServers(); + return GetPostgreSqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlFlexibleServers(); } /// @@ -238,16 +194,20 @@ public static PostgreSqlFlexibleServerCollection GetPostgreSqlFlexibleServers(th /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static async Task> GetPostgreSqlFlexibleServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPostgreSqlFlexibleServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlFlexibleServerAsync(serverName, cancellationToken).ConfigureAwait(false); } /// @@ -262,16 +222,20 @@ public static async Task> GetPostgreS /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The cancellation token to use. - /// 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 static Response GetPostgreSqlFlexibleServer(this ResourceGroupResource resourceGroupResource, string serverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPostgreSqlFlexibleServers().Get(serverName, cancellationToken); + return GetPostgreSqlFlexibleServersResourceGroupMockingExtension(resourceGroupResource).GetPostgreSqlFlexibleServer(serverName, cancellationToken); } /// @@ -286,6 +250,10 @@ public static Response GetPostgreSqlFlexibleSe /// LocationBasedCapabilities_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -293,7 +261,7 @@ public static Response GetPostgreSqlFlexibleSe /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable ExecuteLocationBasedCapabilitiesAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteLocationBasedCapabilitiesAsync(locationName, cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteLocationBasedCapabilitiesAsync(locationName, cancellationToken); } /// @@ -308,6 +276,10 @@ public static AsyncPageable Execut /// LocationBasedCapabilities_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -315,7 +287,7 @@ public static AsyncPageable Execut /// A collection of that may take multiple service requests to iterate over. public static Pageable ExecuteLocationBasedCapabilities(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteLocationBasedCapabilities(locationName, cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteLocationBasedCapabilities(locationName, cancellationToken); } /// @@ -330,6 +302,10 @@ public static Pageable ExecuteLoca /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -337,9 +313,7 @@ public static Pageable ExecuteLoca /// is null. public static async Task> CheckPostgreSqlFlexibleServerNameAvailabilityAsync(this SubscriptionResource subscriptionResource, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -354,6 +328,10 @@ public static async TaskCheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -361,9 +339,7 @@ public static async Task is null. public static Response CheckPostgreSqlFlexibleServerNameAvailability(this SubscriptionResource subscriptionResource, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailability(content, cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailability(content, cancellationToken); } /// @@ -378,6 +354,10 @@ public static Response CheckPost /// CheckNameAvailabilityWithLocation_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -386,9 +366,7 @@ public static Response CheckPost /// is null. public static async Task> CheckPostgreSqlFlexibleServerNameAvailabilityWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityWithLocationAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityWithLocationAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -403,6 +381,10 @@ public static async TaskCheckNameAvailabilityWithLocation_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -411,9 +393,7 @@ public static async Task is null. public static Response CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation(this SubscriptionResource subscriptionResource, AzureLocation locationName, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation(locationName, content, cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation(locationName, content, cancellationToken); } /// @@ -428,13 +408,17 @@ public static Response CheckPost /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPostgreSqlFlexibleServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPostgreSqlFlexibleServersAsync(cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetPostgreSqlFlexibleServersAsync(cancellationToken); } /// @@ -449,13 +433,17 @@ public static AsyncPageable GetPostgreSqlFlexi /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPostgreSqlFlexibleServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPostgreSqlFlexibleServers(cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).GetPostgreSqlFlexibleServers(cancellationToken); } /// @@ -470,6 +458,10 @@ public static Pageable GetPostgreSqlFlexibleSe /// VirtualNetworkSubnetUsage_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -478,9 +470,7 @@ public static Pageable GetPostgreSqlFlexibleSe /// is null. public static async Task> ExecuteVirtualNetworkSubnetUsageAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, PostgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteVirtualNetworkSubnetUsageAsync(locationName, postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteVirtualNetworkSubnetUsageAsync(locationName, postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken).ConfigureAwait(false); } /// @@ -495,6 +485,10 @@ public static async TaskVirtualNetworkSubnetUsage_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the location. @@ -503,9 +497,7 @@ public static async Task is null. public static Response ExecuteVirtualNetworkSubnetUsage(this SubscriptionResource subscriptionResource, AzureLocation locationName, PostgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExecuteVirtualNetworkSubnetUsage(locationName, postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken); + return GetPostgreSqlFlexibleServersSubscriptionMockingExtension(subscriptionResource).ExecuteVirtualNetworkSubnetUsage(locationName, postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, cancellationToken); } /// @@ -520,12 +512,16 @@ public static Response /// GetPrivateDnsZoneSuffix_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> ExecuteGetPrivateDnsZoneSuffixAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).ExecuteGetPrivateDnsZoneSuffixAsync(cancellationToken).ConfigureAwait(false); + return await GetPostgreSqlFlexibleServersTenantMockingExtension(tenantResource).ExecuteGetPrivateDnsZoneSuffixAsync(cancellationToken).ConfigureAwait(false); } /// @@ -540,12 +536,16 @@ public static async Task> ExecuteGetPrivateDnsZoneSuffixAsync(t /// GetPrivateDnsZoneSuffix_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response ExecuteGetPrivateDnsZoneSuffix(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).ExecuteGetPrivateDnsZoneSuffix(cancellationToken); + return GetPostgreSqlFlexibleServersTenantMockingExtension(tenantResource).ExecuteGetPrivateDnsZoneSuffix(cancellationToken); } } } diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersArmClientMockingExtension.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersArmClientMockingExtension.cs new file mode 100644 index 000000000000..0ee0a29bf4bb --- /dev/null +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersArmClientMockingExtension.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.FlexibleServers; + +namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PostgreSqlFlexibleServersArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PostgreSqlFlexibleServersArmClientMockingExtension() + { + } + + /// 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 PostgreSqlFlexibleServersArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PostgreSqlFlexibleServersArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PostgreSqlFlexibleServerActiveDirectoryAdministratorResource GetPostgreSqlFlexibleServerActiveDirectoryAdministratorResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerActiveDirectoryAdministratorResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerActiveDirectoryAdministratorResource(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 PostgreSqlFlexibleServerBackupResource GetPostgreSqlFlexibleServerBackupResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerBackupResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerBackupResource(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 PostgreSqlFlexibleServerConfigurationResource GetPostgreSqlFlexibleServerConfigurationResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerConfigurationResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerConfigurationResource(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 PostgreSqlFlexibleServerDatabaseResource GetPostgreSqlFlexibleServerDatabaseResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerDatabaseResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerDatabaseResource(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 PostgreSqlFlexibleServerFirewallRuleResource GetPostgreSqlFlexibleServerFirewallRuleResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerFirewallRuleResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerFirewallRuleResource(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 PostgreSqlFlexibleServerResource GetPostgreSqlFlexibleServerResource(ResourceIdentifier id) + { + PostgreSqlFlexibleServerResource.ValidateResourceId(id); + return new PostgreSqlFlexibleServerResource(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 PostgreSqlMigrationResource GetPostgreSqlMigrationResource(ResourceIdentifier id) + { + PostgreSqlMigrationResource.ValidateResourceId(id); + return new PostgreSqlMigrationResource(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 PostgreSqlLtrServerBackupOperationResource GetPostgreSqlLtrServerBackupOperationResource(ResourceIdentifier id) + { + PostgreSqlLtrServerBackupOperationResource.ValidateResourceId(id); + return new PostgreSqlLtrServerBackupOperationResource(Client, id); + } + } +} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersResourceGroupMockingExtension.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..741ca5ffece2 --- /dev/null +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.FlexibleServers; + +namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PostgreSqlFlexibleServersResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PostgreSqlFlexibleServersResourceGroupMockingExtension() + { + } + + /// 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 PostgreSqlFlexibleServersResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PostgreSqlFlexibleServerResources in the ResourceGroupResource. + /// An object representing collection of PostgreSqlFlexibleServerResources and their operations over a PostgreSqlFlexibleServerResource. + public virtual PostgreSqlFlexibleServerCollection GetPostgreSqlFlexibleServers() + { + return GetCachedClient(client => new PostgreSqlFlexibleServerCollection(client, Id)); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPostgreSqlFlexibleServerAsync(string serverName, CancellationToken cancellationToken = default) + { + return await GetPostgreSqlFlexibleServers().GetAsync(serverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPostgreSqlFlexibleServer(string serverName, CancellationToken cancellationToken = default) + { + return GetPostgreSqlFlexibleServers().Get(serverName, cancellationToken); + } + } +} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersSubscriptionMockingExtension.cs similarity index 85% rename from sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersSubscriptionMockingExtension.cs index 3e335cbefe4b..d9c058e81361 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.FlexibleServers; using Azure.ResourceManager.PostgreSql.FlexibleServers.Models; -namespace Azure.ResourceManager.PostgreSql.FlexibleServers +namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PostgreSqlFlexibleServersSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _locationBasedCapabilitiesClientDiagnostics; private LocationBasedCapabilitiesRestOperations _locationBasedCapabilitiesRestClient; @@ -31,15 +32,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _virtualNetworkSubnetUsageClientDiagnostics; private VirtualNetworkSubnetUsageRestOperations _virtualNetworkSubnetUsageRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PostgreSqlFlexibleServersSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PostgreSqlFlexibleServersSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -80,7 +81,7 @@ public virtual AsyncPageable Execu { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedCapabilitiesRestClient.CreateExecuteRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationBasedCapabilitiesRestClient.CreateExecuteNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PostgreSqlFlexibleServerCapabilityProperties.DeserializePostgreSqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.ExecuteLocationBasedCapabilities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, PostgreSqlFlexibleServerCapabilityProperties.DeserializePostgreSqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "PostgreSqlFlexibleServersSubscriptionMockingExtension.ExecuteLocationBasedCapabilities", "value", "nextLink", cancellationToken); } /// @@ -103,7 +104,7 @@ public virtual Pageable ExecuteLoc { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationBasedCapabilitiesRestClient.CreateExecuteRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationBasedCapabilitiesRestClient.CreateExecuteNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PostgreSqlFlexibleServerCapabilityProperties.DeserializePostgreSqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.ExecuteLocationBasedCapabilities", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, PostgreSqlFlexibleServerCapabilityProperties.DeserializePostgreSqlFlexibleServerCapabilityProperties, LocationBasedCapabilitiesClientDiagnostics, Pipeline, "PostgreSqlFlexibleServersSubscriptionMockingExtension.ExecuteLocationBasedCapabilities", "value", "nextLink", cancellationToken); } /// @@ -121,9 +122,12 @@ public virtual Pageable ExecuteLoc /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPostgreSqlFlexibleServerNameAvailabilityAsync(PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlFlexibleServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.CheckPostgreSqlFlexibleServerNameAvailability"); scope.Start(); try { @@ -152,9 +156,12 @@ public virtual async Task /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckPostgreSqlFlexibleServerNameAvailability(PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlFlexibleServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.CheckPostgreSqlFlexibleServerNameAvailability"); scope.Start(); try { @@ -184,9 +191,12 @@ public virtual Response CheckPos /// The name of the location. /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPostgreSqlFlexibleServerNameAvailabilityWithLocationAsync(AzureLocation locationName, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityWithLocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityWithLocationClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation"); scope.Start(); try { @@ -216,9 +226,12 @@ public virtual async Task The name of the location. /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation(AzureLocation locationName, PostgreSqlFlexibleServerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityWithLocationClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityWithLocationClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.CheckPostgreSqlFlexibleServerNameAvailabilityWithLocation"); scope.Start(); try { @@ -251,7 +264,7 @@ public virtual AsyncPageable GetPostgreSqlFlex { HttpMessage FirstPageRequest(int? pageSizeHint) => PostgreSqlFlexibleServerServersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PostgreSqlFlexibleServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PostgreSqlFlexibleServerResource(Client, PostgreSqlFlexibleServerData.DeserializePostgreSqlFlexibleServerData(e)), PostgreSqlFlexibleServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPostgreSqlFlexibleServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PostgreSqlFlexibleServerResource(Client, PostgreSqlFlexibleServerData.DeserializePostgreSqlFlexibleServerData(e)), PostgreSqlFlexibleServerServersClientDiagnostics, Pipeline, "PostgreSqlFlexibleServersSubscriptionMockingExtension.GetPostgreSqlFlexibleServers", "value", "nextLink", cancellationToken); } /// @@ -273,7 +286,7 @@ public virtual Pageable GetPostgreSqlFlexibleS { HttpMessage FirstPageRequest(int? pageSizeHint) => PostgreSqlFlexibleServerServersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PostgreSqlFlexibleServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PostgreSqlFlexibleServerResource(Client, PostgreSqlFlexibleServerData.DeserializePostgreSqlFlexibleServerData(e)), PostgreSqlFlexibleServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPostgreSqlFlexibleServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PostgreSqlFlexibleServerResource(Client, PostgreSqlFlexibleServerData.DeserializePostgreSqlFlexibleServerData(e)), PostgreSqlFlexibleServerServersClientDiagnostics, Pipeline, "PostgreSqlFlexibleServersSubscriptionMockingExtension.GetPostgreSqlFlexibleServers", "value", "nextLink", cancellationToken); } /// @@ -292,9 +305,12 @@ public virtual Pageable GetPostgreSqlFlexibleS /// The name of the location. /// The required parameters for creating or updating a server. /// The cancellation token to use. + /// is null. public virtual async Task> ExecuteVirtualNetworkSubnetUsageAsync(AzureLocation locationName, PostgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - using var scope = VirtualNetworkSubnetUsageClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExecuteVirtualNetworkSubnetUsage"); + Argument.AssertNotNull(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter)); + + using var scope = VirtualNetworkSubnetUsageClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.ExecuteVirtualNetworkSubnetUsage"); scope.Start(); try { @@ -324,9 +340,12 @@ public virtual async Task The name of the location. /// The required parameters for creating or updating a server. /// The cancellation token to use. + /// is null. public virtual Response ExecuteVirtualNetworkSubnetUsage(AzureLocation locationName, PostgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, CancellationToken cancellationToken = default) { - using var scope = VirtualNetworkSubnetUsageClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExecuteVirtualNetworkSubnetUsage"); + Argument.AssertNotNull(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter, nameof(postgreSqlFlexibleServerVirtualNetworkSubnetUsageParameter)); + + using var scope = VirtualNetworkSubnetUsageClientDiagnostics.CreateScope("PostgreSqlFlexibleServersSubscriptionMockingExtension.ExecuteVirtualNetworkSubnetUsage"); scope.Start(); try { diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersTenantMockingExtension.cs similarity index 83% rename from sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersTenantMockingExtension.cs index b7a7c06aa8c3..9dc116d5dde7 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/PostgreSqlFlexibleServersTenantMockingExtension.cs @@ -12,24 +12,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PostgreSql.FlexibleServers; -namespace Azure.ResourceManager.PostgreSql.FlexibleServers +namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class PostgreSqlFlexibleServersTenantMockingExtension : ArmResource { private ClientDiagnostics _getPrivateDnsZoneSuffixClientDiagnostics; private GetPrivateDnsZoneSuffixRestOperations _getPrivateDnsZoneSuffixRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PostgreSqlFlexibleServersTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PostgreSqlFlexibleServersTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,7 +59,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> ExecuteGetPrivateDnsZoneSuffixAsync(CancellationToken cancellationToken = default) { - using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExecuteGetPrivateDnsZoneSuffix"); + using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("PostgreSqlFlexibleServersTenantMockingExtension.ExecuteGetPrivateDnsZoneSuffix"); scope.Start(); try { @@ -88,7 +89,7 @@ public virtual async Task> ExecuteGetPrivateDnsZoneSuffixAsync( /// The cancellation token to use. public virtual Response ExecuteGetPrivateDnsZoneSuffix(CancellationToken cancellationToken = default) { - using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExecuteGetPrivateDnsZoneSuffix"); + using var scope = GetPrivateDnsZoneSuffixClientDiagnostics.CreateScope("PostgreSqlFlexibleServersTenantMockingExtension.ExecuteGetPrivateDnsZoneSuffix"); scope.Start(); try { diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 143eadb87c54..000000000000 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PostgreSql.FlexibleServers -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PostgreSqlFlexibleServerResources in the ResourceGroupResource. - /// An object representing collection of PostgreSqlFlexibleServerResources and their operations over a PostgreSqlFlexibleServerResource. - public virtual PostgreSqlFlexibleServerCollection GetPostgreSqlFlexibleServers() - { - return GetCachedClient(Client => new PostgreSqlFlexibleServerCollection(Client, Id)); - } - } -} diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs index 60af361759e2..449f719f0707 100644 --- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs +++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs @@ -110,7 +110,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PostgreSqlFlexibleServerActiveDirectoryAdministratorResources and their operations over a PostgreSqlFlexibleServerActiveDirectoryAdministratorResource. public virtual PostgreSqlFlexibleServerActiveDirectoryAdministratorCollection GetPostgreSqlFlexibleServerActiveDirectoryAdministrators() { - return GetCachedClient(Client => new PostgreSqlFlexibleServerActiveDirectoryAdministratorCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFlexibleServerActiveDirectoryAdministratorCollection(client, Id)); } /// @@ -128,8 +128,8 @@ public virtual PostgreSqlFlexibleServerActiveDirectoryAdministratorCollection Ge /// /// Guid of the objectId for the administrator. /// The cancellation token to use. - /// 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> GetPostgreSqlFlexibleServerActiveDirectoryAdministratorAsync(string objectId, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task /// Guid of the objectId for the administrator. /// The cancellation token to use. - /// 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 GetPostgreSqlFlexibleServerActiveDirectoryAdministrator(string objectId, CancellationToken cancellationToken = default) { @@ -163,7 +163,7 @@ public virtual Response An object representing collection of PostgreSqlFlexibleServerBackupResources and their operations over a PostgreSqlFlexibleServerBackupResource. public virtual PostgreSqlFlexibleServerBackupCollection GetPostgreSqlFlexibleServerBackups() { - return GetCachedClient(Client => new PostgreSqlFlexibleServerBackupCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFlexibleServerBackupCollection(client, Id)); } /// @@ -181,8 +181,8 @@ public virtual PostgreSqlFlexibleServerBackupCollection GetPostgreSqlFlexibleSer /// /// The name of the backup. /// The cancellation token to use. - /// 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> GetPostgreSqlFlexibleServerBackupAsync(string backupName, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetP /// /// The name of the backup. /// The cancellation token to use. - /// 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 GetPostgreSqlFlexibleServerBackup(string backupName, CancellationToken cancellationToken = default) { @@ -216,7 +216,7 @@ public virtual Response GetPostgreSqlFle /// An object representing collection of PostgreSqlFlexibleServerConfigurationResources and their operations over a PostgreSqlFlexibleServerConfigurationResource. public virtual PostgreSqlFlexibleServerConfigurationCollection GetPostgreSqlFlexibleServerConfigurations() { - return GetCachedClient(Client => new PostgreSqlFlexibleServerConfigurationCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFlexibleServerConfigurationCollection(client, Id)); } /// @@ -234,8 +234,8 @@ public virtual PostgreSqlFlexibleServerConfigurationCollection GetPostgreSqlFlex /// /// The name of the server configuration. /// The cancellation token to use. - /// 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> GetPostgreSqlFlexibleServerConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -257,8 +257,8 @@ public virtual async Task /// The name of the server configuration. /// The cancellation token to use. - /// 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 GetPostgreSqlFlexibleServerConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -269,7 +269,7 @@ public virtual Response GetPostgr /// An object representing collection of PostgreSqlFlexibleServerDatabaseResources and their operations over a PostgreSqlFlexibleServerDatabaseResource. public virtual PostgreSqlFlexibleServerDatabaseCollection GetPostgreSqlFlexibleServerDatabases() { - return GetCachedClient(Client => new PostgreSqlFlexibleServerDatabaseCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFlexibleServerDatabaseCollection(client, Id)); } /// @@ -287,8 +287,8 @@ public virtual PostgreSqlFlexibleServerDatabaseCollection GetPostgreSqlFlexibleS /// /// The name of the database. /// The cancellation token to use. - /// 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> GetPostgreSqlFlexibleServerDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -310,8 +310,8 @@ public virtual async Task> Ge /// /// The name of the database. /// The cancellation token to use. - /// 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 GetPostgreSqlFlexibleServerDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -322,7 +322,7 @@ public virtual Response GetPostgreSqlF /// An object representing collection of PostgreSqlFlexibleServerFirewallRuleResources and their operations over a PostgreSqlFlexibleServerFirewallRuleResource. public virtual PostgreSqlFlexibleServerFirewallRuleCollection GetPostgreSqlFlexibleServerFirewallRules() { - return GetCachedClient(Client => new PostgreSqlFlexibleServerFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlFlexibleServerFirewallRuleCollection(client, Id)); } /// @@ -340,8 +340,8 @@ public virtual PostgreSqlFlexibleServerFirewallRuleCollection GetPostgreSqlFlexi /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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> GetPostgreSqlFlexibleServerFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -363,8 +363,8 @@ public virtual async Task /// /// The name of the server firewall rule. /// The cancellation token to use. - /// 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 GetPostgreSqlFlexibleServerFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -375,7 +375,7 @@ public virtual Response GetPostgre /// An object representing collection of PostgreSqlMigrationResources and their operations over a PostgreSqlMigrationResource. public virtual PostgreSqlMigrationCollection GetPostgreSqlMigrations() { - return GetCachedClient(Client => new PostgreSqlMigrationCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlMigrationCollection(client, Id)); } /// @@ -393,8 +393,8 @@ public virtual PostgreSqlMigrationCollection GetPostgreSqlMigrations() /// /// The name of the migration. /// The cancellation token to use. - /// 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> GetPostgreSqlMigrationAsync(string migrationName, CancellationToken cancellationToken = default) { @@ -416,8 +416,8 @@ public virtual async Task> GetPostgreSqlMi /// /// The name of the migration. /// The cancellation token to use. - /// 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 GetPostgreSqlMigration(string migrationName, CancellationToken cancellationToken = default) { @@ -428,7 +428,7 @@ public virtual Response GetPostgreSqlMigration(stri /// An object representing collection of PostgreSqlLtrServerBackupOperationResources and their operations over a PostgreSqlLtrServerBackupOperationResource. public virtual PostgreSqlLtrServerBackupOperationCollection GetPostgreSqlLtrServerBackupOperations() { - return GetCachedClient(Client => new PostgreSqlLtrServerBackupOperationCollection(Client, Id)); + return GetCachedClient(client => new PostgreSqlLtrServerBackupOperationCollection(client, Id)); } /// @@ -446,8 +446,8 @@ public virtual PostgreSqlLtrServerBackupOperationCollection GetPostgreSqlLtrServ /// /// The name of the backup. /// The cancellation token to use. - /// 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> GetPostgreSqlLtrServerBackupOperationAsync(string backupName, CancellationToken cancellationToken = default) { @@ -469,8 +469,8 @@ public virtual async Task> /// /// The name of the backup. /// The cancellation token to use. - /// 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 GetPostgreSqlLtrServerBackupOperation(string backupName, CancellationToken cancellationToken = default) { diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedArmClientMockingExtension.cs b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedArmClientMockingExtension.cs new file mode 100644 index 000000000000..ec213ad62f7c --- /dev/null +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PowerBIDedicated; + +namespace Azure.ResourceManager.PowerBIDedicated.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PowerBIDedicatedArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PowerBIDedicatedArmClientMockingExtension() + { + } + + /// 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 PowerBIDedicatedArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PowerBIDedicatedArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DedicatedCapacityResource GetDedicatedCapacityResource(ResourceIdentifier id) + { + DedicatedCapacityResource.ValidateResourceId(id); + return new DedicatedCapacityResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutoScaleVCoreResource GetAutoScaleVCoreResource(ResourceIdentifier id) + { + AutoScaleVCoreResource.ValidateResourceId(id); + return new AutoScaleVCoreResource(Client, id); + } + } +} diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedExtensions.cs b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedExtensions.cs index 70eab902cfdf..ddb9fc349f5e 100644 --- a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedExtensions.cs +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.PowerBIDedicated.Mocking; using Azure.ResourceManager.PowerBIDedicated.Models; using Azure.ResourceManager.Resources; @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.PowerBIDedicated /// A class to add extension methods to Azure.ResourceManager.PowerBIDedicated. public static partial class PowerBIDedicatedExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PowerBIDedicatedArmClientMockingExtension GetPowerBIDedicatedArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PowerBIDedicatedArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PowerBIDedicatedResourceGroupMockingExtension GetPowerBIDedicatedResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PowerBIDedicatedResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PowerBIDedicatedSubscriptionMockingExtension GetPowerBIDedicatedSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PowerBIDedicatedSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DedicatedCapacityResource /// /// 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. /// Returns a object. public static DedicatedCapacityResource GetDedicatedCapacityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DedicatedCapacityResource.ValidateResourceId(id); - return new DedicatedCapacityResource(client, id); - } - ); + return GetPowerBIDedicatedArmClientMockingExtension(client).GetDedicatedCapacityResource(id); } - #endregion - #region AutoScaleVCoreResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AutoScaleVCoreResource GetAutoScaleVCoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AutoScaleVCoreResource.ValidateResourceId(id); - return new AutoScaleVCoreResource(client, id); - } - ); + return GetPowerBIDedicatedArmClientMockingExtension(client).GetAutoScaleVCoreResource(id); } - #endregion - /// Gets a collection of DedicatedCapacityResources in the ResourceGroupResource. + /// + /// Gets a collection of DedicatedCapacityResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DedicatedCapacityResources and their operations over a DedicatedCapacityResource. public static DedicatedCapacityCollection GetDedicatedCapacities(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDedicatedCapacities(); + return GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetDedicatedCapacities(); } /// @@ -108,16 +93,20 @@ public static DedicatedCapacityCollection GetDedicatedCapacities(this ResourceGr /// Capacities_GetDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated capacity. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static async Task> GetDedicatedCapacityAsync(this ResourceGroupResource resourceGroupResource, string dedicatedCapacityName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDedicatedCapacities().GetAsync(dedicatedCapacityName, cancellationToken).ConfigureAwait(false); + return await GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetDedicatedCapacityAsync(dedicatedCapacityName, cancellationToken).ConfigureAwait(false); } /// @@ -132,24 +121,34 @@ public static async Task> GetDedicatedCapaci /// Capacities_GetDetails /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated capacity. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static Response GetDedicatedCapacity(this ResourceGroupResource resourceGroupResource, string dedicatedCapacityName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDedicatedCapacities().Get(dedicatedCapacityName, cancellationToken); + return GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetDedicatedCapacity(dedicatedCapacityName, cancellationToken); } - /// Gets a collection of AutoScaleVCoreResources in the ResourceGroupResource. + /// + /// Gets a collection of AutoScaleVCoreResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutoScaleVCoreResources and their operations over a AutoScaleVCoreResource. public static AutoScaleVCoreCollection GetAutoScaleVCores(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAutoScaleVCores(); + return GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetAutoScaleVCores(); } /// @@ -164,16 +163,20 @@ public static AutoScaleVCoreCollection GetAutoScaleVCores(this ResourceGroupReso /// AutoScaleVCores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static async Task> GetAutoScaleVCoreAsync(this ResourceGroupResource resourceGroupResource, string vcoreName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAutoScaleVCores().GetAsync(vcoreName, cancellationToken).ConfigureAwait(false); + return await GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetAutoScaleVCoreAsync(vcoreName, cancellationToken).ConfigureAwait(false); } /// @@ -188,16 +191,20 @@ public static async Task> GetAutoScaleVCoreAsyn /// AutoScaleVCores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. /// The cancellation token to use. - /// 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 static Response GetAutoScaleVCore(this ResourceGroupResource resourceGroupResource, string vcoreName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAutoScaleVCores().Get(vcoreName, cancellationToken); + return GetPowerBIDedicatedResourceGroupMockingExtension(resourceGroupResource).GetAutoScaleVCore(vcoreName, cancellationToken); } /// @@ -212,13 +219,17 @@ public static Response GetAutoScaleVCore(this ResourceGr /// Capacities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDedicatedCapacitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedCapacitiesAsync(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetDedicatedCapacitiesAsync(cancellationToken); } /// @@ -233,13 +244,17 @@ public static AsyncPageable GetDedicatedCapacitiesAsy /// Capacities_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDedicatedCapacities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedCapacities(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetDedicatedCapacities(cancellationToken); } /// @@ -254,13 +269,17 @@ public static Pageable GetDedicatedCapacities(this Su /// Capacities_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusCapacitiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusCapacitiesAsync(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetSkusCapacitiesAsync(cancellationToken); } /// @@ -275,13 +294,17 @@ public static AsyncPageable GetSkusCapacitiesAsync(this Subscriptio /// Capacities_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkusCapacities(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusCapacities(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetSkusCapacities(cancellationToken); } /// @@ -296,6 +319,10 @@ public static Pageable GetSkusCapacities(this SubscriptionResource /// Capacities_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region name which the operation will lookup into. @@ -304,9 +331,7 @@ public static Pageable GetSkusCapacities(this SubscriptionResource /// is null. public static async Task> CheckNameAvailabilityCapacityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CheckCapacityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityCapacityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityCapacityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -321,6 +346,10 @@ public static async Task> CheckNam /// Capacities_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The region name which the operation will lookup into. @@ -329,9 +358,7 @@ public static async Task> CheckNam /// is null. public static Response CheckNameAvailabilityCapacity(this SubscriptionResource subscriptionResource, AzureLocation location, CheckCapacityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityCapacity(location, content, cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityCapacity(location, content, cancellationToken); } /// @@ -346,13 +373,17 @@ public static Response CheckNameAvailabilit /// AutoScaleVCores_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAutoScaleVCoresAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoScaleVCoresAsync(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetAutoScaleVCoresAsync(cancellationToken); } /// @@ -367,13 +398,17 @@ public static AsyncPageable GetAutoScaleVCoresAsync(this /// AutoScaleVCores_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAutoScaleVCores(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoScaleVCores(cancellationToken); + return GetPowerBIDedicatedSubscriptionMockingExtension(subscriptionResource).GetAutoScaleVCores(cancellationToken); } } } diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedResourceGroupMockingExtension.cs b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..251541faaceb --- /dev/null +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PowerBIDedicated; + +namespace Azure.ResourceManager.PowerBIDedicated.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PowerBIDedicatedResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PowerBIDedicatedResourceGroupMockingExtension() + { + } + + /// 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 PowerBIDedicatedResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DedicatedCapacityResources in the ResourceGroupResource. + /// An object representing collection of DedicatedCapacityResources and their operations over a DedicatedCapacityResource. + public virtual DedicatedCapacityCollection GetDedicatedCapacities() + { + return GetCachedClient(client => new DedicatedCapacityCollection(client, Id)); + } + + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName} + /// + /// + /// Operation Id + /// Capacities_GetDetails + /// + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDedicatedCapacityAsync(string dedicatedCapacityName, CancellationToken cancellationToken = default) + { + return await GetDedicatedCapacities().GetAsync(dedicatedCapacityName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details about the specified dedicated capacity. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName} + /// + /// + /// Operation Id + /// Capacities_GetDetails + /// + /// + /// + /// The name of the dedicated capacity. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDedicatedCapacity(string dedicatedCapacityName, CancellationToken cancellationToken = default) + { + return GetDedicatedCapacities().Get(dedicatedCapacityName, cancellationToken); + } + + /// Gets a collection of AutoScaleVCoreResources in the ResourceGroupResource. + /// An object representing collection of AutoScaleVCoreResources and their operations over a AutoScaleVCoreResource. + public virtual AutoScaleVCoreCollection GetAutoScaleVCores() + { + return GetCachedClient(client => new AutoScaleVCoreCollection(client, Id)); + } + + /// + /// Gets details about the specified auto scale v-core. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName} + /// + /// + /// Operation Id + /// AutoScaleVCores_Get + /// + /// + /// + /// The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutoScaleVCoreAsync(string vcoreName, CancellationToken cancellationToken = default) + { + return await GetAutoScaleVCores().GetAsync(vcoreName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details about the specified auto scale v-core. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName} + /// + /// + /// Operation Id + /// AutoScaleVCores_Get + /// + /// + /// + /// The name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutoScaleVCore(string vcoreName, CancellationToken cancellationToken = default) + { + return GetAutoScaleVCores().Get(vcoreName, cancellationToken); + } + } +} diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedSubscriptionMockingExtension.cs similarity index 86% rename from sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedSubscriptionMockingExtension.cs index 43d508f594bc..6a6bd1136b9a 100644 --- a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/PowerBIDedicatedSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PowerBIDedicated; using Azure.ResourceManager.PowerBIDedicated.Models; -namespace Azure.ResourceManager.PowerBIDedicated +namespace Azure.ResourceManager.PowerBIDedicated.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PowerBIDedicatedSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dedicatedCapacityCapacitiesClientDiagnostics; private CapacitiesRestOperations _dedicatedCapacityCapacitiesRestClient; private ClientDiagnostics _autoScaleVCoreClientDiagnostics; private AutoScaleVCoresRestOperations _autoScaleVCoreRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PowerBIDedicatedSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PowerBIDedicatedSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetDedicatedCapacitiesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedCapacityCapacitiesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new DedicatedCapacityResource(Client, DedicatedCapacityData.DeserializeDedicatedCapacityData(e)), DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedCapacities", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new DedicatedCapacityResource(Client, DedicatedCapacityData.DeserializeDedicatedCapacityData(e)), DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetDedicatedCapacities", "value", null, cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual AsyncPageable GetDedicatedCapacitiesAs public virtual Pageable GetDedicatedCapacities(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedCapacityCapacitiesRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new DedicatedCapacityResource(Client, DedicatedCapacityData.DeserializeDedicatedCapacityData(e)), DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedCapacities", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new DedicatedCapacityResource(Client, DedicatedCapacityData.DeserializeDedicatedCapacityData(e)), DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetDedicatedCapacities", "value", null, cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual Pageable GetDedicatedCapacities(Cancel public virtual AsyncPageable GetSkusCapacitiesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedCapacityCapacitiesRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CapacitySku.DeserializeCapacitySku, DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusCapacities", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CapacitySku.DeserializeCapacitySku, DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetSkusCapacities", "value", null, cancellationToken); } /// @@ -129,7 +130,7 @@ public virtual AsyncPageable GetSkusCapacitiesAsync(CancellationTok public virtual Pageable GetSkusCapacities(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedCapacityCapacitiesRestClient.CreateListSkusRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CapacitySku.DeserializeCapacitySku, DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusCapacities", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CapacitySku.DeserializeCapacitySku, DedicatedCapacityCapacitiesClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetSkusCapacities", "value", null, cancellationToken); } /// @@ -148,9 +149,12 @@ public virtual Pageable GetSkusCapacities(CancellationToken cancell /// The region name which the operation will lookup into. /// The name of the capacity. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNameAvailabilityCapacityAsync(AzureLocation location, CheckCapacityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DedicatedCapacityCapacitiesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityCapacity"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DedicatedCapacityCapacitiesClientDiagnostics.CreateScope("PowerBIDedicatedSubscriptionMockingExtension.CheckNameAvailabilityCapacity"); scope.Start(); try { @@ -180,9 +184,12 @@ public virtual async Task> CheckNa /// The region name which the operation will lookup into. /// The name of the capacity. /// The cancellation token to use. + /// is null. public virtual Response CheckNameAvailabilityCapacity(AzureLocation location, CheckCapacityNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DedicatedCapacityCapacitiesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityCapacity"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DedicatedCapacityCapacitiesClientDiagnostics.CreateScope("PowerBIDedicatedSubscriptionMockingExtension.CheckNameAvailabilityCapacity"); scope.Start(); try { @@ -214,7 +221,7 @@ public virtual Response CheckNameAvailabili public virtual AsyncPageable GetAutoScaleVCoresAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AutoScaleVCoreRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AutoScaleVCoreResource(Client, AutoScaleVCoreData.DeserializeAutoScaleVCoreData(e)), AutoScaleVCoreClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoScaleVCores", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AutoScaleVCoreResource(Client, AutoScaleVCoreData.DeserializeAutoScaleVCoreData(e)), AutoScaleVCoreClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetAutoScaleVCores", "value", null, cancellationToken); } /// @@ -235,7 +242,7 @@ public virtual AsyncPageable GetAutoScaleVCoresAsync(Can public virtual Pageable GetAutoScaleVCores(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AutoScaleVCoreRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AutoScaleVCoreResource(Client, AutoScaleVCoreData.DeserializeAutoScaleVCoreData(e)), AutoScaleVCoreClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAutoScaleVCores", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AutoScaleVCoreResource(Client, AutoScaleVCoreData.DeserializeAutoScaleVCoreData(e)), AutoScaleVCoreClientDiagnostics, Pipeline, "PowerBIDedicatedSubscriptionMockingExtension.GetAutoScaleVCores", "value", null, cancellationToken); } } } diff --git a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index b5a6b737ef05..000000000000 --- a/sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PowerBIDedicated -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DedicatedCapacityResources in the ResourceGroupResource. - /// An object representing collection of DedicatedCapacityResources and their operations over a DedicatedCapacityResource. - public virtual DedicatedCapacityCollection GetDedicatedCapacities() - { - return GetCachedClient(Client => new DedicatedCapacityCollection(Client, Id)); - } - - /// Gets a collection of AutoScaleVCoreResources in the ResourceGroupResource. - /// An object representing collection of AutoScaleVCoreResources and their operations over a AutoScaleVCoreResource. - public virtual AutoScaleVCoreCollection GetAutoScaleVCores() - { - return GetCachedClient(Client => new AutoScaleVCoreCollection(Client, Id)); - } - } -} diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsArmClientMockingExtension.cs b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsArmClientMockingExtension.cs new file mode 100644 index 000000000000..ae60562d94b0 --- /dev/null +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PrivateDns; + +namespace Azure.ResourceManager.PrivateDns.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PrivateDnsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PrivateDnsArmClientMockingExtension() + { + } + + /// 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 PrivateDnsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PrivateDnsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PrivateDnsZoneResource GetPrivateDnsZoneResource(ResourceIdentifier id) + { + PrivateDnsZoneResource.ValidateResourceId(id); + return new PrivateDnsZoneResource(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 VirtualNetworkLinkResource GetVirtualNetworkLinkResource(ResourceIdentifier id) + { + VirtualNetworkLinkResource.ValidateResourceId(id); + return new VirtualNetworkLinkResource(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 PrivateDnsARecordResource GetPrivateDnsARecordResource(ResourceIdentifier id) + { + PrivateDnsARecordResource.ValidateResourceId(id); + return new PrivateDnsARecordResource(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 PrivateDnsAaaaRecordResource GetPrivateDnsAaaaRecordResource(ResourceIdentifier id) + { + PrivateDnsAaaaRecordResource.ValidateResourceId(id); + return new PrivateDnsAaaaRecordResource(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 PrivateDnsCnameRecordResource GetPrivateDnsCnameRecordResource(ResourceIdentifier id) + { + PrivateDnsCnameRecordResource.ValidateResourceId(id); + return new PrivateDnsCnameRecordResource(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 PrivateDnsMXRecordResource GetPrivateDnsMXRecordResource(ResourceIdentifier id) + { + PrivateDnsMXRecordResource.ValidateResourceId(id); + return new PrivateDnsMXRecordResource(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 PrivateDnsPtrRecordResource GetPrivateDnsPtrRecordResource(ResourceIdentifier id) + { + PrivateDnsPtrRecordResource.ValidateResourceId(id); + return new PrivateDnsPtrRecordResource(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 PrivateDnsSoaRecordResource GetPrivateDnsSoaRecordResource(ResourceIdentifier id) + { + PrivateDnsSoaRecordResource.ValidateResourceId(id); + return new PrivateDnsSoaRecordResource(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 PrivateDnsSrvRecordResource GetPrivateDnsSrvRecordResource(ResourceIdentifier id) + { + PrivateDnsSrvRecordResource.ValidateResourceId(id); + return new PrivateDnsSrvRecordResource(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 PrivateDnsTxtRecordResource GetPrivateDnsTxtRecordResource(ResourceIdentifier id) + { + PrivateDnsTxtRecordResource.ValidateResourceId(id); + return new PrivateDnsTxtRecordResource(Client, id); + } + } +} diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsExtensions.cs b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsExtensions.cs index ed7989f2e08d..fe71e48f8b14 100644 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsExtensions.cs +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.PrivateDns.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.PrivateDns @@ -18,233 +19,193 @@ namespace Azure.ResourceManager.PrivateDns /// A class to add extension methods to Azure.ResourceManager.PrivateDns. public static partial class PrivateDnsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PrivateDnsArmClientMockingExtension GetPrivateDnsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PrivateDnsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PrivateDnsResourceGroupMockingExtension GetPrivateDnsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PrivateDnsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PrivateDnsSubscriptionMockingExtension GetPrivateDnsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PrivateDnsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region PrivateDnsZoneResource /// /// 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. /// Returns a object. public static PrivateDnsZoneResource GetPrivateDnsZoneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsZoneResource.ValidateResourceId(id); - return new PrivateDnsZoneResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsZoneResource(id); } - #endregion - #region VirtualNetworkLinkResource /// /// 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. /// Returns a object. public static VirtualNetworkLinkResource GetVirtualNetworkLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkLinkResource.ValidateResourceId(id); - return new VirtualNetworkLinkResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetVirtualNetworkLinkResource(id); } - #endregion - #region PrivateDnsARecordResource /// /// 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. /// Returns a object. public static PrivateDnsARecordResource GetPrivateDnsARecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsARecordResource.ValidateResourceId(id); - return new PrivateDnsARecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsARecordResource(id); } - #endregion - #region PrivateDnsAaaaRecordResource /// /// 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. /// Returns a object. public static PrivateDnsAaaaRecordResource GetPrivateDnsAaaaRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsAaaaRecordResource.ValidateResourceId(id); - return new PrivateDnsAaaaRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsAaaaRecordResource(id); } - #endregion - #region PrivateDnsCnameRecordResource /// /// 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. /// Returns a object. public static PrivateDnsCnameRecordResource GetPrivateDnsCnameRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsCnameRecordResource.ValidateResourceId(id); - return new PrivateDnsCnameRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsCnameRecordResource(id); } - #endregion - #region PrivateDnsMXRecordResource /// /// 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. /// Returns a object. public static PrivateDnsMXRecordResource GetPrivateDnsMXRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsMXRecordResource.ValidateResourceId(id); - return new PrivateDnsMXRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsMXRecordResource(id); } - #endregion - #region PrivateDnsPtrRecordResource /// /// 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. /// Returns a object. public static PrivateDnsPtrRecordResource GetPrivateDnsPtrRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsPtrRecordResource.ValidateResourceId(id); - return new PrivateDnsPtrRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsPtrRecordResource(id); } - #endregion - #region PrivateDnsSoaRecordResource /// /// 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. /// Returns a object. public static PrivateDnsSoaRecordResource GetPrivateDnsSoaRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsSoaRecordResource.ValidateResourceId(id); - return new PrivateDnsSoaRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsSoaRecordResource(id); } - #endregion - #region PrivateDnsSrvRecordResource /// /// 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. /// Returns a object. public static PrivateDnsSrvRecordResource GetPrivateDnsSrvRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsSrvRecordResource.ValidateResourceId(id); - return new PrivateDnsSrvRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsSrvRecordResource(id); } - #endregion - #region PrivateDnsTxtRecordResource /// /// 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. /// Returns a object. public static PrivateDnsTxtRecordResource GetPrivateDnsTxtRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateDnsTxtRecordResource.ValidateResourceId(id); - return new PrivateDnsTxtRecordResource(client, id); - } - ); + return GetPrivateDnsArmClientMockingExtension(client).GetPrivateDnsTxtRecordResource(id); } - #endregion - /// Gets a collection of PrivateDnsZoneResources in the ResourceGroupResource. + /// + /// Gets a collection of PrivateDnsZoneResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PrivateDnsZoneResources and their operations over a PrivateDnsZoneResource. public static PrivateDnsZoneCollection GetPrivateDnsZones(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPrivateDnsZones(); + return GetPrivateDnsResourceGroupMockingExtension(resourceGroupResource).GetPrivateDnsZones(); } /// @@ -259,16 +220,20 @@ public static PrivateDnsZoneCollection GetPrivateDnsZones(this ResourceGroupReso /// PrivateZones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Private DNS zone (without a terminating dot). /// The cancellation token to use. - /// 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 static async Task> GetPrivateDnsZoneAsync(this ResourceGroupResource resourceGroupResource, string privateZoneName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPrivateDnsZones().GetAsync(privateZoneName, cancellationToken).ConfigureAwait(false); + return await GetPrivateDnsResourceGroupMockingExtension(resourceGroupResource).GetPrivateDnsZoneAsync(privateZoneName, cancellationToken).ConfigureAwait(false); } /// @@ -283,16 +248,20 @@ public static async Task> GetPrivateDnsZoneAsyn /// PrivateZones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Private DNS zone (without a terminating dot). /// The cancellation token to use. - /// 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 static Response GetPrivateDnsZone(this ResourceGroupResource resourceGroupResource, string privateZoneName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPrivateDnsZones().Get(privateZoneName, cancellationToken); + return GetPrivateDnsResourceGroupMockingExtension(resourceGroupResource).GetPrivateDnsZone(privateZoneName, cancellationToken); } /// @@ -307,6 +276,10 @@ public static Response GetPrivateDnsZone(this ResourceGr /// PrivateZones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. @@ -314,7 +287,7 @@ public static Response GetPrivateDnsZone(this ResourceGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPrivateDnsZonesAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateDnsZonesAsync(top, cancellationToken); + return GetPrivateDnsSubscriptionMockingExtension(subscriptionResource).GetPrivateDnsZonesAsync(top, cancellationToken); } /// @@ -329,6 +302,10 @@ public static AsyncPageable GetPrivateDnsZonesAsync(this /// PrivateZones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. @@ -336,7 +313,7 @@ public static AsyncPageable GetPrivateDnsZonesAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPrivateDnsZones(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPrivateDnsZones(top, cancellationToken); + return GetPrivateDnsSubscriptionMockingExtension(subscriptionResource).GetPrivateDnsZones(top, cancellationToken); } } } diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsResourceGroupMockingExtension.cs b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..9f040d0d0798 --- /dev/null +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.PrivateDns; + +namespace Azure.ResourceManager.PrivateDns.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PrivateDnsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PrivateDnsResourceGroupMockingExtension() + { + } + + /// 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 PrivateDnsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PrivateDnsZoneResources in the ResourceGroupResource. + /// An object representing collection of PrivateDnsZoneResources and their operations over a PrivateDnsZoneResource. + public virtual PrivateDnsZoneCollection GetPrivateDnsZones() + { + return GetCachedClient(client => new PrivateDnsZoneCollection(client, Id)); + } + + /// + /// Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName} + /// + /// + /// Operation Id + /// PrivateZones_Get + /// + /// + /// + /// The name of the Private DNS zone (without a terminating dot). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPrivateDnsZoneAsync(string privateZoneName, CancellationToken cancellationToken = default) + { + return await GetPrivateDnsZones().GetAsync(privateZoneName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName} + /// + /// + /// Operation Id + /// PrivateZones_Get + /// + /// + /// + /// The name of the Private DNS zone (without a terminating dot). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPrivateDnsZone(string privateZoneName, CancellationToken cancellationToken = default) + { + return GetPrivateDnsZones().Get(privateZoneName, cancellationToken); + } + } +} diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsSubscriptionMockingExtension.cs similarity index 85% rename from sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsSubscriptionMockingExtension.cs index 2f5c45cb0b6b..52bb73dc71c2 100644 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/PrivateDnsSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.PrivateDns; -namespace Azure.ResourceManager.PrivateDns +namespace Azure.ResourceManager.PrivateDns.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PrivateDnsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _privateDnsZonePrivateZonesClientDiagnostics; private PrivateZonesRestOperations _privateDnsZonePrivateZonesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PrivateDnsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PrivateDnsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ public virtual AsyncPageable GetPrivateDnsZonesAsync(int { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateDnsZonePrivateZonesRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateDnsZonePrivateZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateDnsZoneResource(Client, PrivateDnsZoneData.DeserializePrivateDnsZoneData(e)), PrivateDnsZonePrivateZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateDnsZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PrivateDnsZoneResource(Client, PrivateDnsZoneData.DeserializePrivateDnsZoneData(e)), PrivateDnsZonePrivateZonesClientDiagnostics, Pipeline, "PrivateDnsSubscriptionMockingExtension.GetPrivateDnsZones", "value", "nextLink", cancellationToken); } /// @@ -84,7 +85,7 @@ public virtual Pageable GetPrivateDnsZones(int? top = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => PrivateDnsZonePrivateZonesRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PrivateDnsZonePrivateZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateDnsZoneResource(Client, PrivateDnsZoneData.DeserializePrivateDnsZoneData(e)), PrivateDnsZonePrivateZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPrivateDnsZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PrivateDnsZoneResource(Client, PrivateDnsZoneData.DeserializePrivateDnsZoneData(e)), PrivateDnsZonePrivateZonesClientDiagnostics, Pipeline, "PrivateDnsSubscriptionMockingExtension.GetPrivateDnsZones", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index a8e2975e741f..000000000000 --- a/sdk/privatedns/Azure.ResourceManager.PrivateDns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.PrivateDns -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PrivateDnsZoneResources in the ResourceGroupResource. - /// An object representing collection of PrivateDnsZoneResources and their operations over a PrivateDnsZoneResource. - public virtual PrivateDnsZoneCollection GetPrivateDnsZones() - { - return GetCachedClient(Client => new PrivateDnsZoneCollection(Client, Id)); - } - } -} diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubArmClientMockingExtension.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubArmClientMockingExtension.cs new file mode 100644 index 000000000000..1ebadff6c730 --- /dev/null +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ProviderHub; + +namespace Azure.ResourceManager.ProviderHub.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ProviderHubArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ProviderHubArmClientMockingExtension() + { + } + + /// 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 ProviderHubArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ProviderHubArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CustomRolloutResource GetCustomRolloutResource(ResourceIdentifier id) + { + CustomRolloutResource.ValidateResourceId(id); + return new CustomRolloutResource(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 DefaultRolloutResource GetDefaultRolloutResource(ResourceIdentifier id) + { + DefaultRolloutResource.ValidateResourceId(id); + return new DefaultRolloutResource(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 NotificationRegistrationResource GetNotificationRegistrationResource(ResourceIdentifier id) + { + NotificationRegistrationResource.ValidateResourceId(id); + return new NotificationRegistrationResource(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 ProviderRegistrationResource GetProviderRegistrationResource(ResourceIdentifier id) + { + ProviderRegistrationResource.ValidateResourceId(id); + return new ProviderRegistrationResource(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 ResourceTypeRegistrationResource GetResourceTypeRegistrationResource(ResourceIdentifier id) + { + ResourceTypeRegistrationResource.ValidateResourceId(id); + return new ResourceTypeRegistrationResource(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 ResourceTypeSkuResource GetResourceTypeSkuResource(ResourceIdentifier id) + { + ResourceTypeSkuResource.ValidateResourceId(id); + return new ResourceTypeSkuResource(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 NestedResourceTypeFirstSkuResource GetNestedResourceTypeFirstSkuResource(ResourceIdentifier id) + { + NestedResourceTypeFirstSkuResource.ValidateResourceId(id); + return new NestedResourceTypeFirstSkuResource(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 NestedResourceTypeSecondSkuResource GetNestedResourceTypeSecondSkuResource(ResourceIdentifier id) + { + NestedResourceTypeSecondSkuResource.ValidateResourceId(id); + return new NestedResourceTypeSecondSkuResource(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 NestedResourceTypeThirdSkuResource GetNestedResourceTypeThirdSkuResource(ResourceIdentifier id) + { + NestedResourceTypeThirdSkuResource.ValidateResourceId(id); + return new NestedResourceTypeThirdSkuResource(Client, id); + } + } +} diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubExtensions.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubExtensions.cs index 0b8f18fdb731..9daab00f8c8f 100644 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubExtensions.cs +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ProviderHub.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ProviderHub @@ -18,198 +19,172 @@ namespace Azure.ResourceManager.ProviderHub /// A class to add extension methods to Azure.ResourceManager.ProviderHub. public static partial class ProviderHubExtensions { - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ProviderHubArmClientMockingExtension GetProviderHubArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ProviderHubArmClientMockingExtension(client0)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ProviderHubSubscriptionMockingExtension GetProviderHubSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ProviderHubSubscriptionMockingExtension(client, resource.Id)); } - #region CustomRolloutResource + /// /// 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. /// Returns a object. public static CustomRolloutResource GetCustomRolloutResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CustomRolloutResource.ValidateResourceId(id); - return new CustomRolloutResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetCustomRolloutResource(id); } - #endregion - #region DefaultRolloutResource /// /// 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. /// Returns a object. public static DefaultRolloutResource GetDefaultRolloutResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DefaultRolloutResource.ValidateResourceId(id); - return new DefaultRolloutResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetDefaultRolloutResource(id); } - #endregion - #region NotificationRegistrationResource /// /// 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. /// Returns a object. public static NotificationRegistrationResource GetNotificationRegistrationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NotificationRegistrationResource.ValidateResourceId(id); - return new NotificationRegistrationResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetNotificationRegistrationResource(id); } - #endregion - #region ProviderRegistrationResource /// /// 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. /// Returns a object. public static ProviderRegistrationResource GetProviderRegistrationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProviderRegistrationResource.ValidateResourceId(id); - return new ProviderRegistrationResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetProviderRegistrationResource(id); } - #endregion - #region ResourceTypeRegistrationResource /// /// 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. /// Returns a object. public static ResourceTypeRegistrationResource GetResourceTypeRegistrationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceTypeRegistrationResource.ValidateResourceId(id); - return new ResourceTypeRegistrationResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetResourceTypeRegistrationResource(id); } - #endregion - #region ResourceTypeSkuResource /// /// 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. /// Returns a object. public static ResourceTypeSkuResource GetResourceTypeSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceTypeSkuResource.ValidateResourceId(id); - return new ResourceTypeSkuResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetResourceTypeSkuResource(id); } - #endregion - #region NestedResourceTypeFirstSkuResource /// /// 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. /// Returns a object. public static NestedResourceTypeFirstSkuResource GetNestedResourceTypeFirstSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NestedResourceTypeFirstSkuResource.ValidateResourceId(id); - return new NestedResourceTypeFirstSkuResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetNestedResourceTypeFirstSkuResource(id); } - #endregion - #region NestedResourceTypeSecondSkuResource /// /// 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. /// Returns a object. public static NestedResourceTypeSecondSkuResource GetNestedResourceTypeSecondSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NestedResourceTypeSecondSkuResource.ValidateResourceId(id); - return new NestedResourceTypeSecondSkuResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetNestedResourceTypeSecondSkuResource(id); } - #endregion - #region NestedResourceTypeThirdSkuResource /// /// 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. /// Returns a object. public static NestedResourceTypeThirdSkuResource GetNestedResourceTypeThirdSkuResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NestedResourceTypeThirdSkuResource.ValidateResourceId(id); - return new NestedResourceTypeThirdSkuResource(client, id); - } - ); + return GetProviderHubArmClientMockingExtension(client).GetNestedResourceTypeThirdSkuResource(id); } - #endregion - /// Gets a collection of ProviderRegistrationResources in the SubscriptionResource. + /// + /// Gets a collection of ProviderRegistrationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ProviderRegistrationResources and their operations over a ProviderRegistrationResource. public static ProviderRegistrationCollection GetProviderRegistrations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProviderRegistrations(); + return GetProviderHubSubscriptionMockingExtension(subscriptionResource).GetProviderRegistrations(); } /// @@ -224,16 +199,20 @@ public static ProviderRegistrationCollection GetProviderRegistrations(this Subsc /// ProviderRegistrations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource provider hosted within ProviderHub. /// The cancellation token to use. - /// 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 static async Task> GetProviderRegistrationAsync(this SubscriptionResource subscriptionResource, string providerNamespace, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetProviderRegistrations().GetAsync(providerNamespace, cancellationToken).ConfigureAwait(false); + return await GetProviderHubSubscriptionMockingExtension(subscriptionResource).GetProviderRegistrationAsync(providerNamespace, cancellationToken).ConfigureAwait(false); } /// @@ -248,16 +227,20 @@ public static async Task> GetProviderRegi /// ProviderRegistrations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource provider hosted within ProviderHub. /// The cancellation token to use. - /// 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 static Response GetProviderRegistration(this SubscriptionResource subscriptionResource, string providerNamespace, CancellationToken cancellationToken = default) { - return subscriptionResource.GetProviderRegistrations().Get(providerNamespace, cancellationToken); + return GetProviderHubSubscriptionMockingExtension(subscriptionResource).GetProviderRegistration(providerNamespace, cancellationToken); } } } diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubSubscriptionMockingExtension.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubSubscriptionMockingExtension.cs new file mode 100644 index 000000000000..26d6eb039e24 --- /dev/null +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/ProviderHubSubscriptionMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ProviderHub; + +namespace Azure.ResourceManager.ProviderHub.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class ProviderHubSubscriptionMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ProviderHubSubscriptionMockingExtension() + { + } + + /// 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 ProviderHubSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ProviderRegistrationResources in the SubscriptionResource. + /// An object representing collection of ProviderRegistrationResources and their operations over a ProviderRegistrationResource. + public virtual ProviderRegistrationCollection GetProviderRegistrations() + { + return GetCachedClient(client => new ProviderRegistrationCollection(client, Id)); + } + + /// + /// Gets the provider registration details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace} + /// + /// + /// Operation Id + /// ProviderRegistrations_Get + /// + /// + /// + /// The name of the resource provider hosted within ProviderHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProviderRegistrationAsync(string providerNamespace, CancellationToken cancellationToken = default) + { + return await GetProviderRegistrations().GetAsync(providerNamespace, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the provider registration details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace} + /// + /// + /// Operation Id + /// ProviderRegistrations_Get + /// + /// + /// + /// The name of the resource provider hosted within ProviderHub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProviderRegistration(string providerNamespace, CancellationToken cancellationToken = default) + { + return GetProviderRegistrations().Get(providerNamespace, cancellationToken); + } + } +} diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs deleted file mode 100644 index 8f07a6732b56..000000000000 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ProviderHub -{ - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() - { - } - - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ProviderRegistrationResources in the SubscriptionResource. - /// An object representing collection of ProviderRegistrationResources and their operations over a ProviderRegistrationResource. - public virtual ProviderRegistrationCollection GetProviderRegistrations() - { - return GetCachedClient(Client => new ProviderRegistrationCollection(Client, Id)); - } - } -} diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ProviderRegistrationResource.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ProviderRegistrationResource.cs index 4aaef2065396..7a97ee3c48c7 100644 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ProviderRegistrationResource.cs +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ProviderRegistrationResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CustomRolloutResources and their operations over a CustomRolloutResource. public virtual CustomRolloutCollection GetCustomRollouts() { - return GetCachedClient(Client => new CustomRolloutCollection(Client, Id)); + return GetCachedClient(client => new CustomRolloutCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual CustomRolloutCollection GetCustomRollouts() /// /// The rollout name. /// The cancellation token to use. - /// 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> GetCustomRolloutAsync(string rolloutName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetCustomRolloutAsync /// /// The rollout name. /// The cancellation token to use. - /// 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 GetCustomRollout(string rolloutName, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetCustomRollout(string rolloutNa /// An object representing collection of DefaultRolloutResources and their operations over a DefaultRolloutResource. public virtual DefaultRolloutCollection GetDefaultRollouts() { - return GetCachedClient(Client => new DefaultRolloutCollection(Client, Id)); + return GetCachedClient(client => new DefaultRolloutCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual DefaultRolloutCollection GetDefaultRollouts() /// /// The rollout name. /// The cancellation token to use. - /// 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> GetDefaultRolloutAsync(string rolloutName, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetDefaultRolloutAsy /// /// The rollout name. /// The cancellation token to use. - /// 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 GetDefaultRollout(string rolloutName, CancellationToken cancellationToken = default) { @@ -202,7 +202,7 @@ public virtual Response GetDefaultRollout(string rollout /// An object representing collection of NotificationRegistrationResources and their operations over a NotificationRegistrationResource. public virtual NotificationRegistrationCollection GetNotificationRegistrations() { - return GetCachedClient(Client => new NotificationRegistrationCollection(Client, Id)); + return GetCachedClient(client => new NotificationRegistrationCollection(client, Id)); } /// @@ -220,8 +220,8 @@ public virtual NotificationRegistrationCollection GetNotificationRegistrations() /// /// The notification registration. /// The cancellation token to use. - /// 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> GetNotificationRegistrationAsync(string notificationRegistrationName, CancellationToken cancellationToken = default) { @@ -243,8 +243,8 @@ public virtual async Task> GetNotific /// /// The notification registration. /// The cancellation token to use. - /// 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 GetNotificationRegistration(string notificationRegistrationName, CancellationToken cancellationToken = default) { @@ -255,7 +255,7 @@ public virtual Response GetNotificationRegistr /// An object representing collection of ResourceTypeRegistrationResources and their operations over a ResourceTypeRegistrationResource. public virtual ResourceTypeRegistrationCollection GetResourceTypeRegistrations() { - return GetCachedClient(Client => new ResourceTypeRegistrationCollection(Client, Id)); + return GetCachedClient(client => new ResourceTypeRegistrationCollection(client, Id)); } /// @@ -273,8 +273,8 @@ public virtual ResourceTypeRegistrationCollection GetResourceTypeRegistrations() /// /// The resource type. /// The cancellation token to use. - /// 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> GetResourceTypeRegistrationAsync(string resourceType, CancellationToken cancellationToken = default) { @@ -296,8 +296,8 @@ public virtual async Task> GetResourc /// /// The resource type. /// The cancellation token to use. - /// 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 GetResourceTypeRegistration(string resourceType, CancellationToken cancellationToken = default) { diff --git a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ResourceTypeRegistrationResource.cs b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ResourceTypeRegistrationResource.cs index d885048d7945..b0b6c750fd88 100644 --- a/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ResourceTypeRegistrationResource.cs +++ b/sdk/providerhub/Azure.ResourceManager.ProviderHub/src/Generated/ResourceTypeRegistrationResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ResourceTypeSkuResources and their operations over a ResourceTypeSkuResource. public virtual ResourceTypeSkuCollection GetResourceTypeSkus() { - return GetCachedClient(Client => new ResourceTypeSkuCollection(Client, Id)); + return GetCachedClient(client => new ResourceTypeSkuCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ResourceTypeSkuCollection GetResourceTypeSkus() /// /// The SKU. /// The cancellation token to use. - /// 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> GetResourceTypeSkuAsync(string sku, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetResourceTypeSkuA /// /// The SKU. /// The cancellation token to use. - /// 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 GetResourceTypeSku(string sku, CancellationToken cancellationToken = default) { @@ -141,13 +141,11 @@ public virtual Response GetResourceTypeSku(string sku, /// Gets a collection of NestedResourceTypeFirstSkuResources in the ResourceTypeRegistration. /// The first child resource type. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of NestedResourceTypeFirstSkuResources and their operations over a NestedResourceTypeFirstSkuResource. public virtual NestedResourceTypeFirstSkuCollection GetNestedResourceTypeFirstSkus(string nestedResourceTypeFirst) { - Argument.AssertNotNullOrEmpty(nestedResourceTypeFirst, nameof(nestedResourceTypeFirst)); - return new NestedResourceTypeFirstSkuCollection(Client, Id, nestedResourceTypeFirst); } @@ -167,8 +165,8 @@ public virtual NestedResourceTypeFirstSkuCollection GetNestedResourceTypeFirstSk /// The first child resource type. /// The SKU. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetNestedResourceTypeFirstSkuAsync(string nestedResourceTypeFirst, string sku, CancellationToken cancellationToken = default) { @@ -191,8 +189,8 @@ public virtual async Task> GetNeste /// The first child resource type. /// The SKU. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetNestedResourceTypeFirstSku(string nestedResourceTypeFirst, string sku, CancellationToken cancellationToken = default) { @@ -202,14 +200,11 @@ public virtual Response GetNestedResourceTyp /// Gets a collection of NestedResourceTypeSecondSkuResources in the ResourceTypeRegistration. /// The first child resource type. /// The second child resource type. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of NestedResourceTypeSecondSkuResources and their operations over a NestedResourceTypeSecondSkuResource. public virtual NestedResourceTypeSecondSkuCollection GetNestedResourceTypeSecondSkus(string nestedResourceTypeFirst, string nestedResourceTypeSecond) { - Argument.AssertNotNullOrEmpty(nestedResourceTypeFirst, nameof(nestedResourceTypeFirst)); - Argument.AssertNotNullOrEmpty(nestedResourceTypeSecond, nameof(nestedResourceTypeSecond)); - return new NestedResourceTypeSecondSkuCollection(Client, Id, nestedResourceTypeFirst, nestedResourceTypeSecond); } @@ -230,8 +225,8 @@ public virtual NestedResourceTypeSecondSkuCollection GetNestedResourceTypeSecond /// The second child resource type. /// The SKU. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetNestedResourceTypeSecondSkuAsync(string nestedResourceTypeFirst, string nestedResourceTypeSecond, string sku, CancellationToken cancellationToken = default) { @@ -255,8 +250,8 @@ public virtual async Task> GetNest /// The second child resource type. /// The SKU. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetNestedResourceTypeSecondSku(string nestedResourceTypeFirst, string nestedResourceTypeSecond, string sku, CancellationToken cancellationToken = default) { @@ -267,15 +262,11 @@ public virtual Response GetNestedResourceTy /// The first child resource type. /// The second child resource type. /// The third child resource type. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of NestedResourceTypeThirdSkuResources and their operations over a NestedResourceTypeThirdSkuResource. public virtual NestedResourceTypeThirdSkuCollection GetNestedResourceTypeThirdSkus(string nestedResourceTypeFirst, string nestedResourceTypeSecond, string nestedResourceTypeThird) { - Argument.AssertNotNullOrEmpty(nestedResourceTypeFirst, nameof(nestedResourceTypeFirst)); - Argument.AssertNotNullOrEmpty(nestedResourceTypeSecond, nameof(nestedResourceTypeSecond)); - Argument.AssertNotNullOrEmpty(nestedResourceTypeThird, nameof(nestedResourceTypeThird)); - return new NestedResourceTypeThirdSkuCollection(Client, Id, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird); } @@ -297,8 +288,8 @@ public virtual NestedResourceTypeThirdSkuCollection GetNestedResourceTypeThirdSk /// The third child resource type. /// The SKU. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetNestedResourceTypeThirdSkuAsync(string nestedResourceTypeFirst, string nestedResourceTypeSecond, string nestedResourceTypeThird, string sku, CancellationToken cancellationToken = default) { @@ -323,8 +314,8 @@ public virtual async Task> GetNeste /// The third child resource type. /// The SKU. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetNestedResourceTypeThirdSku(string nestedResourceTypeFirst, string nestedResourceTypeSecond, string nestedResourceTypeThird, string sku, CancellationToken cancellationToken = default) { From be6cd4a50b8709ac4494ce0e00faea9e48503d89 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:26:06 +0000 Subject: [PATCH 6/8] Update SDK codes pu_sq_5 --- .../PurviewArmClientMockingExtension.cs | 75 + .../Generated/Extensions/PurviewExtensions.cs | 177 +- .../PurviewResourceGroupMockingExtension.cs | 92 + ...=> PurviewSubscriptionMockingExtension.cs} | 27 +- ...nt.cs => PurviewTenantMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/PurviewAccountResource.cs | 12 +- .../QuantumArmClientMockingExtension.cs | 51 + .../Generated/Extensions/QuantumExtensions.cs | 114 +- .../QuantumResourceGroupMockingExtension.cs | 92 + ...=> QuantumSubscriptionMockingExtension.cs} | 43 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../QumuloArmClientMockingExtension.cs | 51 + .../Generated/Extensions/QumuloExtensions.cs | 80 +- .../QumuloResourceGroupMockingExtension.cs | 92 + ... => QumuloSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Extensions/ArmResourceExtensionClient.cs | 55 - .../QuotaArmClientMockingExtension.cs | 267 ++ .../Generated/Extensions/QuotaExtensions.cs | 221 +- ...ient.cs => QuotaTenantMockingExtension.cs} | 17 +- .../Generated/BackupProtectedItemResource.cs | 6 +- .../BackupProtectionContainerResource.cs | 6 +- ...ServicesBackupArmClientMockingExtension.cs | 183 + .../RecoveryServicesBackupExtensions.cs | 673 ++-- ...cesBackupResourceGroupMockingExtension.cs} | 643 +++- ...icesBackupSubscriptionMockingExtension.cs} | 43 +- .../DataReplicationFabricResource.cs | 6 +- .../DataReplicationProtectedItemResource.cs | 6 +- .../Generated/DataReplicationVaultResource.cs | 36 +- ...ataReplicationArmClientMockingExtension.cs | 159 + ...coveryServicesDataReplicationExtensions.cs | 263 +- ...eplicationResourceGroupMockingExtension.cs | 225 ++ ...eplicationSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 124 - ...esSiteRecoveryArmClientMockingExtension.cs | 315 ++ .../RecoveryServicesSiteRecoveryExtensions.cs | 809 +++-- ...eRecoveryResourceGroupMockingExtension.cs} | 631 +++- .../ReplicationProtectedItemResource.cs | 6 +- .../Generated/SiteRecoveryFabricResource.cs | 36 +- .../SiteRecoveryMigrationItemResource.cs | 6 +- .../Generated/SiteRecoveryNetworkResource.cs | 6 +- ...SiteRecoveryProtectionContainerResource.cs | 24 +- .../StorageClassificationResource.cs | 6 +- ...coveryServicesArmClientMockingExtension.cs | 75 + .../Extensions/RecoveryServicesExtensions.cs | 138 +- ...yServicesResourceGroupMockingExtension.cs} | 71 +- ...ryServicesSubscriptionMockingExtension.cs} | 27 +- .../RecoveryServicesVaultResource.cs | 6 +- .../RedisArmClientMockingExtension.cs | 99 + .../Generated/Extensions/RedisExtensions.cs | 164 +- .../RedisResourceGroupMockingExtension.cs | 92 + ...s => RedisSubscriptionMockingExtension.cs} | 39 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/RedisResource.cs | 20 +- ...edisEnterpriseArmClientMockingExtension.cs | 75 + .../Extensions/RedisEnterpriseExtensions.cs | 134 +- ...EnterpriseResourceGroupMockingExtension.cs | 92 + ...EnterpriseSubscriptionMockingExtension.cs} | 33 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../RedisEnterpriseClusterResource.cs | 12 +- .../RelayArmClientMockingExtension.cs | 147 + .../Generated/Extensions/RelayExtensions.cs | 200 +- .../RelayResourceGroupMockingExtension.cs | 92 + ...s => RelaySubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../RelayHybridConnectionResource.cs | 6 +- .../src/Generated/RelayNamespaceResource.cs | 30 +- .../src/Generated/WcfRelayResource.cs | 6 +- .../ReservationsArmClientMockingExtension.cs | 87 + .../Extensions/ReservationsExtensions.cs | 255 +- ...servationsSubscriptionMockingExtension.cs} | 129 +- ... => ReservationsTenantMockingExtension.cs} | 97 +- .../src/Generated/ReservationOrderResource.cs | 2 +- ...ourceConnectorArmClientMockingExtension.cs | 51 + .../Extensions/ResourceConnectorExtensions.cs | 92 +- ...eConnectorResourceGroupMockingExtension.cs | 92 + ...eConnectorSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Extensions/ResourceGraphExtensions.cs | 49 +- ...=> ResourceGraphTenantMockingExtension.cs} | 33 +- .../Samples/Sample_ArmResourceExtensions.cs | 161 - ...esourceHealthArmClientMockingExtension.cs} | 206 +- .../Extensions/ResourceHealthExtensions.cs | 466 +-- ...rceHealthResourceGroupMockingExtension.cs} | 17 +- ...urceHealthSubscriptionMockingExtension.cs} | 71 +- .../ResourceHealthTenantMockingExtension.cs | 199 ++ .../TenantResourceExtensionClient.cs | 55 - .../Generated/ResourceHealthEventResource.cs | 6 +- .../TenantResourceHealthEventResource.cs | 6 +- .../Generated/Extensions/ArmClient.cs | 2 - .../Generated/Extensions/TenantResource.cs | 6 +- .../Generated/Extensions/ArmClient.cs | 28 - .../Generated/Extensions/ArmResource.cs | 125 - .../Extensions/ManagementGroupResource.cs | 12 +- .../Generated/ResourceProviderResource.cs | 6 +- .../Generated/SubscriptionResource.cs | 24 +- .../src/Resources/Generated/TenantResource.cs | 26 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ResourceMoverArmClientMockingExtension.cs | 63 + .../Extensions/ResourceMoverExtensions.cs | 120 +- ...ourceMoverResourceGroupMockingExtension.cs | 92 + ...ourceMoverSubscriptionMockingExtension.cs} | 17 +- ...=> ResourceMoverTenantMockingExtension.cs} | 17 +- .../src/Generated/MoverResourceSetResource.cs | 6 +- .../ManagementGroupResourceExtensionClient.cs | 41 - .../ResourceGroupResourceExtensionClient.cs | 76 - .../ResourcesArmClientMockingExtension.cs | 135 + .../Extensions/ResourcesExtensions.cs | 461 ++- ...esourcesManagementGroupMockingExtension.cs | 92 + .../ResourcesResourceGroupMockingExtension.cs | 360 ++ ... ResourcesSubscriptionMockingExtension.cs} | 79 +- ....cs => ResourcesTenantMockingExtension.cs} | 71 +- .../src/Generated/TemplateSpecResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../SearchArmClientMockingExtension.cs | 75 + .../Generated/Extensions/SearchExtensions.cs | 122 +- .../SearchResourceGroupMockingExtension.cs | 95 + ... => SearchSubscriptionMockingExtension.cs} | 27 +- .../src/Generated/SearchServiceResource.cs | 12 +- .../Extensions/ArmResourceExtensionClient.cs | 307 -- .../ResourceGroupResourceExtensionClient.cs | 568 ---- ...SecurityCenterArmClientMockingExtension.cs | 1203 +++++++ .../Extensions/SecurityCenterExtensions.cs | 2996 ++++++++++------- ...rityCenterResourceGroupMockingExtension.cs | 1135 +++++++ ...rityCenterSubscriptionMockingExtension.cs} | 709 +++- ...> SecurityCenterTenantMockingExtension.cs} | 67 +- ...tSecuritySolutionAnalyticsModelResource.cs | 12 +- .../RegulatoryComplianceControlResource.cs | 6 +- .../RegulatoryComplianceStandardResource.cs | 6 +- .../Generated/SecurityAssessmentResource.cs | 12 +- .../SecurityCenterLocationResource.cs | 18 +- .../Generated/SecurityConnectorResource.cs | 6 +- .../Generated/AzureDevOpsConnectorResource.cs | 6 +- .../src/Generated/AzureDevOpsOrgResource.cs | 6 +- .../Generated/AzureDevOpsProjectResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 48 - ...SecurityDevOpsArmClientMockingExtension.cs | 123 + .../Extensions/SecurityDevOpsExtensions.cs | 196 +- ...rityDevOpsResourceGroupMockingExtension.cs | 145 + ...rityDevOpsSubscriptionMockingExtension.cs} | 21 +- .../src/Generated/GitHubConnectorResource.cs | 6 +- .../src/Generated/GitHubOwnerResource.cs | 6 +- ...curityInsightsArmClientMockingExtension.cs | 219 ++ .../Extensions/SecurityInsightsExtensions.cs | 211 +- ...yInsightsResourceGroupMockingExtension.cs} | 12 +- ...sightsWorkspaceSecurityInsightsResource.cs | 60 +- .../SecurityInsightsAlertRuleResource.cs | 6 +- .../SecurityInsightsIncidentResource.cs | 12 +- .../SecurityInsightsWatchlistResource.cs | 6 +- ...s => SelfHelpArmClientMockingExtension.cs} | 125 +- .../Extensions/SelfHelpExtensions.cs | 96 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ServiceBusArmClientMockingExtension.cs | 195 ++ .../Extensions/ServiceBusExtensions.cs | 252 +- ...ServiceBusResourceGroupMockingExtension.cs | 92 + ...ServiceBusSubscriptionMockingExtension.cs} | 27 +- .../ServiceBusDisasterRecoveryResource.cs | 6 +- .../Generated/ServiceBusNamespaceResource.cs | 36 +- .../src/Generated/ServiceBusQueueResource.cs | 6 +- .../ServiceBusSubscriptionResource.cs | 6 +- .../src/Generated/ServiceBusTopicResource.cs | 12 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ServiceFabricArmClientMockingExtension.cs | 99 + .../Extensions/ServiceFabricExtensions.cs | 188 +- ...viceFabricResourceGroupMockingExtension.cs | 92 + ...viceFabricSubscriptionMockingExtension.cs} | 50 +- .../ServiceFabricApplicationResource.cs | 6 +- .../ServiceFabricApplicationTypeResource.cs | 6 +- .../Generated/ServiceFabricClusterResource.cs | 12 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...anagedClustersArmClientMockingExtension.cs | 111 + .../ServiceFabricManagedClustersExtensions.cs | 229 +- ...edClustersResourceGroupMockingExtension.cs | 92 + ...edClustersSubscriptionMockingExtension.cs} | 65 +- ...ServiceFabricManagedApplicationResource.cs | 6 +- ...iceFabricManagedApplicationTypeResource.cs | 6 +- .../ServiceFabricManagedClusterResource.cs | 18 +- .../Extensions/ArmResourceExtensionClient.cs | 41 - .../ServiceLinkerArmClientMockingExtension.cs | 111 + .../ServiceLinkerArmMockingExtension.cs | 92 + .../Extensions/ServiceLinkerExtensions.cs | 125 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...viceNetworkingArmClientMockingExtension.cs | 75 + .../Extensions/ServiceNetworkingExtensions.cs | 106 +- ...NetworkingResourceGroupMockingExtension.cs | 92 + ...NetworkingSubscriptionMockingExtension.cs} | 17 +- .../Generated/TrafficControllerResource.cs | 12 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../SignalRArmClientMockingExtension.cs | 99 + .../Generated/Extensions/SignalRExtensions.cs | 160 +- .../SignalRResourceGroupMockingExtension.cs | 92 + ...=> SignalRSubscriptionMockingExtension.cs} | 31 +- .../src/Generated/SignalRResource.cs | 24 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../SphereArmClientMockingExtension.cs | 123 + .../Generated/Extensions/SphereExtensions.cs | 158 +- .../SphereResourceGroupMockingExtension.cs | 92 + ... => SphereSubscriptionMockingExtension.cs} | 17 +- .../src/Generated/SphereCatalogResource.cs | 18 +- .../Generated/SphereDeviceGroupResource.cs | 12 +- .../src/Generated/SphereProductResource.cs | 6 +- .../ResourceGroupResourceExtensionClient.cs | 317 -- .../SqlArmClientMockingExtension.cs | 1551 +++++++++ .../src/Generated/Extensions/SqlExtensions.cs | 2237 ++++++------ .../SqlResourceGroupMockingExtension.cs | 728 ++++ ....cs => SqlSubscriptionMockingExtension.cs} | 335 +- .../ManagedDatabaseColumnResource.cs | 2 +- .../src/Generated/ManagedDatabaseResource.cs | 22 +- .../ManagedDatabaseSchemaResource.cs | 6 +- .../Generated/ManagedDatabaseTableResource.cs | 6 +- ...DatabaseVulnerabilityAssessmentResource.cs | 12 +- .../src/Generated/ManagedInstanceResource.cs | 80 +- ...estorableDroppedManagedDatabaseResource.cs | 2 +- .../Generated/SqlDatabaseAdvisorResource.cs | 6 +- .../Generated/SqlDatabaseColumnResource.cs | 2 +- .../src/Generated/SqlDatabaseResource.cs | 60 +- .../Generated/SqlDatabaseSchemaResource.cs | 6 +- ...VulnerabilityAssessmentBaselineResource.cs | 6 +- ...abaseSqlVulnerabilityAssessmentResource.cs | 8 +- ...eSqlVulnerabilityAssessmentScanResource.cs | 6 +- .../src/Generated/SqlDatabaseTableResource.cs | 6 +- ...DatabaseVulnerabilityAssessmentResource.cs | 12 +- .../Generated/SqlServerJobAgentResource.cs | 18 +- .../SqlServerJobExecutionResource.cs | 6 +- .../SqlServerJobExecutionStepResource.cs | 2 +- .../src/Generated/SqlServerJobResource.cs | 10 +- .../Generated/SqlServerJobVersionResource.cs | 6 +- .../src/Generated/SqlServerResource.cs | 134 +- ...VulnerabilityAssessmentBaselineResource.cs | 6 +- ...erverSqlVulnerabilityAssessmentResource.cs | 8 +- ...rSqlVulnerabilityAssessmentScanResource.cs | 6 +- .../src/Generated/SyncGroupResource.cs | 6 +- .../src/Generated/WorkloadGroupResource.cs | 6 +- 234 files changed, 20296 insertions(+), 9034 deletions(-) create mode 100644 sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewArmClientMockingExtension.cs create mode 100644 sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewResourceGroupMockingExtension.cs rename sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => PurviewSubscriptionMockingExtension.cs} (86%) rename sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/{TenantResourceExtensionClient.cs => PurviewTenantMockingExtension.cs} (89%) delete mode 100644 sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumArmClientMockingExtension.cs create mode 100644 sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumResourceGroupMockingExtension.cs rename sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => QuantumSubscriptionMockingExtension.cs} (81%) delete mode 100644 sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloArmClientMockingExtension.cs create mode 100644 sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloResourceGroupMockingExtension.cs rename sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => QumuloSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaArmClientMockingExtension.cs rename sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/{TenantResourceExtensionClient.cs => QuotaTenantMockingExtension.cs} (87%) create mode 100644 sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupArmClientMockingExtension.cs rename sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => RecoveryServicesBackupResourceGroupMockingExtension.cs} (52%) rename sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RecoveryServicesBackupSubscriptionMockingExtension.cs} (84%) create mode 100644 sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationArmClientMockingExtension.cs create mode 100644 sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationResourceGroupMockingExtension.cs rename sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RecoveryServicesDataReplicationSubscriptionMockingExtension.cs} (90%) delete mode 100644 sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryArmClientMockingExtension.cs rename sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => RecoveryServicesSiteRecoveryResourceGroupMockingExtension.cs} (61%) create mode 100644 sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesArmClientMockingExtension.cs rename sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => RecoveryServicesResourceGroupMockingExtension.cs} (60%) rename sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RecoveryServicesSubscriptionMockingExtension.cs} (86%) create mode 100644 sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisArmClientMockingExtension.cs create mode 100644 sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisResourceGroupMockingExtension.cs rename sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RedisSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseArmClientMockingExtension.cs create mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseResourceGroupMockingExtension.cs rename sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RedisEnterpriseSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayArmClientMockingExtension.cs create mode 100644 sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayResourceGroupMockingExtension.cs rename sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => RelaySubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsArmClientMockingExtension.cs rename sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ReservationsSubscriptionMockingExtension.cs} (51%) rename sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ReservationsTenantMockingExtension.cs} (80%) create mode 100644 sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorArmClientMockingExtension.cs create mode 100644 sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorResourceGroupMockingExtension.cs rename sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ResourceConnectorSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ResourceGraphTenantMockingExtension.cs} (82%) delete mode 100644 sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/samples/Generated/Samples/Sample_ArmResourceExtensions.cs rename sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/{ArmResourceExtensionClient.cs => ResourceHealthArmClientMockingExtension.cs} (63%) rename sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => ResourceHealthResourceGroupMockingExtension.cs} (86%) rename sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ResourceHealthSubscriptionMockingExtension.cs} (56%) create mode 100644 sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthTenantMockingExtension.cs delete mode 100644 sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/TenantResourceExtensionClient.cs delete mode 100644 sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmResource.cs delete mode 100644 sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverArmClientMockingExtension.cs create mode 100644 sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverResourceGroupMockingExtension.cs rename sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ResourceMoverSubscriptionMockingExtension.cs} (85%) rename sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ResourceMoverTenantMockingExtension.cs} (84%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesArmClientMockingExtension.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesManagementGroupMockingExtension.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesResourceGroupMockingExtension.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ResourcesSubscriptionMockingExtension.cs} (79%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ResourcesTenantMockingExtension.cs} (56%) delete mode 100644 sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchArmClientMockingExtension.cs create mode 100644 sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchResourceGroupMockingExtension.cs rename sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SearchSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs delete mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterArmClientMockingExtension.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterResourceGroupMockingExtension.cs rename sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SecurityCenterSubscriptionMockingExtension.cs} (65%) rename sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/{TenantResourceExtensionClient.cs => SecurityCenterTenantMockingExtension.cs} (57%) delete mode 100644 sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsArmClientMockingExtension.cs create mode 100644 sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsResourceGroupMockingExtension.cs rename sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SecurityDevOpsSubscriptionMockingExtension.cs} (88%) create mode 100644 sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsArmClientMockingExtension.cs rename sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => SecurityInsightsResourceGroupMockingExtension.cs} (63%) rename sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/{ArmResourceExtensionClient.cs => SelfHelpArmClientMockingExtension.cs} (58%) delete mode 100644 sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusArmClientMockingExtension.cs create mode 100644 sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusResourceGroupMockingExtension.cs rename sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ServiceBusSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricArmClientMockingExtension.cs create mode 100644 sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricResourceGroupMockingExtension.cs rename sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ServiceFabricSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersArmClientMockingExtension.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersResourceGroupMockingExtension.cs rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ServiceFabricManagedClustersSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmClientMockingExtension.cs create mode 100644 sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmMockingExtension.cs delete mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingArmClientMockingExtension.cs create mode 100644 sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingResourceGroupMockingExtension.cs rename sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ServiceNetworkingSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRArmClientMockingExtension.cs create mode 100644 sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRResourceGroupMockingExtension.cs rename sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SignalRSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereArmClientMockingExtension.cs create mode 100644 sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereResourceGroupMockingExtension.cs rename sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SphereSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlArmClientMockingExtension.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlResourceGroupMockingExtension.cs rename sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => SqlSubscriptionMockingExtension.cs} (69%) diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewArmClientMockingExtension.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewArmClientMockingExtension.cs new file mode 100644 index 000000000000..d4e7ff22e985 --- /dev/null +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Purview; + +namespace Azure.ResourceManager.Purview.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class PurviewArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PurviewArmClientMockingExtension() + { + } + + /// 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 PurviewArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal PurviewArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PurviewAccountResource GetPurviewAccountResource(ResourceIdentifier id) + { + PurviewAccountResource.ValidateResourceId(id); + return new PurviewAccountResource(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 PurviewPrivateEndpointConnectionResource GetPurviewPrivateEndpointConnectionResource(ResourceIdentifier id) + { + PurviewPrivateEndpointConnectionResource.ValidateResourceId(id); + return new PurviewPrivateEndpointConnectionResource(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 PurviewPrivateLinkResource GetPurviewPrivateLinkResource(ResourceIdentifier id) + { + PurviewPrivateLinkResource.ValidateResourceId(id); + return new PurviewPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewExtensions.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewExtensions.cs index 96683532b51b..ad1d517bcdc7 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewExtensions.cs +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Purview.Mocking; using Azure.ResourceManager.Purview.Models; using Azure.ResourceManager.Resources; @@ -19,116 +20,86 @@ namespace Azure.ResourceManager.Purview /// A class to add extension methods to Azure.ResourceManager.Purview. public static partial class PurviewExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static PurviewArmClientMockingExtension GetPurviewArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new PurviewArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PurviewResourceGroupMockingExtension GetPurviewResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PurviewResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static PurviewSubscriptionMockingExtension GetPurviewSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new PurviewSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static PurviewTenantMockingExtension GetPurviewTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new PurviewTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region PurviewAccountResource /// /// 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. /// Returns a object. public static PurviewAccountResource GetPurviewAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PurviewAccountResource.ValidateResourceId(id); - return new PurviewAccountResource(client, id); - } - ); + return GetPurviewArmClientMockingExtension(client).GetPurviewAccountResource(id); } - #endregion - #region PurviewPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static PurviewPrivateEndpointConnectionResource GetPurviewPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PurviewPrivateEndpointConnectionResource.ValidateResourceId(id); - return new PurviewPrivateEndpointConnectionResource(client, id); - } - ); + return GetPurviewArmClientMockingExtension(client).GetPurviewPrivateEndpointConnectionResource(id); } - #endregion - #region PurviewPrivateLinkResource /// /// 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. /// Returns a object. public static PurviewPrivateLinkResource GetPurviewPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PurviewPrivateLinkResource.ValidateResourceId(id); - return new PurviewPrivateLinkResource(client, id); - } - ); + return GetPurviewArmClientMockingExtension(client).GetPurviewPrivateLinkResource(id); } - #endregion - /// Gets a collection of PurviewAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of PurviewAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PurviewAccountResources and their operations over a PurviewAccountResource. public static PurviewAccountCollection GetPurviewAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPurviewAccounts(); + return GetPurviewResourceGroupMockingExtension(resourceGroupResource).GetPurviewAccounts(); } /// @@ -143,16 +114,20 @@ public static PurviewAccountCollection GetPurviewAccounts(this ResourceGroupReso /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the account. /// The cancellation token to use. - /// 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 static async Task> GetPurviewAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPurviewAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetPurviewResourceGroupMockingExtension(resourceGroupResource).GetPurviewAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -167,16 +142,20 @@ public static async Task> GetPurviewAccountAsyn /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the account. /// The cancellation token to use. - /// 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 static Response GetPurviewAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPurviewAccounts().Get(accountName, cancellationToken); + return GetPurviewResourceGroupMockingExtension(resourceGroupResource).GetPurviewAccount(accountName, cancellationToken); } /// @@ -191,6 +170,10 @@ public static Response GetPurviewAccount(this ResourceGr /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The skip token. @@ -198,7 +181,7 @@ public static Response GetPurviewAccount(this ResourceGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPurviewAccountsAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPurviewAccountsAsync(skipToken, cancellationToken); + return GetPurviewSubscriptionMockingExtension(subscriptionResource).GetPurviewAccountsAsync(skipToken, cancellationToken); } /// @@ -213,6 +196,10 @@ public static AsyncPageable GetPurviewAccountsAsync(this /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The skip token. @@ -220,7 +207,7 @@ public static AsyncPageable GetPurviewAccountsAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPurviewAccounts(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPurviewAccounts(skipToken, cancellationToken); + return GetPurviewSubscriptionMockingExtension(subscriptionResource).GetPurviewAccounts(skipToken, cancellationToken); } /// @@ -235,6 +222,10 @@ public static Pageable GetPurviewAccounts(this Subscript /// Accounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check name availability request. @@ -242,9 +233,7 @@ public static Pageable GetPurviewAccounts(this Subscript /// is null. public static async Task> CheckPurviewAccountNameAvailabilityAsync(this SubscriptionResource subscriptionResource, PurviewAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPurviewAccountNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetPurviewSubscriptionMockingExtension(subscriptionResource).CheckPurviewAccountNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -259,6 +248,10 @@ public static async Task> CheckPu /// Accounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The check name availability request. @@ -266,9 +259,7 @@ public static async Task> CheckPu /// is null. public static Response CheckPurviewAccountNameAvailability(this SubscriptionResource subscriptionResource, PurviewAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckPurviewAccountNameAvailability(content, cancellationToken); + return GetPurviewSubscriptionMockingExtension(subscriptionResource).CheckPurviewAccountNameAvailability(content, cancellationToken); } /// @@ -283,6 +274,10 @@ public static Response CheckPurviewAccount /// DefaultAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The tenant ID. @@ -291,7 +286,7 @@ public static Response CheckPurviewAccount /// The cancellation token to use. public static async Task> GetDefaultAccountAsync(this TenantResource tenantResource, Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).GetDefaultAccountAsync(scopeTenantId, scopeType, scope, cancellationToken).ConfigureAwait(false); + return await GetPurviewTenantMockingExtension(tenantResource).GetDefaultAccountAsync(scopeTenantId, scopeType, scope, cancellationToken).ConfigureAwait(false); } /// @@ -306,6 +301,10 @@ public static async Task> GetDefaultAccou /// DefaultAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The tenant ID. @@ -314,7 +313,7 @@ public static async Task> GetDefaultAccou /// The cancellation token to use. public static Response GetDefaultAccount(this TenantResource tenantResource, Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetDefaultAccount(scopeTenantId, scopeType, scope, cancellationToken); + return GetPurviewTenantMockingExtension(tenantResource).GetDefaultAccount(scopeTenantId, scopeType, scope, cancellationToken); } /// @@ -329,6 +328,10 @@ public static Response GetDefaultAccount(this Tena /// DefaultAccounts_Set /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The payload containing the default account information and the scope. @@ -336,9 +339,7 @@ public static Response GetDefaultAccount(this Tena /// is null. public static async Task> SetDefaultAccountAsync(this TenantResource tenantResource, DefaultPurviewAccountPayload defaultAccountPayload, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(defaultAccountPayload, nameof(defaultAccountPayload)); - - return await GetTenantResourceExtensionClient(tenantResource).SetDefaultAccountAsync(defaultAccountPayload, cancellationToken).ConfigureAwait(false); + return await GetPurviewTenantMockingExtension(tenantResource).SetDefaultAccountAsync(defaultAccountPayload, cancellationToken).ConfigureAwait(false); } /// @@ -353,6 +354,10 @@ public static async Task> SetDefaultAccou /// DefaultAccounts_Set /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The payload containing the default account information and the scope. @@ -360,9 +365,7 @@ public static async Task> SetDefaultAccou /// is null. public static Response SetDefaultAccount(this TenantResource tenantResource, DefaultPurviewAccountPayload defaultAccountPayload, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(defaultAccountPayload, nameof(defaultAccountPayload)); - - return GetTenantResourceExtensionClient(tenantResource).SetDefaultAccount(defaultAccountPayload, cancellationToken); + return GetPurviewTenantMockingExtension(tenantResource).SetDefaultAccount(defaultAccountPayload, cancellationToken); } /// @@ -377,6 +380,10 @@ public static Response SetDefaultAccount(this Tena /// DefaultAccounts_Remove /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The tenant ID. @@ -385,7 +392,7 @@ public static Response SetDefaultAccount(this Tena /// The cancellation token to use. public static async Task RemoveDefaultAccountAsync(this TenantResource tenantResource, Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).RemoveDefaultAccountAsync(scopeTenantId, scopeType, scope, cancellationToken).ConfigureAwait(false); + return await GetPurviewTenantMockingExtension(tenantResource).RemoveDefaultAccountAsync(scopeTenantId, scopeType, scope, cancellationToken).ConfigureAwait(false); } /// @@ -400,6 +407,10 @@ public static async Task RemoveDefaultAccountAsync(this TenantResource /// DefaultAccounts_Remove /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The tenant ID. @@ -408,7 +419,7 @@ public static async Task RemoveDefaultAccountAsync(this TenantResource /// The cancellation token to use. public static Response RemoveDefaultAccount(this TenantResource tenantResource, Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).RemoveDefaultAccount(scopeTenantId, scopeType, scope, cancellationToken); + return GetPurviewTenantMockingExtension(tenantResource).RemoveDefaultAccount(scopeTenantId, scopeType, scope, cancellationToken); } } } diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewResourceGroupMockingExtension.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..db07c2cf7cf7 --- /dev/null +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Purview; + +namespace Azure.ResourceManager.Purview.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class PurviewResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected PurviewResourceGroupMockingExtension() + { + } + + /// 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 PurviewResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of PurviewAccountResources in the ResourceGroupResource. + /// An object representing collection of PurviewAccountResources and their operations over a PurviewAccountResource. + public virtual PurviewAccountCollection GetPurviewAccounts() + { + return GetCachedClient(client => new PurviewAccountCollection(client, Id)); + } + + /// + /// Get an account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPurviewAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetPurviewAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Purview/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPurviewAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetPurviewAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewSubscriptionMockingExtension.cs similarity index 86% rename from sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewSubscriptionMockingExtension.cs index c14a968a7182..363966b52d63 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Purview; using Azure.ResourceManager.Purview.Models; -namespace Azure.ResourceManager.Purview +namespace Azure.ResourceManager.Purview.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class PurviewSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _purviewAccountAccountsClientDiagnostics; private AccountsRestOperations _purviewAccountAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PurviewSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PurviewSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ public virtual AsyncPageable GetPurviewAccountsAsync(str { HttpMessage FirstPageRequest(int? pageSizeHint) => PurviewAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PurviewAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PurviewAccountResource(Client, PurviewAccountData.DeserializePurviewAccountData(e)), PurviewAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPurviewAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PurviewAccountResource(Client, PurviewAccountData.DeserializePurviewAccountData(e)), PurviewAccountAccountsClientDiagnostics, Pipeline, "PurviewSubscriptionMockingExtension.GetPurviewAccounts", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetPurviewAccounts(string skipTo { HttpMessage FirstPageRequest(int? pageSizeHint) => PurviewAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PurviewAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PurviewAccountResource(Client, PurviewAccountData.DeserializePurviewAccountData(e)), PurviewAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPurviewAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PurviewAccountResource(Client, PurviewAccountData.DeserializePurviewAccountData(e)), PurviewAccountAccountsClientDiagnostics, Pipeline, "PurviewSubscriptionMockingExtension.GetPurviewAccounts", "value", "nextLink", cancellationToken); } /// @@ -105,9 +106,12 @@ public virtual Pageable GetPurviewAccounts(string skipTo /// /// The check name availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckPurviewAccountNameAvailabilityAsync(PurviewAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = PurviewAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPurviewAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PurviewAccountAccountsClientDiagnostics.CreateScope("PurviewSubscriptionMockingExtension.CheckPurviewAccountNameAvailability"); scope.Start(); try { @@ -136,9 +140,12 @@ public virtual async Task> CheckP /// /// The check name availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckPurviewAccountNameAvailability(PurviewAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = PurviewAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckPurviewAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = PurviewAccountAccountsClientDiagnostics.CreateScope("PurviewSubscriptionMockingExtension.CheckPurviewAccountNameAvailability"); scope.Start(); try { diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewTenantMockingExtension.cs similarity index 89% rename from sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewTenantMockingExtension.cs index 0c05ae6f6ce1..5bbaba8bf14a 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/PurviewTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Purview; using Azure.ResourceManager.Purview.Models; -namespace Azure.ResourceManager.Purview +namespace Azure.ResourceManager.Purview.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class PurviewTenantMockingExtension : ArmResource { private ClientDiagnostics _defaultAccountsClientDiagnostics; private DefaultAccountsRestOperations _defaultAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected PurviewTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PurviewTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -62,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> GetDefaultAccountAsync(Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetDefaultAccount"); + using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.GetDefaultAccount"); scope0.Start(); try { @@ -95,7 +96,7 @@ public virtual async Task> GetDefaultAcco /// The cancellation token to use. public virtual Response GetDefaultAccount(Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetDefaultAccount"); + using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.GetDefaultAccount"); scope0.Start(); try { @@ -124,9 +125,12 @@ public virtual Response GetDefaultAccount(Guid sco /// /// The payload containing the default account information and the scope. /// The cancellation token to use. + /// is null. public virtual async Task> SetDefaultAccountAsync(DefaultPurviewAccountPayload defaultAccountPayload, CancellationToken cancellationToken = default) { - using var scope = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.SetDefaultAccount"); + Argument.AssertNotNull(defaultAccountPayload, nameof(defaultAccountPayload)); + + using var scope = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.SetDefaultAccount"); scope.Start(); try { @@ -155,9 +159,12 @@ public virtual async Task> SetDefaultAcco /// /// The payload containing the default account information and the scope. /// The cancellation token to use. + /// is null. public virtual Response SetDefaultAccount(DefaultPurviewAccountPayload defaultAccountPayload, CancellationToken cancellationToken = default) { - using var scope = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.SetDefaultAccount"); + Argument.AssertNotNull(defaultAccountPayload, nameof(defaultAccountPayload)); + + using var scope = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.SetDefaultAccount"); scope.Start(); try { @@ -190,7 +197,7 @@ public virtual Response SetDefaultAccount(DefaultP /// The cancellation token to use. public virtual async Task RemoveDefaultAccountAsync(Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RemoveDefaultAccount"); + using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.RemoveDefaultAccount"); scope0.Start(); try { @@ -223,7 +230,7 @@ public virtual async Task RemoveDefaultAccountAsync(Guid scopeTenantId /// The cancellation token to use. public virtual Response RemoveDefaultAccount(Guid scopeTenantId, PurviewAccountScopeType scopeType, string scope = null, CancellationToken cancellationToken = default) { - using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RemoveDefaultAccount"); + using var scope0 = DefaultAccountsClientDiagnostics.CreateScope("PurviewTenantMockingExtension.RemoveDefaultAccount"); scope0.Start(); try { diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f8d64e6cf13b..000000000000 --- a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Purview -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of PurviewAccountResources in the ResourceGroupResource. - /// An object representing collection of PurviewAccountResources and their operations over a PurviewAccountResource. - public virtual PurviewAccountCollection GetPurviewAccounts() - { - return GetCachedClient(Client => new PurviewAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/PurviewAccountResource.cs b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/PurviewAccountResource.cs index 3f7e9375380c..667aa2bc79d1 100644 --- a/sdk/purview/Azure.ResourceManager.Purview/src/Generated/PurviewAccountResource.cs +++ b/sdk/purview/Azure.ResourceManager.Purview/src/Generated/PurviewAccountResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PurviewPrivateEndpointConnectionResources and their operations over a PurviewPrivateEndpointConnectionResource. public virtual PurviewPrivateEndpointConnectionCollection GetPurviewPrivateEndpointConnections() { - return GetCachedClient(Client => new PurviewPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new PurviewPrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual PurviewPrivateEndpointConnectionCollection GetPurviewPrivateEndpo /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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> GetPurviewPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// Name of the private endpoint connection. /// The cancellation token to use. - /// 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 GetPurviewPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetPurviewPriv /// An object representing collection of PurviewPrivateLinkResources and their operations over a PurviewPrivateLinkResource. public virtual PurviewPrivateLinkResourceCollection GetPurviewPrivateLinkResources() { - return GetCachedClient(Client => new PurviewPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new PurviewPrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual PurviewPrivateLinkResourceCollection GetPurviewPrivateLinkResourc /// /// The group identifier. /// The cancellation token to use. - /// 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> GetPurviewPrivateLinkResourceAsync(string groupId, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetPurviewPrivat /// /// The group identifier. /// The cancellation token to use. - /// 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 GetPurviewPrivateLinkResource(string groupId, CancellationToken cancellationToken = default) { diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumArmClientMockingExtension.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumArmClientMockingExtension.cs new file mode 100644 index 000000000000..7749f8e70a5b --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class QuantumArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected QuantumArmClientMockingExtension() + { + } + + /// 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 QuantumArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal QuantumArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual QuantumWorkspaceResource GetQuantumWorkspaceResource(ResourceIdentifier id) + { + QuantumWorkspaceResource.ValidateResourceId(id); + return new QuantumWorkspaceResource(Client, id); + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs index 8fd23a8decbe..0c97bb34e289 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Quantum.Mocking; using Azure.ResourceManager.Quantum.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.Quantum /// A class to add extension methods to Azure.ResourceManager.Quantum. public static partial class QuantumExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static QuantumArmClientMockingExtension GetQuantumArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new QuantumArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static QuantumResourceGroupMockingExtension GetQuantumResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new QuantumResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static QuantumSubscriptionMockingExtension GetQuantumSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new QuantumSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region QuantumWorkspaceResource /// /// 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. /// Returns a object. public static QuantumWorkspaceResource GetQuantumWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - QuantumWorkspaceResource.ValidateResourceId(id); - return new QuantumWorkspaceResource(client, id); - } - ); + return GetQuantumArmClientMockingExtension(client).GetQuantumWorkspaceResource(id); } - #endregion - /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of QuantumWorkspaceResources and their operations over a QuantumWorkspaceResource. public static QuantumWorkspaceCollection GetQuantumWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetQuantumWorkspaces(); + return GetQuantumResourceGroupMockingExtension(resourceGroupResource).GetQuantumWorkspaces(); } /// @@ -89,16 +77,20 @@ public static QuantumWorkspaceCollection GetQuantumWorkspaces(this ResourceGroup /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the quantum workspace resource. /// The cancellation token to use. - /// 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 static async Task> GetQuantumWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetQuantumWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetQuantumResourceGroupMockingExtension(resourceGroupResource).GetQuantumWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetQuantumWorkspace /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the quantum workspace resource. /// The cancellation token to use. - /// 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 static Response GetQuantumWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetQuantumWorkspaces().Get(workspaceName, cancellationToken); + return GetQuantumResourceGroupMockingExtension(resourceGroupResource).GetQuantumWorkspace(workspaceName, cancellationToken); } /// @@ -137,13 +133,17 @@ public static Response GetQuantumWorkspace(this Resour /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetQuantumWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQuantumWorkspacesAsync(cancellationToken); + return GetQuantumSubscriptionMockingExtension(subscriptionResource).GetQuantumWorkspacesAsync(cancellationToken); } /// @@ -158,13 +158,17 @@ public static AsyncPageable GetQuantumWorkspacesAsync( /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetQuantumWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQuantumWorkspaces(cancellationToken); + return GetQuantumSubscriptionMockingExtension(subscriptionResource).GetQuantumWorkspaces(cancellationToken); } /// @@ -179,6 +183,10 @@ public static Pageable GetQuantumWorkspaces(this Subsc /// Offerings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location. @@ -188,9 +196,7 @@ public static Pageable GetQuantumWorkspaces(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOfferingsAsync(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOfferingsAsync(locationName, cancellationToken); + return GetQuantumSubscriptionMockingExtension(subscriptionResource).GetOfferingsAsync(locationName, cancellationToken); } /// @@ -205,6 +211,10 @@ public static AsyncPageable GetOfferingsAsync(this Subscrip /// Offerings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location. @@ -214,9 +224,7 @@ public static AsyncPageable GetOfferingsAsync(this Subscrip /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOfferings(this SubscriptionResource subscriptionResource, string locationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOfferings(locationName, cancellationToken); + return GetQuantumSubscriptionMockingExtension(subscriptionResource).GetOfferings(locationName, cancellationToken); } /// @@ -231,6 +239,10 @@ public static Pageable GetOfferings(this SubscriptionResour /// Workspace_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location. @@ -240,10 +252,7 @@ public static Pageable GetOfferings(this SubscriptionResour /// or is null. public static async Task> CheckNameAvailabilityWorkspaceAsync(this SubscriptionResource subscriptionResource, string locationName, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityWorkspaceAsync(locationName, content, cancellationToken).ConfigureAwait(false); + return await GetQuantumSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityWorkspaceAsync(locationName, content, cancellationToken).ConfigureAwait(false); } /// @@ -258,6 +267,10 @@ public static async Task> CheckNameAvailab /// Workspace_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location. @@ -267,10 +280,7 @@ public static async Task> CheckNameAvailab /// or is null. public static Response CheckNameAvailabilityWorkspace(this SubscriptionResource subscriptionResource, string locationName, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityWorkspace(locationName, content, cancellationToken); + return GetQuantumSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityWorkspace(locationName, content, cancellationToken); } } } diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumResourceGroupMockingExtension.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..859c9691185f --- /dev/null +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; + +namespace Azure.ResourceManager.Quantum.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class QuantumResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected QuantumResourceGroupMockingExtension() + { + } + + /// 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 QuantumResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of QuantumWorkspaceResources and their operations over a QuantumWorkspaceResource. + public virtual QuantumWorkspaceCollection GetQuantumWorkspaces() + { + return GetCachedClient(client => new QuantumWorkspaceCollection(client, Id)); + } + + /// + /// Returns the Workspace resource associated with the given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the quantum workspace resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetQuantumWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetQuantumWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the Workspace resource associated with the given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the quantum workspace resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetQuantumWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetQuantumWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumSubscriptionMockingExtension.cs similarity index 81% rename from sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumSubscriptionMockingExtension.cs index ef6516614d54..f2b1b42af504 100644 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/QuantumSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Quantum; using Azure.ResourceManager.Quantum.Models; -namespace Azure.ResourceManager.Quantum +namespace Azure.ResourceManager.Quantum.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class QuantumSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _quantumWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _quantumWorkspaceWorkspacesRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _workspaceClientDiagnostics; private WorkspaceRestOperations _workspaceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected QuantumSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal QuantumSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +72,7 @@ public virtual AsyncPageable GetQuantumWorkspacesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "QuantumSubscriptionMockingExtension.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -93,7 +94,7 @@ public virtual Pageable GetQuantumWorkspaces(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuantumWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QuantumWorkspaceResource(Client, QuantumWorkspaceData.DeserializeQuantumWorkspaceData(e)), QuantumWorkspaceWorkspacesClientDiagnostics, Pipeline, "QuantumSubscriptionMockingExtension.GetQuantumWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -111,12 +112,16 @@ public virtual Pageable GetQuantumWorkspaces(Cancellat /// /// Location. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetOfferingsAsync(string locationName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OfferingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProviderDescription.DeserializeProviderDescription, OfferingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOfferings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProviderDescription.DeserializeProviderDescription, OfferingsClientDiagnostics, Pipeline, "QuantumSubscriptionMockingExtension.GetOfferings", "value", "nextLink", cancellationToken); } /// @@ -134,12 +139,16 @@ public virtual AsyncPageable GetOfferingsAsync(string locat /// /// Location. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetOfferings(string locationName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OfferingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProviderDescription.DeserializeProviderDescription, OfferingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOfferings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProviderDescription.DeserializeProviderDescription, OfferingsClientDiagnostics, Pipeline, "QuantumSubscriptionMockingExtension.GetOfferings", "value", "nextLink", cancellationToken); } /// @@ -158,9 +167,14 @@ public virtual Pageable GetOfferings(string locationName, C /// Location. /// The name and type of the resource. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> CheckNameAvailabilityWorkspaceAsync(string locationName, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = WorkspaceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityWorkspace"); + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = WorkspaceClientDiagnostics.CreateScope("QuantumSubscriptionMockingExtension.CheckNameAvailabilityWorkspace"); scope.Start(); try { @@ -190,9 +204,14 @@ public virtual async Task> CheckNameAvaila /// Location. /// The name and type of the resource. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response CheckNameAvailabilityWorkspace(string locationName, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = WorkspaceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityWorkspace"); + Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = WorkspaceClientDiagnostics.CreateScope("QuantumSubscriptionMockingExtension.CheckNameAvailabilityWorkspace"); scope.Start(); try { diff --git a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ec146eb5a8c8..000000000000 --- a/sdk/quantum/Azure.ResourceManager.Quantum/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Quantum -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of QuantumWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of QuantumWorkspaceResources and their operations over a QuantumWorkspaceResource. - public virtual QuantumWorkspaceCollection GetQuantumWorkspaces() - { - return GetCachedClient(Client => new QuantumWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloArmClientMockingExtension.cs b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloArmClientMockingExtension.cs new file mode 100644 index 000000000000..ba2e063ed529 --- /dev/null +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Qumulo; + +namespace Azure.ResourceManager.Qumulo.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class QumuloArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected QumuloArmClientMockingExtension() + { + } + + /// 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 QumuloArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal QumuloArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual QumuloFileSystemResource GetQumuloFileSystemResource(ResourceIdentifier id) + { + QumuloFileSystemResource.ValidateResourceId(id); + return new QumuloFileSystemResource(Client, id); + } + } +} diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloExtensions.cs b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloExtensions.cs index cc098bea72c2..e91e8f18dea1 100644 --- a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloExtensions.cs +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Qumulo.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Qumulo @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.Qumulo /// A class to add extension methods to Azure.ResourceManager.Qumulo. public static partial class QumuloExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static QumuloArmClientMockingExtension GetQumuloArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new QumuloArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static QumuloResourceGroupMockingExtension GetQumuloResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new QumuloResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static QumuloSubscriptionMockingExtension GetQumuloSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new QumuloSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region QumuloFileSystemResource /// /// 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. /// Returns a object. public static QumuloFileSystemResource GetQumuloFileSystemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - QumuloFileSystemResource.ValidateResourceId(id); - return new QumuloFileSystemResource(client, id); - } - ); + return GetQumuloArmClientMockingExtension(client).GetQumuloFileSystemResource(id); } - #endregion - /// Gets a collection of QumuloFileSystemResources in the ResourceGroupResource. + /// + /// Gets a collection of QumuloFileSystemResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of QumuloFileSystemResources and their operations over a QumuloFileSystemResource. public static QumuloFileSystemResourceCollection GetQumuloFileSystemResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetQumuloFileSystemResources(); + return GetQumuloResourceGroupMockingExtension(resourceGroupResource).GetQumuloFileSystemResources(); } /// @@ -88,16 +76,20 @@ public static QumuloFileSystemResourceCollection GetQumuloFileSystemResources(th /// FileSystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the File System resource. /// The cancellation token to use. - /// 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 static async Task> GetQumuloFileSystemResourceAsync(this ResourceGroupResource resourceGroupResource, string fileSystemName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetQumuloFileSystemResources().GetAsync(fileSystemName, cancellationToken).ConfigureAwait(false); + return await GetQumuloResourceGroupMockingExtension(resourceGroupResource).GetQumuloFileSystemResourceAsync(fileSystemName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetQumuloFileSystem /// FileSystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the File System resource. /// The cancellation token to use. - /// 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 static Response GetQumuloFileSystemResource(this ResourceGroupResource resourceGroupResource, string fileSystemName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetQumuloFileSystemResources().Get(fileSystemName, cancellationToken); + return GetQumuloResourceGroupMockingExtension(resourceGroupResource).GetQumuloFileSystemResource(fileSystemName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetQumuloFileSystemResource(thi /// FileSystems_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetQumuloFileSystemResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQumuloFileSystemResourcesAsync(cancellationToken); + return GetQumuloSubscriptionMockingExtension(subscriptionResource).GetQumuloFileSystemResourcesAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetQumuloFileSystemResourc /// FileSystems_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetQumuloFileSystemResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQumuloFileSystemResources(cancellationToken); + return GetQumuloSubscriptionMockingExtension(subscriptionResource).GetQumuloFileSystemResources(cancellationToken); } } } diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloResourceGroupMockingExtension.cs b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..76c50d7bb64d --- /dev/null +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Qumulo; + +namespace Azure.ResourceManager.Qumulo.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class QumuloResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected QumuloResourceGroupMockingExtension() + { + } + + /// 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 QumuloResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of QumuloFileSystemResources in the ResourceGroupResource. + /// An object representing collection of QumuloFileSystemResources and their operations over a QumuloFileSystemResource. + public virtual QumuloFileSystemResourceCollection GetQumuloFileSystemResources() + { + return GetCachedClient(client => new QumuloFileSystemResourceCollection(client, Id)); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName} + /// + /// + /// Operation Id + /// FileSystems_Get + /// + /// + /// + /// Name of the File System resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetQumuloFileSystemResourceAsync(string fileSystemName, CancellationToken cancellationToken = default) + { + return await GetQumuloFileSystemResources().GetAsync(fileSystemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FileSystemResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName} + /// + /// + /// Operation Id + /// FileSystems_Get + /// + /// + /// + /// Name of the File System resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetQumuloFileSystemResource(string fileSystemName, CancellationToken cancellationToken = default) + { + return GetQumuloFileSystemResources().Get(fileSystemName, cancellationToken); + } + } +} diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloSubscriptionMockingExtension.cs similarity index 86% rename from sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloSubscriptionMockingExtension.cs index bcf986604931..308ede950b54 100644 --- a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/QumuloSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Qumulo; -namespace Azure.ResourceManager.Qumulo +namespace Azure.ResourceManager.Qumulo.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class QumuloSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _qumuloFileSystemResourceFileSystemsClientDiagnostics; private FileSystemsRestOperations _qumuloFileSystemResourceFileSystemsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected QumuloSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal QumuloSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetQumuloFileSystemResour { HttpMessage FirstPageRequest(int? pageSizeHint) => QumuloFileSystemResourceFileSystemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QumuloFileSystemResourceFileSystemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QumuloFileSystemResource(Client, QumuloFileSystemResourceData.DeserializeQumuloFileSystemResourceData(e)), QumuloFileSystemResourceFileSystemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQumuloFileSystemResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new QumuloFileSystemResource(Client, QumuloFileSystemResourceData.DeserializeQumuloFileSystemResourceData(e)), QumuloFileSystemResourceFileSystemsClientDiagnostics, Pipeline, "QumuloSubscriptionMockingExtension.GetQumuloFileSystemResources", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetQumuloFileSystemResources(C { HttpMessage FirstPageRequest(int? pageSizeHint) => QumuloFileSystemResourceFileSystemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QumuloFileSystemResourceFileSystemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QumuloFileSystemResource(Client, QumuloFileSystemResourceData.DeserializeQumuloFileSystemResourceData(e)), QumuloFileSystemResourceFileSystemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetQumuloFileSystemResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new QumuloFileSystemResource(Client, QumuloFileSystemResourceData.DeserializeQumuloFileSystemResourceData(e)), QumuloFileSystemResourceFileSystemsClientDiagnostics, Pipeline, "QumuloSubscriptionMockingExtension.GetQumuloFileSystemResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 44a3cac71aed..000000000000 --- a/sdk/qumulo/Azure.ResourceManager.Qumulo/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Qumulo -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of QumuloFileSystemResources in the ResourceGroupResource. - /// An object representing collection of QumuloFileSystemResources and their operations over a QumuloFileSystemResource. - public virtual QumuloFileSystemResourceCollection GetQumuloFileSystemResources() - { - return GetCachedClient(Client => new QumuloFileSystemResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index acd067670610..000000000000 --- a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Quota -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CurrentUsagesBaseResources in the ArmResource. - /// An object representing collection of CurrentUsagesBaseResources and their operations over a CurrentUsagesBaseResource. - public virtual CurrentUsagesBaseCollection GetCurrentUsagesBases() - { - return GetCachedClient(Client => new CurrentUsagesBaseCollection(Client, Id)); - } - - /// Gets a collection of CurrentQuotaLimitBaseResources in the ArmResource. - /// An object representing collection of CurrentQuotaLimitBaseResources and their operations over a CurrentQuotaLimitBaseResource. - public virtual CurrentQuotaLimitBaseCollection GetCurrentQuotaLimitBases() - { - return GetCachedClient(Client => new CurrentQuotaLimitBaseCollection(Client, Id)); - } - - /// Gets a collection of QuotaRequestDetailResources in the ArmResource. - /// An object representing collection of QuotaRequestDetailResources and their operations over a QuotaRequestDetailResource. - public virtual QuotaRequestDetailCollection GetQuotaRequestDetails() - { - return GetCachedClient(Client => new QuotaRequestDetailCollection(Client, Id)); - } - } -} diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaArmClientMockingExtension.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaArmClientMockingExtension.cs new file mode 100644 index 000000000000..ee952cbe0c84 --- /dev/null +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaArmClientMockingExtension.cs @@ -0,0 +1,267 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Quota; + +namespace Azure.ResourceManager.Quota.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class QuotaArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected QuotaArmClientMockingExtension() + { + } + + /// 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 QuotaArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal QuotaArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CurrentUsagesBaseResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of CurrentUsagesBaseResources and their operations over a CurrentUsagesBaseResource. + public virtual CurrentUsagesBaseCollection GetCurrentUsagesBases(ResourceIdentifier scope) + { + return new CurrentUsagesBaseCollection(Client, scope); + } + + /// + /// Get the current usage of a resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/usages/{resourceName} + /// + /// + /// Operation Id + /// Usages_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// + /// Resource name for a given resource provider. For example: + /// - SKU name for Microsoft.Compute + /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + /// For Microsoft.Network PublicIPAddresses. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCurrentUsagesBaseAsync(ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) + { + return await GetCurrentUsagesBases(scope).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the current usage of a resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/usages/{resourceName} + /// + /// + /// Operation Id + /// Usages_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// + /// Resource name for a given resource provider. For example: + /// - SKU name for Microsoft.Compute + /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + /// For Microsoft.Network PublicIPAddresses. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCurrentUsagesBase(ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) + { + return GetCurrentUsagesBases(scope).Get(resourceName, cancellationToken); + } + + /// Gets a collection of CurrentQuotaLimitBaseResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of CurrentQuotaLimitBaseResources and their operations over a CurrentQuotaLimitBaseResource. + public virtual CurrentQuotaLimitBaseCollection GetCurrentQuotaLimitBases(ResourceIdentifier scope) + { + return new CurrentQuotaLimitBaseCollection(Client, scope); + } + + /// + /// Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/quotas/{resourceName} + /// + /// + /// Operation Id + /// Quota_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// + /// Resource name for a given resource provider. For example: + /// - SKU name for Microsoft.Compute + /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + /// For Microsoft.Network PublicIPAddresses. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCurrentQuotaLimitBaseAsync(ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) + { + return await GetCurrentQuotaLimitBases(scope).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new quota limit that can be submitted with a PUT request. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/quotas/{resourceName} + /// + /// + /// Operation Id + /// Quota_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// + /// Resource name for a given resource provider. For example: + /// - SKU name for Microsoft.Compute + /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices + /// For Microsoft.Network PublicIPAddresses. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCurrentQuotaLimitBase(ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) + { + return GetCurrentQuotaLimitBases(scope).Get(resourceName, cancellationToken); + } + + /// Gets a collection of QuotaRequestDetailResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of QuotaRequestDetailResources and their operations over a QuotaRequestDetailResource. + public virtual QuotaRequestDetailCollection GetQuotaRequestDetails(ResourceIdentifier scope) + { + return new QuotaRequestDetailCollection(Client, scope); + } + + /// + /// Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location. The quota request ID **id** is returned in the response of the PUT operation. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/quotaRequests/{id} + /// + /// + /// Operation Id + /// QuotaRequestStatus_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Quota request ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetQuotaRequestDetailAsync(ResourceIdentifier scope, string id, CancellationToken cancellationToken = default) + { + return await GetQuotaRequestDetails(scope).GetAsync(id, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the quota request details and status by quota request ID for the resources of the resource provider at a specific location. The quota request ID **id** is returned in the response of the PUT operation. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Quota/quotaRequests/{id} + /// + /// + /// Operation Id + /// QuotaRequestStatus_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Quota request ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetQuotaRequestDetail(ResourceIdentifier scope, string id, CancellationToken cancellationToken = default) + { + return GetQuotaRequestDetails(scope).Get(id, 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 CurrentUsagesBaseResource GetCurrentUsagesBaseResource(ResourceIdentifier id) + { + CurrentUsagesBaseResource.ValidateResourceId(id); + return new CurrentUsagesBaseResource(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 CurrentQuotaLimitBaseResource GetCurrentQuotaLimitBaseResource(ResourceIdentifier id) + { + CurrentQuotaLimitBaseResource.ValidateResourceId(id); + return new CurrentQuotaLimitBaseResource(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 QuotaRequestDetailResource GetQuotaRequestDetailResource(ResourceIdentifier id) + { + QuotaRequestDetailResource.ValidateResourceId(id); + return new QuotaRequestDetailResource(Client, id); + } + } +} diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaExtensions.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaExtensions.cs index 41dda3945133..6bd9421c8764 100644 --- a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaExtensions.cs +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Quota.Mocking; using Azure.ResourceManager.Quota.Models; using Azure.ResourceManager.Resources; @@ -19,101 +20,29 @@ namespace Azure.ResourceManager.Quota /// A class to add extension methods to Azure.ResourceManager.Quota. public static partial class QuotaExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static QuotaArmClientMockingExtension GetQuotaArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new QuotaArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static QuotaTenantMockingExtension GetQuotaTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new QuotaTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region CurrentUsagesBaseResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CurrentUsagesBaseResource GetCurrentUsagesBaseResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CurrentUsagesBaseResource.ValidateResourceId(id); - return new CurrentUsagesBaseResource(client, id); - } - ); - } - #endregion - - #region CurrentQuotaLimitBaseResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CurrentQuotaLimitBaseResource GetCurrentQuotaLimitBaseResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CurrentQuotaLimitBaseResource.ValidateResourceId(id); - return new CurrentQuotaLimitBaseResource(client, id); - } - ); - } - #endregion - - #region QuotaRequestDetailResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of CurrentUsagesBaseResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static QuotaRequestDetailResource GetQuotaRequestDetailResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - QuotaRequestDetailResource.ValidateResourceId(id); - return new QuotaRequestDetailResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of CurrentUsagesBaseResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of CurrentUsagesBaseResources and their operations over a CurrentUsagesBaseResource. public static CurrentUsagesBaseCollection GetCurrentUsagesBases(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetCurrentUsagesBases(); + return GetQuotaArmClientMockingExtension(client).GetCurrentUsagesBases(scope); } /// @@ -128,6 +57,10 @@ public static CurrentUsagesBaseCollection GetCurrentUsagesBases(this ArmClient c /// Usages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -138,12 +71,12 @@ public static CurrentUsagesBaseCollection GetCurrentUsagesBases(this ArmClient c /// For Microsoft.Network PublicIPAddresses. /// /// The cancellation token to use. - /// 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 static async Task> GetCurrentUsagesBaseAsync(this ArmClient client, ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) { - return await client.GetCurrentUsagesBases(scope).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetQuotaArmClientMockingExtension(client).GetCurrentUsagesBaseAsync(scope, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -158,6 +91,10 @@ public static async Task> GetCurrentUsagesBa /// Usages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -168,21 +105,27 @@ public static async Task> GetCurrentUsagesBa /// For Microsoft.Network PublicIPAddresses. /// /// The cancellation token to use. - /// 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 static Response GetCurrentUsagesBase(this ArmClient client, ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) { - return client.GetCurrentUsagesBases(scope).Get(resourceName, cancellationToken); + return GetQuotaArmClientMockingExtension(client).GetCurrentUsagesBase(scope, resourceName, cancellationToken); } - /// Gets a collection of CurrentQuotaLimitBaseResources in the ArmResource. + /// + /// Gets a collection of CurrentQuotaLimitBaseResources 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. /// An object representing collection of CurrentQuotaLimitBaseResources and their operations over a CurrentQuotaLimitBaseResource. public static CurrentQuotaLimitBaseCollection GetCurrentQuotaLimitBases(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetCurrentQuotaLimitBases(); + return GetQuotaArmClientMockingExtension(client).GetCurrentQuotaLimitBases(scope); } /// @@ -197,6 +140,10 @@ public static CurrentQuotaLimitBaseCollection GetCurrentQuotaLimitBases(this Arm /// Quota_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -207,12 +154,12 @@ public static CurrentQuotaLimitBaseCollection GetCurrentQuotaLimitBases(this Arm /// For Microsoft.Network PublicIPAddresses. /// /// The cancellation token to use. - /// 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 static async Task> GetCurrentQuotaLimitBaseAsync(this ArmClient client, ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) { - return await client.GetCurrentQuotaLimitBases(scope).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetQuotaArmClientMockingExtension(client).GetCurrentQuotaLimitBaseAsync(scope, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -227,6 +174,10 @@ public static async Task> GetCurrentQuot /// Quota_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -237,21 +188,27 @@ public static async Task> GetCurrentQuot /// For Microsoft.Network PublicIPAddresses. /// /// The cancellation token to use. - /// 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 static Response GetCurrentQuotaLimitBase(this ArmClient client, ResourceIdentifier scope, string resourceName, CancellationToken cancellationToken = default) { - return client.GetCurrentQuotaLimitBases(scope).Get(resourceName, cancellationToken); + return GetQuotaArmClientMockingExtension(client).GetCurrentQuotaLimitBase(scope, resourceName, cancellationToken); } - /// Gets a collection of QuotaRequestDetailResources in the ArmResource. + /// + /// Gets a collection of QuotaRequestDetailResources 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. /// An object representing collection of QuotaRequestDetailResources and their operations over a QuotaRequestDetailResource. public static QuotaRequestDetailCollection GetQuotaRequestDetails(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetQuotaRequestDetails(); + return GetQuotaArmClientMockingExtension(client).GetQuotaRequestDetails(scope); } /// @@ -266,17 +223,21 @@ public static QuotaRequestDetailCollection GetQuotaRequestDetails(this ArmClient /// QuotaRequestStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Quota request ID. /// The cancellation token to use. - /// 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 static async Task> GetQuotaRequestDetailAsync(this ArmClient client, ResourceIdentifier scope, string id, CancellationToken cancellationToken = default) { - return await client.GetQuotaRequestDetails(scope).GetAsync(id, cancellationToken).ConfigureAwait(false); + return await GetQuotaArmClientMockingExtension(client).GetQuotaRequestDetailAsync(scope, id, cancellationToken).ConfigureAwait(false); } /// @@ -291,17 +252,69 @@ public static async Task> GetQuotaRequestDe /// QuotaRequestStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Quota request ID. /// The cancellation token to use. - /// 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 static Response GetQuotaRequestDetail(this ArmClient client, ResourceIdentifier scope, string id, CancellationToken cancellationToken = default) { - return client.GetQuotaRequestDetails(scope).Get(id, cancellationToken); + return GetQuotaArmClientMockingExtension(client).GetQuotaRequestDetail(scope, id, 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. + /// Returns a object. + public static CurrentUsagesBaseResource GetCurrentUsagesBaseResource(this ArmClient client, ResourceIdentifier id) + { + return GetQuotaArmClientMockingExtension(client).GetCurrentUsagesBaseResource(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. + /// Returns a object. + public static CurrentQuotaLimitBaseResource GetCurrentQuotaLimitBaseResource(this ArmClient client, ResourceIdentifier id) + { + return GetQuotaArmClientMockingExtension(client).GetCurrentQuotaLimitBaseResource(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. + /// Returns a object. + public static QuotaRequestDetailResource GetQuotaRequestDetailResource(this ArmClient client, ResourceIdentifier id) + { + return GetQuotaArmClientMockingExtension(client).GetQuotaRequestDetailResource(id); } /// @@ -316,13 +329,17 @@ public static Response GetQuotaRequestDetail(this Ar /// QuotaOperation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetQuotaOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetQuotaOperationsAsync(cancellationToken); + return GetQuotaTenantMockingExtension(tenantResource).GetQuotaOperationsAsync(cancellationToken); } /// @@ -337,13 +354,17 @@ public static AsyncPageable GetQuotaOperationsAsync(this T /// QuotaOperation_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetQuotaOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetQuotaOperations(cancellationToken); + return GetQuotaTenantMockingExtension(tenantResource).GetQuotaOperations(cancellationToken); } } } diff --git a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaTenantMockingExtension.cs similarity index 87% rename from sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaTenantMockingExtension.cs index 41343bb69708..2c48517175af 100644 --- a/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/quota/Azure.ResourceManager.Quota/src/Generated/Extensions/QuotaTenantMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Quota; using Azure.ResourceManager.Quota.Models; -namespace Azure.ResourceManager.Quota +namespace Azure.ResourceManager.Quota.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class QuotaTenantMockingExtension : ArmResource { private ClientDiagnostics _quotaOperationClientDiagnostics; private QuotaOperationRestOperations _quotaOperationRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected QuotaTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal QuotaTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ public virtual AsyncPageable GetQuotaOperationsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => QuotaOperationRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuotaOperationRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, QuotaOperationResult.DeserializeQuotaOperationResult, QuotaOperationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetQuotaOperations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, QuotaOperationResult.DeserializeQuotaOperationResult, QuotaOperationClientDiagnostics, Pipeline, "QuotaTenantMockingExtension.GetQuotaOperations", "value", "nextLink", cancellationToken); } /// @@ -83,7 +84,7 @@ public virtual Pageable GetQuotaOperations(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => QuotaOperationRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => QuotaOperationRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, QuotaOperationResult.DeserializeQuotaOperationResult, QuotaOperationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetQuotaOperations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, QuotaOperationResult.DeserializeQuotaOperationResult, QuotaOperationClientDiagnostics, Pipeline, "QuotaTenantMockingExtension.GetQuotaOperations", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectedItemResource.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectedItemResource.cs index a5a5d0796c4b..fe4aef63f4b4 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectedItemResource.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectedItemResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BackupRecoveryPointResources and their operations over a BackupRecoveryPointResource. public virtual BackupRecoveryPointCollection GetBackupRecoveryPoints() { - return GetCachedClient(Client => new BackupRecoveryPointCollection(Client, Id)); + return GetCachedClient(client => new BackupRecoveryPointCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual BackupRecoveryPointCollection GetBackupRecoveryPoints() /// /// RecoveryPointID represents the backed up data to be fetched. /// The cancellation token to use. - /// 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> GetBackupRecoveryPointAsync(string recoveryPointId, CancellationToken cancellationToken = default) { @@ -144,8 +144,8 @@ public virtual async Task> GetBackupRecove /// /// RecoveryPointID represents the backed up data to be fetched. /// The cancellation token to use. - /// 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 GetBackupRecoveryPoint(string recoveryPointId, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs index 4d66fc870fe1..5fcade954b76 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of BackupProtectedItemResources and their operations over a BackupProtectedItemResource. public virtual BackupProtectedItemCollection GetBackupProtectedItems() { - return GetCachedClient(Client => new BackupProtectedItemCollection(Client, Id)); + return GetCachedClient(client => new BackupProtectedItemCollection(client, Id)); } /// @@ -118,8 +118,8 @@ public virtual BackupProtectedItemCollection GetBackupProtectedItems() /// Backed up item name whose details are to be fetched. /// OData filter options. /// The cancellation token to use. - /// 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> GetBackupProtectedItemAsync(string protectedItemName, string filter = null, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> GetBackupProtec /// Backed up item name whose details are to be fetched. /// OData filter options. /// The cancellation token to use. - /// 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 GetBackupProtectedItem(string protectedItemName, string filter = null, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupArmClientMockingExtension.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupArmClientMockingExtension.cs new file mode 100644 index 000000000000..5d320aaeabbc --- /dev/null +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupArmClientMockingExtension.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesBackup; + +namespace Azure.ResourceManager.RecoveryServicesBackup.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RecoveryServicesBackupArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesBackupArmClientMockingExtension() + { + } + + /// 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 RecoveryServicesBackupArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RecoveryServicesBackupArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual BackupResourceConfigResource GetBackupResourceConfigResource(ResourceIdentifier id) + { + BackupResourceConfigResource.ValidateResourceId(id); + return new BackupResourceConfigResource(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 BackupProtectionIntentResource GetBackupProtectionIntentResource(ResourceIdentifier id) + { + BackupProtectionIntentResource.ValidateResourceId(id); + return new BackupProtectionIntentResource(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 BackupResourceVaultConfigResource GetBackupResourceVaultConfigResource(ResourceIdentifier id) + { + BackupResourceVaultConfigResource.ValidateResourceId(id); + return new BackupResourceVaultConfigResource(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 BackupResourceEncryptionConfigExtendedResource GetBackupResourceEncryptionConfigExtendedResource(ResourceIdentifier id) + { + BackupResourceEncryptionConfigExtendedResource.ValidateResourceId(id); + return new BackupResourceEncryptionConfigExtendedResource(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 BackupPrivateEndpointConnectionResource GetBackupPrivateEndpointConnectionResource(ResourceIdentifier id) + { + BackupPrivateEndpointConnectionResource.ValidateResourceId(id); + return new BackupPrivateEndpointConnectionResource(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 BackupProtectedItemResource GetBackupProtectedItemResource(ResourceIdentifier id) + { + BackupProtectedItemResource.ValidateResourceId(id); + return new BackupProtectedItemResource(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 BackupRecoveryPointResource GetBackupRecoveryPointResource(ResourceIdentifier id) + { + BackupRecoveryPointResource.ValidateResourceId(id); + return new BackupRecoveryPointResource(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 BackupProtectionPolicyResource GetBackupProtectionPolicyResource(ResourceIdentifier id) + { + BackupProtectionPolicyResource.ValidateResourceId(id); + return new BackupProtectionPolicyResource(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 BackupJobResource GetBackupJobResource(ResourceIdentifier id) + { + BackupJobResource.ValidateResourceId(id); + return new BackupJobResource(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 BackupEngineResource GetBackupEngineResource(ResourceIdentifier id) + { + BackupEngineResource.ValidateResourceId(id); + return new BackupEngineResource(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 BackupProtectionContainerResource GetBackupProtectionContainerResource(ResourceIdentifier id) + { + BackupProtectionContainerResource.ValidateResourceId(id); + return new BackupProtectionContainerResource(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 ResourceGuardProxyResource GetResourceGuardProxyResource(ResourceIdentifier id) + { + ResourceGuardProxyResource.ValidateResourceId(id); + return new ResourceGuardProxyResource(Client, id); + } + } +} diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupExtensions.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupExtensions.cs index bc20d599d96e..365f621bf8ba 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupExtensions.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesBackup.Mocking; using Azure.ResourceManager.RecoveryServicesBackup.Models; using Azure.ResourceManager.Resources; @@ -19,271 +20,225 @@ namespace Azure.ResourceManager.RecoveryServicesBackup /// A class to add extension methods to Azure.ResourceManager.RecoveryServicesBackup. public static partial class RecoveryServicesBackupExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RecoveryServicesBackupArmClientMockingExtension GetRecoveryServicesBackupArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RecoveryServicesBackupArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RecoveryServicesBackupResourceGroupMockingExtension GetRecoveryServicesBackupResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RecoveryServicesBackupResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RecoveryServicesBackupSubscriptionMockingExtension GetRecoveryServicesBackupSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RecoveryServicesBackupSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region BackupResourceConfigResource /// /// 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. /// Returns a object. public static BackupResourceConfigResource GetBackupResourceConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupResourceConfigResource.ValidateResourceId(id); - return new BackupResourceConfigResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupResourceConfigResource(id); } - #endregion - #region BackupProtectionIntentResource /// /// 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. /// Returns a object. public static BackupProtectionIntentResource GetBackupProtectionIntentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupProtectionIntentResource.ValidateResourceId(id); - return new BackupProtectionIntentResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupProtectionIntentResource(id); } - #endregion - #region BackupResourceVaultConfigResource /// /// 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. /// Returns a object. public static BackupResourceVaultConfigResource GetBackupResourceVaultConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupResourceVaultConfigResource.ValidateResourceId(id); - return new BackupResourceVaultConfigResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupResourceVaultConfigResource(id); } - #endregion - #region BackupResourceEncryptionConfigExtendedResource /// /// 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. /// Returns a object. public static BackupResourceEncryptionConfigExtendedResource GetBackupResourceEncryptionConfigExtendedResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupResourceEncryptionConfigExtendedResource.ValidateResourceId(id); - return new BackupResourceEncryptionConfigExtendedResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupResourceEncryptionConfigExtendedResource(id); } - #endregion - #region BackupPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static BackupPrivateEndpointConnectionResource GetBackupPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupPrivateEndpointConnectionResource.ValidateResourceId(id); - return new BackupPrivateEndpointConnectionResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupPrivateEndpointConnectionResource(id); } - #endregion - #region BackupProtectedItemResource /// /// 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. /// Returns a object. public static BackupProtectedItemResource GetBackupProtectedItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupProtectedItemResource.ValidateResourceId(id); - return new BackupProtectedItemResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupProtectedItemResource(id); } - #endregion - #region BackupRecoveryPointResource /// /// 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. /// Returns a object. public static BackupRecoveryPointResource GetBackupRecoveryPointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupRecoveryPointResource.ValidateResourceId(id); - return new BackupRecoveryPointResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupRecoveryPointResource(id); } - #endregion - #region BackupProtectionPolicyResource /// /// 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. /// Returns a object. public static BackupProtectionPolicyResource GetBackupProtectionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupProtectionPolicyResource.ValidateResourceId(id); - return new BackupProtectionPolicyResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupProtectionPolicyResource(id); } - #endregion - #region BackupJobResource /// /// 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. /// Returns a object. public static BackupJobResource GetBackupJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupJobResource.ValidateResourceId(id); - return new BackupJobResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupJobResource(id); } - #endregion - #region BackupEngineResource /// /// 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. /// Returns a object. public static BackupEngineResource GetBackupEngineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupEngineResource.ValidateResourceId(id); - return new BackupEngineResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupEngineResource(id); } - #endregion - #region BackupProtectionContainerResource /// /// 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. /// Returns a object. public static BackupProtectionContainerResource GetBackupProtectionContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupProtectionContainerResource.ValidateResourceId(id); - return new BackupProtectionContainerResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetBackupProtectionContainerResource(id); } - #endregion - #region ResourceGuardProxyResource /// /// 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. /// Returns a object. public static ResourceGuardProxyResource GetResourceGuardProxyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGuardProxyResource.ValidateResourceId(id); - return new ResourceGuardProxyResource(client, id); - } - ); + return GetRecoveryServicesBackupArmClientMockingExtension(client).GetResourceGuardProxyResource(id); } - #endregion - /// Gets a collection of BackupResourceConfigResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupResourceConfigResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupResourceConfigResources and their operations over a BackupResourceConfigResource. public static BackupResourceConfigCollection GetBackupResourceConfigs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupResourceConfigs(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceConfigs(); } /// @@ -298,16 +253,20 @@ public static BackupResourceConfigCollection GetBackupResourceConfigs(this Resou /// BackupResourceStorageConfigsNonCRR_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static async Task> GetBackupResourceConfigAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupResourceConfigs().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceConfigAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -322,24 +281,34 @@ public static async Task> GetBackupResour /// BackupResourceStorageConfigsNonCRR_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static Response GetBackupResourceConfig(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupResourceConfigs().Get(vaultName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceConfig(vaultName, cancellationToken); } - /// Gets a collection of BackupProtectionIntentResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupProtectionIntentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupProtectionIntentResources and their operations over a BackupProtectionIntentResource. public static BackupProtectionIntentCollection GetBackupProtectionIntents(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionIntents(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionIntents(); } /// @@ -355,18 +324,22 @@ public static BackupProtectionIntentCollection GetBackupProtectionIntents(this R /// ProtectionIntent_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Fabric name associated with the backed up item. /// Backed up item name whose details are to be fetched. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupProtectionIntentAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupProtectionIntents().GetAsync(vaultName, fabricName, intentObjectName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionIntentAsync(vaultName, fabricName, intentObjectName, cancellationToken).ConfigureAwait(false); } /// @@ -382,26 +355,36 @@ public static async Task> GetBackupProt /// ProtectionIntent_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Fabric name associated with the backed up item. /// Backed up item name whose details are to be fetched. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupProtectionIntent(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupProtectionIntents().Get(vaultName, fabricName, intentObjectName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionIntent(vaultName, fabricName, intentObjectName, cancellationToken); } - /// Gets a collection of BackupResourceVaultConfigResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupResourceVaultConfigResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupResourceVaultConfigResources and their operations over a BackupResourceVaultConfigResource. public static BackupResourceVaultConfigCollection GetBackupResourceVaultConfigs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupResourceVaultConfigs(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceVaultConfigs(); } /// @@ -416,16 +399,20 @@ public static BackupResourceVaultConfigCollection GetBackupResourceVaultConfigs( /// BackupResourceVaultConfigs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static async Task> GetBackupResourceVaultConfigAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupResourceVaultConfigs().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceVaultConfigAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -440,24 +427,34 @@ public static async Task> GetBackupR /// BackupResourceVaultConfigs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static Response GetBackupResourceVaultConfig(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupResourceVaultConfigs().Get(vaultName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceVaultConfig(vaultName, cancellationToken); } - /// Gets a collection of BackupResourceEncryptionConfigExtendedResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupResourceEncryptionConfigExtendedResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupResourceEncryptionConfigExtendedResources and their operations over a BackupResourceEncryptionConfigExtendedResource. public static BackupResourceEncryptionConfigExtendedCollection GetBackupResourceEncryptionConfigExtendeds(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupResourceEncryptionConfigExtendeds(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceEncryptionConfigExtendeds(); } /// @@ -472,16 +469,20 @@ public static BackupResourceEncryptionConfigExtendedCollection GetBackupResource /// BackupResourceEncryptionConfigs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static async Task> GetBackupResourceEncryptionConfigExtendedAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupResourceEncryptionConfigExtendeds().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceEncryptionConfigExtendedAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -496,24 +497,34 @@ public static async TaskBackupResourceEncryptionConfigs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static Response GetBackupResourceEncryptionConfigExtended(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupResourceEncryptionConfigExtendeds().Get(vaultName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupResourceEncryptionConfigExtended(vaultName, cancellationToken); } - /// Gets a collection of BackupPrivateEndpointConnectionResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupPrivateEndpointConnectionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupPrivateEndpointConnectionResources and their operations over a BackupPrivateEndpointConnectionResource. public static BackupPrivateEndpointConnectionCollection GetBackupPrivateEndpointConnections(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupPrivateEndpointConnections(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupPrivateEndpointConnections(); } /// @@ -528,17 +539,21 @@ public static BackupPrivateEndpointConnectionCollection GetBackupPrivateEndpoint /// PrivateEndpointConnection_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the private endpoint connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupPrivateEndpointConnectionAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupPrivateEndpointConnections().GetAsync(vaultName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupPrivateEndpointConnectionAsync(vaultName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -553,30 +568,38 @@ public static async Task> GetB /// PrivateEndpointConnection_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the private endpoint connection. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupPrivateEndpointConnection(this ResourceGroupResource resourceGroupResource, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupPrivateEndpointConnections().Get(vaultName, privateEndpointConnectionName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupPrivateEndpointConnection(vaultName, privateEndpointConnectionName, cancellationToken); } - /// Gets a collection of BackupProtectionPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupProtectionPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupProtectionPolicyResources and their operations over a BackupProtectionPolicyResource. public static BackupProtectionPolicyCollection GetBackupProtectionPolicies(this ResourceGroupResource resourceGroupResource, string vaultName) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionPolicies(vaultName); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionPolicies(vaultName); } /// @@ -592,17 +615,21 @@ public static BackupProtectionPolicyCollection GetBackupProtectionPolicies(this /// ProtectionPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Backup policy information to be fetched. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupProtectionPolicyAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string policyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupProtectionPolicies(vaultName).GetAsync(policyName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionPolicyAsync(vaultName, policyName, cancellationToken).ConfigureAwait(false); } /// @@ -618,30 +645,38 @@ public static async Task> GetBackupProt /// ProtectionPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Backup policy information to be fetched. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupProtectionPolicy(this ResourceGroupResource resourceGroupResource, string vaultName, string policyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupProtectionPolicies(vaultName).Get(policyName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionPolicy(vaultName, policyName, cancellationToken); } - /// Gets a collection of BackupJobResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupJobResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupJobResources and their operations over a BackupJobResource. public static BackupJobCollection GetBackupJobs(this ResourceGroupResource resourceGroupResource, string vaultName) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupJobs(vaultName); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupJobs(vaultName); } /// @@ -656,17 +691,21 @@ public static BackupJobCollection GetBackupJobs(this ResourceGroupResource resou /// JobDetails_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the job whose details are to be fetched. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupJobAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string jobName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupJobs(vaultName).GetAsync(jobName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupJobAsync(vaultName, jobName, cancellationToken).ConfigureAwait(false); } /// @@ -681,30 +720,38 @@ public static async Task> GetBackupJobAsync(this Res /// JobDetails_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the job whose details are to be fetched. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupJob(this ResourceGroupResource resourceGroupResource, string vaultName, string jobName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupJobs(vaultName).Get(jobName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupJob(vaultName, jobName, cancellationToken); } - /// Gets a collection of BackupEngineResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupEngineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupEngineResources and their operations over a BackupEngineResource. public static BackupEngineCollection GetBackupEngines(this ResourceGroupResource resourceGroupResource, string vaultName) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupEngines(vaultName); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupEngines(vaultName); } /// @@ -719,6 +766,10 @@ public static BackupEngineCollection GetBackupEngines(this ResourceGroupResource /// BackupEngines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -726,12 +777,12 @@ public static BackupEngineCollection GetBackupEngines(this ResourceGroupResource /// OData filter options. /// skipToken Filter. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupEngineAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string backupEngineName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupEngines(vaultName).GetAsync(backupEngineName, filter, skipToken, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupEngineAsync(vaultName, backupEngineName, filter, skipToken, cancellationToken).ConfigureAwait(false); } /// @@ -746,6 +797,10 @@ public static async Task> GetBackupEngineAsync(th /// BackupEngines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -753,20 +808,26 @@ public static async Task> GetBackupEngineAsync(th /// OData filter options. /// skipToken Filter. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupEngine(this ResourceGroupResource resourceGroupResource, string vaultName, string backupEngineName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupEngines(vaultName).Get(backupEngineName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupEngine(vaultName, backupEngineName, filter, skipToken, cancellationToken); } - /// Gets a collection of BackupProtectionContainerResources in the ResourceGroupResource. + /// + /// Gets a collection of BackupProtectionContainerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of BackupProtectionContainerResources and their operations over a BackupProtectionContainerResource. public static BackupProtectionContainerCollection GetBackupProtectionContainers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionContainers(); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionContainers(); } /// @@ -781,18 +842,22 @@ public static BackupProtectionContainerCollection GetBackupProtectionContainers( /// ProtectionContainers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the fabric where the container belongs. /// Name of the container whose details need to be fetched. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetBackupProtectionContainerAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string containerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetBackupProtectionContainers().GetAsync(vaultName, fabricName, containerName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionContainerAsync(vaultName, fabricName, containerName, cancellationToken).ConfigureAwait(false); } /// @@ -807,31 +872,39 @@ public static async Task> GetBackupP /// ProtectionContainers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the fabric where the container belongs. /// Name of the container whose details need to be fetched. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetBackupProtectionContainer(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string containerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetBackupProtectionContainers().Get(vaultName, fabricName, containerName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionContainer(vaultName, fabricName, containerName, cancellationToken); } - /// Gets a collection of ResourceGuardProxyResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGuardProxyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ResourceGuardProxyResources and their operations over a ResourceGuardProxyResource. public static ResourceGuardProxyCollection GetResourceGuardProxies(this ResourceGroupResource resourceGroupResource, string vaultName) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGuardProxies(vaultName); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuardProxies(vaultName); } /// @@ -846,17 +919,21 @@ public static ResourceGuardProxyCollection GetResourceGuardProxies(this Resource /// ResourceGuardProxy_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The String to use. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetResourceGuardProxyAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string resourceGuardProxyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGuardProxies(vaultName).GetAsync(resourceGuardProxyName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuardProxyAsync(vaultName, resourceGuardProxyName, cancellationToken).ConfigureAwait(false); } /// @@ -871,17 +948,21 @@ public static async Task> GetResourceGuardP /// ResourceGuardProxy_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The String to use. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetResourceGuardProxy(this ResourceGroupResource resourceGroupResource, string vaultName, string resourceGuardProxyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGuardProxies(vaultName).Get(resourceGuardProxyName, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuardProxy(vaultName, resourceGuardProxyName, cancellationToken); } /// @@ -896,6 +977,10 @@ public static Response GetResourceGuardProxy(this Re /// BackupProtectionIntent_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -907,9 +992,7 @@ public static Response GetResourceGuardProxy(this Re /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBackupProtectionIntentsAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionIntentsAsync(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionIntentsAsync(vaultName, filter, skipToken, cancellationToken); } /// @@ -924,6 +1007,10 @@ public static AsyncPageable GetBackupProtectionI /// BackupProtectionIntent_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -935,9 +1022,7 @@ public static AsyncPageable GetBackupProtectionI /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBackupProtectionIntents(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionIntents(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionIntents(vaultName, filter, skipToken, cancellationToken); } /// @@ -952,6 +1037,10 @@ public static Pageable GetBackupProtectionIntent /// BackupUsageSummaries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -963,9 +1052,7 @@ public static Pageable GetBackupProtectionIntent /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBackupUsageSummariesAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupUsageSummariesAsync(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupUsageSummariesAsync(vaultName, filter, skipToken, cancellationToken); } /// @@ -980,6 +1067,10 @@ public static AsyncPageable GetBackupUsageSummariesAsync( /// BackupUsageSummaries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -991,9 +1082,7 @@ public static AsyncPageable GetBackupUsageSummariesAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBackupUsageSummaries(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupUsageSummaries(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupUsageSummaries(vaultName, filter, skipToken, cancellationToken); } /// @@ -1008,6 +1097,10 @@ public static Pageable GetBackupUsageSummaries(this Resou /// Jobs_Export /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1017,9 +1110,7 @@ public static Pageable GetBackupUsageSummaries(this Resou /// is null. public static async Task ExportJobAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).ExportJobAsync(vaultName, filter, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).ExportJobAsync(vaultName, filter, cancellationToken).ConfigureAwait(false); } /// @@ -1034,6 +1125,10 @@ public static async Task ExportJobAsync(this ResourceGroupResource res /// Jobs_Export /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1043,9 +1138,7 @@ public static async Task ExportJobAsync(this ResourceGroupResource res /// is null. public static Response ExportJob(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).ExportJob(vaultName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).ExportJob(vaultName, filter, cancellationToken); } /// @@ -1060,6 +1153,10 @@ public static Response ExportJob(this ResourceGroupResource resourceGroupResourc /// BackupProtectedItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1071,9 +1168,7 @@ public static Response ExportJob(this ResourceGroupResource resourceGroupResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBackupProtectedItemsAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectedItemsAsync(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectedItemsAsync(vaultName, filter, skipToken, cancellationToken); } /// @@ -1088,6 +1183,10 @@ public static AsyncPageable GetBackupProtectedItems /// BackupProtectedItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1099,9 +1198,7 @@ public static AsyncPageable GetBackupProtectedItems /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBackupProtectedItems(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectedItems(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectedItems(vaultName, filter, skipToken, cancellationToken); } /// @@ -1116,6 +1213,10 @@ public static Pageable GetBackupProtectedItems(this /// ProtectableContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1127,10 +1228,7 @@ public static Pageable GetBackupProtectedItems(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProtectableContainersAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProtectableContainersAsync(vaultName, fabricName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetProtectableContainersAsync(vaultName, fabricName, filter, cancellationToken); } /// @@ -1145,6 +1243,10 @@ public static AsyncPageable GetProtectableContaine /// ProtectableContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1156,10 +1258,7 @@ public static AsyncPageable GetProtectableContaine /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProtectableContainers(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProtectableContainers(vaultName, fabricName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetProtectableContainers(vaultName, fabricName, filter, cancellationToken); } /// @@ -1175,6 +1274,10 @@ public static Pageable GetProtectableContainers(th /// ProtectionContainers_Refresh /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1185,10 +1288,7 @@ public static Pageable GetProtectableContainers(th /// or is null. public static async Task RefreshProtectionContainerAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).RefreshProtectionContainerAsync(vaultName, fabricName, filter, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).RefreshProtectionContainerAsync(vaultName, fabricName, filter, cancellationToken).ConfigureAwait(false); } /// @@ -1204,6 +1304,10 @@ public static async Task RefreshProtectionContainerAsync(this Resource /// ProtectionContainers_Refresh /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1214,10 +1318,7 @@ public static async Task RefreshProtectionContainerAsync(this Resource /// or is null. public static Response RefreshProtectionContainer(this ResourceGroupResource resourceGroupResource, string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).RefreshProtectionContainer(vaultName, fabricName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).RefreshProtectionContainer(vaultName, fabricName, filter, cancellationToken); } /// @@ -1233,6 +1334,10 @@ public static Response RefreshProtectionContainer(this ResourceGroupResource res /// BackupProtectableItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1244,9 +1349,7 @@ public static Response RefreshProtectionContainer(this ResourceGroupResource res /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBackupProtectableItemsAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectableItemsAsync(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectableItemsAsync(vaultName, filter, skipToken, cancellationToken); } /// @@ -1262,6 +1365,10 @@ public static AsyncPageable GetBackupProtectabl /// BackupProtectableItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1273,9 +1380,7 @@ public static AsyncPageable GetBackupProtectabl /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBackupProtectableItems(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectableItems(vaultName, filter, skipToken, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectableItems(vaultName, filter, skipToken, cancellationToken); } /// @@ -1290,6 +1395,10 @@ public static Pageable GetBackupProtectableItem /// BackupProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1300,9 +1409,7 @@ public static Pageable GetBackupProtectableItem /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBackupProtectionContainersAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionContainersAsync(vaultName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionContainersAsync(vaultName, filter, cancellationToken); } /// @@ -1317,6 +1424,10 @@ public static AsyncPageable GetBackupProtecti /// BackupProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1327,9 +1438,7 @@ public static AsyncPageable GetBackupProtecti /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBackupProtectionContainers(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetBackupProtectionContainers(vaultName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetBackupProtectionContainers(vaultName, filter, cancellationToken); } /// @@ -1344,6 +1453,10 @@ public static Pageable GetBackupProtectionCon /// DeletedProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1354,9 +1467,7 @@ public static Pageable GetBackupProtectionCon /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSoftDeletedProtectionContainersAsync(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSoftDeletedProtectionContainersAsync(vaultName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetSoftDeletedProtectionContainersAsync(vaultName, filter, cancellationToken); } /// @@ -1371,6 +1482,10 @@ public static AsyncPageable GetSoftDeletedPro /// DeletedProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1381,9 +1496,7 @@ public static AsyncPageable GetSoftDeletedPro /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSoftDeletedProtectionContainers(this ResourceGroupResource resourceGroupResource, string vaultName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSoftDeletedProtectionContainers(vaultName, filter, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetSoftDeletedProtectionContainers(vaultName, filter, cancellationToken); } /// @@ -1398,6 +1511,10 @@ public static Pageable GetSoftDeletedProtecti /// SecurityPINs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1407,9 +1524,7 @@ public static Pageable GetSoftDeletedProtecti /// is null. public static async Task> GetSecurityPinAsync(this ResourceGroupResource resourceGroupResource, string vaultName, SecurityPinContent content = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecurityPinAsync(vaultName, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetSecurityPinAsync(vaultName, content, cancellationToken).ConfigureAwait(false); } /// @@ -1424,6 +1539,10 @@ public static async Task> GetSecurityPinAsync(this Re /// SecurityPINs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1433,9 +1552,7 @@ public static async Task> GetSecurityPinAsync(this Re /// is null. public static Response GetSecurityPin(this ResourceGroupResource resourceGroupResource, string vaultName, SecurityPinContent content = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecurityPin(vaultName, content, cancellationToken); + return GetRecoveryServicesBackupResourceGroupMockingExtension(resourceGroupResource).GetSecurityPin(vaultName, content, cancellationToken); } /// @@ -1453,6 +1570,10 @@ public static Response GetSecurityPin(this ResourceGroupResour /// ProtectionIntent_Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1461,9 +1582,7 @@ public static Response GetSecurityPin(this ResourceGroupResour /// is null. public static async Task> ValidateProtectionIntentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, PreValidateEnableBackupContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateProtectionIntentAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).ValidateProtectionIntentAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -1481,6 +1600,10 @@ public static async Task> ValidateProtec /// ProtectionIntent_Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1489,9 +1612,7 @@ public static async Task> ValidateProtec /// is null. public static Response ValidateProtectionIntent(this SubscriptionResource subscriptionResource, AzureLocation location, PreValidateEnableBackupContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateProtectionIntent(location, content, cancellationToken); + return GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).ValidateProtectionIntent(location, content, cancellationToken); } /// @@ -1506,6 +1627,10 @@ public static Response ValidateProtectionIntent(t /// BackupStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1514,9 +1639,7 @@ public static Response ValidateProtectionIntent(t /// is null. public static async Task> GetBackupStatusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, BackupStatusContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetBackupStatusAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).GetBackupStatusAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -1531,6 +1654,10 @@ public static async Task> GetBackupStatusAsync(this /// BackupStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1539,9 +1666,7 @@ public static async Task> GetBackupStatusAsync(this /// is null. public static Response GetBackupStatus(this SubscriptionResource subscriptionResource, AzureLocation location, BackupStatusContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBackupStatus(location, content, cancellationToken); + return GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).GetBackupStatus(location, content, cancellationToken); } /// @@ -1556,6 +1681,10 @@ public static Response GetBackupStatus(this SubscriptionReso /// FeatureSupport_Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1564,9 +1693,7 @@ public static Response GetBackupStatus(this SubscriptionReso /// is null. public static async Task> ValidateFeatureSupportAsync(this SubscriptionResource subscriptionResource, AzureLocation location, FeatureSupportContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateFeatureSupportAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).ValidateFeatureSupportAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -1581,6 +1708,10 @@ public static async Task> ValidateFeatu /// FeatureSupport_Validate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure region to hit Api. @@ -1589,9 +1720,7 @@ public static async Task> ValidateFeatu /// is null. public static Response ValidateFeatureSupport(this SubscriptionResource subscriptionResource, AzureLocation location, FeatureSupportContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateFeatureSupport(location, content, cancellationToken); + return GetRecoveryServicesBackupSubscriptionMockingExtension(subscriptionResource).ValidateFeatureSupport(location, content, cancellationToken); } } } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupResourceGroupMockingExtension.cs similarity index 52% rename from sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupResourceGroupMockingExtension.cs index 73b2172c0c0a..2b7d647d5f93 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupResourceGroupMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesBackup; using Azure.ResourceManager.RecoveryServicesBackup.Models; -namespace Azure.ResourceManager.RecoveryServicesBackup +namespace Azure.ResourceManager.RecoveryServicesBackup.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class RecoveryServicesBackupResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _backupProtectionIntentClientDiagnostics; private BackupProtectionIntentRestOperations _backupProtectionIntentRestClient; @@ -41,15 +42,15 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource private ClientDiagnostics _securityPINsClientDiagnostics; private SecurityPINsRestOperations _securityPINsRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesBackupResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesBackupResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -84,76 +85,570 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of BackupResourceConfigResources and their operations over a BackupResourceConfigResource. public virtual BackupResourceConfigCollection GetBackupResourceConfigs() { - return GetCachedClient(Client => new BackupResourceConfigCollection(Client, Id)); + return GetCachedClient(client => new BackupResourceConfigCollection(client, Id)); + } + + /// + /// Fetches resource storage config. + /// + /// + /// Request Path + /// /Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig + /// + /// + /// Operation Id + /// BackupResourceStorageConfigsNonCRR_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupResourceConfigAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetBackupResourceConfigs().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fetches resource storage config. + /// + /// + /// Request Path + /// /Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig + /// + /// + /// Operation Id + /// BackupResourceStorageConfigsNonCRR_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupResourceConfig(string vaultName, CancellationToken cancellationToken = default) + { + return GetBackupResourceConfigs().Get(vaultName, cancellationToken); } /// Gets a collection of BackupProtectionIntentResources in the ResourceGroupResource. /// An object representing collection of BackupProtectionIntentResources and their operations over a BackupProtectionIntentResource. public virtual BackupProtectionIntentCollection GetBackupProtectionIntents() { - return GetCachedClient(Client => new BackupProtectionIntentCollection(Client, Id)); + return GetCachedClient(client => new BackupProtectionIntentCollection(client, Id)); + } + + /// + /// Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// Request Path + /// /Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName} + /// + /// + /// Operation Id + /// ProtectionIntent_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Fabric name associated with the backed up item. + /// Backed up item name whose details are to be fetched. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupProtectionIntentAsync(string vaultName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default) + { + return await GetBackupProtectionIntents().GetAsync(vaultName, fabricName, intentObjectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. + /// + /// + /// Request Path + /// /Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName} + /// + /// + /// Operation Id + /// ProtectionIntent_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Fabric name associated with the backed up item. + /// Backed up item name whose details are to be fetched. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupProtectionIntent(string vaultName, string fabricName, string intentObjectName, CancellationToken cancellationToken = default) + { + return GetBackupProtectionIntents().Get(vaultName, fabricName, intentObjectName, cancellationToken); } /// Gets a collection of BackupResourceVaultConfigResources in the ResourceGroupResource. /// An object representing collection of BackupResourceVaultConfigResources and their operations over a BackupResourceVaultConfigResource. public virtual BackupResourceVaultConfigCollection GetBackupResourceVaultConfigs() { - return GetCachedClient(Client => new BackupResourceVaultConfigCollection(Client, Id)); + return GetCachedClient(client => new BackupResourceVaultConfigCollection(client, Id)); + } + + /// + /// Fetches resource vault config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig + /// + /// + /// Operation Id + /// BackupResourceVaultConfigs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupResourceVaultConfigAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetBackupResourceVaultConfigs().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fetches resource vault config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig + /// + /// + /// Operation Id + /// BackupResourceVaultConfigs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupResourceVaultConfig(string vaultName, CancellationToken cancellationToken = default) + { + return GetBackupResourceVaultConfigs().Get(vaultName, cancellationToken); } /// Gets a collection of BackupResourceEncryptionConfigExtendedResources in the ResourceGroupResource. /// An object representing collection of BackupResourceEncryptionConfigExtendedResources and their operations over a BackupResourceEncryptionConfigExtendedResource. public virtual BackupResourceEncryptionConfigExtendedCollection GetBackupResourceEncryptionConfigExtendeds() { - return GetCachedClient(Client => new BackupResourceEncryptionConfigExtendedCollection(Client, Id)); + return GetCachedClient(client => new BackupResourceEncryptionConfigExtendedCollection(client, Id)); + } + + /// + /// Fetches Vault Encryption config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig + /// + /// + /// Operation Id + /// BackupResourceEncryptionConfigs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupResourceEncryptionConfigExtendedAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetBackupResourceEncryptionConfigExtendeds().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fetches Vault Encryption config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig + /// + /// + /// Operation Id + /// BackupResourceEncryptionConfigs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupResourceEncryptionConfigExtended(string vaultName, CancellationToken cancellationToken = default) + { + return GetBackupResourceEncryptionConfigExtendeds().Get(vaultName, cancellationToken); } /// Gets a collection of BackupPrivateEndpointConnectionResources in the ResourceGroupResource. /// An object representing collection of BackupPrivateEndpointConnectionResources and their operations over a BackupPrivateEndpointConnectionResource. public virtual BackupPrivateEndpointConnectionCollection GetBackupPrivateEndpointConnections() { - return GetCachedClient(Client => new BackupPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new BackupPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the private endpoint connection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupPrivateEndpointConnectionAsync(string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetBackupPrivateEndpointConnections().GetAsync(vaultName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Private Endpoint Connection. This call is made by Backup Admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the private endpoint connection. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupPrivateEndpointConnection(string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetBackupPrivateEndpointConnections().Get(vaultName, privateEndpointConnectionName, cancellationToken); } /// Gets a collection of BackupProtectionPolicyResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupProtectionPolicyResources and their operations over a BackupProtectionPolicyResource. public virtual BackupProtectionPolicyCollection GetBackupProtectionPolicies(string vaultName) { return new BackupProtectionPolicyCollection(Client, Id, vaultName); } + /// + /// Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using GetPolicyOperationResult API. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName} + /// + /// + /// Operation Id + /// ProtectionPolicies_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Backup policy information to be fetched. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupProtectionPolicyAsync(string vaultName, string policyName, CancellationToken cancellationToken = default) + { + return await GetBackupProtectionPolicies(vaultName).GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using GetPolicyOperationResult API. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName} + /// + /// + /// Operation Id + /// ProtectionPolicies_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Backup policy information to be fetched. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupProtectionPolicy(string vaultName, string policyName, CancellationToken cancellationToken = default) + { + return GetBackupProtectionPolicies(vaultName).Get(policyName, cancellationToken); + } + /// Gets a collection of BackupJobResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupJobResources and their operations over a BackupJobResource. public virtual BackupJobCollection GetBackupJobs(string vaultName) { return new BackupJobCollection(Client, Id, vaultName); } + /// + /// Gets extended information associated with the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName} + /// + /// + /// Operation Id + /// JobDetails_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the job whose details are to be fetched. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupJobAsync(string vaultName, string jobName, CancellationToken cancellationToken = default) + { + return await GetBackupJobs(vaultName).GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets extended information associated with the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName} + /// + /// + /// Operation Id + /// JobDetails_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the job whose details are to be fetched. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupJob(string vaultName, string jobName, CancellationToken cancellationToken = default) + { + return GetBackupJobs(vaultName).Get(jobName, cancellationToken); + } + /// Gets a collection of BackupEngineResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of BackupEngineResources and their operations over a BackupEngineResource. public virtual BackupEngineCollection GetBackupEngines(string vaultName) { return new BackupEngineCollection(Client, Id, vaultName); } + /// + /// Returns backup management server registered to Recovery Services Vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName} + /// + /// + /// Operation Id + /// BackupEngines_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the backup management server. + /// OData filter options. + /// skipToken Filter. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupEngineAsync(string vaultName, string backupEngineName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + return await GetBackupEngines(vaultName).GetAsync(backupEngineName, filter, skipToken, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns backup management server registered to Recovery Services Vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName} + /// + /// + /// Operation Id + /// BackupEngines_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the backup management server. + /// OData filter options. + /// skipToken Filter. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupEngine(string vaultName, string backupEngineName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + { + return GetBackupEngines(vaultName).Get(backupEngineName, filter, skipToken, cancellationToken); + } + /// Gets a collection of BackupProtectionContainerResources in the ResourceGroupResource. /// An object representing collection of BackupProtectionContainerResources and their operations over a BackupProtectionContainerResource. public virtual BackupProtectionContainerCollection GetBackupProtectionContainers() { - return GetCachedClient(Client => new BackupProtectionContainerCollection(Client, Id)); + return GetCachedClient(client => new BackupProtectionContainerCollection(client, Id)); + } + + /// + /// Gets details of the specific container registered to your Recovery Services Vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName} + /// + /// + /// Operation Id + /// ProtectionContainers_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the fabric where the container belongs. + /// Name of the container whose details need to be fetched. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBackupProtectionContainerAsync(string vaultName, string fabricName, string containerName, CancellationToken cancellationToken = default) + { + return await GetBackupProtectionContainers().GetAsync(vaultName, fabricName, containerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details of the specific container registered to your Recovery Services Vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName} + /// + /// + /// Operation Id + /// ProtectionContainers_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the fabric where the container belongs. + /// Name of the container whose details need to be fetched. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBackupProtectionContainer(string vaultName, string fabricName, string containerName, CancellationToken cancellationToken = default) + { + return GetBackupProtectionContainers().Get(vaultName, fabricName, containerName, cancellationToken); } /// Gets a collection of ResourceGuardProxyResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ResourceGuardProxyResources and their operations over a ResourceGuardProxyResource. public virtual ResourceGuardProxyCollection GetResourceGuardProxies(string vaultName) { return new ResourceGuardProxyCollection(Client, Id, vaultName); } + /// + /// Returns ResourceGuardProxy under vault and with the name referenced in request + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName} + /// + /// + /// Operation Id + /// ResourceGuardProxy_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The String to use. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGuardProxyAsync(string vaultName, string resourceGuardProxyName, CancellationToken cancellationToken = default) + { + return await GetResourceGuardProxies(vaultName).GetAsync(resourceGuardProxyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns ResourceGuardProxy under vault and with the name referenced in request + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName} + /// + /// + /// Operation Id + /// ResourceGuardProxy_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The String to use. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGuardProxy(string vaultName, string resourceGuardProxyName, CancellationToken cancellationToken = default) + { + return GetResourceGuardProxies(vaultName).Get(resourceGuardProxyName, cancellationToken); + } + /// /// Provides a pageable list of all intents that are present within a vault. /// @@ -171,12 +666,16 @@ public virtual ResourceGuardProxyCollection GetResourceGuardProxies(string vault /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBackupProtectionIntentsAsync(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectionIntentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectionIntentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionIntentResource(Client, BackupProtectionIntentData.DeserializeBackupProtectionIntentData(e)), BackupProtectionIntentClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectionIntents", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionIntentResource(Client, BackupProtectionIntentData.DeserializeBackupProtectionIntentData(e)), BackupProtectionIntentClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectionIntents", "value", "nextLink", cancellationToken); } /// @@ -196,12 +695,16 @@ public virtual AsyncPageable GetBackupProtection /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBackupProtectionIntents(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectionIntentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectionIntentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionIntentResource(Client, BackupProtectionIntentData.DeserializeBackupProtectionIntentData(e)), BackupProtectionIntentClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectionIntents", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionIntentResource(Client, BackupProtectionIntentData.DeserializeBackupProtectionIntentData(e)), BackupProtectionIntentClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectionIntents", "value", "nextLink", cancellationToken); } /// @@ -221,11 +724,15 @@ public virtual Pageable GetBackupProtectionInten /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBackupUsageSummariesAsync(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupUsageSummariesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, BackupManagementUsage.DeserializeBackupManagementUsage, BackupUsageSummariesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupUsageSummaries", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, BackupManagementUsage.DeserializeBackupManagementUsage, BackupUsageSummariesClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupUsageSummaries", "value", null, cancellationToken); } /// @@ -245,11 +752,15 @@ public virtual AsyncPageable GetBackupUsageSummariesAsync /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBackupUsageSummaries(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupUsageSummariesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, BackupManagementUsage.DeserializeBackupManagementUsage, BackupUsageSummariesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupUsageSummaries", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, BackupManagementUsage.DeserializeBackupManagementUsage, BackupUsageSummariesClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupUsageSummaries", "value", null, cancellationToken); } /// @@ -268,9 +779,13 @@ public virtual Pageable GetBackupUsageSummaries(string va /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task ExportJobAsync(string vaultName, string filter = null, CancellationToken cancellationToken = default) { - using var scope = JobsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ExportJob"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = JobsClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.ExportJob"); scope.Start(); try { @@ -300,9 +815,13 @@ public virtual async Task ExportJobAsync(string vaultName, string filt /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response ExportJob(string vaultName, string filter = null, CancellationToken cancellationToken = default) { - using var scope = JobsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ExportJob"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = JobsClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.ExportJob"); scope.Start(); try { @@ -333,12 +852,16 @@ public virtual Response ExportJob(string vaultName, string filter = null, Cancel /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBackupProtectedItemsAsync(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectedItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectedItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectedItemResource(Client, BackupProtectedItemData.DeserializeBackupProtectedItemData(e)), BackupProtectedItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectedItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectedItemResource(Client, BackupProtectedItemData.DeserializeBackupProtectedItemData(e)), BackupProtectedItemsClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectedItems", "value", "nextLink", cancellationToken); } /// @@ -358,12 +881,16 @@ public virtual AsyncPageable GetBackupProtectedItem /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBackupProtectedItems(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectedItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectedItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectedItemResource(Client, BackupProtectedItemData.DeserializeBackupProtectedItemData(e)), BackupProtectedItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectedItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectedItemResource(Client, BackupProtectedItemData.DeserializeBackupProtectedItemData(e)), BackupProtectedItemsClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectedItems", "value", "nextLink", cancellationToken); } /// @@ -383,12 +910,17 @@ public virtual Pageable GetBackupProtectedItems(str /// The String to use. /// OData filter options. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetProtectableContainersAsync(string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProtectableContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProtectableContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProtectableContainerResource.DeserializeProtectableContainerResource, ProtectableContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetProtectableContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProtectableContainerResource.DeserializeProtectableContainerResource, ProtectableContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetProtectableContainers", "value", "nextLink", cancellationToken); } /// @@ -408,12 +940,17 @@ public virtual AsyncPageable GetProtectableContain /// The String to use. /// OData filter options. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetProtectableContainers(string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProtectableContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProtectableContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProtectableContainerResource.DeserializeProtectableContainerResource, ProtectableContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetProtectableContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProtectableContainerResource.DeserializeProtectableContainerResource, ProtectableContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetProtectableContainers", "value", "nextLink", cancellationToken); } /// @@ -434,9 +971,14 @@ public virtual Pageable GetProtectableContainers(s /// Fabric name associated the container. /// OData filter options. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task RefreshProtectionContainerAsync(string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - using var scope = BackupProtectionContainerProtectionContainersClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.RefreshProtectionContainer"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = BackupProtectionContainerProtectionContainersClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.RefreshProtectionContainer"); scope.Start(); try { @@ -468,9 +1010,14 @@ public virtual async Task RefreshProtectionContainerAsync(string vault /// Fabric name associated the container. /// OData filter options. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response RefreshProtectionContainer(string vaultName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - using var scope = BackupProtectionContainerProtectionContainersClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.RefreshProtectionContainer"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = BackupProtectionContainerProtectionContainersClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.RefreshProtectionContainer"); scope.Start(); try { @@ -502,12 +1049,16 @@ public virtual Response RefreshProtectionContainer(string vaultName, string fabr /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBackupProtectableItemsAsync(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectableItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectableItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WorkloadProtectableItemResource.DeserializeWorkloadProtectableItemResource, BackupProtectableItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectableItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, WorkloadProtectableItemResource.DeserializeWorkloadProtectableItemResource, BackupProtectableItemsClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectableItems", "value", "nextLink", cancellationToken); } /// @@ -528,12 +1079,16 @@ public virtual AsyncPageable GetBackupProtectab /// OData filter options. /// skipToken Filter. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBackupProtectableItems(string vaultName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectableItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectableItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WorkloadProtectableItemResource.DeserializeWorkloadProtectableItemResource, BackupProtectableItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectableItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, WorkloadProtectableItemResource.DeserializeWorkloadProtectableItemResource, BackupProtectableItemsClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectableItems", "value", "nextLink", cancellationToken); } /// @@ -552,12 +1107,16 @@ public virtual Pageable GetBackupProtectableIte /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBackupProtectionContainersAsync(string vaultName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), BackupProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), BackupProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -576,12 +1135,16 @@ public virtual AsyncPageable GetBackupProtect /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBackupProtectionContainers(string vaultName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BackupProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BackupProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), BackupProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetBackupProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), BackupProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetBackupProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -600,12 +1163,16 @@ public virtual Pageable GetBackupProtectionCo /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSoftDeletedProtectionContainersAsync(string vaultName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), DeletedProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSoftDeletedProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), DeletedProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetSoftDeletedProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -624,12 +1191,16 @@ public virtual AsyncPageable GetSoftDeletedPr /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSoftDeletedProtectionContainers(string vaultName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, vaultName, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), DeletedProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSoftDeletedProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BackupProtectionContainerResource(Client, BackupProtectionContainerData.DeserializeBackupProtectionContainerData(e)), DeletedProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesBackupResourceGroupMockingExtension.GetSoftDeletedProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -648,9 +1219,13 @@ public virtual Pageable GetSoftDeletedProtect /// The name of the recovery services vault. /// security pin request. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetSecurityPinAsync(string vaultName, SecurityPinContent content = null, CancellationToken cancellationToken = default) { - using var scope = SecurityPINsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecurityPin"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = SecurityPINsClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.GetSecurityPin"); scope.Start(); try { @@ -680,9 +1255,13 @@ public virtual async Task> GetSecurityPinAsync(string /// The name of the recovery services vault. /// security pin request. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetSecurityPin(string vaultName, SecurityPinContent content = null, CancellationToken cancellationToken = default) { - using var scope = SecurityPINsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecurityPin"); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = SecurityPINsClientDiagnostics.CreateScope("RecoveryServicesBackupResourceGroupMockingExtension.GetSecurityPin"); scope.Start(); try { diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupSubscriptionMockingExtension.cs similarity index 84% rename from sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupSubscriptionMockingExtension.cs index 67dcfe9ae991..0294931265c9 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Extensions/RecoveryServicesBackupSubscriptionMockingExtension.cs @@ -12,12 +12,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesBackup; using Azure.ResourceManager.RecoveryServicesBackup.Models; -namespace Azure.ResourceManager.RecoveryServicesBackup +namespace Azure.ResourceManager.RecoveryServicesBackup.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RecoveryServicesBackupSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _backupProtectionIntentProtectionIntentClientDiagnostics; private ProtectionIntentRestOperations _backupProtectionIntentProtectionIntentRestClient; @@ -26,15 +27,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _featureSupportClientDiagnostics; private FeatureSupportRestOperations _featureSupportRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesBackupSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesBackupSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -70,9 +71,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Azure region to hit Api. /// Enable backup validation request on Virtual Machine. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateProtectionIntentAsync(AzureLocation location, PreValidateEnableBackupContent content, CancellationToken cancellationToken = default) { - using var scope = BackupProtectionIntentProtectionIntentClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProtectionIntent"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BackupProtectionIntentProtectionIntentClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.ValidateProtectionIntent"); scope.Start(); try { @@ -105,9 +109,12 @@ public virtual async Task> ValidateProte /// Azure region to hit Api. /// Enable backup validation request on Virtual Machine. /// The cancellation token to use. + /// is null. public virtual Response ValidateProtectionIntent(AzureLocation location, PreValidateEnableBackupContent content, CancellationToken cancellationToken = default) { - using var scope = BackupProtectionIntentProtectionIntentClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateProtectionIntent"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BackupProtectionIntentProtectionIntentClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.ValidateProtectionIntent"); scope.Start(); try { @@ -137,9 +144,12 @@ public virtual Response ValidateProtectionIntent( /// Azure region to hit Api. /// Container Backup Status Request. /// The cancellation token to use. + /// is null. public virtual async Task> GetBackupStatusAsync(AzureLocation location, BackupStatusContent content, CancellationToken cancellationToken = default) { - using var scope = BackupStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBackupStatus"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BackupStatusClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.GetBackupStatus"); scope.Start(); try { @@ -169,9 +179,12 @@ public virtual async Task> GetBackupStatusAsync(Azu /// Azure region to hit Api. /// Container Backup Status Request. /// The cancellation token to use. + /// is null. public virtual Response GetBackupStatus(AzureLocation location, BackupStatusContent content, CancellationToken cancellationToken = default) { - using var scope = BackupStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetBackupStatus"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BackupStatusClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.GetBackupStatus"); scope.Start(); try { @@ -201,9 +214,12 @@ public virtual Response GetBackupStatus(AzureLocation locati /// Azure region to hit Api. /// Feature support request object. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateFeatureSupportAsync(AzureLocation location, FeatureSupportContent content, CancellationToken cancellationToken = default) { - using var scope = FeatureSupportClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateFeatureSupport"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FeatureSupportClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.ValidateFeatureSupport"); scope.Start(); try { @@ -233,9 +249,12 @@ public virtual async Task> ValidateFeat /// Azure region to hit Api. /// Feature support request object. /// The cancellation token to use. + /// is null. public virtual Response ValidateFeatureSupport(AzureLocation location, FeatureSupportContent content, CancellationToken cancellationToken = default) { - using var scope = FeatureSupportClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateFeatureSupport"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FeatureSupportClientDiagnostics.CreateScope("RecoveryServicesBackupSubscriptionMockingExtension.ValidateFeatureSupport"); scope.Start(); try { diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs index 0115d392e7d5..cf24cf371138 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataReplicationDraResources and their operations over a DataReplicationDraResource. public virtual DataReplicationDraCollection GetDataReplicationDras() { - return GetCachedClient(Client => new DataReplicationDraCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationDraCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DataReplicationDraCollection GetDataReplicationDras() /// /// The fabric agent (Dra) name. /// The cancellation token to use. - /// 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> GetDataReplicationDraAsync(string fabricAgentName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDataReplicati /// /// The fabric agent (Dra) name. /// The cancellation token to use. - /// 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 GetDataReplicationDra(string fabricAgentName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs index 29efc9f05ed8..48b0f5e0de04 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataReplicationRecoveryPointResources and their operations over a DataReplicationRecoveryPointResource. public virtual DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() { - return GetCachedClient(Client => new DataReplicationRecoveryPointCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationRecoveryPointCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual DataReplicationRecoveryPointCollection GetDataReplicationRecovery /// /// The recovery point name. /// The cancellation token to use. - /// 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> GetDataReplicationRecoveryPointAsync(string recoveryPointName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetDat /// /// The recovery point name. /// The cancellation token to use. - /// 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 GetDataReplicationRecoveryPoint(string recoveryPointName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs index 2c48bd5d8a6f..0409a79354e1 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataReplicationEmailConfigurationResources and their operations over a DataReplicationEmailConfigurationResource. public virtual DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() { - return GetCachedClient(Client => new DataReplicationEmailConfigurationCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationEmailConfigurationCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DataReplicationEmailConfigurationCollection GetDataReplicationEma /// /// The email configuration name. /// The cancellation token to use. - /// 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> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> G /// /// The email configuration name. /// The cancellation token to use. - /// 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 GetDataReplicationEmailConfiguration(string emailConfigurationName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDataReplic /// An object representing collection of DataReplicationEventResources and their operations over a DataReplicationEventResource. public virtual DataReplicationEventCollection GetDataReplicationEvents() { - return GetCachedClient(Client => new DataReplicationEventCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationEventCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DataReplicationEventCollection GetDataReplicationEvents() /// /// The event name. /// The cancellation token to use. - /// 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> GetDataReplicationEventAsync(string eventName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetDataReplica /// /// The event name. /// The cancellation token to use. - /// 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 GetDataReplicationEvent(string eventName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetDataReplicationEvent(st /// An object representing collection of DataReplicationPolicyResources and their operations over a DataReplicationPolicyResource. public virtual DataReplicationPolicyCollection GetDataReplicationPolicies() { - return GetCachedClient(Client => new DataReplicationPolicyCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationPolicyCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual DataReplicationPolicyCollection GetDataReplicationPolicies() /// /// The policy name. /// The cancellation token to use. - /// 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> GetDataReplicationPolicyAsync(string policyName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetDataReplic /// /// The policy name. /// The cancellation token to use. - /// 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 GetDataReplicationPolicy(string policyName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetDataReplicationPolicy( /// An object representing collection of DataReplicationProtectedItemResources and their operations over a DataReplicationProtectedItemResource. public virtual DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() { - return GetCachedClient(Client => new DataReplicationProtectedItemCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationProtectedItemCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual DataReplicationProtectedItemCollection GetDataReplicationProtecte /// /// The protected item name. /// The cancellation token to use. - /// 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> GetDataReplicationProtectedItemAsync(string protectedItemName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetDat /// /// The protected item name. /// The cancellation token to use. - /// 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 GetDataReplicationProtectedItem(string protectedItemName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetDataReplication /// An object representing collection of DataReplicationReplicationExtensionResources and their operations over a DataReplicationReplicationExtensionResource. public virtual DataReplicationReplicationExtensionCollection GetDataReplicationReplicationExtensions() { - return GetCachedClient(Client => new DataReplicationReplicationExtensionCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationReplicationExtensionCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual DataReplicationReplicationExtensionCollection GetDataReplicationR /// /// The replication extension name. /// The cancellation token to use. - /// 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> GetDataReplicationReplicationExtensionAsync(string replicationExtensionName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> /// /// The replication extension name. /// The cancellation token to use. - /// 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 GetDataReplicationReplicationExtension(string replicationExtensionName, CancellationToken cancellationToken = default) { @@ -358,7 +358,7 @@ public virtual Response GetDataRepl /// An object representing collection of DataReplicationWorkflowResources and their operations over a DataReplicationWorkflowResource. public virtual DataReplicationWorkflowCollection GetDataReplicationWorkflows() { - return GetCachedClient(Client => new DataReplicationWorkflowCollection(Client, Id)); + return GetCachedClient(client => new DataReplicationWorkflowCollection(client, Id)); } /// @@ -376,8 +376,8 @@ public virtual DataReplicationWorkflowCollection GetDataReplicationWorkflows() /// /// The job (workflow) name. /// The cancellation token to use. - /// 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> GetDataReplicationWorkflowAsync(string jobName, CancellationToken cancellationToken = default) { @@ -399,8 +399,8 @@ public virtual async Task> GetDataRepl /// /// The job (workflow) name. /// The cancellation token to use. - /// 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 GetDataReplicationWorkflow(string jobName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationArmClientMockingExtension.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationArmClientMockingExtension.cs new file mode 100644 index 000000000000..075e0b366c07 --- /dev/null +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesDataReplication; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RecoveryServicesDataReplicationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationArmClientMockingExtension() + { + } + + /// 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 RecoveryServicesDataReplicationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RecoveryServicesDataReplicationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationDraResource GetDataReplicationDraResource(ResourceIdentifier id) + { + DataReplicationDraResource.ValidateResourceId(id); + return new DataReplicationDraResource(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 DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(ResourceIdentifier id) + { + DataReplicationEmailConfigurationResource.ValidateResourceId(id); + return new DataReplicationEmailConfigurationResource(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 DataReplicationEventResource GetDataReplicationEventResource(ResourceIdentifier id) + { + DataReplicationEventResource.ValidateResourceId(id); + return new DataReplicationEventResource(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 DataReplicationFabricResource GetDataReplicationFabricResource(ResourceIdentifier id) + { + DataReplicationFabricResource.ValidateResourceId(id); + return new DataReplicationFabricResource(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 DataReplicationPolicyResource GetDataReplicationPolicyResource(ResourceIdentifier id) + { + DataReplicationPolicyResource.ValidateResourceId(id); + return new DataReplicationPolicyResource(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 DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(ResourceIdentifier id) + { + DataReplicationProtectedItemResource.ValidateResourceId(id); + return new DataReplicationProtectedItemResource(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 DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(ResourceIdentifier id) + { + DataReplicationRecoveryPointResource.ValidateResourceId(id); + return new DataReplicationRecoveryPointResource(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 DataReplicationReplicationExtensionResource GetDataReplicationReplicationExtensionResource(ResourceIdentifier id) + { + DataReplicationReplicationExtensionResource.ValidateResourceId(id); + return new DataReplicationReplicationExtensionResource(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 DataReplicationVaultResource GetDataReplicationVaultResource(ResourceIdentifier id) + { + DataReplicationVaultResource.ValidateResourceId(id); + return new DataReplicationVaultResource(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 DataReplicationWorkflowResource GetDataReplicationWorkflowResource(ResourceIdentifier id) + { + DataReplicationWorkflowResource.ValidateResourceId(id); + return new DataReplicationWorkflowResource(Client, id); + } + } +} diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs index a7f4414a17e6..1cac8effb1b2 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesDataReplication.Mocking; using Azure.ResourceManager.RecoveryServicesDataReplication.Models; using Azure.ResourceManager.Resources; @@ -19,233 +20,193 @@ namespace Azure.ResourceManager.RecoveryServicesDataReplication /// A class to add extension methods to Azure.ResourceManager.RecoveryServicesDataReplication. public static partial class RecoveryServicesDataReplicationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RecoveryServicesDataReplicationArmClientMockingExtension GetRecoveryServicesDataReplicationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RecoveryServicesDataReplicationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RecoveryServicesDataReplicationResourceGroupMockingExtension GetRecoveryServicesDataReplicationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RecoveryServicesDataReplicationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RecoveryServicesDataReplicationSubscriptionMockingExtension GetRecoveryServicesDataReplicationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RecoveryServicesDataReplicationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataReplicationDraResource /// /// 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. /// Returns a object. public static DataReplicationDraResource GetDataReplicationDraResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationDraResource.ValidateResourceId(id); - return new DataReplicationDraResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationDraResource(id); } - #endregion - #region DataReplicationEmailConfigurationResource /// /// 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. /// Returns a object. public static DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationEmailConfigurationResource.ValidateResourceId(id); - return new DataReplicationEmailConfigurationResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationEmailConfigurationResource(id); } - #endregion - #region DataReplicationEventResource /// /// 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. /// Returns a object. public static DataReplicationEventResource GetDataReplicationEventResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationEventResource.ValidateResourceId(id); - return new DataReplicationEventResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationEventResource(id); } - #endregion - #region DataReplicationFabricResource /// /// 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. /// Returns a object. public static DataReplicationFabricResource GetDataReplicationFabricResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationFabricResource.ValidateResourceId(id); - return new DataReplicationFabricResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationFabricResource(id); } - #endregion - #region DataReplicationPolicyResource /// /// 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. /// Returns a object. public static DataReplicationPolicyResource GetDataReplicationPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationPolicyResource.ValidateResourceId(id); - return new DataReplicationPolicyResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationPolicyResource(id); } - #endregion - #region DataReplicationProtectedItemResource /// /// 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. /// Returns a object. public static DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationProtectedItemResource.ValidateResourceId(id); - return new DataReplicationProtectedItemResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationProtectedItemResource(id); } - #endregion - #region DataReplicationRecoveryPointResource /// /// 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. /// Returns a object. public static DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationRecoveryPointResource.ValidateResourceId(id); - return new DataReplicationRecoveryPointResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationRecoveryPointResource(id); } - #endregion - #region DataReplicationReplicationExtensionResource /// /// 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. /// Returns a object. public static DataReplicationReplicationExtensionResource GetDataReplicationReplicationExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationReplicationExtensionResource.ValidateResourceId(id); - return new DataReplicationReplicationExtensionResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationReplicationExtensionResource(id); } - #endregion - #region DataReplicationVaultResource /// /// 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. /// Returns a object. public static DataReplicationVaultResource GetDataReplicationVaultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationVaultResource.ValidateResourceId(id); - return new DataReplicationVaultResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationVaultResource(id); } - #endregion - #region DataReplicationWorkflowResource /// /// 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. /// Returns a object. public static DataReplicationWorkflowResource GetDataReplicationWorkflowResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataReplicationWorkflowResource.ValidateResourceId(id); - return new DataReplicationWorkflowResource(client, id); - } - ); + return GetRecoveryServicesDataReplicationArmClientMockingExtension(client).GetDataReplicationWorkflowResource(id); } - #endregion - /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. public static DataReplicationFabricCollection GetDataReplicationFabrics(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataReplicationFabrics(); + return GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationFabrics(); } /// @@ -260,16 +221,20 @@ public static DataReplicationFabricCollection GetDataReplicationFabrics(this Res /// Fabric_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The fabric name. /// The cancellation token to use. - /// 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 static async Task> GetDataReplicationFabricAsync(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataReplicationFabrics().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationFabricAsync(fabricName, cancellationToken).ConfigureAwait(false); } /// @@ -284,24 +249,34 @@ public static async Task> GetDataReplica /// Fabric_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The fabric name. /// The cancellation token to use. - /// 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 static Response GetDataReplicationFabric(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataReplicationFabrics().Get(fabricName, cancellationToken); + return GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationFabric(fabricName, cancellationToken); } - /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. public static DataReplicationVaultCollection GetDataReplicationVaults(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataReplicationVaults(); + return GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationVaults(); } /// @@ -316,16 +291,20 @@ public static DataReplicationVaultCollection GetDataReplicationVaults(this Resou /// Vault_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The vault name. /// The cancellation token to use. - /// 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 static async Task> GetDataReplicationVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataReplicationVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -340,16 +319,20 @@ public static async Task> GetDataReplicat /// Vault_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The vault name. /// The cancellation token to use. - /// 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 static Response GetDataReplicationVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataReplicationVaults().Get(vaultName, cancellationToken); + return GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).GetDataReplicationVault(vaultName, cancellationToken); } /// @@ -364,6 +347,10 @@ public static Response GetDataReplicationVault(thi /// DeploymentPreflight /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Deployment Id. @@ -373,9 +360,7 @@ public static Response GetDataReplicationVault(thi /// is null. public static async Task> DeploymentPreflightAsync(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).DeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); } /// @@ -390,6 +375,10 @@ public static async Task> DeploymentPreflight /// DeploymentPreflight /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Deployment Id. @@ -399,9 +388,7 @@ public static async Task> DeploymentPreflight /// is null. public static Response DeploymentPreflight(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeploymentPreflight(deploymentId, body, cancellationToken); + return GetRecoveryServicesDataReplicationResourceGroupMockingExtension(resourceGroupResource).DeploymentPreflight(deploymentId, body, cancellationToken); } /// @@ -416,6 +403,10 @@ public static Response DeploymentPreflight(this Resour /// Fabric_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token from the previous call. @@ -423,7 +414,7 @@ public static Response DeploymentPreflight(this Resour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataReplicationFabricsAsync(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataReplicationFabricsAsync(continuationToken, cancellationToken); + return GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).GetDataReplicationFabricsAsync(continuationToken, cancellationToken); } /// @@ -438,6 +429,10 @@ public static AsyncPageable GetDataReplicationFab /// Fabric_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token from the previous call. @@ -445,7 +440,7 @@ public static AsyncPageable GetDataReplicationFab /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataReplicationFabrics(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataReplicationFabrics(continuationToken, cancellationToken); + return GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).GetDataReplicationFabrics(continuationToken, cancellationToken); } /// @@ -460,6 +455,10 @@ public static Pageable GetDataReplicationFabrics( /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -467,7 +466,7 @@ public static Pageable GetDataReplicationFabrics( /// The cancellation token to use. public static async Task> CheckDataReplicationNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataReplicationNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).CheckDataReplicationNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -482,6 +481,10 @@ public static async Task> CheckD /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -489,7 +492,7 @@ public static async Task> CheckD /// The cancellation token to use. public static Response CheckDataReplicationNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataReplicationNameAvailability(location, content, cancellationToken); + return GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).CheckDataReplicationNameAvailability(location, content, cancellationToken); } /// @@ -504,6 +507,10 @@ public static Response CheckDataReplicati /// Vault_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token from the previous call. @@ -511,7 +518,7 @@ public static Response CheckDataReplicati /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataReplicationVaultsAsync(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataReplicationVaultsAsync(continuationToken, cancellationToken); + return GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).GetDataReplicationVaultsAsync(continuationToken, cancellationToken); } /// @@ -526,6 +533,10 @@ public static AsyncPageable GetDataReplicationVaul /// Vault_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token from the previous call. @@ -533,7 +544,7 @@ public static AsyncPageable GetDataReplicationVaul /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataReplicationVaults(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataReplicationVaults(continuationToken, cancellationToken); + return GetRecoveryServicesDataReplicationSubscriptionMockingExtension(subscriptionResource).GetDataReplicationVaults(continuationToken, cancellationToken); } } } diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationResourceGroupMockingExtension.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..4f51f3d36518 --- /dev/null +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationResourceGroupMockingExtension.cs @@ -0,0 +1,225 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesDataReplication; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class RecoveryServicesDataReplicationResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _defaultClientDiagnostics; + private AzureSiteRecoveryManagementServiceAPIRestOperations _defaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationResourceGroupMockingExtension() + { + } + + /// 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 RecoveryServicesDataReplicationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AzureSiteRecoveryManagementServiceAPIRestOperations DefaultRestClient => _defaultRestClient ??= new AzureSiteRecoveryManagementServiceAPIRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. + public virtual DataReplicationFabricCollection GetDataReplicationFabrics() + { + return GetCachedClient(client => new DataReplicationFabricCollection(client, Id)); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationFabricAsync(string fabricName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationFabrics().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationFabric(string fabricName, CancellationToken cancellationToken = default) + { + return GetDataReplicationFabrics().Get(fabricName, cancellationToken); + } + + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. + public virtual DataReplicationVaultCollection GetDataReplicationVaults() + { + return GetCachedClient(client => new DataReplicationVaultCollection(client, Id)); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetDataReplicationVaults().Get(vaultName, cancellationToken); + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> DeploymentPreflightAsync(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DefaultClientDiagnostics.CreateScope("RecoveryServicesDataReplicationResourceGroupMockingExtension.DeploymentPreflight"); + scope.Start(); + try + { + var response = await DefaultRestClient.DeploymentPreflightAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response DeploymentPreflight(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DefaultClientDiagnostics.CreateScope("RecoveryServicesDataReplicationResourceGroupMockingExtension.DeploymentPreflight"); + scope.Start(); + try + { + var response = DefaultRestClient.DeploymentPreflight(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationSubscriptionMockingExtension.cs similarity index 90% rename from sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationSubscriptionMockingExtension.cs index 3ffb3aaf3ae3..01d7a43523f2 100644 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesDataReplication; using Azure.ResourceManager.RecoveryServicesDataReplication.Models; -namespace Azure.ResourceManager.RecoveryServicesDataReplication +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RecoveryServicesDataReplicationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; private FabricRestOperations _dataReplicationFabricFabricRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; private VaultRestOperations _dataReplicationVaultVaultRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesDataReplicationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesDataReplicationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -72,7 +73,7 @@ public virtual AsyncPageable GetDataReplicationFa { HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationSubscriptionMockingExtension.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); } /// @@ -95,7 +96,7 @@ public virtual Pageable GetDataReplicationFabrics { HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationSubscriptionMockingExtension.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); } /// @@ -116,7 +117,7 @@ public virtual Pageable GetDataReplicationFabrics /// The cancellation token to use. public virtual async Task> CheckDataReplicationNameAvailabilityAsync(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataReplicationNameAvailability"); + using var scope = DefaultClientDiagnostics.CreateScope("RecoveryServicesDataReplicationSubscriptionMockingExtension.CheckDataReplicationNameAvailability"); scope.Start(); try { @@ -148,7 +149,7 @@ public virtual async Task> Check /// The cancellation token to use. public virtual Response CheckDataReplicationNameAvailability(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataReplicationNameAvailability"); + using var scope = DefaultClientDiagnostics.CreateScope("RecoveryServicesDataReplicationSubscriptionMockingExtension.CheckDataReplicationNameAvailability"); scope.Start(); try { @@ -182,7 +183,7 @@ public virtual AsyncPageable GetDataReplicationVau { HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationSubscriptionMockingExtension.GetDataReplicationVaults", "value", "nextLink", cancellationToken); } /// @@ -205,7 +206,7 @@ public virtual Pageable GetDataReplicationVaults(s { HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "RecoveryServicesDataReplicationSubscriptionMockingExtension.GetDataReplicationVaults", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 28bf48155fcc..000000000000 --- a/sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.RecoveryServicesDataReplication.Models; - -namespace Azure.ResourceManager.RecoveryServicesDataReplication -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _defaultClientDiagnostics; - private AzureSiteRecoveryManagementServiceAPIRestOperations _defaultRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AzureSiteRecoveryManagementServiceAPIRestOperations DefaultRestClient => _defaultRestClient ??= new AzureSiteRecoveryManagementServiceAPIRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. - /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. - public virtual DataReplicationFabricCollection GetDataReplicationFabrics() - { - return GetCachedClient(Client => new DataReplicationFabricCollection(Client, Id)); - } - - /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. - /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. - public virtual DataReplicationVaultCollection GetDataReplicationVaults() - { - return GetCachedClient(Client => new DataReplicationVaultCollection(Client, Id)); - } - - /// - /// Performs resource deployment validation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight - /// - /// - /// Operation Id - /// DeploymentPreflight - /// - /// - /// - /// Deployment Id. - /// Deployment preflight model. - /// The cancellation token to use. - public virtual async Task> DeploymentPreflightAsync(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeploymentPreflight"); - scope.Start(); - try - { - var response = await DefaultRestClient.DeploymentPreflightAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Performs resource deployment validation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight - /// - /// - /// Operation Id - /// DeploymentPreflight - /// - /// - /// - /// Deployment Id. - /// Deployment preflight model. - /// The cancellation token to use. - public virtual Response DeploymentPreflight(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) - { - using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeploymentPreflight"); - scope.Start(); - try - { - var response = DefaultRestClient.DeploymentPreflight(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryArmClientMockingExtension.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryArmClientMockingExtension.cs new file mode 100644 index 000000000000..567fdf9d4579 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryArmClientMockingExtension.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesSiteRecovery; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RecoveryServicesSiteRecoveryArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesSiteRecoveryArmClientMockingExtension() + { + } + + /// 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 RecoveryServicesSiteRecoveryArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RecoveryServicesSiteRecoveryArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteRecoveryAlertResource GetSiteRecoveryAlertResource(ResourceIdentifier id) + { + SiteRecoveryAlertResource.ValidateResourceId(id); + return new SiteRecoveryAlertResource(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 ReplicationEligibilityResultResource GetReplicationEligibilityResultResource(ResourceIdentifier id) + { + ReplicationEligibilityResultResource.ValidateResourceId(id); + return new ReplicationEligibilityResultResource(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 SiteRecoveryEventResource GetSiteRecoveryEventResource(ResourceIdentifier id) + { + SiteRecoveryEventResource.ValidateResourceId(id); + return new SiteRecoveryEventResource(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 SiteRecoveryFabricResource GetSiteRecoveryFabricResource(ResourceIdentifier id) + { + SiteRecoveryFabricResource.ValidateResourceId(id); + return new SiteRecoveryFabricResource(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 SiteRecoveryLogicalNetworkResource GetSiteRecoveryLogicalNetworkResource(ResourceIdentifier id) + { + SiteRecoveryLogicalNetworkResource.ValidateResourceId(id); + return new SiteRecoveryLogicalNetworkResource(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 SiteRecoveryNetworkResource GetSiteRecoveryNetworkResource(ResourceIdentifier id) + { + SiteRecoveryNetworkResource.ValidateResourceId(id); + return new SiteRecoveryNetworkResource(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 SiteRecoveryNetworkMappingResource GetSiteRecoveryNetworkMappingResource(ResourceIdentifier id) + { + SiteRecoveryNetworkMappingResource.ValidateResourceId(id); + return new SiteRecoveryNetworkMappingResource(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 SiteRecoveryProtectionContainerResource GetSiteRecoveryProtectionContainerResource(ResourceIdentifier id) + { + SiteRecoveryProtectionContainerResource.ValidateResourceId(id); + return new SiteRecoveryProtectionContainerResource(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 SiteRecoveryMigrationItemResource GetSiteRecoveryMigrationItemResource(ResourceIdentifier id) + { + SiteRecoveryMigrationItemResource.ValidateResourceId(id); + return new SiteRecoveryMigrationItemResource(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 MigrationRecoveryPointResource GetMigrationRecoveryPointResource(ResourceIdentifier id) + { + MigrationRecoveryPointResource.ValidateResourceId(id); + return new MigrationRecoveryPointResource(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 SiteRecoveryProtectableItemResource GetSiteRecoveryProtectableItemResource(ResourceIdentifier id) + { + SiteRecoveryProtectableItemResource.ValidateResourceId(id); + return new SiteRecoveryProtectableItemResource(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 ReplicationProtectedItemResource GetReplicationProtectedItemResource(ResourceIdentifier id) + { + ReplicationProtectedItemResource.ValidateResourceId(id); + return new ReplicationProtectedItemResource(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 SiteRecoveryPointResource GetSiteRecoveryPointResource(ResourceIdentifier id) + { + SiteRecoveryPointResource.ValidateResourceId(id); + return new SiteRecoveryPointResource(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 ProtectionContainerMappingResource GetProtectionContainerMappingResource(ResourceIdentifier id) + { + ProtectionContainerMappingResource.ValidateResourceId(id); + return new ProtectionContainerMappingResource(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 SiteRecoveryServicesProviderResource GetSiteRecoveryServicesProviderResource(ResourceIdentifier id) + { + SiteRecoveryServicesProviderResource.ValidateResourceId(id); + return new SiteRecoveryServicesProviderResource(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 StorageClassificationResource GetStorageClassificationResource(ResourceIdentifier id) + { + StorageClassificationResource.ValidateResourceId(id); + return new StorageClassificationResource(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 StorageClassificationMappingResource GetStorageClassificationMappingResource(ResourceIdentifier id) + { + StorageClassificationMappingResource.ValidateResourceId(id); + return new StorageClassificationMappingResource(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 SiteRecoveryVCenterResource GetSiteRecoveryVCenterResource(ResourceIdentifier id) + { + SiteRecoveryVCenterResource.ValidateResourceId(id); + return new SiteRecoveryVCenterResource(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 SiteRecoveryJobResource GetSiteRecoveryJobResource(ResourceIdentifier id) + { + SiteRecoveryJobResource.ValidateResourceId(id); + return new SiteRecoveryJobResource(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 SiteRecoveryPolicyResource GetSiteRecoveryPolicyResource(ResourceIdentifier id) + { + SiteRecoveryPolicyResource.ValidateResourceId(id); + return new SiteRecoveryPolicyResource(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 ReplicationProtectionIntentResource GetReplicationProtectionIntentResource(ResourceIdentifier id) + { + ReplicationProtectionIntentResource.ValidateResourceId(id); + return new ReplicationProtectionIntentResource(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 SiteRecoveryRecoveryPlanResource GetSiteRecoveryRecoveryPlanResource(ResourceIdentifier id) + { + SiteRecoveryRecoveryPlanResource.ValidateResourceId(id); + return new SiteRecoveryRecoveryPlanResource(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 SiteRecoveryVaultSettingResource GetSiteRecoveryVaultSettingResource(ResourceIdentifier id) + { + SiteRecoveryVaultSettingResource.ValidateResourceId(id); + return new SiteRecoveryVaultSettingResource(Client, id); + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs index 85badd6bf35c..9e8ba5ef4a53 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesSiteRecovery.Mocking; using Azure.ResourceManager.RecoveryServicesSiteRecovery.Models; using Azure.ResourceManager.Resources; @@ -19,469 +20,399 @@ namespace Azure.ResourceManager.RecoveryServicesSiteRecovery /// A class to add extension methods to Azure.ResourceManager.RecoveryServicesSiteRecovery. public static partial class RecoveryServicesSiteRecoveryExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RecoveryServicesSiteRecoveryArmClientMockingExtension GetRecoveryServicesSiteRecoveryArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RecoveryServicesSiteRecoveryArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RecoveryServicesSiteRecoveryResourceGroupMockingExtension GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RecoveryServicesSiteRecoveryResourceGroupMockingExtension(client, resource.Id)); } - #region SiteRecoveryAlertResource + /// /// 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. /// Returns a object. public static SiteRecoveryAlertResource GetSiteRecoveryAlertResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryAlertResource.ValidateResourceId(id); - return new SiteRecoveryAlertResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryAlertResource(id); } - #endregion - #region ReplicationEligibilityResultResource /// /// 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. /// Returns a object. public static ReplicationEligibilityResultResource GetReplicationEligibilityResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReplicationEligibilityResultResource.ValidateResourceId(id); - return new ReplicationEligibilityResultResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetReplicationEligibilityResultResource(id); } - #endregion - #region SiteRecoveryEventResource /// /// 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. /// Returns a object. public static SiteRecoveryEventResource GetSiteRecoveryEventResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryEventResource.ValidateResourceId(id); - return new SiteRecoveryEventResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryEventResource(id); } - #endregion - #region SiteRecoveryFabricResource /// /// 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. /// Returns a object. public static SiteRecoveryFabricResource GetSiteRecoveryFabricResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryFabricResource.ValidateResourceId(id); - return new SiteRecoveryFabricResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryFabricResource(id); } - #endregion - #region SiteRecoveryLogicalNetworkResource /// /// 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. /// Returns a object. public static SiteRecoveryLogicalNetworkResource GetSiteRecoveryLogicalNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryLogicalNetworkResource.ValidateResourceId(id); - return new SiteRecoveryLogicalNetworkResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryLogicalNetworkResource(id); } - #endregion - #region SiteRecoveryNetworkResource /// /// 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. /// Returns a object. public static SiteRecoveryNetworkResource GetSiteRecoveryNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryNetworkResource.ValidateResourceId(id); - return new SiteRecoveryNetworkResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryNetworkResource(id); } - #endregion - #region SiteRecoveryNetworkMappingResource /// /// 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. /// Returns a object. public static SiteRecoveryNetworkMappingResource GetSiteRecoveryNetworkMappingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryNetworkMappingResource.ValidateResourceId(id); - return new SiteRecoveryNetworkMappingResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryNetworkMappingResource(id); } - #endregion - #region SiteRecoveryProtectionContainerResource /// /// 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. /// Returns a object. public static SiteRecoveryProtectionContainerResource GetSiteRecoveryProtectionContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryProtectionContainerResource.ValidateResourceId(id); - return new SiteRecoveryProtectionContainerResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryProtectionContainerResource(id); } - #endregion - #region SiteRecoveryMigrationItemResource /// /// 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. /// Returns a object. public static SiteRecoveryMigrationItemResource GetSiteRecoveryMigrationItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryMigrationItemResource.ValidateResourceId(id); - return new SiteRecoveryMigrationItemResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryMigrationItemResource(id); } - #endregion - #region MigrationRecoveryPointResource /// /// 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. /// Returns a object. public static MigrationRecoveryPointResource GetMigrationRecoveryPointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MigrationRecoveryPointResource.ValidateResourceId(id); - return new MigrationRecoveryPointResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetMigrationRecoveryPointResource(id); } - #endregion - #region SiteRecoveryProtectableItemResource /// /// 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. /// Returns a object. public static SiteRecoveryProtectableItemResource GetSiteRecoveryProtectableItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryProtectableItemResource.ValidateResourceId(id); - return new SiteRecoveryProtectableItemResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryProtectableItemResource(id); } - #endregion - #region ReplicationProtectedItemResource /// /// 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. /// Returns a object. public static ReplicationProtectedItemResource GetReplicationProtectedItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReplicationProtectedItemResource.ValidateResourceId(id); - return new ReplicationProtectedItemResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetReplicationProtectedItemResource(id); } - #endregion - #region SiteRecoveryPointResource /// /// 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. /// Returns a object. public static SiteRecoveryPointResource GetSiteRecoveryPointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryPointResource.ValidateResourceId(id); - return new SiteRecoveryPointResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryPointResource(id); } - #endregion - #region ProtectionContainerMappingResource /// /// 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. /// Returns a object. public static ProtectionContainerMappingResource GetProtectionContainerMappingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProtectionContainerMappingResource.ValidateResourceId(id); - return new ProtectionContainerMappingResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetProtectionContainerMappingResource(id); } - #endregion - #region SiteRecoveryServicesProviderResource /// /// 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. /// Returns a object. public static SiteRecoveryServicesProviderResource GetSiteRecoveryServicesProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryServicesProviderResource.ValidateResourceId(id); - return new SiteRecoveryServicesProviderResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryServicesProviderResource(id); } - #endregion - #region StorageClassificationResource /// /// 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. /// Returns a object. public static StorageClassificationResource GetStorageClassificationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageClassificationResource.ValidateResourceId(id); - return new StorageClassificationResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetStorageClassificationResource(id); } - #endregion - #region StorageClassificationMappingResource /// /// 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. /// Returns a object. public static StorageClassificationMappingResource GetStorageClassificationMappingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - StorageClassificationMappingResource.ValidateResourceId(id); - return new StorageClassificationMappingResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetStorageClassificationMappingResource(id); } - #endregion - #region SiteRecoveryVCenterResource /// /// 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. /// Returns a object. public static SiteRecoveryVCenterResource GetSiteRecoveryVCenterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryVCenterResource.ValidateResourceId(id); - return new SiteRecoveryVCenterResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryVCenterResource(id); } - #endregion - #region SiteRecoveryJobResource /// /// 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. /// Returns a object. public static SiteRecoveryJobResource GetSiteRecoveryJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryJobResource.ValidateResourceId(id); - return new SiteRecoveryJobResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryJobResource(id); } - #endregion - #region SiteRecoveryPolicyResource /// /// 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. /// Returns a object. public static SiteRecoveryPolicyResource GetSiteRecoveryPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryPolicyResource.ValidateResourceId(id); - return new SiteRecoveryPolicyResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryPolicyResource(id); } - #endregion - #region ReplicationProtectionIntentResource /// /// 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. /// Returns a object. public static ReplicationProtectionIntentResource GetReplicationProtectionIntentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReplicationProtectionIntentResource.ValidateResourceId(id); - return new ReplicationProtectionIntentResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetReplicationProtectionIntentResource(id); } - #endregion - #region SiteRecoveryRecoveryPlanResource /// /// 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. /// Returns a object. public static SiteRecoveryRecoveryPlanResource GetSiteRecoveryRecoveryPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryRecoveryPlanResource.ValidateResourceId(id); - return new SiteRecoveryRecoveryPlanResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryRecoveryPlanResource(id); } - #endregion - #region SiteRecoveryVaultSettingResource /// /// 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. /// Returns a object. public static SiteRecoveryVaultSettingResource GetSiteRecoveryVaultSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SiteRecoveryVaultSettingResource.ValidateResourceId(id); - return new SiteRecoveryVaultSettingResource(client, id); - } - ); + return GetRecoveryServicesSiteRecoveryArmClientMockingExtension(client).GetSiteRecoveryVaultSettingResource(id); } - #endregion - /// Gets a collection of SiteRecoveryAlertResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryAlertResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryAlertResources and their operations over a SiteRecoveryAlertResource. public static SiteRecoveryAlertCollection GetSiteRecoveryAlerts(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryAlerts(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryAlerts(resourceName); } /// @@ -496,17 +427,21 @@ public static SiteRecoveryAlertCollection GetSiteRecoveryAlerts(this ResourceGro /// ReplicationAlertSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the email notification configuration. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryAlertAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string alertSettingName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryAlerts(resourceName).GetAsync(alertSettingName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryAlertAsync(resourceName, alertSettingName, cancellationToken).ConfigureAwait(false); } /// @@ -521,30 +456,38 @@ public static async Task> GetSiteRecoveryAle /// ReplicationAlertSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the email notification configuration. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryAlert(this ResourceGroupResource resourceGroupResource, string resourceName, string alertSettingName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryAlerts(resourceName).Get(alertSettingName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryAlert(resourceName, alertSettingName, cancellationToken); } - /// Gets a collection of ReplicationEligibilityResultResources in the ResourceGroupResource. + /// + /// Gets a collection of ReplicationEligibilityResultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Virtual Machine name. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReplicationEligibilityResultResources and their operations over a ReplicationEligibilityResultResource. public static ReplicationEligibilityResultCollection GetReplicationEligibilityResults(this ResourceGroupResource resourceGroupResource, string virtualMachineName) { - Argument.AssertNotNullOrEmpty(virtualMachineName, nameof(virtualMachineName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationEligibilityResults(virtualMachineName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationEligibilityResults(virtualMachineName); } /// @@ -559,16 +502,20 @@ public static ReplicationEligibilityResultCollection GetReplicationEligibilityRe /// ReplicationEligibilityResults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Virtual Machine name. /// The cancellation token to use. - /// 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 static async Task> GetReplicationEligibilityResultAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetReplicationEligibilityResults(virtualMachineName).GetAsync(cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationEligibilityResultAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); } /// @@ -583,29 +530,37 @@ public static async Task> GetRepl /// ReplicationEligibilityResults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Virtual Machine name. /// The cancellation token to use. - /// 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 static Response GetReplicationEligibilityResult(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetReplicationEligibilityResults(virtualMachineName).Get(cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationEligibilityResult(virtualMachineName, cancellationToken); } - /// Gets a collection of SiteRecoveryEventResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryEventResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryEventResources and their operations over a SiteRecoveryEventResource. public static SiteRecoveryEventCollection GetSiteRecoveryEvents(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryEvents(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryEvents(resourceName); } /// @@ -620,17 +575,21 @@ public static SiteRecoveryEventCollection GetSiteRecoveryEvents(this ResourceGro /// ReplicationEvents_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the Azure Site Recovery event. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryEventAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string eventName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryEvents(resourceName).GetAsync(eventName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryEventAsync(resourceName, eventName, cancellationToken).ConfigureAwait(false); } /// @@ -645,30 +604,38 @@ public static async Task> GetSiteRecoveryEve /// ReplicationEvents_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The name of the Azure Site Recovery event. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryEvent(this ResourceGroupResource resourceGroupResource, string resourceName, string eventName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryEvents(resourceName).Get(eventName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryEvent(resourceName, eventName, cancellationToken); } - /// Gets a collection of SiteRecoveryFabricResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryFabricResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryFabricResources and their operations over a SiteRecoveryFabricResource. public static SiteRecoveryFabricCollection GetSiteRecoveryFabrics(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryFabrics(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryFabrics(resourceName); } /// @@ -683,18 +650,22 @@ public static SiteRecoveryFabricCollection GetSiteRecoveryFabrics(this ResourceG /// ReplicationFabrics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Fabric name. /// OData filter options. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryFabricAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryFabrics(resourceName).GetAsync(fabricName, filter, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryFabricAsync(resourceName, fabricName, filter, cancellationToken).ConfigureAwait(false); } /// @@ -709,31 +680,39 @@ public static async Task> GetSiteRecoveryFa /// ReplicationFabrics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Fabric name. /// OData filter options. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryFabric(this ResourceGroupResource resourceGroupResource, string resourceName, string fabricName, string filter = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryFabrics(resourceName).Get(fabricName, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryFabric(resourceName, fabricName, filter, cancellationToken); } - /// Gets a collection of SiteRecoveryJobResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryJobResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryJobResources and their operations over a SiteRecoveryJobResource. public static SiteRecoveryJobCollection GetSiteRecoveryJobs(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryJobs(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryJobs(resourceName); } /// @@ -748,17 +727,21 @@ public static SiteRecoveryJobCollection GetSiteRecoveryJobs(this ResourceGroupRe /// ReplicationJobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Job identifier. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryJobAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string jobName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryJobs(resourceName).GetAsync(jobName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryJobAsync(resourceName, jobName, cancellationToken).ConfigureAwait(false); } /// @@ -773,30 +756,38 @@ public static async Task> GetSiteRecoveryJobAs /// ReplicationJobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Job identifier. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryJob(this ResourceGroupResource resourceGroupResource, string resourceName, string jobName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryJobs(resourceName).Get(jobName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryJob(resourceName, jobName, cancellationToken); } - /// Gets a collection of SiteRecoveryPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryPolicyResources and their operations over a SiteRecoveryPolicyResource. public static SiteRecoveryPolicyCollection GetSiteRecoveryPolicies(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryPolicies(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryPolicies(resourceName); } /// @@ -811,17 +802,21 @@ public static SiteRecoveryPolicyCollection GetSiteRecoveryPolicies(this Resource /// ReplicationPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Replication policy name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryPolicyAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string policyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryPolicies(resourceName).GetAsync(policyName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryPolicyAsync(resourceName, policyName, cancellationToken).ConfigureAwait(false); } /// @@ -836,30 +831,38 @@ public static async Task> GetSiteRecoveryPo /// ReplicationPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Replication policy name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryPolicy(this ResourceGroupResource resourceGroupResource, string resourceName, string policyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryPolicies(resourceName).Get(policyName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryPolicy(resourceName, policyName, cancellationToken); } - /// Gets a collection of ReplicationProtectionIntentResources in the ResourceGroupResource. + /// + /// Gets a collection of ReplicationProtectionIntentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReplicationProtectionIntentResources and their operations over a ReplicationProtectionIntentResource. public static ReplicationProtectionIntentCollection GetReplicationProtectionIntents(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationProtectionIntents(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationProtectionIntents(resourceName); } /// @@ -874,17 +877,21 @@ public static ReplicationProtectionIntentCollection GetReplicationProtectionInte /// ReplicationProtectionIntents_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Replication protection intent name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetReplicationProtectionIntentAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string intentObjectName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetReplicationProtectionIntents(resourceName).GetAsync(intentObjectName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationProtectionIntentAsync(resourceName, intentObjectName, cancellationToken).ConfigureAwait(false); } /// @@ -899,30 +906,38 @@ public static async Task> GetRepli /// ReplicationProtectionIntents_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Replication protection intent name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetReplicationProtectionIntent(this ResourceGroupResource resourceGroupResource, string resourceName, string intentObjectName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetReplicationProtectionIntents(resourceName).Get(intentObjectName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationProtectionIntent(resourceName, intentObjectName, cancellationToken); } - /// Gets a collection of SiteRecoveryRecoveryPlanResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryRecoveryPlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryRecoveryPlanResources and their operations over a SiteRecoveryRecoveryPlanResource. public static SiteRecoveryRecoveryPlanCollection GetSiteRecoveryRecoveryPlans(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryRecoveryPlans(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryRecoveryPlans(resourceName); } /// @@ -937,17 +952,21 @@ public static SiteRecoveryRecoveryPlanCollection GetSiteRecoveryRecoveryPlans(th /// ReplicationRecoveryPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the recovery plan. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryRecoveryPlanAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string recoveryPlanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryRecoveryPlans(resourceName).GetAsync(recoveryPlanName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryRecoveryPlanAsync(resourceName, recoveryPlanName, cancellationToken).ConfigureAwait(false); } /// @@ -962,30 +981,38 @@ public static async Task> GetSiteReco /// ReplicationRecoveryPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Name of the recovery plan. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryRecoveryPlan(this ResourceGroupResource resourceGroupResource, string resourceName, string recoveryPlanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryRecoveryPlans(resourceName).Get(recoveryPlanName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryRecoveryPlan(resourceName, recoveryPlanName, cancellationToken); } - /// Gets a collection of SiteRecoveryVaultSettingResources in the ResourceGroupResource. + /// + /// Gets a collection of SiteRecoveryVaultSettingResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the recovery services vault. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryVaultSettingResources and their operations over a SiteRecoveryVaultSettingResource. public static SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(this ResourceGroupResource resourceGroupResource, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryVaultSettings(resourceName); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryVaultSettings(resourceName); } /// @@ -1000,17 +1027,21 @@ public static SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(th /// ReplicationVaultSetting_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Vault setting name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSiteRecoveryVaultSettingAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string vaultSettingName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSiteRecoveryVaultSettings(resourceName).GetAsync(vaultSettingName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryVaultSettingAsync(resourceName, vaultSettingName, cancellationToken).ConfigureAwait(false); } /// @@ -1025,17 +1056,21 @@ public static async Task> GetSiteReco /// ReplicationVaultSetting_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// Vault setting name. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSiteRecoveryVaultSetting(this ResourceGroupResource resourceGroupResource, string resourceName, string vaultSettingName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSiteRecoveryVaultSettings(resourceName).Get(vaultSettingName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryVaultSetting(resourceName, vaultSettingName, cancellationToken); } /// @@ -1050,6 +1085,10 @@ public static Response GetSiteRecoveryVaultSet /// ReplicationAppliances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1060,9 +1099,7 @@ public static Response GetSiteRecoveryVaultSet /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetReplicationAppliancesAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationAppliancesAsync(resourceName, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationAppliancesAsync(resourceName, filter, cancellationToken); } /// @@ -1077,6 +1114,10 @@ public static AsyncPageable GetReplicationAppl /// ReplicationAppliances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1087,9 +1128,7 @@ public static AsyncPageable GetReplicationAppl /// A collection of that may take multiple service requests to iterate over. public static Pageable GetReplicationAppliances(this ResourceGroupResource resourceGroupResource, string resourceName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationAppliances(resourceName, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationAppliances(resourceName, filter, cancellationToken); } /// @@ -1104,6 +1143,10 @@ public static Pageable GetReplicationAppliance /// ReplicationNetworks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1113,9 +1156,7 @@ public static Pageable GetReplicationAppliance /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryNetworksAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryNetworksAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryNetworksAsync(resourceName, cancellationToken); } /// @@ -1130,6 +1171,10 @@ public static AsyncPageable GetSiteRecoveryNetworks /// ReplicationNetworks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1139,9 +1184,7 @@ public static AsyncPageable GetSiteRecoveryNetworks /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryNetworks(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryNetworks(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryNetworks(resourceName, cancellationToken); } /// @@ -1156,6 +1199,10 @@ public static Pageable GetSiteRecoveryNetworks(this /// ReplicationNetworkMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1165,9 +1212,7 @@ public static Pageable GetSiteRecoveryNetworks(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryNetworkMappingsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryNetworkMappingsAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryNetworkMappingsAsync(resourceName, cancellationToken); } /// @@ -1182,6 +1227,10 @@ public static AsyncPageable GetSiteRecoveryN /// ReplicationNetworkMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1191,9 +1240,7 @@ public static AsyncPageable GetSiteRecoveryN /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryNetworkMappings(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryNetworkMappings(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryNetworkMappings(resourceName, cancellationToken); } /// @@ -1208,6 +1255,10 @@ public static Pageable GetSiteRecoveryNetwor /// ReplicationProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1217,9 +1268,7 @@ public static Pageable GetSiteRecoveryNetwor /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryProtectionContainersAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryProtectionContainersAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryProtectionContainersAsync(resourceName, cancellationToken); } /// @@ -1234,6 +1283,10 @@ public static AsyncPageable GetSiteReco /// ReplicationProtectionContainers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1243,9 +1296,7 @@ public static AsyncPageable GetSiteReco /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryProtectionContainers(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryProtectionContainers(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryProtectionContainers(resourceName, cancellationToken); } /// @@ -1260,6 +1311,10 @@ public static Pageable GetSiteRecoveryP /// ReplicationMigrationItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1272,9 +1327,7 @@ public static Pageable GetSiteRecoveryP /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryMigrationItemsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string takeToken = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryMigrationItemsAsync(resourceName, skipToken, takeToken, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryMigrationItemsAsync(resourceName, skipToken, takeToken, filter, cancellationToken); } /// @@ -1289,6 +1342,10 @@ public static AsyncPageable GetSiteRecoveryMi /// ReplicationMigrationItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1301,9 +1358,7 @@ public static AsyncPageable GetSiteRecoveryMi /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryMigrationItems(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string takeToken = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryMigrationItems(resourceName, skipToken, takeToken, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryMigrationItems(resourceName, skipToken, takeToken, filter, cancellationToken); } /// @@ -1318,6 +1373,10 @@ public static Pageable GetSiteRecoveryMigrati /// ReplicationProtectedItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1329,9 +1388,7 @@ public static Pageable GetSiteRecoveryMigrati /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetReplicationProtectedItemsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationProtectedItemsAsync(resourceName, skipToken, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationProtectedItemsAsync(resourceName, skipToken, filter, cancellationToken); } /// @@ -1346,6 +1403,10 @@ public static AsyncPageable GetReplicationProt /// ReplicationProtectedItems_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1357,9 +1418,7 @@ public static AsyncPageable GetReplicationProt /// A collection of that may take multiple service requests to iterate over. public static Pageable GetReplicationProtectedItems(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationProtectedItems(resourceName, skipToken, filter, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationProtectedItems(resourceName, skipToken, filter, cancellationToken); } /// @@ -1374,6 +1433,10 @@ public static Pageable GetReplicationProtected /// ReplicationProtectionContainerMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1383,9 +1446,7 @@ public static Pageable GetReplicationProtected /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProtectionContainerMappingsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProtectionContainerMappingsAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetProtectionContainerMappingsAsync(resourceName, cancellationToken); } /// @@ -1400,6 +1461,10 @@ public static AsyncPageable GetProtectionCon /// ReplicationProtectionContainerMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1409,9 +1474,7 @@ public static AsyncPageable GetProtectionCon /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProtectionContainerMappings(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProtectionContainerMappings(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetProtectionContainerMappings(resourceName, cancellationToken); } /// @@ -1426,6 +1489,10 @@ public static Pageable GetProtectionContaine /// ReplicationRecoveryServicesProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1435,9 +1502,7 @@ public static Pageable GetProtectionContaine /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryServicesProvidersAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryServicesProvidersAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryServicesProvidersAsync(resourceName, cancellationToken); } /// @@ -1452,6 +1517,10 @@ public static AsyncPageable GetSiteRecover /// ReplicationRecoveryServicesProviders_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1461,9 +1530,7 @@ public static AsyncPageable GetSiteRecover /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryServicesProviders(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryServicesProviders(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryServicesProviders(resourceName, cancellationToken); } /// @@ -1478,6 +1545,10 @@ public static Pageable GetSiteRecoveryServ /// ReplicationStorageClassifications_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1487,9 +1558,7 @@ public static Pageable GetSiteRecoveryServ /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageClassificationsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageClassificationsAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetStorageClassificationsAsync(resourceName, cancellationToken); } /// @@ -1504,6 +1573,10 @@ public static AsyncPageable GetStorageClassificat /// ReplicationStorageClassifications_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1513,9 +1586,7 @@ public static AsyncPageable GetStorageClassificat /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageClassifications(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageClassifications(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetStorageClassifications(resourceName, cancellationToken); } /// @@ -1530,6 +1601,10 @@ public static Pageable GetStorageClassifications( /// ReplicationStorageClassificationMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1539,9 +1614,7 @@ public static Pageable GetStorageClassifications( /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetStorageClassificationMappingsAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageClassificationMappingsAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetStorageClassificationMappingsAsync(resourceName, cancellationToken); } /// @@ -1556,6 +1629,10 @@ public static AsyncPageable GetStorageClas /// ReplicationStorageClassificationMappings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1565,9 +1642,7 @@ public static AsyncPageable GetStorageClas /// A collection of that may take multiple service requests to iterate over. public static Pageable GetStorageClassificationMappings(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetStorageClassificationMappings(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetStorageClassificationMappings(resourceName, cancellationToken); } /// @@ -1582,6 +1657,10 @@ public static Pageable GetStorageClassific /// ReplicationvCenters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1591,9 +1670,7 @@ public static Pageable GetStorageClassific /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSiteRecoveryVCentersAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryVCentersAsync(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryVCentersAsync(resourceName, cancellationToken); } /// @@ -1608,6 +1685,10 @@ public static AsyncPageable GetSiteRecoveryVCenters /// ReplicationvCenters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1617,9 +1698,7 @@ public static AsyncPageable GetSiteRecoveryVCenters /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSiteRecoveryVCenters(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSiteRecoveryVCenters(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSiteRecoveryVCenters(resourceName, cancellationToken); } /// @@ -1634,6 +1713,10 @@ public static Pageable GetSiteRecoveryVCenters(this /// SupportedOperatingSystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1643,9 +1726,7 @@ public static Pageable GetSiteRecoveryVCenters(this /// is null. public static async Task> GetSupportedOperatingSystemAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string instanceType = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSupportedOperatingSystemAsync(resourceName, instanceType, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSupportedOperatingSystemAsync(resourceName, instanceType, cancellationToken).ConfigureAwait(false); } /// @@ -1660,6 +1741,10 @@ public static async Task> GetSup /// SupportedOperatingSystems_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1669,9 +1754,7 @@ public static async Task> GetSup /// is null. public static Response GetSupportedOperatingSystem(this ResourceGroupResource resourceGroupResource, string resourceName, string instanceType = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSupportedOperatingSystem(resourceName, instanceType, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetSupportedOperatingSystem(resourceName, instanceType, cancellationToken); } /// @@ -1686,6 +1769,10 @@ public static Response GetSupportedOperat /// ReplicationVaultHealth_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1694,9 +1781,7 @@ public static Response GetSupportedOperat /// is null. public static async Task> GetReplicationVaultHealthAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationVaultHealthAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationVaultHealthAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1711,6 +1796,10 @@ public static async Task> GetReplicationVaultHealth /// ReplicationVaultHealth_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. @@ -1719,9 +1808,7 @@ public static async Task> GetReplicationVaultHealth /// is null. public static Response GetReplicationVaultHealth(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetReplicationVaultHealth(resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).GetReplicationVaultHealth(resourceName, cancellationToken); } /// @@ -1736,6 +1823,10 @@ public static Response GetReplicationVaultHealth(this Resour /// ReplicationVaultHealth_Refresh /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1745,9 +1836,7 @@ public static Response GetReplicationVaultHealth(this Resour /// is null. public static async Task> RefreshReplicationVaultHealthAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).RefreshReplicationVaultHealthAsync(waitUntil, resourceName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).RefreshReplicationVaultHealthAsync(waitUntil, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1762,6 +1851,10 @@ public static async Task> RefreshReplicationVau /// ReplicationVaultHealth_Refresh /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1771,9 +1864,7 @@ public static async Task> RefreshReplicationVau /// is null. public static ArmOperation RefreshReplicationVaultHealth(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).RefreshReplicationVaultHealth(waitUntil, resourceName, cancellationToken); + return GetRecoveryServicesSiteRecoveryResourceGroupMockingExtension(resourceGroupResource).RefreshReplicationVaultHealth(waitUntil, resourceName, cancellationToken); } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryResourceGroupMockingExtension.cs similarity index 61% rename from sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryResourceGroupMockingExtension.cs index 5000af15cb07..b282052904cb 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryResourceGroupMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServicesSiteRecovery; using Azure.ResourceManager.RecoveryServicesSiteRecovery.Models; -namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class RecoveryServicesSiteRecoveryResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _replicationAppliancesClientDiagnostics; private ReplicationAppliancesRestOperations _replicationAppliancesRestClient; @@ -47,15 +48,15 @@ internal partial class ResourceGroupResourceExtensionClient : ArmResource private ClientDiagnostics _replicationVaultHealthClientDiagnostics; private ReplicationVaultHealthRestOperations _replicationVaultHealthRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesSiteRecoveryResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesSiteRecoveryResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -94,76 +95,526 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Gets a collection of SiteRecoveryAlertResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryAlertResources and their operations over a SiteRecoveryAlertResource. public virtual SiteRecoveryAlertCollection GetSiteRecoveryAlerts(string resourceName) { return new SiteRecoveryAlertCollection(Client, Id, resourceName); } + /// + /// Gets the details of the specified email notification(alert) configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName} + /// + /// + /// Operation Id + /// ReplicationAlertSettings_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the email notification configuration. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryAlertAsync(string resourceName, string alertSettingName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryAlerts(resourceName).GetAsync(alertSettingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the specified email notification(alert) configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName} + /// + /// + /// Operation Id + /// ReplicationAlertSettings_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the email notification configuration. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryAlert(string resourceName, string alertSettingName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryAlerts(resourceName).Get(alertSettingName, cancellationToken); + } + /// Gets a collection of ReplicationEligibilityResultResources in the ResourceGroupResource. /// Virtual Machine name. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReplicationEligibilityResultResources and their operations over a ReplicationEligibilityResultResource. public virtual ReplicationEligibilityResultCollection GetReplicationEligibilityResults(string virtualMachineName) { return new ReplicationEligibilityResultCollection(Client, Id, virtualMachineName); } + /// + /// Validates whether a given VM can be protected or not in which case returns list of errors. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default + /// + /// + /// Operation Id + /// ReplicationEligibilityResults_Get + /// + /// + /// + /// Virtual Machine name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReplicationEligibilityResultAsync(string virtualMachineName, CancellationToken cancellationToken = default) + { + return await GetReplicationEligibilityResults(virtualMachineName).GetAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Validates whether a given VM can be protected or not in which case returns list of errors. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default + /// + /// + /// Operation Id + /// ReplicationEligibilityResults_Get + /// + /// + /// + /// Virtual Machine name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReplicationEligibilityResult(string virtualMachineName, CancellationToken cancellationToken = default) + { + return GetReplicationEligibilityResults(virtualMachineName).Get(cancellationToken); + } + /// Gets a collection of SiteRecoveryEventResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryEventResources and their operations over a SiteRecoveryEventResource. public virtual SiteRecoveryEventCollection GetSiteRecoveryEvents(string resourceName) { return new SiteRecoveryEventCollection(Client, Id, resourceName); } + /// + /// The operation to get the details of an Azure Site recovery event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName} + /// + /// + /// Operation Id + /// ReplicationEvents_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the Azure Site Recovery event. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryEventAsync(string resourceName, string eventName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryEvents(resourceName).GetAsync(eventName, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation to get the details of an Azure Site recovery event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName} + /// + /// + /// Operation Id + /// ReplicationEvents_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The name of the Azure Site Recovery event. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryEvent(string resourceName, string eventName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryEvents(resourceName).Get(eventName, cancellationToken); + } + /// Gets a collection of SiteRecoveryFabricResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryFabricResources and their operations over a SiteRecoveryFabricResource. public virtual SiteRecoveryFabricCollection GetSiteRecoveryFabrics(string resourceName) { return new SiteRecoveryFabricCollection(Client, Id, resourceName); } + /// + /// Gets the details of an Azure Site Recovery fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// ReplicationFabrics_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Fabric name. + /// OData filter options. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryFabricAsync(string resourceName, string fabricName, string filter = null, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryFabrics(resourceName).GetAsync(fabricName, filter, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of an Azure Site Recovery fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// ReplicationFabrics_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Fabric name. + /// OData filter options. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryFabric(string resourceName, string fabricName, string filter = null, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryFabrics(resourceName).Get(fabricName, filter, cancellationToken); + } + /// Gets a collection of SiteRecoveryJobResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryJobResources and their operations over a SiteRecoveryJobResource. public virtual SiteRecoveryJobCollection GetSiteRecoveryJobs(string resourceName) { return new SiteRecoveryJobCollection(Client, Id, resourceName); } + /// + /// Get the details of an Azure Site Recovery job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName} + /// + /// + /// Operation Id + /// ReplicationJobs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Job identifier. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryJobAsync(string resourceName, string jobName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryJobs(resourceName).GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details of an Azure Site Recovery job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName} + /// + /// + /// Operation Id + /// ReplicationJobs_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Job identifier. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryJob(string resourceName, string jobName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryJobs(resourceName).Get(jobName, cancellationToken); + } + /// Gets a collection of SiteRecoveryPolicyResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryPolicyResources and their operations over a SiteRecoveryPolicyResource. public virtual SiteRecoveryPolicyCollection GetSiteRecoveryPolicies(string resourceName) { return new SiteRecoveryPolicyCollection(Client, Id, resourceName); } + /// + /// Gets the details of a replication policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// ReplicationPolicies_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Replication policy name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryPolicyAsync(string resourceName, string policyName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryPolicies(resourceName).GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of a replication policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// ReplicationPolicies_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Replication policy name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryPolicy(string resourceName, string policyName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryPolicies(resourceName).Get(policyName, cancellationToken); + } + /// Gets a collection of ReplicationProtectionIntentResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReplicationProtectionIntentResources and their operations over a ReplicationProtectionIntentResource. public virtual ReplicationProtectionIntentCollection GetReplicationProtectionIntents(string resourceName) { return new ReplicationProtectionIntentCollection(Client, Id, resourceName); } + /// + /// Gets the details of an ASR replication protection intent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName} + /// + /// + /// Operation Id + /// ReplicationProtectionIntents_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Replication protection intent name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReplicationProtectionIntentAsync(string resourceName, string intentObjectName, CancellationToken cancellationToken = default) + { + return await GetReplicationProtectionIntents(resourceName).GetAsync(intentObjectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of an ASR replication protection intent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName} + /// + /// + /// Operation Id + /// ReplicationProtectionIntents_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Replication protection intent name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReplicationProtectionIntent(string resourceName, string intentObjectName, CancellationToken cancellationToken = default) + { + return GetReplicationProtectionIntents(resourceName).Get(intentObjectName, cancellationToken); + } + /// Gets a collection of SiteRecoveryRecoveryPlanResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryRecoveryPlanResources and their operations over a SiteRecoveryRecoveryPlanResource. public virtual SiteRecoveryRecoveryPlanCollection GetSiteRecoveryRecoveryPlans(string resourceName) { return new SiteRecoveryRecoveryPlanCollection(Client, Id, resourceName); } + /// + /// Gets the details of the recovery plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName} + /// + /// + /// Operation Id + /// ReplicationRecoveryPlans_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the recovery plan. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryRecoveryPlanAsync(string resourceName, string recoveryPlanName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryRecoveryPlans(resourceName).GetAsync(recoveryPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the recovery plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName} + /// + /// + /// Operation Id + /// ReplicationRecoveryPlans_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Name of the recovery plan. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryRecoveryPlan(string resourceName, string recoveryPlanName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryRecoveryPlans(resourceName).Get(recoveryPlanName, cancellationToken); + } + /// Gets a collection of SiteRecoveryVaultSettingResources in the ResourceGroupResource. /// The name of the recovery services vault. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of SiteRecoveryVaultSettingResources and their operations over a SiteRecoveryVaultSettingResource. public virtual SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(string resourceName) { return new SiteRecoveryVaultSettingCollection(Client, Id, resourceName); } + /// + /// Gets the vault setting. This includes the Migration Hub connection settings. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName} + /// + /// + /// Operation Id + /// ReplicationVaultSetting_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Vault setting name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSiteRecoveryVaultSettingAsync(string resourceName, string vaultSettingName, CancellationToken cancellationToken = default) + { + return await GetSiteRecoveryVaultSettings(resourceName).GetAsync(vaultSettingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the vault setting. This includes the Migration Hub connection settings. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName} + /// + /// + /// Operation Id + /// ReplicationVaultSetting_Get + /// + /// + /// + /// The name of the recovery services vault. + /// Vault setting name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSiteRecoveryVaultSetting(string resourceName, string vaultSettingName, CancellationToken cancellationToken = default) + { + return GetSiteRecoveryVaultSettings(resourceName).Get(vaultSettingName, cancellationToken); + } + /// /// Gets the list of Azure Site Recovery appliances for the vault. /// @@ -180,12 +631,16 @@ public virtual SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(s /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetReplicationAppliancesAsync(string resourceName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationAppliancesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationAppliancesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SiteRecoveryReplicationAppliance.DeserializeSiteRecoveryReplicationAppliance, ReplicationAppliancesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetReplicationAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SiteRecoveryReplicationAppliance.DeserializeSiteRecoveryReplicationAppliance, ReplicationAppliancesClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationAppliances", "value", "nextLink", cancellationToken); } /// @@ -204,12 +659,16 @@ public virtual AsyncPageable GetReplicationApp /// The name of the recovery services vault. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetReplicationAppliances(string resourceName, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationAppliancesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationAppliancesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SiteRecoveryReplicationAppliance.DeserializeSiteRecoveryReplicationAppliance, ReplicationAppliancesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetReplicationAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SiteRecoveryReplicationAppliance.DeserializeSiteRecoveryReplicationAppliance, ReplicationAppliancesClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationAppliances", "value", "nextLink", cancellationToken); } /// @@ -227,12 +686,16 @@ public virtual Pageable GetReplicationApplianc /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryNetworksAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryNetworkReplicationNetworksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryNetworkReplicationNetworksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkResource(Client, SiteRecoveryNetworkData.DeserializeSiteRecoveryNetworkData(e)), SiteRecoveryNetworkReplicationNetworksClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkResource(Client, SiteRecoveryNetworkData.DeserializeSiteRecoveryNetworkData(e)), SiteRecoveryNetworkReplicationNetworksClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryNetworks", "value", "nextLink", cancellationToken); } /// @@ -250,12 +713,16 @@ public virtual AsyncPageable GetSiteRecoveryNetwork /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryNetworks(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryNetworkReplicationNetworksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryNetworkReplicationNetworksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkResource(Client, SiteRecoveryNetworkData.DeserializeSiteRecoveryNetworkData(e)), SiteRecoveryNetworkReplicationNetworksClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkResource(Client, SiteRecoveryNetworkData.DeserializeSiteRecoveryNetworkData(e)), SiteRecoveryNetworkReplicationNetworksClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryNetworks", "value", "nextLink", cancellationToken); } /// @@ -273,12 +740,16 @@ public virtual Pageable GetSiteRecoveryNetworks(str /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryNetworkMappingsAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryNetworkMappingReplicationNetworkMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryNetworkMappingReplicationNetworkMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkMappingResource(Client, SiteRecoveryNetworkMappingData.DeserializeSiteRecoveryNetworkMappingData(e)), SiteRecoveryNetworkMappingReplicationNetworkMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryNetworkMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkMappingResource(Client, SiteRecoveryNetworkMappingData.DeserializeSiteRecoveryNetworkMappingData(e)), SiteRecoveryNetworkMappingReplicationNetworkMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryNetworkMappings", "value", "nextLink", cancellationToken); } /// @@ -296,12 +767,16 @@ public virtual AsyncPageable GetSiteRecovery /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryNetworkMappings(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryNetworkMappingReplicationNetworkMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryNetworkMappingReplicationNetworkMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkMappingResource(Client, SiteRecoveryNetworkMappingData.DeserializeSiteRecoveryNetworkMappingData(e)), SiteRecoveryNetworkMappingReplicationNetworkMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryNetworkMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryNetworkMappingResource(Client, SiteRecoveryNetworkMappingData.DeserializeSiteRecoveryNetworkMappingData(e)), SiteRecoveryNetworkMappingReplicationNetworkMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryNetworkMappings", "value", "nextLink", cancellationToken); } /// @@ -319,12 +794,16 @@ public virtual Pageable GetSiteRecoveryNetwo /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryProtectionContainersAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryProtectionContainerResource(Client, SiteRecoveryProtectionContainerData.DeserializeSiteRecoveryProtectionContainerData(e)), SiteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryProtectionContainerResource(Client, SiteRecoveryProtectionContainerData.DeserializeSiteRecoveryProtectionContainerData(e)), SiteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -342,12 +821,16 @@ public virtual AsyncPageable GetSiteRec /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryProtectionContainers(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryProtectionContainerResource(Client, SiteRecoveryProtectionContainerData.DeserializeSiteRecoveryProtectionContainerData(e)), SiteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryProtectionContainers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryProtectionContainerResource(Client, SiteRecoveryProtectionContainerData.DeserializeSiteRecoveryProtectionContainerData(e)), SiteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryProtectionContainers", "value", "nextLink", cancellationToken); } /// @@ -368,12 +851,16 @@ public virtual Pageable GetSiteRecovery /// The page size. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryMigrationItemsAsync(string resourceName, string skipToken = null, string takeToken = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryMigrationItemReplicationMigrationItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, takeToken, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryMigrationItemReplicationMigrationItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, takeToken, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryMigrationItemResource(Client, SiteRecoveryMigrationItemData.DeserializeSiteRecoveryMigrationItemData(e)), SiteRecoveryMigrationItemReplicationMigrationItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryMigrationItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryMigrationItemResource(Client, SiteRecoveryMigrationItemData.DeserializeSiteRecoveryMigrationItemData(e)), SiteRecoveryMigrationItemReplicationMigrationItemsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryMigrationItems", "value", "nextLink", cancellationToken); } /// @@ -394,12 +881,16 @@ public virtual AsyncPageable GetSiteRecoveryM /// The page size. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryMigrationItems(string resourceName, string skipToken = null, string takeToken = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryMigrationItemReplicationMigrationItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, takeToken, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryMigrationItemReplicationMigrationItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, takeToken, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryMigrationItemResource(Client, SiteRecoveryMigrationItemData.DeserializeSiteRecoveryMigrationItemData(e)), SiteRecoveryMigrationItemReplicationMigrationItemsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryMigrationItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryMigrationItemResource(Client, SiteRecoveryMigrationItemData.DeserializeSiteRecoveryMigrationItemData(e)), SiteRecoveryMigrationItemReplicationMigrationItemsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryMigrationItems", "value", "nextLink", cancellationToken); } /// @@ -419,12 +910,16 @@ public virtual Pageable GetSiteRecoveryMigrat /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetReplicationProtectedItemsAsync(string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReplicationProtectedItemResource(Client, ReplicationProtectedItemData.DeserializeReplicationProtectedItemData(e)), ReplicationProtectedItemClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetReplicationProtectedItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReplicationProtectedItemResource(Client, ReplicationProtectedItemData.DeserializeReplicationProtectedItemData(e)), ReplicationProtectedItemClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationProtectedItems", "value", "nextLink", cancellationToken); } /// @@ -444,12 +939,16 @@ public virtual AsyncPageable GetReplicationPro /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. /// OData filter options. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetReplicationProtectedItems(string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicationProtectedItemResource(Client, ReplicationProtectedItemData.DeserializeReplicationProtectedItemData(e)), ReplicationProtectedItemClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetReplicationProtectedItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicationProtectedItemResource(Client, ReplicationProtectedItemData.DeserializeReplicationProtectedItemData(e)), ReplicationProtectedItemClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationProtectedItems", "value", "nextLink", cancellationToken); } /// @@ -467,12 +966,16 @@ public virtual Pageable GetReplicationProtecte /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetProtectionContainerMappingsAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProtectionContainerMappingReplicationProtectionContainerMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProtectionContainerMappingReplicationProtectionContainerMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProtectionContainerMappingResource(Client, ProtectionContainerMappingData.DeserializeProtectionContainerMappingData(e)), ProtectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetProtectionContainerMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProtectionContainerMappingResource(Client, ProtectionContainerMappingData.DeserializeProtectionContainerMappingData(e)), ProtectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetProtectionContainerMappings", "value", "nextLink", cancellationToken); } /// @@ -490,12 +993,16 @@ public virtual AsyncPageable GetProtectionCo /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetProtectionContainerMappings(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProtectionContainerMappingReplicationProtectionContainerMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProtectionContainerMappingReplicationProtectionContainerMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProtectionContainerMappingResource(Client, ProtectionContainerMappingData.DeserializeProtectionContainerMappingData(e)), ProtectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetProtectionContainerMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProtectionContainerMappingResource(Client, ProtectionContainerMappingData.DeserializeProtectionContainerMappingData(e)), ProtectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetProtectionContainerMappings", "value", "nextLink", cancellationToken); } /// @@ -513,12 +1020,16 @@ public virtual Pageable GetProtectionContain /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryServicesProvidersAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryServicesProviderResource(Client, SiteRecoveryServicesProviderData.DeserializeSiteRecoveryServicesProviderData(e)), SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryServicesProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryServicesProviderResource(Client, SiteRecoveryServicesProviderData.DeserializeSiteRecoveryServicesProviderData(e)), SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryServicesProviders", "value", "nextLink", cancellationToken); } /// @@ -536,12 +1047,16 @@ public virtual AsyncPageable GetSiteRecove /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryServicesProviders(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryServicesProviderResource(Client, SiteRecoveryServicesProviderData.DeserializeSiteRecoveryServicesProviderData(e)), SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryServicesProviders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryServicesProviderResource(Client, SiteRecoveryServicesProviderData.DeserializeSiteRecoveryServicesProviderData(e)), SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryServicesProviders", "value", "nextLink", cancellationToken); } /// @@ -559,12 +1074,16 @@ public virtual Pageable GetSiteRecoverySer /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetStorageClassificationsAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => StorageClassificationReplicationStorageClassificationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageClassificationReplicationStorageClassificationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationResource(Client, StorageClassificationData.DeserializeStorageClassificationData(e)), StorageClassificationReplicationStorageClassificationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetStorageClassifications", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationResource(Client, StorageClassificationData.DeserializeStorageClassificationData(e)), StorageClassificationReplicationStorageClassificationsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetStorageClassifications", "value", "nextLink", cancellationToken); } /// @@ -582,12 +1101,16 @@ public virtual AsyncPageable GetStorageClassifica /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetStorageClassifications(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => StorageClassificationReplicationStorageClassificationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageClassificationReplicationStorageClassificationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationResource(Client, StorageClassificationData.DeserializeStorageClassificationData(e)), StorageClassificationReplicationStorageClassificationsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetStorageClassifications", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationResource(Client, StorageClassificationData.DeserializeStorageClassificationData(e)), StorageClassificationReplicationStorageClassificationsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetStorageClassifications", "value", "nextLink", cancellationToken); } /// @@ -605,12 +1128,16 @@ public virtual Pageable GetStorageClassifications /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetStorageClassificationMappingsAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => StorageClassificationMappingReplicationStorageClassificationMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageClassificationMappingReplicationStorageClassificationMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationMappingResource(Client, StorageClassificationMappingData.DeserializeStorageClassificationMappingData(e)), StorageClassificationMappingReplicationStorageClassificationMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetStorageClassificationMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationMappingResource(Client, StorageClassificationMappingData.DeserializeStorageClassificationMappingData(e)), StorageClassificationMappingReplicationStorageClassificationMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetStorageClassificationMappings", "value", "nextLink", cancellationToken); } /// @@ -628,12 +1155,16 @@ public virtual AsyncPageable GetStorageCla /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetStorageClassificationMappings(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => StorageClassificationMappingReplicationStorageClassificationMappingsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StorageClassificationMappingReplicationStorageClassificationMappingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationMappingResource(Client, StorageClassificationMappingData.DeserializeStorageClassificationMappingData(e)), StorageClassificationMappingReplicationStorageClassificationMappingsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetStorageClassificationMappings", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StorageClassificationMappingResource(Client, StorageClassificationMappingData.DeserializeStorageClassificationMappingData(e)), StorageClassificationMappingReplicationStorageClassificationMappingsClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetStorageClassificationMappings", "value", "nextLink", cancellationToken); } /// @@ -651,12 +1182,16 @@ public virtual Pageable GetStorageClassifi /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSiteRecoveryVCentersAsync(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryVCenterReplicationvCentersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryVCenterReplicationvCentersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryVCenterResource(Client, SiteRecoveryVCenterData.DeserializeSiteRecoveryVCenterData(e)), SiteRecoveryVCenterReplicationvCentersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryVCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryVCenterResource(Client, SiteRecoveryVCenterData.DeserializeSiteRecoveryVCenterData(e)), SiteRecoveryVCenterReplicationvCentersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryVCenters", "value", "nextLink", cancellationToken); } /// @@ -674,12 +1209,16 @@ public virtual AsyncPageable GetSiteRecoveryVCenter /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSiteRecoveryVCenters(string resourceName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => SiteRecoveryVCenterReplicationvCentersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SiteRecoveryVCenterReplicationvCentersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryVCenterResource(Client, SiteRecoveryVCenterData.DeserializeSiteRecoveryVCenterData(e)), SiteRecoveryVCenterReplicationvCentersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetSiteRecoveryVCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SiteRecoveryVCenterResource(Client, SiteRecoveryVCenterData.DeserializeSiteRecoveryVCenterData(e)), SiteRecoveryVCenterReplicationvCentersClientDiagnostics, Pipeline, "RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSiteRecoveryVCenters", "value", "nextLink", cancellationToken); } /// @@ -698,9 +1237,13 @@ public virtual Pageable GetSiteRecoveryVCenters(str /// The name of the recovery services vault. /// The instance type. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetSupportedOperatingSystemAsync(string resourceName, string instanceType = null, CancellationToken cancellationToken = default) { - using var scope = SupportedOperatingSystemsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSupportedOperatingSystem"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = SupportedOperatingSystemsClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSupportedOperatingSystem"); scope.Start(); try { @@ -730,9 +1273,13 @@ public virtual async Task> GetSu /// The name of the recovery services vault. /// The instance type. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetSupportedOperatingSystem(string resourceName, string instanceType = null, CancellationToken cancellationToken = default) { - using var scope = SupportedOperatingSystemsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSupportedOperatingSystem"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = SupportedOperatingSystemsClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetSupportedOperatingSystem"); scope.Start(); try { @@ -761,9 +1308,13 @@ public virtual Response GetSupportedOpera /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetReplicationVaultHealthAsync(string resourceName, CancellationToken cancellationToken = default) { - using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetReplicationVaultHealth"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationVaultHealth"); scope.Start(); try { @@ -792,9 +1343,13 @@ public virtual async Task> GetReplicationVaultHealt /// /// The name of the recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetReplicationVaultHealth(string resourceName, CancellationToken cancellationToken = default) { - using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetReplicationVaultHealth"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.GetReplicationVaultHealth"); scope.Start(); try { @@ -824,9 +1379,13 @@ public virtual Response GetReplicationVaultHealth(string res /// 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 recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> RefreshReplicationVaultHealthAsync(WaitUntil waitUntil, string resourceName, CancellationToken cancellationToken = default) { - using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.RefreshReplicationVaultHealth"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.RefreshReplicationVaultHealth"); scope.Start(); try { @@ -859,9 +1418,13 @@ public virtual async Task> RefreshReplicationVa /// 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 recovery services vault. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual ArmOperation RefreshReplicationVaultHealth(WaitUntil waitUntil, string resourceName, CancellationToken cancellationToken = default) { - using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.RefreshReplicationVaultHealth"); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var scope = ReplicationVaultHealthClientDiagnostics.CreateScope("RecoveryServicesSiteRecoveryResourceGroupMockingExtension.RefreshReplicationVaultHealth"); scope.Start(); try { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs index 47958df07077..bfb9aae177e2 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteRecoveryPointResources and their operations over a SiteRecoveryPointResource. public virtual SiteRecoveryPointCollection GetSiteRecoveryPoints() { - return GetCachedClient(Client => new SiteRecoveryPointCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryPointCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual SiteRecoveryPointCollection GetSiteRecoveryPoints() /// /// The recovery point name. /// The cancellation token to use. - /// 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> GetSiteRecoveryPointAsync(string recoveryPointName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetSiteRecoveryPo /// /// The recovery point name. /// The cancellation token to use. - /// 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 GetSiteRecoveryPoint(string recoveryPointName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs index 62b9d4a09259..588b4ff3a6f3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteRecoveryLogicalNetworkResources and their operations over a SiteRecoveryLogicalNetworkResource. public virtual SiteRecoveryLogicalNetworkCollection GetSiteRecoveryLogicalNetworks() { - return GetCachedClient(Client => new SiteRecoveryLogicalNetworkCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryLogicalNetworkCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SiteRecoveryLogicalNetworkCollection GetSiteRecoveryLogicalNetwor /// /// Logical network name. /// The cancellation token to use. - /// 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> GetSiteRecoveryLogicalNetworkAsync(string logicalNetworkName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSiteR /// /// Logical network name. /// The cancellation token to use. - /// 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 GetSiteRecoveryLogicalNetwork(string logicalNetworkName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetSiteRecoveryLogic /// An object representing collection of SiteRecoveryNetworkResources and their operations over a SiteRecoveryNetworkResource. public virtual SiteRecoveryNetworkCollection GetSiteRecoveryNetworks() { - return GetCachedClient(Client => new SiteRecoveryNetworkCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryNetworkCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual SiteRecoveryNetworkCollection GetSiteRecoveryNetworks() /// /// Primary network name. /// The cancellation token to use. - /// 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> GetSiteRecoveryNetworkAsync(string networkName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> GetSiteRecovery /// /// Primary network name. /// The cancellation token to use. - /// 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 GetSiteRecoveryNetwork(string networkName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetSiteRecoveryNetwork(stri /// An object representing collection of SiteRecoveryProtectionContainerResources and their operations over a SiteRecoveryProtectionContainerResource. public virtual SiteRecoveryProtectionContainerCollection GetSiteRecoveryProtectionContainers() { - return GetCachedClient(Client => new SiteRecoveryProtectionContainerCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryProtectionContainerCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual SiteRecoveryProtectionContainerCollection GetSiteRecoveryProtecti /// /// Protection container name. /// The cancellation token to use. - /// 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> GetSiteRecoveryProtectionContainerAsync(string protectionContainerName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> Get /// /// Protection container name. /// The cancellation token to use. - /// 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 GetSiteRecoveryProtectionContainer(string protectionContainerName, CancellationToken cancellationToken = default) { @@ -251,7 +251,7 @@ public virtual Response GetSiteRecovery /// An object representing collection of SiteRecoveryServicesProviderResources and their operations over a SiteRecoveryServicesProviderResource. public virtual SiteRecoveryServicesProviderCollection GetSiteRecoveryServicesProviders() { - return GetCachedClient(Client => new SiteRecoveryServicesProviderCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryServicesProviderCollection(client, Id)); } /// @@ -269,8 +269,8 @@ public virtual SiteRecoveryServicesProviderCollection GetSiteRecoveryServicesPro /// /// Recovery services provider name. /// The cancellation token to use. - /// 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> GetSiteRecoveryServicesProviderAsync(string providerName, CancellationToken cancellationToken = default) { @@ -292,8 +292,8 @@ public virtual async Task> GetSit /// /// Recovery services provider name. /// The cancellation token to use. - /// 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 GetSiteRecoveryServicesProvider(string providerName, CancellationToken cancellationToken = default) { @@ -304,7 +304,7 @@ public virtual Response GetSiteRecoverySer /// An object representing collection of StorageClassificationResources and their operations over a StorageClassificationResource. public virtual StorageClassificationCollection GetStorageClassifications() { - return GetCachedClient(Client => new StorageClassificationCollection(Client, Id)); + return GetCachedClient(client => new StorageClassificationCollection(client, Id)); } /// @@ -322,8 +322,8 @@ public virtual StorageClassificationCollection GetStorageClassifications() /// /// Storage classification name. /// The cancellation token to use. - /// 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> GetStorageClassificationAsync(string storageClassificationName, CancellationToken cancellationToken = default) { @@ -345,8 +345,8 @@ public virtual async Task> GetStorageCla /// /// Storage classification name. /// The cancellation token to use. - /// 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 GetStorageClassification(string storageClassificationName, CancellationToken cancellationToken = default) { @@ -357,7 +357,7 @@ public virtual Response GetStorageClassification( /// An object representing collection of SiteRecoveryVCenterResources and their operations over a SiteRecoveryVCenterResource. public virtual SiteRecoveryVCenterCollection GetSiteRecoveryVCenters() { - return GetCachedClient(Client => new SiteRecoveryVCenterCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryVCenterCollection(client, Id)); } /// @@ -375,8 +375,8 @@ public virtual SiteRecoveryVCenterCollection GetSiteRecoveryVCenters() /// /// vcenter name. /// The cancellation token to use. - /// 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> GetSiteRecoveryVCenterAsync(string vCenterName, CancellationToken cancellationToken = default) { @@ -398,8 +398,8 @@ public virtual async Task> GetSiteRecovery /// /// vcenter name. /// The cancellation token to use. - /// 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 GetSiteRecoveryVCenter(string vCenterName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs index 5f13df3db945..cef32cbea0e0 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MigrationRecoveryPointResources and their operations over a MigrationRecoveryPointResource. public virtual MigrationRecoveryPointCollection GetMigrationRecoveryPoints() { - return GetCachedClient(Client => new MigrationRecoveryPointCollection(Client, Id)); + return GetCachedClient(client => new MigrationRecoveryPointCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual MigrationRecoveryPointCollection GetMigrationRecoveryPoints() /// /// The migration recovery point name. /// The cancellation token to use. - /// 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> GetMigrationRecoveryPointAsync(string migrationRecoveryPointName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetMigration /// /// The migration recovery point name. /// The cancellation token to use. - /// 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 GetMigrationRecoveryPoint(string migrationRecoveryPointName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs index 2aaa14926e43..ed246fbafcf3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteRecoveryNetworkMappingResources and their operations over a SiteRecoveryNetworkMappingResource. public virtual SiteRecoveryNetworkMappingCollection GetSiteRecoveryNetworkMappings() { - return GetCachedClient(Client => new SiteRecoveryNetworkMappingCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryNetworkMappingCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SiteRecoveryNetworkMappingCollection GetSiteRecoveryNetworkMappin /// /// Network mapping name. /// The cancellation token to use. - /// 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> GetSiteRecoveryNetworkMappingAsync(string networkMappingName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSiteR /// /// Network mapping name. /// The cancellation token to use. - /// 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 GetSiteRecoveryNetworkMapping(string networkMappingName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs index e3e85f79ed02..65211336bfb0 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SiteRecoveryMigrationItemResources and their operations over a SiteRecoveryMigrationItemResource. public virtual SiteRecoveryMigrationItemCollection GetSiteRecoveryMigrationItems() { - return GetCachedClient(Client => new SiteRecoveryMigrationItemCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryMigrationItemCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SiteRecoveryMigrationItemCollection GetSiteRecoveryMigrationItems /// /// Migration item name. /// The cancellation token to use. - /// 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> GetSiteRecoveryMigrationItemAsync(string migrationItemName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetSiteRe /// /// Migration item name. /// The cancellation token to use. - /// 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 GetSiteRecoveryMigrationItem(string migrationItemName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetSiteRecoveryMigrat /// An object representing collection of SiteRecoveryProtectableItemResources and their operations over a SiteRecoveryProtectableItemResource. public virtual SiteRecoveryProtectableItemCollection GetSiteRecoveryProtectableItems() { - return GetCachedClient(Client => new SiteRecoveryProtectableItemCollection(Client, Id)); + return GetCachedClient(client => new SiteRecoveryProtectableItemCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual SiteRecoveryProtectableItemCollection GetSiteRecoveryProtectableI /// /// Protectable item name. /// The cancellation token to use. - /// 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> GetSiteRecoveryProtectableItemAsync(string protectableItemName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetSite /// /// Protectable item name. /// The cancellation token to use. - /// 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 GetSiteRecoveryProtectableItem(string protectableItemName, CancellationToken cancellationToken = default) { @@ -197,7 +197,7 @@ public virtual Response GetSiteRecoveryProt /// An object representing collection of ReplicationProtectedItemResources and their operations over a ReplicationProtectedItemResource. public virtual ReplicationProtectedItemCollection GetReplicationProtectedItems() { - return GetCachedClient(Client => new ReplicationProtectedItemCollection(Client, Id)); + return GetCachedClient(client => new ReplicationProtectedItemCollection(client, Id)); } /// @@ -215,8 +215,8 @@ public virtual ReplicationProtectedItemCollection GetReplicationProtectedItems() /// /// Replication protected item name. /// The cancellation token to use. - /// 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> GetReplicationProtectedItemAsync(string replicatedProtectedItemName, CancellationToken cancellationToken = default) { @@ -238,8 +238,8 @@ public virtual async Task> GetReplica /// /// Replication protected item name. /// The cancellation token to use. - /// 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 GetReplicationProtectedItem(string replicatedProtectedItemName, CancellationToken cancellationToken = default) { @@ -250,7 +250,7 @@ public virtual Response GetReplicationProtecte /// An object representing collection of ProtectionContainerMappingResources and their operations over a ProtectionContainerMappingResource. public virtual ProtectionContainerMappingCollection GetProtectionContainerMappings() { - return GetCachedClient(Client => new ProtectionContainerMappingCollection(Client, Id)); + return GetCachedClient(client => new ProtectionContainerMappingCollection(client, Id)); } /// @@ -268,8 +268,8 @@ public virtual ProtectionContainerMappingCollection GetProtectionContainerMappin /// /// Protection Container mapping name. /// The cancellation token to use. - /// 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> GetProtectionContainerMappingAsync(string mappingName, CancellationToken cancellationToken = default) { @@ -291,8 +291,8 @@ public virtual async Task> GetProte /// /// Protection Container mapping name. /// The cancellation token to use. - /// 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 GetProtectionContainerMapping(string mappingName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs index 80d873fb0493..f796f6b3d725 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of StorageClassificationMappingResources and their operations over a StorageClassificationMappingResource. public virtual StorageClassificationMappingCollection GetStorageClassificationMappings() { - return GetCachedClient(Client => new StorageClassificationMappingCollection(Client, Id)); + return GetCachedClient(client => new StorageClassificationMappingCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual StorageClassificationMappingCollection GetStorageClassificationMa /// /// Storage classification mapping name. /// The cancellation token to use. - /// 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> GetStorageClassificationMappingAsync(string storageClassificationMappingName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSto /// /// Storage classification mapping name. /// The cancellation token to use. - /// 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 GetStorageClassificationMapping(string storageClassificationMappingName, CancellationToken cancellationToken = default) { diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesArmClientMockingExtension.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..41f2b6a90cea --- /dev/null +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServices; + +namespace Azure.ResourceManager.RecoveryServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RecoveryServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesArmClientMockingExtension() + { + } + + /// 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 RecoveryServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RecoveryServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RecoveryServicesPrivateLinkResource GetRecoveryServicesPrivateLinkResource(ResourceIdentifier id) + { + RecoveryServicesPrivateLinkResource.ValidateResourceId(id); + return new RecoveryServicesPrivateLinkResource(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 RecoveryServicesVaultResource GetRecoveryServicesVaultResource(ResourceIdentifier id) + { + RecoveryServicesVaultResource.ValidateResourceId(id); + return new RecoveryServicesVaultResource(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 RecoveryServicesVaultExtendedInfoResource GetRecoveryServicesVaultExtendedInfoResource(ResourceIdentifier id) + { + RecoveryServicesVaultExtendedInfoResource.ValidateResourceId(id); + return new RecoveryServicesVaultExtendedInfoResource(Client, id); + } + } +} diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs index b3ffcb49e641..1206a926b22a 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServices.Mocking; using Azure.ResourceManager.RecoveryServices.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.RecoveryServices /// A class to add extension methods to Azure.ResourceManager.RecoveryServices. public static partial class RecoveryServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RecoveryServicesArmClientMockingExtension GetRecoveryServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RecoveryServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RecoveryServicesResourceGroupMockingExtension GetRecoveryServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RecoveryServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RecoveryServicesSubscriptionMockingExtension GetRecoveryServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RecoveryServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region RecoveryServicesPrivateLinkResource /// /// 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. /// Returns a object. public static RecoveryServicesPrivateLinkResource GetRecoveryServicesPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecoveryServicesPrivateLinkResource.ValidateResourceId(id); - return new RecoveryServicesPrivateLinkResource(client, id); - } - ); + return GetRecoveryServicesArmClientMockingExtension(client).GetRecoveryServicesPrivateLinkResource(id); } - #endregion - #region RecoveryServicesVaultResource /// /// 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. /// Returns a object. public static RecoveryServicesVaultResource GetRecoveryServicesVaultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecoveryServicesVaultResource.ValidateResourceId(id); - return new RecoveryServicesVaultResource(client, id); - } - ); + return GetRecoveryServicesArmClientMockingExtension(client).GetRecoveryServicesVaultResource(id); } - #endregion - #region RecoveryServicesVaultExtendedInfoResource /// /// 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. /// Returns a object. public static RecoveryServicesVaultExtendedInfoResource GetRecoveryServicesVaultExtendedInfoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecoveryServicesVaultExtendedInfoResource.ValidateResourceId(id); - return new RecoveryServicesVaultExtendedInfoResource(client, id); - } - ); + return GetRecoveryServicesArmClientMockingExtension(client).GetRecoveryServicesVaultExtendedInfoResource(id); } - #endregion - /// Gets a collection of RecoveryServicesVaultResources in the ResourceGroupResource. + /// + /// Gets a collection of RecoveryServicesVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RecoveryServicesVaultResources and their operations over a RecoveryServicesVaultResource. public static RecoveryServicesVaultCollection GetRecoveryServicesVaults(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRecoveryServicesVaults(); + return GetRecoveryServicesResourceGroupMockingExtension(resourceGroupResource).GetRecoveryServicesVaults(); } /// @@ -127,16 +109,20 @@ public static RecoveryServicesVaultCollection GetRecoveryServicesVaults(this Res /// Vaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static async Task> GetRecoveryServicesVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRecoveryServicesVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesResourceGroupMockingExtension(resourceGroupResource).GetRecoveryServicesVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -151,16 +137,20 @@ public static async Task> GetRecoverySer /// Vaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the recovery services vault. /// The cancellation token to use. - /// 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 static Response GetRecoveryServicesVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRecoveryServicesVaults().Get(vaultName, cancellationToken); + return GetRecoveryServicesResourceGroupMockingExtension(resourceGroupResource).GetRecoveryServicesVault(vaultName, cancellationToken); } /// @@ -177,6 +167,10 @@ public static Response GetRecoveryServicesVault(t /// RecoveryServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the resource. @@ -185,9 +179,7 @@ public static Response GetRecoveryServicesVault(t /// is null. public static async Task> CheckRecoveryServicesNameAvailabilityAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, RecoveryServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckRecoveryServicesNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesResourceGroupMockingExtension(resourceGroupResource).CheckRecoveryServicesNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -204,6 +196,10 @@ public static async Task> Check /// RecoveryServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the resource. @@ -212,9 +208,7 @@ public static async Task> Check /// is null. public static Response CheckRecoveryServicesNameAvailability(this ResourceGroupResource resourceGroupResource, AzureLocation location, RecoveryServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckRecoveryServicesNameAvailability(location, content, cancellationToken); + return GetRecoveryServicesResourceGroupMockingExtension(resourceGroupResource).CheckRecoveryServicesNameAvailability(location, content, cancellationToken); } /// @@ -229,6 +223,10 @@ public static Response CheckRecoveryServ /// RecoveryServices_Capabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the resource. @@ -237,9 +235,7 @@ public static Response CheckRecoveryServ /// is null. public static async Task> GetRecoveryServiceCapabilitiesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ResourceCapabilities input, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(input, nameof(input)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecoveryServiceCapabilitiesAsync(location, input, cancellationToken).ConfigureAwait(false); + return await GetRecoveryServicesSubscriptionMockingExtension(subscriptionResource).GetRecoveryServiceCapabilitiesAsync(location, input, cancellationToken).ConfigureAwait(false); } /// @@ -254,6 +250,10 @@ public static async Task> GetRecoveryServiceCapabil /// RecoveryServices_Capabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the resource. @@ -262,9 +262,7 @@ public static async Task> GetRecoveryServiceCapabil /// is null. public static Response GetRecoveryServiceCapabilities(this SubscriptionResource subscriptionResource, AzureLocation location, ResourceCapabilities input, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(input, nameof(input)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecoveryServiceCapabilities(location, input, cancellationToken); + return GetRecoveryServicesSubscriptionMockingExtension(subscriptionResource).GetRecoveryServiceCapabilities(location, input, cancellationToken); } /// @@ -279,13 +277,17 @@ public static Response GetRecoveryServiceCapabilities(this S /// Vaults_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRecoveryServicesVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecoveryServicesVaultsAsync(cancellationToken); + return GetRecoveryServicesSubscriptionMockingExtension(subscriptionResource).GetRecoveryServicesVaultsAsync(cancellationToken); } /// @@ -300,13 +302,17 @@ public static AsyncPageable GetRecoveryServicesVa /// Vaults_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRecoveryServicesVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRecoveryServicesVaults(cancellationToken); + return GetRecoveryServicesSubscriptionMockingExtension(subscriptionResource).GetRecoveryServicesVaults(cancellationToken); } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesResourceGroupMockingExtension.cs similarity index 60% rename from sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesResourceGroupMockingExtension.cs index 7dddcc16c0cb..b2867fcb2964 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesResourceGroupMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServices; using Azure.ResourceManager.RecoveryServices.Models; -namespace Azure.ResourceManager.RecoveryServices +namespace Azure.ResourceManager.RecoveryServices.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class RecoveryServicesResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _recoveryServicesClientDiagnostics; private RecoveryServicesRestOperations _recoveryServicesRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,7 +48,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of RecoveryServicesVaultResources and their operations over a RecoveryServicesVaultResource. public virtual RecoveryServicesVaultCollection GetRecoveryServicesVaults() { - return GetCachedClient(Client => new RecoveryServicesVaultCollection(Client, Id)); + return GetCachedClient(client => new RecoveryServicesVaultCollection(client, Id)); + } + + /// + /// Get the Vault details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRecoveryServicesVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetRecoveryServicesVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the Vault details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName} + /// + /// + /// Operation Id + /// Vaults_Get + /// + /// + /// + /// The name of the recovery services vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRecoveryServicesVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetRecoveryServicesVaults().Get(vaultName, cancellationToken); } /// @@ -68,9 +115,12 @@ public virtual RecoveryServicesVaultCollection GetRecoveryServicesVaults() /// Location of the resource. /// Contains information about Resource type and Resource name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckRecoveryServicesNameAvailabilityAsync(AzureLocation location, RecoveryServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RecoveryServicesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckRecoveryServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RecoveryServicesClientDiagnostics.CreateScope("RecoveryServicesResourceGroupMockingExtension.CheckRecoveryServicesNameAvailability"); scope.Start(); try { @@ -102,9 +152,12 @@ public virtual async Task> Chec /// Location of the resource. /// Contains information about Resource type and Resource name. /// The cancellation token to use. + /// is null. public virtual Response CheckRecoveryServicesNameAvailability(AzureLocation location, RecoveryServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RecoveryServicesClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckRecoveryServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RecoveryServicesClientDiagnostics.CreateScope("RecoveryServicesResourceGroupMockingExtension.CheckRecoveryServicesNameAvailability"); scope.Start(); try { diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesSubscriptionMockingExtension.cs similarity index 86% rename from sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesSubscriptionMockingExtension.cs index 372b1e808746..8305a8be21af 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/Extensions/RecoveryServicesSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RecoveryServices; using Azure.ResourceManager.RecoveryServices.Models; -namespace Azure.ResourceManager.RecoveryServices +namespace Azure.ResourceManager.RecoveryServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RecoveryServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _recoveryServicesClientDiagnostics; private RecoveryServicesRestOperations _recoveryServicesRestClient; private ClientDiagnostics _recoveryServicesVaultVaultsClientDiagnostics; private VaultsRestOperations _recoveryServicesVaultVaultsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RecoveryServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RecoveryServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,9 +65,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Location of the resource. /// Contains information about Resource type and properties to get capabilities. /// The cancellation token to use. + /// is null. public virtual async Task> GetRecoveryServiceCapabilitiesAsync(AzureLocation location, ResourceCapabilities input, CancellationToken cancellationToken = default) { - using var scope = RecoveryServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRecoveryServiceCapabilities"); + Argument.AssertNotNull(input, nameof(input)); + + using var scope = RecoveryServicesClientDiagnostics.CreateScope("RecoveryServicesSubscriptionMockingExtension.GetRecoveryServiceCapabilities"); scope.Start(); try { @@ -96,9 +100,12 @@ public virtual async Task> GetRecoveryServiceCapabi /// Location of the resource. /// Contains information about Resource type and properties to get capabilities. /// The cancellation token to use. + /// is null. public virtual Response GetRecoveryServiceCapabilities(AzureLocation location, ResourceCapabilities input, CancellationToken cancellationToken = default) { - using var scope = RecoveryServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRecoveryServiceCapabilities"); + Argument.AssertNotNull(input, nameof(input)); + + using var scope = RecoveryServicesClientDiagnostics.CreateScope("RecoveryServicesSubscriptionMockingExtension.GetRecoveryServiceCapabilities"); scope.Start(); try { @@ -131,7 +138,7 @@ public virtual AsyncPageable GetRecoveryServicesV { HttpMessage FirstPageRequest(int? pageSizeHint) => RecoveryServicesVaultVaultsRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RecoveryServicesVaultVaultsRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesVaultResource(Client, RecoveryServicesVaultData.DeserializeRecoveryServicesVaultData(e)), RecoveryServicesVaultVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRecoveryServicesVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesVaultResource(Client, RecoveryServicesVaultData.DeserializeRecoveryServicesVaultData(e)), RecoveryServicesVaultVaultsClientDiagnostics, Pipeline, "RecoveryServicesSubscriptionMockingExtension.GetRecoveryServicesVaults", "value", "nextLink", cancellationToken); } /// @@ -153,7 +160,7 @@ public virtual Pageable GetRecoveryServicesVaults { HttpMessage FirstPageRequest(int? pageSizeHint) => RecoveryServicesVaultVaultsRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RecoveryServicesVaultVaultsRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesVaultResource(Client, RecoveryServicesVaultData.DeserializeRecoveryServicesVaultData(e)), RecoveryServicesVaultVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRecoveryServicesVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryServicesVaultResource(Client, RecoveryServicesVaultData.DeserializeRecoveryServicesVaultData(e)), RecoveryServicesVaultVaultsClientDiagnostics, Pipeline, "RecoveryServicesSubscriptionMockingExtension.GetRecoveryServicesVaults", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs index 6428d561d3fb..42e9ef470b82 100644 --- a/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs +++ b/sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/src/Generated/RecoveryServicesVaultResource.cs @@ -110,7 +110,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RecoveryServicesPrivateLinkResources and their operations over a RecoveryServicesPrivateLinkResource. public virtual RecoveryServicesPrivateLinkResourceCollection GetRecoveryServicesPrivateLinkResources() { - return GetCachedClient(Client => new RecoveryServicesPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new RecoveryServicesPrivateLinkResourceCollection(client, Id)); } /// @@ -128,8 +128,8 @@ public virtual RecoveryServicesPrivateLinkResourceCollection GetRecoveryServices /// /// The String to use. /// The cancellation token to use. - /// 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> GetRecoveryServicesPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task> GetReco /// /// The String to use. /// The cancellation token to use. - /// 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 GetRecoveryServicesPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisArmClientMockingExtension.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisArmClientMockingExtension.cs new file mode 100644 index 000000000000..81d96882ad3a --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RedisArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RedisArmClientMockingExtension() + { + } + + /// 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 RedisArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RedisArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RedisResource GetRedisResource(ResourceIdentifier id) + { + RedisResource.ValidateResourceId(id); + return new RedisResource(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 RedisFirewallRuleResource GetRedisFirewallRuleResource(ResourceIdentifier id) + { + RedisFirewallRuleResource.ValidateResourceId(id); + return new RedisFirewallRuleResource(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 RedisPatchScheduleResource GetRedisPatchScheduleResource(ResourceIdentifier id) + { + RedisPatchScheduleResource.ValidateResourceId(id); + return new RedisPatchScheduleResource(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 RedisLinkedServerWithPropertyResource GetRedisLinkedServerWithPropertyResource(ResourceIdentifier id) + { + RedisLinkedServerWithPropertyResource.ValidateResourceId(id); + return new RedisLinkedServerWithPropertyResource(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 RedisPrivateEndpointConnectionResource GetRedisPrivateEndpointConnectionResource(ResourceIdentifier id) + { + RedisPrivateEndpointConnectionResource.ValidateResourceId(id); + return new RedisPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs index bb2f25a9ee79..ff38c4cbe35b 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Redis.Mocking; using Azure.ResourceManager.Redis.Models; using Azure.ResourceManager.Resources; @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.Redis /// A class to add extension methods to Azure.ResourceManager.Redis. public static partial class RedisExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RedisArmClientMockingExtension GetRedisArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RedisArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RedisResourceGroupMockingExtension GetRedisResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RedisResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RedisSubscriptionMockingExtension GetRedisSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RedisSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region RedisResource /// /// 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. /// Returns a object. public static RedisResource GetRedisResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisResource.ValidateResourceId(id); - return new RedisResource(client, id); - } - ); + return GetRedisArmClientMockingExtension(client).GetRedisResource(id); } - #endregion - #region RedisFirewallRuleResource /// /// 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. /// Returns a object. public static RedisFirewallRuleResource GetRedisFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisFirewallRuleResource.ValidateResourceId(id); - return new RedisFirewallRuleResource(client, id); - } - ); + return GetRedisArmClientMockingExtension(client).GetRedisFirewallRuleResource(id); } - #endregion - #region RedisPatchScheduleResource /// /// 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. /// Returns a object. public static RedisPatchScheduleResource GetRedisPatchScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisPatchScheduleResource.ValidateResourceId(id); - return new RedisPatchScheduleResource(client, id); - } - ); + return GetRedisArmClientMockingExtension(client).GetRedisPatchScheduleResource(id); } - #endregion - #region RedisLinkedServerWithPropertyResource /// /// 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. /// Returns a object. public static RedisLinkedServerWithPropertyResource GetRedisLinkedServerWithPropertyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisLinkedServerWithPropertyResource.ValidateResourceId(id); - return new RedisLinkedServerWithPropertyResource(client, id); - } - ); + return GetRedisArmClientMockingExtension(client).GetRedisLinkedServerWithPropertyResource(id); } - #endregion - #region RedisPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static RedisPrivateEndpointConnectionResource GetRedisPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisPrivateEndpointConnectionResource.ValidateResourceId(id); - return new RedisPrivateEndpointConnectionResource(client, id); - } - ); + return GetRedisArmClientMockingExtension(client).GetRedisPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of RedisResources in the ResourceGroupResource. + /// + /// Gets a collection of RedisResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RedisResources and their operations over a RedisResource. public static RedisCollection GetAllRedis(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAllRedis(); + return GetRedisResourceGroupMockingExtension(resourceGroupResource).GetAllRedis(); } /// @@ -165,16 +141,20 @@ public static RedisCollection GetAllRedis(this ResourceGroupResource resourceGro /// Redis_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Redis cache. /// The cancellation token to use. - /// 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 static async Task> GetRedisAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAllRedis().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetRedisResourceGroupMockingExtension(resourceGroupResource).GetRedisAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetRedisAsync(this ResourceGro /// Redis_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Redis cache. /// The cancellation token to use. - /// 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 static Response GetRedis(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAllRedis().Get(name, cancellationToken); + return GetRedisResourceGroupMockingExtension(resourceGroupResource).GetRedis(name, cancellationToken); } /// @@ -213,6 +197,10 @@ public static Response GetRedis(this ResourceGroupResource resour /// Redis_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. @@ -220,9 +208,7 @@ public static Response GetRedis(this ResourceGroupResource resour /// is null. public static async Task CheckRedisNameAvailabilityAsync(this SubscriptionResource subscriptionResource, RedisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckRedisNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetRedisSubscriptionMockingExtension(subscriptionResource).CheckRedisNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -237,6 +223,10 @@ public static async Task CheckRedisNameAvailabilityAsync(this Subscrip /// Redis_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. @@ -244,9 +234,7 @@ public static async Task CheckRedisNameAvailabilityAsync(this Subscrip /// is null. public static Response CheckRedisNameAvailability(this SubscriptionResource subscriptionResource, RedisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckRedisNameAvailability(content, cancellationToken); + return GetRedisSubscriptionMockingExtension(subscriptionResource).CheckRedisNameAvailability(content, cancellationToken); } /// @@ -261,13 +249,17 @@ public static Response CheckRedisNameAvailability(this SubscriptionResource subs /// Redis_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAllRedisAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllRedisAsync(cancellationToken); + return GetRedisSubscriptionMockingExtension(subscriptionResource).GetAllRedisAsync(cancellationToken); } /// @@ -282,13 +274,17 @@ public static AsyncPageable GetAllRedisAsync(this SubscriptionRes /// Redis_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAllRedis(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllRedis(cancellationToken); + return GetRedisSubscriptionMockingExtension(subscriptionResource).GetAllRedis(cancellationToken); } /// @@ -303,6 +299,10 @@ public static Pageable GetAllRedis(this SubscriptionResource subs /// AsyncOperationStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location at which operation was triggered. @@ -312,9 +312,7 @@ public static Pageable GetAllRedis(this SubscriptionResource subs /// is null. public static async Task> GetAsyncOperationStatusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetAsyncOperationStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); + return await GetRedisSubscriptionMockingExtension(subscriptionResource).GetAsyncOperationStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); } /// @@ -329,6 +327,10 @@ public static async Task> GetAsyncOperationStatus /// AsyncOperationStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location at which operation was triggered. @@ -338,9 +340,7 @@ public static async Task> GetAsyncOperationStatus /// is null. public static Response GetAsyncOperationStatus(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAsyncOperationStatus(location, operationId, cancellationToken); + return GetRedisSubscriptionMockingExtension(subscriptionResource).GetAsyncOperationStatus(location, operationId, cancellationToken); } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisResourceGroupMockingExtension.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..54d198cbb18e --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class RedisResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RedisResourceGroupMockingExtension() + { + } + + /// 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 RedisResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of RedisResources in the ResourceGroupResource. + /// An object representing collection of RedisResources and their operations over a RedisResource. + public virtual RedisCollection GetAllRedis() + { + return GetCachedClient(client => new RedisCollection(client, Id)); + } + + /// + /// Gets a Redis cache (resource description). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name} + /// + /// + /// Operation Id + /// Redis_Get + /// + /// + /// + /// The name of the Redis cache. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRedisAsync(string name, CancellationToken cancellationToken = default) + { + return await GetAllRedis().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Redis cache (resource description). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name} + /// + /// + /// Operation Id + /// Redis_Get + /// + /// + /// + /// The name of the Redis cache. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRedis(string name, CancellationToken cancellationToken = default) + { + return GetAllRedis().Get(name, cancellationToken); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisSubscriptionMockingExtension.cs similarity index 84% rename from sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisSubscriptionMockingExtension.cs index dc8fb907c4dc..e8e95952973a 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Redis; using Azure.ResourceManager.Redis.Models; -namespace Azure.ResourceManager.Redis +namespace Azure.ResourceManager.Redis.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RedisSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _redisClientDiagnostics; private RedisRestOperations _redisRestClient; private ClientDiagnostics _asyncOperationStatusClientDiagnostics; private AsyncOperationStatusRestOperations _asyncOperationStatusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RedisSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RedisSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,9 +64,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. /// The cancellation token to use. + /// is null. public virtual async Task CheckRedisNameAvailabilityAsync(RedisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RedisClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckRedisNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RedisClientDiagnostics.CreateScope("RedisSubscriptionMockingExtension.CheckRedisNameAvailability"); scope.Start(); try { @@ -94,9 +98,12 @@ public virtual async Task CheckRedisNameAvailabilityAsync(RedisNameAva /// /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. /// The cancellation token to use. + /// is null. public virtual Response CheckRedisNameAvailability(RedisNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RedisClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckRedisNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RedisClientDiagnostics.CreateScope("RedisSubscriptionMockingExtension.CheckRedisNameAvailability"); scope.Start(); try { @@ -129,7 +136,7 @@ public virtual AsyncPageable GetAllRedisAsync(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => RedisRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RedisRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisResource(Client, RedisData.DeserializeRedisData(e)), RedisClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllRedis", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisResource(Client, RedisData.DeserializeRedisData(e)), RedisClientDiagnostics, Pipeline, "RedisSubscriptionMockingExtension.GetAllRedis", "value", "nextLink", cancellationToken); } /// @@ -151,7 +158,7 @@ public virtual Pageable GetAllRedis(CancellationToken cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => RedisRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RedisRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisResource(Client, RedisData.DeserializeRedisData(e)), RedisClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllRedis", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisResource(Client, RedisData.DeserializeRedisData(e)), RedisClientDiagnostics, Pipeline, "RedisSubscriptionMockingExtension.GetAllRedis", "value", "nextLink", cancellationToken); } /// @@ -170,9 +177,13 @@ public virtual Pageable GetAllRedis(CancellationToken cancellatio /// The location at which operation was triggered. /// The ID of asynchronous operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetAsyncOperationStatusAsync(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = AsyncOperationStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAsyncOperationStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = AsyncOperationStatusClientDiagnostics.CreateScope("RedisSubscriptionMockingExtension.GetAsyncOperationStatus"); scope.Start(); try { @@ -202,9 +213,13 @@ public virtual async Task> GetAsyncOperationStatu /// The location at which operation was triggered. /// The ID of asynchronous operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetAsyncOperationStatus(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = AsyncOperationStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAsyncOperationStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = AsyncOperationStatusClientDiagnostics.CreateScope("RedisSubscriptionMockingExtension.GetAsyncOperationStatus"); scope.Start(); try { diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3b91688e9110..000000000000 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Redis -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of RedisResources in the ResourceGroupResource. - /// An object representing collection of RedisResources and their operations over a RedisResource. - public virtual RedisCollection GetAllRedis() - { - return GetCachedClient(Client => new RedisCollection(Client, Id)); - } - } -} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs index 410a404b6f95..d117d3c3e597 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RedisFirewallRuleResources and their operations over a RedisFirewallRuleResource. public virtual RedisFirewallRuleCollection GetRedisFirewallRules() { - return GetCachedClient(Client => new RedisFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new RedisFirewallRuleCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual RedisFirewallRuleCollection GetRedisFirewallRules() /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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> GetRedisFirewallRuleAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetRedisFirewallR /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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 GetRedisFirewallRule(string ruleName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetRedisFirewallRule(string r /// An object representing collection of RedisPatchScheduleResources and their operations over a RedisPatchScheduleResource. public virtual RedisPatchScheduleCollection GetRedisPatchSchedules() { - return GetCachedClient(Client => new RedisPatchScheduleCollection(Client, Id)); + return GetCachedClient(client => new RedisPatchScheduleCollection(client, Id)); } /// @@ -200,7 +200,7 @@ public virtual Response GetRedisPatchSchedule(RedisP /// An object representing collection of RedisLinkedServerWithPropertyResources and their operations over a RedisLinkedServerWithPropertyResource. public virtual RedisLinkedServerWithPropertyCollection GetRedisLinkedServerWithProperties() { - return GetCachedClient(Client => new RedisLinkedServerWithPropertyCollection(Client, Id)); + return GetCachedClient(client => new RedisLinkedServerWithPropertyCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual RedisLinkedServerWithPropertyCollection GetRedisLinkedServerWithP /// /// The name of the linked server. /// The cancellation token to use. - /// 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> GetRedisLinkedServerWithPropertyAsync(string linkedServerName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetRe /// /// The name of the linked server. /// The cancellation token to use. - /// 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 GetRedisLinkedServerWithProperty(string linkedServerName, CancellationToken cancellationToken = default) { @@ -253,7 +253,7 @@ public virtual Response GetRedisLinkedSer /// An object representing collection of RedisPrivateEndpointConnectionResources and their operations over a RedisPrivateEndpointConnectionResource. public virtual RedisPrivateEndpointConnectionCollection GetRedisPrivateEndpointConnections() { - return GetCachedClient(Client => new RedisPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new RedisPrivateEndpointConnectionCollection(client, Id)); } /// @@ -271,8 +271,8 @@ public virtual RedisPrivateEndpointConnectionCollection GetRedisPrivateEndpointC /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetRedisPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -294,8 +294,8 @@ public virtual async Task> GetR /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetRedisPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseArmClientMockingExtension.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseArmClientMockingExtension.cs new file mode 100644 index 000000000000..02c42cdec619 --- /dev/null +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RedisEnterprise; + +namespace Azure.ResourceManager.RedisEnterprise.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RedisEnterpriseArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RedisEnterpriseArmClientMockingExtension() + { + } + + /// 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 RedisEnterpriseArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RedisEnterpriseArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(ResourceIdentifier id) + { + RedisEnterpriseClusterResource.ValidateResourceId(id); + return new RedisEnterpriseClusterResource(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 RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResource(ResourceIdentifier id) + { + RedisEnterpriseDatabaseResource.ValidateResourceId(id); + return new RedisEnterpriseDatabaseResource(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 RedisEnterprisePrivateEndpointConnectionResource GetRedisEnterprisePrivateEndpointConnectionResource(ResourceIdentifier id) + { + RedisEnterprisePrivateEndpointConnectionResource.ValidateResourceId(id); + return new RedisEnterprisePrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs index 9d821d222bb4..dac5d7cc43b6 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.RedisEnterprise.Mocking; using Azure.ResourceManager.RedisEnterprise.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.RedisEnterprise /// A class to add extension methods to Azure.ResourceManager.RedisEnterprise. public static partial class RedisEnterpriseExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RedisEnterpriseArmClientMockingExtension GetRedisEnterpriseArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RedisEnterpriseArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RedisEnterpriseResourceGroupMockingExtension GetRedisEnterpriseResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RedisEnterpriseResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RedisEnterpriseSubscriptionMockingExtension GetRedisEnterpriseSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RedisEnterpriseSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region RedisEnterpriseClusterResource /// /// 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. /// Returns a object. public static RedisEnterpriseClusterResource GetRedisEnterpriseClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisEnterpriseClusterResource.ValidateResourceId(id); - return new RedisEnterpriseClusterResource(client, id); - } - ); + return GetRedisEnterpriseArmClientMockingExtension(client).GetRedisEnterpriseClusterResource(id); } - #endregion - #region RedisEnterpriseDatabaseResource /// /// 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. /// Returns a object. public static RedisEnterpriseDatabaseResource GetRedisEnterpriseDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisEnterpriseDatabaseResource.ValidateResourceId(id); - return new RedisEnterpriseDatabaseResource(client, id); - } - ); + return GetRedisEnterpriseArmClientMockingExtension(client).GetRedisEnterpriseDatabaseResource(id); } - #endregion - #region RedisEnterprisePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static RedisEnterprisePrivateEndpointConnectionResource GetRedisEnterprisePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RedisEnterprisePrivateEndpointConnectionResource.ValidateResourceId(id); - return new RedisEnterprisePrivateEndpointConnectionResource(client, id); - } - ); + return GetRedisEnterpriseArmClientMockingExtension(client).GetRedisEnterprisePrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of RedisEnterpriseClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of RedisEnterpriseClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RedisEnterpriseClusterResources and their operations over a RedisEnterpriseClusterResource. public static RedisEnterpriseClusterCollection GetRedisEnterpriseClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRedisEnterpriseClusters(); + return GetRedisEnterpriseResourceGroupMockingExtension(resourceGroupResource).GetRedisEnterpriseClusters(); } /// @@ -127,16 +109,20 @@ public static RedisEnterpriseClusterCollection GetRedisEnterpriseClusters(this R /// RedisEnterprise_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the RedisEnterprise cluster. /// The cancellation token to use. - /// 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 static async Task> GetRedisEnterpriseClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRedisEnterpriseClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetRedisEnterpriseResourceGroupMockingExtension(resourceGroupResource).GetRedisEnterpriseClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -151,16 +137,20 @@ public static async Task> GetRedisEnter /// RedisEnterprise_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the RedisEnterprise cluster. /// The cancellation token to use. - /// 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 static Response GetRedisEnterpriseCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRedisEnterpriseClusters().Get(clusterName, cancellationToken); + return GetRedisEnterpriseResourceGroupMockingExtension(resourceGroupResource).GetRedisEnterpriseCluster(clusterName, cancellationToken); } /// @@ -175,6 +165,10 @@ public static Response GetRedisEnterpriseCluster /// OperationsStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -184,9 +178,7 @@ public static Response GetRedisEnterpriseCluster /// is null. public static async Task> GetRedisEnterpriseOperationsStatusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseOperationsStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); + return await GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseOperationsStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); } /// @@ -201,6 +193,10 @@ public static async Task> GetRedisEnter /// OperationsStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -210,9 +206,7 @@ public static async Task> GetRedisEnter /// is null. public static Response GetRedisEnterpriseOperationsStatus(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseOperationsStatus(location, operationId, cancellationToken); + return GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseOperationsStatus(location, operationId, cancellationToken); } /// @@ -227,13 +221,17 @@ public static Response GetRedisEnterpriseOperati /// RedisEnterprise_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRedisEnterpriseClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseClustersAsync(cancellationToken); + return GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseClustersAsync(cancellationToken); } /// @@ -248,13 +246,17 @@ public static AsyncPageable GetRedisEnterpriseCl /// RedisEnterprise_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRedisEnterpriseClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseClusters(cancellationToken); + return GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseClusters(cancellationToken); } /// @@ -269,6 +271,10 @@ public static Pageable GetRedisEnterpriseCluster /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -276,7 +282,7 @@ public static Pageable GetRedisEnterpriseCluster /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRedisEnterpriseSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseSkusAsync(location, cancellationToken); + return GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseSkusAsync(location, cancellationToken); } /// @@ -291,6 +297,10 @@ public static AsyncPageable GetRedisEnterpriseSk /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -298,7 +308,7 @@ public static AsyncPageable GetRedisEnterpriseSk /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRedisEnterpriseSkus(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRedisEnterpriseSkus(location, cancellationToken); + return GetRedisEnterpriseSubscriptionMockingExtension(subscriptionResource).GetRedisEnterpriseSkus(location, cancellationToken); } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseResourceGroupMockingExtension.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..40417c7c7605 --- /dev/null +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.RedisEnterprise; + +namespace Azure.ResourceManager.RedisEnterprise.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class RedisEnterpriseResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RedisEnterpriseResourceGroupMockingExtension() + { + } + + /// 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 RedisEnterpriseResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of RedisEnterpriseClusterResources in the ResourceGroupResource. + /// An object representing collection of RedisEnterpriseClusterResources and their operations over a RedisEnterpriseClusterResource. + public virtual RedisEnterpriseClusterCollection GetRedisEnterpriseClusters() + { + return GetCachedClient(client => new RedisEnterpriseClusterCollection(client, Id)); + } + + /// + /// Gets information about a RedisEnterprise cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName} + /// + /// + /// Operation Id + /// RedisEnterprise_Get + /// + /// + /// + /// The name of the RedisEnterprise cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRedisEnterpriseClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetRedisEnterpriseClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a RedisEnterprise cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName} + /// + /// + /// Operation Id + /// RedisEnterprise_Get + /// + /// + /// + /// The name of the RedisEnterprise cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRedisEnterpriseCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetRedisEnterpriseClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseSubscriptionMockingExtension.cs similarity index 85% rename from sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseSubscriptionMockingExtension.cs index 03154ad913ef..edf50ca9d070 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/RedisEnterpriseSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.RedisEnterprise; using Azure.ResourceManager.RedisEnterprise.Models; -namespace Azure.ResourceManager.RedisEnterprise +namespace Azure.ResourceManager.RedisEnterprise.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RedisEnterpriseSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _operationsStatusClientDiagnostics; private OperationsStatusRestOperations _operationsStatusRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _skusClientDiagnostics; private SkusRestOperations _skusRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RedisEnterpriseSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RedisEnterpriseSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,9 +69,13 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The name of Azure region. /// The ID of an ongoing async operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetRedisEnterpriseOperationsStatusAsync(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = OperationsStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRedisEnterpriseOperationsStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationsStatusClientDiagnostics.CreateScope("RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseOperationsStatus"); scope.Start(); try { @@ -100,9 +105,13 @@ public virtual async Task> GetRedisEnte /// The name of Azure region. /// The ID of an ongoing async operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetRedisEnterpriseOperationsStatus(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = OperationsStatusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRedisEnterpriseOperationsStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationsStatusClientDiagnostics.CreateScope("RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseOperationsStatus"); scope.Start(); try { @@ -135,7 +144,7 @@ public virtual AsyncPageable GetRedisEnterpriseC { HttpMessage FirstPageRequest(int? pageSizeHint) => RedisEnterpriseClusterRedisEnterpriseRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RedisEnterpriseClusterRedisEnterpriseRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisEnterpriseClusterResource(Client, RedisEnterpriseClusterData.DeserializeRedisEnterpriseClusterData(e)), RedisEnterpriseClusterRedisEnterpriseClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRedisEnterpriseClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisEnterpriseClusterResource(Client, RedisEnterpriseClusterData.DeserializeRedisEnterpriseClusterData(e)), RedisEnterpriseClusterRedisEnterpriseClientDiagnostics, Pipeline, "RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseClusters", "value", "nextLink", cancellationToken); } /// @@ -157,7 +166,7 @@ public virtual Pageable GetRedisEnterpriseCluste { HttpMessage FirstPageRequest(int? pageSizeHint) => RedisEnterpriseClusterRedisEnterpriseRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RedisEnterpriseClusterRedisEnterpriseRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisEnterpriseClusterResource(Client, RedisEnterpriseClusterData.DeserializeRedisEnterpriseClusterData(e)), RedisEnterpriseClusterRedisEnterpriseClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRedisEnterpriseClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisEnterpriseClusterResource(Client, RedisEnterpriseClusterData.DeserializeRedisEnterpriseClusterData(e)), RedisEnterpriseClusterRedisEnterpriseClientDiagnostics, Pipeline, "RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseClusters", "value", "nextLink", cancellationToken); } /// @@ -179,7 +188,7 @@ public virtual Pageable GetRedisEnterpriseCluste public virtual AsyncPageable GetRedisEnterpriseSkusAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, RedisEnterpriseRegionSkuDetail.DeserializeRedisEnterpriseRegionSkuDetail, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRedisEnterpriseSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, RedisEnterpriseRegionSkuDetail.DeserializeRedisEnterpriseRegionSkuDetail, SkusClientDiagnostics, Pipeline, "RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseSkus", "value", null, cancellationToken); } /// @@ -201,7 +210,7 @@ public virtual AsyncPageable GetRedisEnterpriseS public virtual Pageable GetRedisEnterpriseSkus(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, RedisEnterpriseRegionSkuDetail.DeserializeRedisEnterpriseRegionSkuDetail, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRedisEnterpriseSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, RedisEnterpriseRegionSkuDetail.DeserializeRedisEnterpriseRegionSkuDetail, SkusClientDiagnostics, Pipeline, "RedisEnterpriseSubscriptionMockingExtension.GetRedisEnterpriseSkus", "value", null, cancellationToken); } } } diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 643384b3cc58..000000000000 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.RedisEnterprise -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of RedisEnterpriseClusterResources in the ResourceGroupResource. - /// An object representing collection of RedisEnterpriseClusterResources and their operations over a RedisEnterpriseClusterResource. - public virtual RedisEnterpriseClusterCollection GetRedisEnterpriseClusters() - { - return GetCachedClient(Client => new RedisEnterpriseClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs index a11ebb289fea..6bff9a04a331 100644 --- a/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs +++ b/sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/src/Generated/RedisEnterpriseClusterResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RedisEnterpriseDatabaseResources and their operations over a RedisEnterpriseDatabaseResource. public virtual RedisEnterpriseDatabaseCollection GetRedisEnterpriseDatabases() { - return GetCachedClient(Client => new RedisEnterpriseDatabaseCollection(Client, Id)); + return GetCachedClient(client => new RedisEnterpriseDatabaseCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual RedisEnterpriseDatabaseCollection GetRedisEnterpriseDatabases() /// /// The name of the database. /// The cancellation token to use. - /// 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> GetRedisEnterpriseDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetRedisEnt /// /// The name of the database. /// The cancellation token to use. - /// 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 GetRedisEnterpriseDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetRedisEnterpriseDatab /// An object representing collection of RedisEnterprisePrivateEndpointConnectionResources and their operations over a RedisEnterprisePrivateEndpointConnectionResource. public virtual RedisEnterprisePrivateEndpointConnectionCollection GetRedisEnterprisePrivateEndpointConnections() { - return GetCachedClient(Client => new RedisEnterprisePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new RedisEnterprisePrivateEndpointConnectionCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual RedisEnterprisePrivateEndpointConnectionCollection GetRedisEnterp /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetRedisEnterprisePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetRedisEnterprisePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayArmClientMockingExtension.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayArmClientMockingExtension.cs new file mode 100644 index 000000000000..b7beca7b64f1 --- /dev/null +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Relay; + +namespace Azure.ResourceManager.Relay.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class RelayArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RelayArmClientMockingExtension() + { + } + + /// 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 RelayArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal RelayArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RelayNamespaceAuthorizationRuleResource GetRelayNamespaceAuthorizationRuleResource(ResourceIdentifier id) + { + RelayNamespaceAuthorizationRuleResource.ValidateResourceId(id); + return new RelayNamespaceAuthorizationRuleResource(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 RelayHybridConnectionAuthorizationRuleResource GetRelayHybridConnectionAuthorizationRuleResource(ResourceIdentifier id) + { + RelayHybridConnectionAuthorizationRuleResource.ValidateResourceId(id); + return new RelayHybridConnectionAuthorizationRuleResource(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 WcfRelayAuthorizationRuleResource GetWcfRelayAuthorizationRuleResource(ResourceIdentifier id) + { + WcfRelayAuthorizationRuleResource.ValidateResourceId(id); + return new WcfRelayAuthorizationRuleResource(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 RelayNamespaceResource GetRelayNamespaceResource(ResourceIdentifier id) + { + RelayNamespaceResource.ValidateResourceId(id); + return new RelayNamespaceResource(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 RelayNetworkRuleSetResource GetRelayNetworkRuleSetResource(ResourceIdentifier id) + { + RelayNetworkRuleSetResource.ValidateResourceId(id); + return new RelayNetworkRuleSetResource(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 RelayHybridConnectionResource GetRelayHybridConnectionResource(ResourceIdentifier id) + { + RelayHybridConnectionResource.ValidateResourceId(id); + return new RelayHybridConnectionResource(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 WcfRelayResource GetWcfRelayResource(ResourceIdentifier id) + { + WcfRelayResource.ValidateResourceId(id); + return new WcfRelayResource(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 RelayPrivateEndpointConnectionResource GetRelayPrivateEndpointConnectionResource(ResourceIdentifier id) + { + RelayPrivateEndpointConnectionResource.ValidateResourceId(id); + return new RelayPrivateEndpointConnectionResource(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 RelayPrivateLinkResource GetRelayPrivateLinkResource(ResourceIdentifier id) + { + RelayPrivateLinkResource.ValidateResourceId(id); + return new RelayPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayExtensions.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayExtensions.cs index 4ce1952a888d..2dd0d435841e 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayExtensions.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Relay.Mocking; using Azure.ResourceManager.Relay.Models; using Azure.ResourceManager.Resources; @@ -19,214 +20,177 @@ namespace Azure.ResourceManager.Relay /// A class to add extension methods to Azure.ResourceManager.Relay. public static partial class RelayExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static RelayArmClientMockingExtension GetRelayArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new RelayArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static RelayResourceGroupMockingExtension GetRelayResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new RelayResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static RelaySubscriptionMockingExtension GetRelaySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new RelaySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region RelayNamespaceAuthorizationRuleResource /// /// 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. /// Returns a object. public static RelayNamespaceAuthorizationRuleResource GetRelayNamespaceAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayNamespaceAuthorizationRuleResource.ValidateResourceId(id); - return new RelayNamespaceAuthorizationRuleResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayNamespaceAuthorizationRuleResource(id); } - #endregion - #region RelayHybridConnectionAuthorizationRuleResource /// /// 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. /// Returns a object. public static RelayHybridConnectionAuthorizationRuleResource GetRelayHybridConnectionAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayHybridConnectionAuthorizationRuleResource.ValidateResourceId(id); - return new RelayHybridConnectionAuthorizationRuleResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayHybridConnectionAuthorizationRuleResource(id); } - #endregion - #region WcfRelayAuthorizationRuleResource /// /// 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. /// Returns a object. public static WcfRelayAuthorizationRuleResource GetWcfRelayAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WcfRelayAuthorizationRuleResource.ValidateResourceId(id); - return new WcfRelayAuthorizationRuleResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetWcfRelayAuthorizationRuleResource(id); } - #endregion - #region RelayNamespaceResource /// /// 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. /// Returns a object. public static RelayNamespaceResource GetRelayNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayNamespaceResource.ValidateResourceId(id); - return new RelayNamespaceResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayNamespaceResource(id); } - #endregion - #region RelayNetworkRuleSetResource /// /// 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. /// Returns a object. public static RelayNetworkRuleSetResource GetRelayNetworkRuleSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayNetworkRuleSetResource.ValidateResourceId(id); - return new RelayNetworkRuleSetResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayNetworkRuleSetResource(id); } - #endregion - #region RelayHybridConnectionResource /// /// 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. /// Returns a object. public static RelayHybridConnectionResource GetRelayHybridConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayHybridConnectionResource.ValidateResourceId(id); - return new RelayHybridConnectionResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayHybridConnectionResource(id); } - #endregion - #region WcfRelayResource /// /// 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. /// Returns a object. public static WcfRelayResource GetWcfRelayResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WcfRelayResource.ValidateResourceId(id); - return new WcfRelayResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetWcfRelayResource(id); } - #endregion - #region RelayPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static RelayPrivateEndpointConnectionResource GetRelayPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayPrivateEndpointConnectionResource.ValidateResourceId(id); - return new RelayPrivateEndpointConnectionResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayPrivateEndpointConnectionResource(id); } - #endregion - #region RelayPrivateLinkResource /// /// 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. /// Returns a object. public static RelayPrivateLinkResource GetRelayPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelayPrivateLinkResource.ValidateResourceId(id); - return new RelayPrivateLinkResource(client, id); - } - ); + return GetRelayArmClientMockingExtension(client).GetRelayPrivateLinkResource(id); } - #endregion - /// Gets a collection of RelayNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of RelayNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RelayNamespaceResources and their operations over a RelayNamespaceResource. public static RelayNamespaceCollection GetRelayNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRelayNamespaces(); + return GetRelayResourceGroupMockingExtension(resourceGroupResource).GetRelayNamespaces(); } /// @@ -241,16 +205,20 @@ public static RelayNamespaceCollection GetRelayNamespaces(this ResourceGroupReso /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static async Task> GetRelayNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRelayNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetRelayResourceGroupMockingExtension(resourceGroupResource).GetRelayNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -265,16 +233,20 @@ public static async Task> GetRelayNamespaceAsyn /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static Response GetRelayNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRelayNamespaces().Get(namespaceName, cancellationToken); + return GetRelayResourceGroupMockingExtension(resourceGroupResource).GetRelayNamespace(namespaceName, cancellationToken); } /// @@ -289,6 +261,10 @@ public static Response GetRelayNamespace(this ResourceGr /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the specified namespace name. @@ -296,9 +272,7 @@ public static Response GetRelayNamespace(this ResourceGr /// is null. public static async Task> CheckRelayNamespaceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, RelayNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckRelayNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetRelaySubscriptionMockingExtension(subscriptionResource).CheckRelayNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -313,6 +287,10 @@ public static async Task> CheckRelayNamesp /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the specified namespace name. @@ -320,9 +298,7 @@ public static async Task> CheckRelayNamesp /// is null. public static Response CheckRelayNamespaceNameAvailability(this SubscriptionResource subscriptionResource, RelayNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckRelayNamespaceNameAvailability(content, cancellationToken); + return GetRelaySubscriptionMockingExtension(subscriptionResource).CheckRelayNamespaceNameAvailability(content, cancellationToken); } /// @@ -337,13 +313,17 @@ public static Response CheckRelayNamespaceNameAvail /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRelayNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRelayNamespacesAsync(cancellationToken); + return GetRelaySubscriptionMockingExtension(subscriptionResource).GetRelayNamespacesAsync(cancellationToken); } /// @@ -358,13 +338,17 @@ public static AsyncPageable GetRelayNamespacesAsync(this /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRelayNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRelayNamespaces(cancellationToken); + return GetRelaySubscriptionMockingExtension(subscriptionResource).GetRelayNamespaces(cancellationToken); } } } diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayResourceGroupMockingExtension.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f61caa842f3a --- /dev/null +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelayResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Relay; + +namespace Azure.ResourceManager.Relay.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class RelayResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected RelayResourceGroupMockingExtension() + { + } + + /// 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 RelayResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of RelayNamespaceResources in the ResourceGroupResource. + /// An object representing collection of RelayNamespaceResources and their operations over a RelayNamespaceResource. + public virtual RelayNamespaceCollection GetRelayNamespaces() + { + return GetCachedClient(client => new RelayNamespaceCollection(client, Id)); + } + + /// + /// Returns the description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRelayNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + { + return await GetRelayNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRelayNamespace(string namespaceName, CancellationToken cancellationToken = default) + { + return GetRelayNamespaces().Get(namespaceName, cancellationToken); + } + } +} diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelaySubscriptionMockingExtension.cs similarity index 85% rename from sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelaySubscriptionMockingExtension.cs index 597334524cde..364d82924c3d 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/RelaySubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Relay; using Azure.ResourceManager.Relay.Models; -namespace Azure.ResourceManager.Relay +namespace Azure.ResourceManager.Relay.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class RelaySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _relayNamespaceNamespacesClientDiagnostics; private NamespacesRestOperations _relayNamespaceNamespacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected RelaySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal RelaySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,9 +60,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Parameters to check availability of the specified namespace name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckRelayNamespaceNameAvailabilityAsync(RelayNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RelayNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckRelayNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RelayNamespaceNamespacesClientDiagnostics.CreateScope("RelaySubscriptionMockingExtension.CheckRelayNamespaceNameAvailability"); scope.Start(); try { @@ -90,9 +94,12 @@ public virtual async Task> CheckRelayNames /// /// Parameters to check availability of the specified namespace name. /// The cancellation token to use. + /// is null. public virtual Response CheckRelayNamespaceNameAvailability(RelayNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = RelayNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckRelayNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = RelayNamespaceNamespacesClientDiagnostics.CreateScope("RelaySubscriptionMockingExtension.CheckRelayNamespaceNameAvailability"); scope.Start(); try { @@ -125,7 +132,7 @@ public virtual AsyncPageable GetRelayNamespacesAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => RelayNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RelayNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RelayNamespaceResource(Client, RelayNamespaceData.DeserializeRelayNamespaceData(e)), RelayNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRelayNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RelayNamespaceResource(Client, RelayNamespaceData.DeserializeRelayNamespaceData(e)), RelayNamespaceNamespacesClientDiagnostics, Pipeline, "RelaySubscriptionMockingExtension.GetRelayNamespaces", "value", "nextLink", cancellationToken); } /// @@ -147,7 +154,7 @@ public virtual Pageable GetRelayNamespaces(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => RelayNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RelayNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RelayNamespaceResource(Client, RelayNamespaceData.DeserializeRelayNamespaceData(e)), RelayNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRelayNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RelayNamespaceResource(Client, RelayNamespaceData.DeserializeRelayNamespaceData(e)), RelayNamespaceNamespacesClientDiagnostics, Pipeline, "RelaySubscriptionMockingExtension.GetRelayNamespaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 18e6c2bb452d..000000000000 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Relay -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of RelayNamespaceResources in the ResourceGroupResource. - /// An object representing collection of RelayNamespaceResources and their operations over a RelayNamespaceResource. - public virtual RelayNamespaceCollection GetRelayNamespaces() - { - return GetCachedClient(Client => new RelayNamespaceCollection(Client, Id)); - } - } -} diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayHybridConnectionResource.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayHybridConnectionResource.cs index cf76f2701a7d..8c4f64abd0d6 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayHybridConnectionResource.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayHybridConnectionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RelayHybridConnectionAuthorizationRuleResources and their operations over a RelayHybridConnectionAuthorizationRuleResource. public virtual RelayHybridConnectionAuthorizationRuleCollection GetRelayHybridConnectionAuthorizationRules() { - return GetCachedClient(Client => new RelayHybridConnectionAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new RelayHybridConnectionAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual RelayHybridConnectionAuthorizationRuleCollection GetRelayHybridCo /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetRelayHybridConnectionAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// The authorization rule name. /// The cancellation token to use. - /// 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 GetRelayHybridConnectionAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNamespaceResource.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNamespaceResource.cs index 5fd5c261f281..8612bda9cbec 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNamespaceResource.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/RelayNamespaceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RelayNamespaceAuthorizationRuleResources and their operations over a RelayNamespaceAuthorizationRuleResource. public virtual RelayNamespaceAuthorizationRuleCollection GetRelayNamespaceAuthorizationRules() { - return GetCachedClient(Client => new RelayNamespaceAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new RelayNamespaceAuthorizationRuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual RelayNamespaceAuthorizationRuleCollection GetRelayNamespaceAuthor /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetRelayNamespaceAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Get /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetRelayNamespaceAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -153,7 +153,7 @@ public virtual RelayNetworkRuleSetResource GetRelayNetworkRuleSet() /// An object representing collection of RelayHybridConnectionResources and their operations over a RelayHybridConnectionResource. public virtual RelayHybridConnectionCollection GetRelayHybridConnections() { - return GetCachedClient(Client => new RelayHybridConnectionCollection(Client, Id)); + return GetCachedClient(client => new RelayHybridConnectionCollection(client, Id)); } /// @@ -171,8 +171,8 @@ public virtual RelayHybridConnectionCollection GetRelayHybridConnections() /// /// The hybrid connection name. /// The cancellation token to use. - /// 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> GetRelayHybridConnectionAsync(string hybridConnectionName, CancellationToken cancellationToken = default) { @@ -194,8 +194,8 @@ public virtual async Task> GetRelayHybri /// /// The hybrid connection name. /// The cancellation token to use. - /// 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 GetRelayHybridConnection(string hybridConnectionName, CancellationToken cancellationToken = default) { @@ -206,7 +206,7 @@ public virtual Response GetRelayHybridConnection( /// An object representing collection of WcfRelayResources and their operations over a WcfRelayResource. public virtual WcfRelayCollection GetWcfRelays() { - return GetCachedClient(Client => new WcfRelayCollection(Client, Id)); + return GetCachedClient(client => new WcfRelayCollection(client, Id)); } /// @@ -224,8 +224,8 @@ public virtual WcfRelayCollection GetWcfRelays() /// /// The relay name. /// The cancellation token to use. - /// 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> GetWcfRelayAsync(string relayName, CancellationToken cancellationToken = default) { @@ -247,8 +247,8 @@ public virtual async Task> GetWcfRelayAsync(string re /// /// The relay name. /// The cancellation token to use. - /// 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 GetWcfRelay(string relayName, CancellationToken cancellationToken = default) { @@ -259,7 +259,7 @@ public virtual Response GetWcfRelay(string relayName, Cancella /// An object representing collection of RelayPrivateEndpointConnectionResources and their operations over a RelayPrivateEndpointConnectionResource. public virtual RelayPrivateEndpointConnectionCollection GetRelayPrivateEndpointConnections() { - return GetCachedClient(Client => new RelayPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new RelayPrivateEndpointConnectionCollection(client, Id)); } /// @@ -277,8 +277,8 @@ public virtual RelayPrivateEndpointConnectionCollection GetRelayPrivateEndpointC /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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> GetRelayPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -300,8 +300,8 @@ public virtual async Task> GetR /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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 GetRelayPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -312,7 +312,7 @@ public virtual Response GetRelayPrivateE /// An object representing collection of RelayPrivateLinkResources and their operations over a RelayPrivateLinkResource. public virtual RelayPrivateLinkResourceCollection GetRelayPrivateLinkResources() { - return GetCachedClient(Client => new RelayPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new RelayPrivateLinkResourceCollection(client, Id)); } /// @@ -330,8 +330,8 @@ public virtual RelayPrivateLinkResourceCollection GetRelayPrivateLinkResources() /// /// The PrivateLinkResource name. /// The cancellation token to use. - /// 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> GetRelayPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -353,8 +353,8 @@ public virtual async Task> GetRelayPrivateLin /// /// The PrivateLinkResource name. /// The cancellation token to use. - /// 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 GetRelayPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/WcfRelayResource.cs b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/WcfRelayResource.cs index b719d9e8d226..e42acd13684a 100644 --- a/sdk/relay/Azure.ResourceManager.Relay/src/Generated/WcfRelayResource.cs +++ b/sdk/relay/Azure.ResourceManager.Relay/src/Generated/WcfRelayResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WcfRelayAuthorizationRuleResources and their operations over a WcfRelayAuthorizationRuleResource. public virtual WcfRelayAuthorizationRuleCollection GetWcfRelayAuthorizationRules() { - return GetCachedClient(Client => new WcfRelayAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new WcfRelayAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual WcfRelayAuthorizationRuleCollection GetWcfRelayAuthorizationRules /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetWcfRelayAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetWcfRel /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetWcfRelayAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsArmClientMockingExtension.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsArmClientMockingExtension.cs new file mode 100644 index 000000000000..b0c145e014f2 --- /dev/null +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Reservations; + +namespace Azure.ResourceManager.Reservations.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ReservationsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ReservationsArmClientMockingExtension() + { + } + + /// 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 ReservationsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ReservationsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ReservationDetailResource GetReservationDetailResource(ResourceIdentifier id) + { + ReservationDetailResource.ValidateResourceId(id); + return new ReservationDetailResource(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 ReservationOrderResource GetReservationOrderResource(ResourceIdentifier id) + { + ReservationOrderResource.ValidateResourceId(id); + return new ReservationOrderResource(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 ReservationQuotaResource GetReservationQuotaResource(ResourceIdentifier id) + { + ReservationQuotaResource.ValidateResourceId(id); + return new ReservationQuotaResource(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 QuotaRequestDetailResource GetQuotaRequestDetailResource(ResourceIdentifier id) + { + QuotaRequestDetailResource.ValidateResourceId(id); + return new QuotaRequestDetailResource(Client, id); + } + } +} diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsExtensions.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsExtensions.cs index ea71a9bc1f51..64a13f301a4b 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsExtensions.cs +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Reservations.Mocking; using Azure.ResourceManager.Reservations.Models; using Azure.ResourceManager.Resources; @@ -19,125 +20,101 @@ namespace Azure.ResourceManager.Reservations /// A class to add extension methods to Azure.ResourceManager.Reservations. public static partial class ReservationsExtensions { - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ReservationsArmClientMockingExtension GetReservationsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ReservationsArmClientMockingExtension(client0)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ReservationsSubscriptionMockingExtension GetReservationsSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ReservationsSubscriptionMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static ReservationsTenantMockingExtension GetReservationsTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ReservationsTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region ReservationDetailResource /// /// 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. /// Returns a object. public static ReservationDetailResource GetReservationDetailResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReservationDetailResource.ValidateResourceId(id); - return new ReservationDetailResource(client, id); - } - ); + return GetReservationsArmClientMockingExtension(client).GetReservationDetailResource(id); } - #endregion - #region ReservationOrderResource /// /// 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. /// Returns a object. public static ReservationOrderResource GetReservationOrderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReservationOrderResource.ValidateResourceId(id); - return new ReservationOrderResource(client, id); - } - ); + return GetReservationsArmClientMockingExtension(client).GetReservationOrderResource(id); } - #endregion - #region ReservationQuotaResource /// /// 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. /// Returns a object. public static ReservationQuotaResource GetReservationQuotaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ReservationQuotaResource.ValidateResourceId(id); - return new ReservationQuotaResource(client, id); - } - ); + return GetReservationsArmClientMockingExtension(client).GetReservationQuotaResource(id); } - #endregion - #region QuotaRequestDetailResource /// /// 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. /// Returns a object. public static QuotaRequestDetailResource GetQuotaRequestDetailResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - QuotaRequestDetailResource.ValidateResourceId(id); - return new QuotaRequestDetailResource(client, id); - } - ); + return GetReservationsArmClientMockingExtension(client).GetQuotaRequestDetailResource(id); } - #endregion - /// Gets a collection of ReservationQuotaResources in the SubscriptionResource. + /// + /// Gets a collection of ReservationQuotaResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReservationQuotaResources and their operations over a ReservationQuotaResource. public static ReservationQuotaCollection GetAllReservationQuota(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location) { - Argument.AssertNotNullOrEmpty(providerId, nameof(providerId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllReservationQuota(providerId, location); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetAllReservationQuota(providerId, location); } /// @@ -152,18 +129,22 @@ public static ReservationQuotaCollection GetAllReservationQuota(this Subscriptio /// Quota_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. /// The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetReservationQuotaAsync(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location, string resourceName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAllReservationQuota(providerId, location).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetReservationsSubscriptionMockingExtension(subscriptionResource).GetReservationQuotaAsync(providerId, location, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -178,32 +159,40 @@ public static async Task> GetReservationQuota /// Quota_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. /// The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetReservationQuota(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location, string resourceName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAllReservationQuota(providerId, location).Get(resourceName, cancellationToken); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetReservationQuota(providerId, location, resourceName, cancellationToken); } - /// Gets a collection of QuotaRequestDetailResources in the SubscriptionResource. + /// + /// Gets a collection of QuotaRequestDetailResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of QuotaRequestDetailResources and their operations over a QuotaRequestDetailResource. public static QuotaRequestDetailCollection GetQuotaRequestDetails(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location) { - Argument.AssertNotNullOrEmpty(providerId, nameof(providerId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetQuotaRequestDetails(providerId, location); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetQuotaRequestDetails(providerId, location); } /// @@ -218,18 +207,22 @@ public static QuotaRequestDetailCollection GetQuotaRequestDetails(this Subscript /// QuotaRequestStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. /// Quota Request ID. /// The cancellation token to use. - /// 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 static async Task> GetQuotaRequestDetailAsync(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location, Guid id, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetQuotaRequestDetails(providerId, location).GetAsync(id, cancellationToken).ConfigureAwait(false); + return await GetReservationsSubscriptionMockingExtension(subscriptionResource).GetQuotaRequestDetailAsync(providerId, location, id, cancellationToken).ConfigureAwait(false); } /// @@ -244,18 +237,22 @@ public static async Task> GetQuotaRequestDe /// QuotaRequestStatus_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Azure resource provider ID. /// Azure region. /// Quota Request ID. /// The cancellation token to use. - /// 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 static Response GetQuotaRequestDetail(this SubscriptionResource subscriptionResource, string providerId, AzureLocation location, Guid id, CancellationToken cancellationToken = default) { - return subscriptionResource.GetQuotaRequestDetails(providerId, location).Get(id, cancellationToken); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetQuotaRequestDetail(providerId, location, id, cancellationToken); } /// @@ -270,6 +267,10 @@ public static Response GetQuotaRequestDetail(this Su /// GetCatalog /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -277,9 +278,7 @@ public static Response GetQuotaRequestDetail(this Su /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCatalogAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetCatalogOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetCatalogOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCatalogAsync(options, cancellationToken); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetCatalogAsync(options, cancellationToken); } /// @@ -294,6 +293,10 @@ public static AsyncPageable GetCatalogAsync(this Subscriptio /// GetCatalog /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -301,9 +304,7 @@ public static AsyncPageable GetCatalogAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCatalog(this SubscriptionResource subscriptionResource, SubscriptionResourceGetCatalogOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetCatalogOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCatalog(options, cancellationToken); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetCatalog(options, cancellationToken); } /// @@ -318,12 +319,16 @@ public static Pageable GetCatalog(this SubscriptionResource /// GetAppliedReservationList /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetAppliedReservationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppliedReservationsAsync(cancellationToken).ConfigureAwait(false); + return await GetReservationsSubscriptionMockingExtension(subscriptionResource).GetAppliedReservationsAsync(cancellationToken).ConfigureAwait(false); } /// @@ -338,20 +343,30 @@ public static async Task> GetAppliedReservation /// GetAppliedReservationList /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetAppliedReservations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAppliedReservations(cancellationToken); + return GetReservationsSubscriptionMockingExtension(subscriptionResource).GetAppliedReservations(cancellationToken); } - /// Gets a collection of ReservationOrderResources in the TenantResource. + /// + /// Gets a collection of ReservationOrderResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ReservationOrderResources and their operations over a ReservationOrderResource. public static ReservationOrderCollection GetReservationOrders(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetReservationOrders(); + return GetReservationsTenantMockingExtension(tenantResource).GetReservationOrders(); } /// @@ -366,6 +381,10 @@ public static ReservationOrderCollection GetReservationOrders(this TenantResourc /// ReservationOrder_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Order Id of the reservation. @@ -374,7 +393,7 @@ public static ReservationOrderCollection GetReservationOrders(this TenantResourc [ForwardsClientCalls] public static async Task> GetReservationOrderAsync(this TenantResource tenantResource, Guid reservationOrderId, string expand = null, CancellationToken cancellationToken = default) { - return await tenantResource.GetReservationOrders().GetAsync(reservationOrderId, expand, cancellationToken).ConfigureAwait(false); + return await GetReservationsTenantMockingExtension(tenantResource).GetReservationOrderAsync(reservationOrderId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -389,6 +408,10 @@ public static async Task> GetReservationOrder /// ReservationOrder_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Order Id of the reservation. @@ -397,7 +420,7 @@ public static async Task> GetReservationOrder [ForwardsClientCalls] public static Response GetReservationOrder(this TenantResource tenantResource, Guid reservationOrderId, string expand = null, CancellationToken cancellationToken = default) { - return tenantResource.GetReservationOrders().Get(reservationOrderId, expand, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).GetReservationOrder(reservationOrderId, expand, cancellationToken); } /// @@ -412,6 +435,10 @@ public static Response GetReservationOrder(this Tenant /// Reservation_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -419,9 +446,7 @@ public static Response GetReservationOrder(this Tenant /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetReservationDetailsAsync(this TenantResource tenantResource, TenantResourceGetReservationDetailsOptions options, CancellationToken cancellationToken = default) { - options ??= new TenantResourceGetReservationDetailsOptions(); - - return GetTenantResourceExtensionClient(tenantResource).GetReservationDetailsAsync(options, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).GetReservationDetailsAsync(options, cancellationToken); } /// @@ -436,6 +461,10 @@ public static AsyncPageable GetReservationDetailsAsyn /// Reservation_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -443,9 +472,7 @@ public static AsyncPageable GetReservationDetailsAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetReservationDetails(this TenantResource tenantResource, TenantResourceGetReservationDetailsOptions options, CancellationToken cancellationToken = default) { - options ??= new TenantResourceGetReservationDetailsOptions(); - - return GetTenantResourceExtensionClient(tenantResource).GetReservationDetails(options, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).GetReservationDetails(options, cancellationToken); } /// @@ -460,6 +487,10 @@ public static Pageable GetReservationDetails(this Ten /// ReservationOrder_Calculate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information needed for calculate or purchase reservation. @@ -467,9 +498,7 @@ public static Pageable GetReservationDetails(this Ten /// is null. public static async Task> CalculateReservationOrderAsync(this TenantResource tenantResource, ReservationPurchaseContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CalculateReservationOrderAsync(content, cancellationToken).ConfigureAwait(false); + return await GetReservationsTenantMockingExtension(tenantResource).CalculateReservationOrderAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -484,6 +513,10 @@ public static async Task> CalculateReservationOrd /// ReservationOrder_Calculate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Information needed for calculate or purchase reservation. @@ -491,9 +524,7 @@ public static async Task> CalculateReservationOrd /// is null. public static Response CalculateReservationOrder(this TenantResource tenantResource, ReservationPurchaseContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CalculateReservationOrder(content, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).CalculateReservationOrder(content, cancellationToken); } /// @@ -509,6 +540,10 @@ public static Response CalculateReservationOrder(this Tena /// CalculateExchange_Post /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -517,9 +552,7 @@ public static Response CalculateReservationOrder(this Tena /// is null. public static async Task> CalculateReservationExchangeAsync(this TenantResource tenantResource, WaitUntil waitUntil, CalculateExchangeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CalculateReservationExchangeAsync(waitUntil, content, cancellationToken).ConfigureAwait(false); + return await GetReservationsTenantMockingExtension(tenantResource).CalculateReservationExchangeAsync(waitUntil, content, cancellationToken).ConfigureAwait(false); } /// @@ -535,6 +568,10 @@ public static async Task> CalculateReserva /// CalculateExchange_Post /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -543,9 +580,7 @@ public static async Task> CalculateReserva /// is null. public static ArmOperation CalculateReservationExchange(this TenantResource tenantResource, WaitUntil waitUntil, CalculateExchangeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CalculateReservationExchange(waitUntil, content, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).CalculateReservationExchange(waitUntil, content, cancellationToken); } /// @@ -561,6 +596,10 @@ public static ArmOperation CalculateReservationExchange /// Exchange_Post /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -569,9 +608,7 @@ public static ArmOperation CalculateReservationExchange /// is null. public static async Task> ExchangeAsync(this TenantResource tenantResource, WaitUntil waitUntil, ExchangeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).ExchangeAsync(waitUntil, content, cancellationToken).ConfigureAwait(false); + return await GetReservationsTenantMockingExtension(tenantResource).ExchangeAsync(waitUntil, content, cancellationToken).ConfigureAwait(false); } /// @@ -587,6 +624,10 @@ public static async Task> ExchangeAsync(this Tenant /// Exchange_Post /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -595,9 +636,7 @@ public static async Task> ExchangeAsync(this Tenant /// is null. public static ArmOperation Exchange(this TenantResource tenantResource, WaitUntil waitUntil, ExchangeContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).Exchange(waitUntil, content, cancellationToken); + return GetReservationsTenantMockingExtension(tenantResource).Exchange(waitUntil, content, cancellationToken); } } } diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsSubscriptionMockingExtension.cs similarity index 51% rename from sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsSubscriptionMockingExtension.cs index 90e9f26c50fa..c77cc2198e6b 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Reservations; using Azure.ResourceManager.Reservations.Models; -namespace Azure.ResourceManager.Reservations +namespace Azure.ResourceManager.Reservations.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ReservationsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private AzureReservationAPIRestOperations _defaultRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ReservationsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ReservationsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,21 +48,125 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Gets a collection of ReservationQuotaResources in the SubscriptionResource. /// Azure resource provider ID. /// Azure region. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of ReservationQuotaResources and their operations over a ReservationQuotaResource. public virtual ReservationQuotaCollection GetAllReservationQuota(string providerId, AzureLocation location) { return new ReservationQuotaCollection(Client, Id, providerId, location); } + /// + /// Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to submit quota update request. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName} + /// + /// + /// Operation Id + /// Quota_Get + /// + /// + /// + /// Azure resource provider ID. + /// Azure region. + /// The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReservationQuotaAsync(string providerId, AzureLocation location, string resourceName, CancellationToken cancellationToken = default) + { + return await GetAllReservationQuota(providerId, location).GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the current quota (service limit) and usage of a resource. You can use the response from the GET operation to submit quota update request. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName} + /// + /// + /// Operation Id + /// Quota_Get + /// + /// + /// + /// Azure resource provider ID. + /// Azure region. + /// The resource name for a resource provider, such as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReservationQuota(string providerId, AzureLocation location, string resourceName, CancellationToken cancellationToken = default) + { + return GetAllReservationQuota(providerId, location).Get(resourceName, cancellationToken); + } + /// Gets a collection of QuotaRequestDetailResources in the SubscriptionResource. /// Azure resource provider ID. /// Azure region. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of QuotaRequestDetailResources and their operations over a QuotaRequestDetailResource. public virtual QuotaRequestDetailCollection GetQuotaRequestDetails(string providerId, AzureLocation location) { return new QuotaRequestDetailCollection(Client, Id, providerId, location); } + /// + /// For the specified Azure region (location), get the details and status of the quota request by the quota request ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response with the requestId parameter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id} + /// + /// + /// Operation Id + /// QuotaRequestStatus_Get + /// + /// + /// + /// Azure resource provider ID. + /// Azure region. + /// Quota Request ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetQuotaRequestDetailAsync(string providerId, AzureLocation location, Guid id, CancellationToken cancellationToken = default) + { + return await GetQuotaRequestDetails(providerId, location).GetAsync(id, cancellationToken).ConfigureAwait(false); + } + + /// + /// For the specified Azure region (location), get the details and status of the quota request by the quota request ID for the resources of the resource provider. The PUT request for the quota (service limit) returns a response with the requestId parameter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id} + /// + /// + /// Operation Id + /// QuotaRequestStatus_Get + /// + /// + /// + /// Azure resource provider ID. + /// Azure region. + /// Quota Request ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetQuotaRequestDetail(string providerId, AzureLocation location, Guid id, CancellationToken cancellationToken = default) + { + return GetQuotaRequestDetails(providerId, location).Get(id, cancellationToken); + } + /// /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. /// @@ -80,9 +185,11 @@ public virtual QuotaRequestDetailCollection GetQuotaRequestDetails(string provid /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetCatalogAsync(SubscriptionResourceGetCatalogOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetCatalogOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateGetCatalogRequest(Id.SubscriptionId, options.ReservedResourceType, options.Location, options.PublisherId, options.OfferId, options.PlanId, options.Filter, options.Skip, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateGetCatalogNextPageRequest(nextLink, Id.SubscriptionId, options.ReservedResourceType, options.Location, options.PublisherId, options.OfferId, options.PlanId, options.Filter, options.Skip, options.Take); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ReservationCatalog.DeserializeReservationCatalog, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCatalog", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ReservationCatalog.DeserializeReservationCatalog, DefaultClientDiagnostics, Pipeline, "ReservationsSubscriptionMockingExtension.GetCatalog", "value", "nextLink", cancellationToken); } /// @@ -103,9 +210,11 @@ public virtual AsyncPageable GetCatalogAsync(SubscriptionRes /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetCatalog(SubscriptionResourceGetCatalogOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetCatalogOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateGetCatalogRequest(Id.SubscriptionId, options.ReservedResourceType, options.Location, options.PublisherId, options.OfferId, options.PlanId, options.Filter, options.Skip, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateGetCatalogNextPageRequest(nextLink, Id.SubscriptionId, options.ReservedResourceType, options.Location, options.PublisherId, options.OfferId, options.PlanId, options.Filter, options.Skip, options.Take); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ReservationCatalog.DeserializeReservationCatalog, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCatalog", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ReservationCatalog.DeserializeReservationCatalog, DefaultClientDiagnostics, Pipeline, "ReservationsSubscriptionMockingExtension.GetCatalog", "value", "nextLink", cancellationToken); } /// @@ -124,7 +233,7 @@ public virtual Pageable GetCatalog(SubscriptionResourceGetCa /// The cancellation token to use. public virtual async Task> GetAppliedReservationsAsync(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAppliedReservations"); + using var scope = DefaultClientDiagnostics.CreateScope("ReservationsSubscriptionMockingExtension.GetAppliedReservations"); scope.Start(); try { @@ -154,7 +263,7 @@ public virtual async Task> GetAppliedReservatio /// The cancellation token to use. public virtual Response GetAppliedReservations(CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetAppliedReservations"); + using var scope = DefaultClientDiagnostics.CreateScope("ReservationsSubscriptionMockingExtension.GetAppliedReservations"); scope.Start(); try { diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsTenantMockingExtension.cs similarity index 80% rename from sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsTenantMockingExtension.cs index eddfe959cf73..38ed57ba812c 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/Extensions/ReservationsTenantMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Reservations; using Azure.ResourceManager.Reservations.Models; -namespace Azure.ResourceManager.Reservations +namespace Azure.ResourceManager.Reservations.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ReservationsTenantMockingExtension : ArmResource { private ClientDiagnostics _reservationDetailReservationClientDiagnostics; private ReservationRestOperations _reservationDetailReservationRestClient; @@ -29,15 +30,15 @@ internal partial class TenantResourceExtensionClient : ArmResource private ClientDiagnostics _exchangeClientDiagnostics; private ExchangeRestOperations _exchangeRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ReservationsTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ReservationsTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,51 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ReservationOrderResources and their operations over a ReservationOrderResource. public virtual ReservationOrderCollection GetReservationOrders() { - return GetCachedClient(Client => new ReservationOrderCollection(Client, Id)); + return GetCachedClient(client => new ReservationOrderCollection(client, Id)); + } + + /// + /// Get the details of the `ReservationOrder`. + /// + /// + /// Request Path + /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId} + /// + /// + /// Operation Id + /// ReservationOrder_Get + /// + /// + /// + /// Order Id of the reservation. + /// May be used to expand the planInformation. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetReservationOrderAsync(Guid reservationOrderId, string expand = null, CancellationToken cancellationToken = default) + { + return await GetReservationOrders().GetAsync(reservationOrderId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details of the `ReservationOrder`. + /// + /// + /// Request Path + /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId} + /// + /// + /// Operation Id + /// ReservationOrder_Get + /// + /// + /// + /// Order Id of the reservation. + /// May be used to expand the planInformation. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetReservationOrder(Guid reservationOrderId, string expand = null, CancellationToken cancellationToken = default) + { + return GetReservationOrders().Get(reservationOrderId, expand, cancellationToken); } /// @@ -81,9 +126,11 @@ public virtual ReservationOrderCollection GetReservationOrders() /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetReservationDetailsAsync(TenantResourceGetReservationDetailsOptions options, CancellationToken cancellationToken = default) { + options ??= new TenantResourceGetReservationDetailsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationDetailReservationRestClient.CreateListAllRequest(options.Filter, options.Orderby, options.RefreshSummary, options.Skiptoken, options.SelectedState, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationDetailReservationRestClient.CreateListAllNextPageRequest(nextLink, options.Filter, options.Orderby, options.RefreshSummary, options.Skiptoken, options.SelectedState, options.Take); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReservationDetailResource(Client, ReservationDetailData.DeserializeReservationDetailData(e)), ReservationDetailReservationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetReservationDetails", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReservationDetailResource(Client, ReservationDetailData.DeserializeReservationDetailData(e)), ReservationDetailReservationClientDiagnostics, Pipeline, "ReservationsTenantMockingExtension.GetReservationDetails", "value", "nextLink", cancellationToken); } /// @@ -104,9 +151,11 @@ public virtual AsyncPageable GetReservationDetailsAsy /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetReservationDetails(TenantResourceGetReservationDetailsOptions options, CancellationToken cancellationToken = default) { + options ??= new TenantResourceGetReservationDetailsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationDetailReservationRestClient.CreateListAllRequest(options.Filter, options.Orderby, options.RefreshSummary, options.Skiptoken, options.SelectedState, options.Take); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationDetailReservationRestClient.CreateListAllNextPageRequest(nextLink, options.Filter, options.Orderby, options.RefreshSummary, options.Skiptoken, options.SelectedState, options.Take); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReservationDetailResource(Client, ReservationDetailData.DeserializeReservationDetailData(e)), ReservationDetailReservationClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetReservationDetails", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReservationDetailResource(Client, ReservationDetailData.DeserializeReservationDetailData(e)), ReservationDetailReservationClientDiagnostics, Pipeline, "ReservationsTenantMockingExtension.GetReservationDetails", "value", "nextLink", cancellationToken); } /// @@ -124,9 +173,12 @@ public virtual Pageable GetReservationDetails(TenantR /// /// Information needed for calculate or purchase reservation. /// The cancellation token to use. + /// is null. public virtual async Task> CalculateReservationOrderAsync(ReservationPurchaseContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationOrderClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateReservationOrder"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationOrderClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.CalculateReservationOrder"); scope.Start(); try { @@ -155,9 +207,12 @@ public virtual async Task> CalculateReservationOr /// /// Information needed for calculate or purchase reservation. /// The cancellation token to use. + /// is null. public virtual Response CalculateReservationOrder(ReservationPurchaseContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationOrderClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateReservationOrder"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationOrderClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.CalculateReservationOrder"); scope.Start(); try { @@ -188,9 +243,12 @@ public virtual Response CalculateReservationOrder(Reservat /// 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. /// Request containing purchases and refunds that need to be executed. /// The cancellation token to use. + /// is null. public virtual async Task> CalculateReservationExchangeAsync(WaitUntil waitUntil, CalculateExchangeContent content, CancellationToken cancellationToken = default) { - using var scope = CalculateExchangeClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateReservationExchange"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CalculateExchangeClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.CalculateReservationExchange"); scope.Start(); try { @@ -224,9 +282,12 @@ public virtual async Task> CalculateReserv /// 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. /// Request containing purchases and refunds that need to be executed. /// The cancellation token to use. + /// is null. public virtual ArmOperation CalculateReservationExchange(WaitUntil waitUntil, CalculateExchangeContent content, CancellationToken cancellationToken = default) { - using var scope = CalculateExchangeClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateReservationExchange"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CalculateExchangeClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.CalculateReservationExchange"); scope.Start(); try { @@ -260,9 +321,12 @@ public virtual ArmOperation CalculateReservationExchang /// 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. /// Request containing the refunds and purchases that need to be executed. /// The cancellation token to use. + /// is null. public virtual async Task> ExchangeAsync(WaitUntil waitUntil, ExchangeContent content, CancellationToken cancellationToken = default) { - using var scope = ExchangeClientDiagnostics.CreateScope("TenantResourceExtensionClient.Exchange"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ExchangeClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.Exchange"); scope.Start(); try { @@ -296,9 +360,12 @@ public virtual async Task> ExchangeAsync(WaitUntil /// 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. /// Request containing the refunds and purchases that need to be executed. /// The cancellation token to use. + /// is null. public virtual ArmOperation Exchange(WaitUntil waitUntil, ExchangeContent content, CancellationToken cancellationToken = default) { - using var scope = ExchangeClientDiagnostics.CreateScope("TenantResourceExtensionClient.Exchange"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ExchangeClientDiagnostics.CreateScope("ReservationsTenantMockingExtension.Exchange"); scope.Start(); try { diff --git a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ReservationOrderResource.cs b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ReservationOrderResource.cs index 557bf300e3ee..8367806edaf4 100644 --- a/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ReservationOrderResource.cs +++ b/sdk/reservations/Azure.ResourceManager.Reservations/src/Generated/ReservationOrderResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ReservationDetailResources and their operations over a ReservationDetailResource. public virtual ReservationDetailCollection GetReservationDetails() { - return GetCachedClient(Client => new ReservationDetailCollection(Client, Id)); + return GetCachedClient(client => new ReservationDetailCollection(client, Id)); } /// diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorArmClientMockingExtension.cs b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorArmClientMockingExtension.cs new file mode 100644 index 000000000000..769e88776b41 --- /dev/null +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ResourceConnector; + +namespace Azure.ResourceManager.ResourceConnector.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ResourceConnectorArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceConnectorArmClientMockingExtension() + { + } + + /// 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 ResourceConnectorArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ResourceConnectorArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ResourceConnectorApplianceResource GetResourceConnectorApplianceResource(ResourceIdentifier id) + { + ResourceConnectorApplianceResource.ValidateResourceId(id); + return new ResourceConnectorApplianceResource(Client, id); + } + } +} diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorExtensions.cs b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorExtensions.cs index 1f702d8194ff..ce498eed11e9 100644 --- a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorExtensions.cs +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceConnector.Mocking; using Azure.ResourceManager.ResourceConnector.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.ResourceConnector /// A class to add extension methods to Azure.ResourceManager.ResourceConnector. public static partial class ResourceConnectorExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ResourceConnectorArmClientMockingExtension GetResourceConnectorArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ResourceConnectorArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourceConnectorResourceGroupMockingExtension GetResourceConnectorResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceConnectorResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ResourceConnectorSubscriptionMockingExtension GetResourceConnectorSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ResourceConnectorSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ResourceConnectorApplianceResource /// /// 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. /// Returns a object. public static ResourceConnectorApplianceResource GetResourceConnectorApplianceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceConnectorApplianceResource.ValidateResourceId(id); - return new ResourceConnectorApplianceResource(client, id); - } - ); + return GetResourceConnectorArmClientMockingExtension(client).GetResourceConnectorApplianceResource(id); } - #endregion - /// Gets a collection of ResourceConnectorApplianceResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceConnectorApplianceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ResourceConnectorApplianceResources and their operations over a ResourceConnectorApplianceResource. public static ResourceConnectorApplianceCollection GetResourceConnectorAppliances(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceConnectorAppliances(); + return GetResourceConnectorResourceGroupMockingExtension(resourceGroupResource).GetResourceConnectorAppliances(); } /// @@ -89,16 +77,20 @@ public static ResourceConnectorApplianceCollection GetResourceConnectorAppliance /// Appliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Appliances name. /// The cancellation token to use. - /// 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 static async Task> GetResourceConnectorApplianceAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceConnectorAppliances().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetResourceConnectorResourceGroupMockingExtension(resourceGroupResource).GetResourceConnectorApplianceAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetResour /// Appliances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Appliances name. /// The cancellation token to use. - /// 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 static Response GetResourceConnectorAppliance(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceConnectorAppliances().Get(resourceName, cancellationToken); + return GetResourceConnectorResourceGroupMockingExtension(resourceGroupResource).GetResourceConnectorAppliance(resourceName, cancellationToken); } /// @@ -137,13 +133,17 @@ public static Response GetResourceConnectorA /// Appliances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceConnectorAppliancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceConnectorAppliancesAsync(cancellationToken); + return GetResourceConnectorSubscriptionMockingExtension(subscriptionResource).GetResourceConnectorAppliancesAsync(cancellationToken); } /// @@ -158,13 +158,17 @@ public static AsyncPageable GetResourceConne /// Appliances_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceConnectorAppliances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceConnectorAppliances(cancellationToken); + return GetResourceConnectorSubscriptionMockingExtension(subscriptionResource).GetResourceConnectorAppliances(cancellationToken); } /// @@ -179,12 +183,16 @@ public static Pageable GetResourceConnectorA /// Appliances_GetTelemetryConfig /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetTelemetryConfigApplianceAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetTelemetryConfigApplianceAsync(cancellationToken).ConfigureAwait(false); + return await GetResourceConnectorSubscriptionMockingExtension(subscriptionResource).GetTelemetryConfigApplianceAsync(cancellationToken).ConfigureAwait(false); } /// @@ -199,12 +207,16 @@ public static async Task> GetTelemetryC /// Appliances_GetTelemetryConfig /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetTelemetryConfigAppliance(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTelemetryConfigAppliance(cancellationToken); + return GetResourceConnectorSubscriptionMockingExtension(subscriptionResource).GetTelemetryConfigAppliance(cancellationToken); } } } diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorResourceGroupMockingExtension.cs b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8ffd09a1b433 --- /dev/null +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ResourceConnector; + +namespace Azure.ResourceManager.ResourceConnector.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ResourceConnectorResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceConnectorResourceGroupMockingExtension() + { + } + + /// 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 ResourceConnectorResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ResourceConnectorApplianceResources in the ResourceGroupResource. + /// An object representing collection of ResourceConnectorApplianceResources and their operations over a ResourceConnectorApplianceResource. + public virtual ResourceConnectorApplianceCollection GetResourceConnectorAppliances() + { + return GetCachedClient(client => new ResourceConnectorApplianceCollection(client, Id)); + } + + /// + /// Gets the details of an Appliance with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName} + /// + /// + /// Operation Id + /// Appliances_Get + /// + /// + /// + /// Appliances name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceConnectorApplianceAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetResourceConnectorAppliances().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of an Appliance with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName} + /// + /// + /// Operation Id + /// Appliances_Get + /// + /// + /// + /// Appliances name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceConnectorAppliance(string resourceName, CancellationToken cancellationToken = default) + { + return GetResourceConnectorAppliances().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorSubscriptionMockingExtension.cs similarity index 87% rename from sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorSubscriptionMockingExtension.cs index f93abee43cba..27d4a8252b25 100644 --- a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceConnectorSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceConnector; using Azure.ResourceManager.ResourceConnector.Models; -namespace Azure.ResourceManager.ResourceConnector +namespace Azure.ResourceManager.ResourceConnector.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ResourceConnectorSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _resourceConnectorApplianceAppliancesClientDiagnostics; private AppliancesRestOperations _resourceConnectorApplianceAppliancesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceConnectorSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceConnectorSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetResourceConn { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceConnectorApplianceAppliancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceConnectorApplianceAppliancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceConnectorApplianceResource(Client, ResourceConnectorApplianceData.DeserializeResourceConnectorApplianceData(e)), ResourceConnectorApplianceAppliancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceConnectorAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceConnectorApplianceResource(Client, ResourceConnectorApplianceData.DeserializeResourceConnectorApplianceData(e)), ResourceConnectorApplianceAppliancesClientDiagnostics, Pipeline, "ResourceConnectorSubscriptionMockingExtension.GetResourceConnectorAppliances", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetResourceConnector { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceConnectorApplianceAppliancesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceConnectorApplianceAppliancesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceConnectorApplianceResource(Client, ResourceConnectorApplianceData.DeserializeResourceConnectorApplianceData(e)), ResourceConnectorApplianceAppliancesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceConnectorAppliances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceConnectorApplianceResource(Client, ResourceConnectorApplianceData.DeserializeResourceConnectorApplianceData(e)), ResourceConnectorApplianceAppliancesClientDiagnostics, Pipeline, "ResourceConnectorSubscriptionMockingExtension.GetResourceConnectorAppliances", "value", "nextLink", cancellationToken); } /// @@ -104,7 +105,7 @@ public virtual Pageable GetResourceConnector /// The cancellation token to use. public virtual async Task> GetTelemetryConfigApplianceAsync(CancellationToken cancellationToken = default) { - using var scope = ResourceConnectorApplianceAppliancesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetTelemetryConfigAppliance"); + using var scope = ResourceConnectorApplianceAppliancesClientDiagnostics.CreateScope("ResourceConnectorSubscriptionMockingExtension.GetTelemetryConfigAppliance"); scope.Start(); try { @@ -134,7 +135,7 @@ public virtual async Task> GetTelemetry /// The cancellation token to use. public virtual Response GetTelemetryConfigAppliance(CancellationToken cancellationToken = default) { - using var scope = ResourceConnectorApplianceAppliancesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetTelemetryConfigAppliance"); + using var scope = ResourceConnectorApplianceAppliancesClientDiagnostics.CreateScope("ResourceConnectorSubscriptionMockingExtension.GetTelemetryConfigAppliance"); scope.Start(); try { diff --git a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4f7699aa9b31..000000000000 --- a/sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ResourceConnector -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ResourceConnectorApplianceResources in the ResourceGroupResource. - /// An object representing collection of ResourceConnectorApplianceResources and their operations over a ResourceConnectorApplianceResource. - public virtual ResourceConnectorApplianceCollection GetResourceConnectorAppliances() - { - return GetCachedClient(Client => new ResourceConnectorApplianceCollection(Client, Id)); - } - } -} diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphExtensions.cs b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphExtensions.cs index d1d3300d1d63..b0b01dce7b4e 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphExtensions.cs +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphExtensions.cs @@ -9,8 +9,8 @@ using System.Threading; using System.Threading.Tasks; using Azure; -using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceGraph.Mocking; using Azure.ResourceManager.ResourceGraph.Models; using Azure.ResourceManager.Resources; @@ -19,20 +19,9 @@ namespace Azure.ResourceManager.ResourceGraph /// A class to add extension methods to Azure.ResourceManager.ResourceGraph. public static partial class ResourceGraphExtensions { - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + private static ResourceGraphTenantMockingExtension GetResourceGraphTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceGraphTenantMockingExtension(client, resource.Id)); } /// @@ -47,6 +36,10 @@ private static TenantResourceExtensionClient GetTenantResourceExtensionClient(Ar /// Resources /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request specifying query and its options. @@ -54,9 +47,7 @@ private static TenantResourceExtensionClient GetTenantResourceExtensionClient(Ar /// is null. public static async Task> GetResourcesAsync(this TenantResource tenantResource, ResourceQueryContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GetResourcesAsync(content, cancellationToken).ConfigureAwait(false); + return await GetResourceGraphTenantMockingExtension(tenantResource).GetResourcesAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -71,6 +62,10 @@ public static async Task> GetResourcesAsync(this T /// Resources /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request specifying query and its options. @@ -78,9 +73,7 @@ public static async Task> GetResourcesAsync(this T /// is null. public static Response GetResources(this TenantResource tenantResource, ResourceQueryContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GetResources(content, cancellationToken); + return GetResourceGraphTenantMockingExtension(tenantResource).GetResources(content, cancellationToken); } /// @@ -95,6 +88,10 @@ public static Response GetResources(this TenantResource ten /// ResourcesHistory /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request specifying the query and its options. @@ -102,9 +99,7 @@ public static Response GetResources(this TenantResource ten /// is null. public static async Task> GetResourceHistoryAsync(this TenantResource tenantResource, ResourcesHistoryContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GetResourceHistoryAsync(content, cancellationToken).ConfigureAwait(false); + return await GetResourceGraphTenantMockingExtension(tenantResource).GetResourceHistoryAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -119,6 +114,10 @@ public static async Task> GetResourceHistoryAsync(this Tena /// ResourcesHistory /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Request specifying the query and its options. @@ -126,9 +125,7 @@ public static async Task> GetResourceHistoryAsync(this Tena /// is null. public static Response GetResourceHistory(this TenantResource tenantResource, ResourcesHistoryContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GetResourceHistory(content, cancellationToken); + return GetResourceGraphTenantMockingExtension(tenantResource).GetResourceHistory(content, cancellationToken); } } } diff --git a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphTenantMockingExtension.cs similarity index 82% rename from sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphTenantMockingExtension.cs index daa2a970c595..a4b33b3cbc8f 100644 --- a/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/src/Generated/Extensions/ResourceGraphTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceGraph; using Azure.ResourceManager.ResourceGraph.Models; -namespace Azure.ResourceManager.ResourceGraph +namespace Azure.ResourceManager.ResourceGraph.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ResourceGraphTenantMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private ResourceGraphRestOperations _defaultRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceGraphTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceGraphTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,9 +59,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Request specifying query and its options. /// The cancellation token to use. + /// is null. public virtual async Task> GetResourcesAsync(ResourceQueryContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetResources"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGraphTenantMockingExtension.GetResources"); scope.Start(); try { @@ -89,9 +93,12 @@ public virtual async Task> GetResourcesAsync(Resou /// /// Request specifying query and its options. /// The cancellation token to use. + /// is null. public virtual Response GetResources(ResourceQueryContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetResources"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGraphTenantMockingExtension.GetResources"); scope.Start(); try { @@ -120,9 +127,12 @@ public virtual Response GetResources(ResourceQueryContent c /// /// Request specifying the query and its options. /// The cancellation token to use. + /// is null. public virtual async Task> GetResourceHistoryAsync(ResourcesHistoryContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetResourceHistory"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGraphTenantMockingExtension.GetResourceHistory"); scope.Start(); try { @@ -151,9 +161,12 @@ public virtual async Task> GetResourceHistoryAsync(Resource /// /// Request specifying the query and its options. /// The cancellation token to use. + /// is null. public virtual Response GetResourceHistory(ResourcesHistoryContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetResourceHistory"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGraphTenantMockingExtension.GetResourceHistory"); scope.Start(); try { diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/samples/Generated/Samples/Sample_ArmResourceExtensions.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/samples/Generated/Samples/Sample_ArmResourceExtensions.cs deleted file mode 100644 index e8d81f551e21..000000000000 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/samples/Generated/Samples/Sample_ArmResourceExtensions.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.ResourceHealth; -using Azure.ResourceManager.ResourceHealth.Models; - -namespace Azure.ResourceManager.ResourceHealth.Samples -{ - public partial class Sample_ArmResourceExtensions - { - // GetCurrentHealthByResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAvailabilityStatus_GetCurrentHealthByResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/AvailabilityStatus_GetByResource.json - // this example is just showing the usage of "AvailabilityStatuses_GetByResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // invoke the operation - string resourceUri = "resourceUri"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - string expand = "recommendedactions"; - ResourceHealthAvailabilityStatus result = await client.GetAvailabilityStatusAsync(scope, expand: expand); - - Console.WriteLine($"Succeeded: {result}"); - } - - // GetHealthHistoryByResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAvailabilityStatuses_GetHealthHistoryByResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/AvailabilityStatuses_List.json - // this example is just showing the usage of "AvailabilityStatuses_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); - - // invoke the operation and iterate over the result - string resourceUri = "resourceUri"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - await foreach (ResourceHealthAvailabilityStatus item in client.GetAvailabilityStatusesAsync(scope)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // ListEventsBySingleResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetHealthEventsOfSingleResource_ListEventsBySingleResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/Events_ListBySingleResource.json - // this example is just showing the usage of "Events_ListBySingleResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // invoke the operation and iterate over the result - string resourceUri = "subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.Compute/virtualMachines/rhctestenvV1PI"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - await foreach (ResourceHealthEventData item in client.GetHealthEventsOfSingleResourceAsync(scope)) - { - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {item.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // GetChildCurrentHealthByResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAvailabilityStatusOfChildResource_GetChildCurrentHealthByResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/ChildAvailabilityStatus_GetByResource.json - // this example is just showing the usage of "ChildAvailabilityStatuses_GetByResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // invoke the operation - string resourceUri = "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - string expand = "recommendedactions"; - ResourceHealthAvailabilityStatus result = await client.GetAvailabilityStatusOfChildResourceAsync(scope, expand: expand); - - Console.WriteLine($"Succeeded: {result}"); - } - - // GetChildHealthHistoryByResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetHistoricalAvailabilityStatusesOfChildResource_GetChildHealthHistoryByResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/ChildAvailabilityStatuses_List.json - // this example is just showing the usage of "ChildAvailabilityStatuses_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); - - // invoke the operation and iterate over the result - string resourceUri = "subscriptions/227b734f-e14f-4de6-b7fc-3190c21e69f6/resourceGroups/JUHACKETRHCTEST/providers/Microsoft.Compute/virtualMachineScaleSets/rhctest/virtualMachines/4"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - await foreach (ResourceHealthAvailabilityStatus item in client.GetHistoricalAvailabilityStatusesOfChildResourceAsync(scope)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // GetCurrentChildHealthByResource - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAvailabilityStatusOfChildResources_GetCurrentChildHealthByResource() - { - // Generated from example definition: specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/stable/2022-10-01/examples/ChildResources_List.json - // this example is just showing the usage of "ChildResources_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); - - // invoke the operation and iterate over the result - string resourceUri = "resourceUri"; - ResourceIdentifier scope = new ResourceIdentifier(string.Format("/{0}", resourceUri)); - await foreach (ResourceHealthAvailabilityStatus item in client.GetAvailabilityStatusOfChildResourcesAsync(scope)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthArmClientMockingExtension.cs similarity index 63% rename from sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ArmResourceExtensionClient.cs rename to sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthArmClientMockingExtension.cs index 6392c0823ce2..26dd25dc72d5 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthArmClientMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceHealth; using Azure.ResourceManager.ResourceHealth.Models; -namespace Azure.ResourceManager.ResourceHealth +namespace Azure.ResourceManager.ResourceHealth.Mocking { - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource + /// A class to add extension methods to ArmClient. + public partial class ResourceHealthArmClientMockingExtension : ArmResource { private ClientDiagnostics _availabilityStatusesClientDiagnostics; private AvailabilityStatusesRestOperations _availabilityStatusesRestClient; @@ -29,15 +30,19 @@ internal partial class ArmResourceExtensionClient : ArmResource private ClientDiagnostics _childResourcesClientDiagnostics; private ChildResourcesRestOperations _childResourcesRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceHealthArmClientMockingExtension() { } - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceHealthArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ResourceHealthArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) { } @@ -69,21 +74,22 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. - public virtual async Task> GetAvailabilityStatusAsync(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAvailabilityStatusAsync(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - using var scope = AvailabilityStatusesClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetAvailabilityStatus"); - scope.Start(); + using var scope0 = AvailabilityStatusesClientDiagnostics.CreateScope("ResourceHealthArmClientMockingExtension.GetAvailabilityStatus"); + scope0.Start(); try { - var response = await AvailabilityStatusesRestClient.GetByResourceAsync(Id, filter, expand, cancellationToken).ConfigureAwait(false); + var response = await AvailabilityStatusesRestClient.GetByResourceAsync(scope, filter, expand, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -101,21 +107,22 @@ public virtual async Task> GetAvailab /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. - public virtual Response GetAvailabilityStatus(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual Response GetAvailabilityStatus(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - using var scope = AvailabilityStatusesClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetAvailabilityStatus"); - scope.Start(); + using var scope0 = AvailabilityStatusesClientDiagnostics.CreateScope("ResourceHealthArmClientMockingExtension.GetAvailabilityStatus"); + scope0.Start(); try { - var response = AvailabilityStatusesRestClient.GetByResource(Id, filter, expand, cancellationToken); + var response = AvailabilityStatusesRestClient.GetByResource(scope, filter, expand, cancellationToken); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -133,15 +140,16 @@ public virtual Response GetAvailabilityStatus( /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAvailabilityStatusesAsync(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAvailabilityStatusesAsync(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetAvailabilityStatuses", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetAvailabilityStatuses", "value", "nextLink", cancellationToken); } /// @@ -157,15 +165,16 @@ public virtual AsyncPageable GetAvailabilitySt /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAvailabilityStatuses(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAvailabilityStatuses(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetAvailabilityStatuses", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetAvailabilityStatuses", "value", "nextLink", cancellationToken); } /// @@ -181,14 +190,15 @@ public virtual Pageable GetAvailabilityStatuse /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHealthEventsOfSingleResourceAsync(string filter = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetHealthEventsOfSingleResourceAsync(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EventsRestClient.CreateListBySingleResourceRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventsRestClient.CreateListBySingleResourceNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthEventData.DeserializeResourceHealthEventData, EventsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetHealthEventsOfSingleResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EventsRestClient.CreateListBySingleResourceRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventsRestClient.CreateListBySingleResourceNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthEventData.DeserializeResourceHealthEventData, EventsClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetHealthEventsOfSingleResource", "value", "nextLink", cancellationToken); } /// @@ -204,14 +214,15 @@ public virtual AsyncPageable GetHealthEventsOfSingleRes /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHealthEventsOfSingleResource(string filter = null, CancellationToken cancellationToken = default) + public virtual Pageable GetHealthEventsOfSingleResource(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EventsRestClient.CreateListBySingleResourceRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventsRestClient.CreateListBySingleResourceNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthEventData.DeserializeResourceHealthEventData, EventsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetHealthEventsOfSingleResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EventsRestClient.CreateListBySingleResourceRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventsRestClient.CreateListBySingleResourceNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthEventData.DeserializeResourceHealthEventData, EventsClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetHealthEventsOfSingleResource", "value", "nextLink", cancellationToken); } /// @@ -227,21 +238,22 @@ public virtual Pageable GetHealthEventsOfSingleResource /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. - public virtual async Task> GetAvailabilityStatusOfChildResourceAsync(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual async Task> GetAvailabilityStatusOfChildResourceAsync(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - using var scope = ChildAvailabilityStatusesClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetAvailabilityStatusOfChildResource"); - scope.Start(); + using var scope0 = ChildAvailabilityStatusesClientDiagnostics.CreateScope("ResourceHealthArmClientMockingExtension.GetAvailabilityStatusOfChildResource"); + scope0.Start(); try { - var response = await ChildAvailabilityStatusesRestClient.GetByResourceAsync(Id, filter, expand, cancellationToken).ConfigureAwait(false); + var response = await ChildAvailabilityStatusesRestClient.GetByResourceAsync(scope, filter, expand, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -259,21 +271,22 @@ public virtual async Task> GetAvailab /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. - public virtual Response GetAvailabilityStatusOfChildResource(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual Response GetAvailabilityStatusOfChildResource(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - using var scope = ChildAvailabilityStatusesClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetAvailabilityStatusOfChildResource"); - scope.Start(); + using var scope0 = ChildAvailabilityStatusesClientDiagnostics.CreateScope("ResourceHealthArmClientMockingExtension.GetAvailabilityStatusOfChildResource"); + scope0.Start(); try { - var response = ChildAvailabilityStatusesRestClient.GetByResource(Id, filter, expand, cancellationToken); + var response = ChildAvailabilityStatusesRestClient.GetByResource(scope, filter, expand, cancellationToken); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -291,15 +304,16 @@ public virtual Response GetAvailabilityStatusO /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHistoricalAvailabilityStatusesOfChildResourceAsync(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetHistoricalAvailabilityStatusesOfChildResourceAsync(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChildAvailabilityStatusesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildAvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildAvailabilityStatusesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetHistoricalAvailabilityStatusesOfChildResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ChildAvailabilityStatusesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildAvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildAvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetHistoricalAvailabilityStatusesOfChildResource", "value", "nextLink", cancellationToken); } /// @@ -315,15 +329,16 @@ public virtual AsyncPageable GetHistoricalAvai /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHistoricalAvailabilityStatusesOfChildResource(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual Pageable GetHistoricalAvailabilityStatusesOfChildResource(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChildAvailabilityStatusesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildAvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildAvailabilityStatusesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetHistoricalAvailabilityStatusesOfChildResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ChildAvailabilityStatusesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildAvailabilityStatusesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildAvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetHistoricalAvailabilityStatusesOfChildResource", "value", "nextLink", cancellationToken); } /// @@ -339,15 +354,16 @@ public virtual Pageable GetHistoricalAvailabil /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAvailabilityStatusOfChildResourcesAsync(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAvailabilityStatusOfChildResourcesAsync(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChildResourcesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildResourcesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetAvailabilityStatusOfChildResources", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ChildResourcesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildResourcesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildResourcesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetAvailabilityStatusOfChildResources", "value", "nextLink", cancellationToken); } /// @@ -363,15 +379,87 @@ public virtual AsyncPageable GetAvailabilitySt /// /// /// + /// The scope to use. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Setting $expand=recommendedactions in url query expands the recommendedactions in the response. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAvailabilityStatusOfChildResources(string filter = null, string expand = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAvailabilityStatusOfChildResources(ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ChildResourcesRestClient.CreateListRequest(scope, filter, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildResourcesRestClient.CreateListNextPageRequest(nextLink, scope, filter, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildResourcesClientDiagnostics, Pipeline, "ResourceHealthArmClientMockingExtension.GetAvailabilityStatusOfChildResources", "value", "nextLink", 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 ResourceHealthMetadataEntityResource GetResourceHealthMetadataEntityResource(ResourceIdentifier id) + { + ResourceHealthMetadataEntityResource.ValidateResourceId(id); + return new ResourceHealthMetadataEntityResource(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 ResourceHealthEventImpactedResource GetResourceHealthEventImpactedResource(ResourceIdentifier id) + { + ResourceHealthEventImpactedResource.ValidateResourceId(id); + return new ResourceHealthEventImpactedResource(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 TenantResourceHealthEventImpactedResource GetTenantResourceHealthEventImpactedResource(ResourceIdentifier id) + { + TenantResourceHealthEventImpactedResource.ValidateResourceId(id); + return new TenantResourceHealthEventImpactedResource(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 ResourceHealthEventResource GetResourceHealthEventResource(ResourceIdentifier id) + { + ResourceHealthEventResource.ValidateResourceId(id); + return new ResourceHealthEventResource(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 TenantResourceHealthEventResource GetTenantResourceHealthEventResource(ResourceIdentifier id) + { + TenantResourceHealthEventResource.ValidateResourceId(id); + return new TenantResourceHealthEventResource(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 ServiceEmergingIssueResource GetServiceEmergingIssueResource(ResourceIdentifier id) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChildResourcesRestClient.CreateListRequest(Id, filter, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ChildResourcesRestClient.CreateListNextPageRequest(nextLink, Id, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, ChildResourcesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetAvailabilityStatusOfChildResources", "value", "nextLink", cancellationToken); + ServiceEmergingIssueResource.ValidateResourceId(id); + return new ServiceEmergingIssueResource(Client, id); } } } diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthExtensions.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthExtensions.cs index c3b9ee6575d8..613e2b22656d 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthExtensions.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceHealth.Mocking; using Azure.ResourceManager.ResourceHealth.Models; using Azure.ResourceManager.Resources; @@ -19,183 +20,26 @@ namespace Azure.ResourceManager.ResourceHealth /// A class to add extension methods to Azure.ResourceManager.ResourceHealth. public static partial class ResourceHealthExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ResourceHealthArmClientMockingExtension GetResourceHealthArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ResourceHealthArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourceHealthResourceGroupMockingExtension GetResourceHealthResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceHealthResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ResourceHealthSubscriptionMockingExtension GetResourceHealthSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ResourceHealthSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourceHealthTenantMockingExtension GetResourceHealthTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceHealthTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region ResourceHealthMetadataEntityResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceHealthMetadataEntityResource GetResourceHealthMetadataEntityResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceHealthMetadataEntityResource.ValidateResourceId(id); - return new ResourceHealthMetadataEntityResource(client, id); - } - ); - } - #endregion - - #region ResourceHealthEventImpactedResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceHealthEventImpactedResource GetResourceHealthEventImpactedResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceHealthEventImpactedResource.ValidateResourceId(id); - return new ResourceHealthEventImpactedResource(client, id); - } - ); - } - #endregion - - #region TenantResourceHealthEventImpactedResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantResourceHealthEventImpactedResource GetTenantResourceHealthEventImpactedResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantResourceHealthEventImpactedResource.ValidateResourceId(id); - return new TenantResourceHealthEventImpactedResource(client, id); - } - ); - } - #endregion - - #region ResourceHealthEventResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceHealthEventResource GetResourceHealthEventResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceHealthEventResource.ValidateResourceId(id); - return new ResourceHealthEventResource(client, id); - } - ); - } - #endregion - - #region TenantResourceHealthEventResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantResourceHealthEventResource GetTenantResourceHealthEventResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantResourceHealthEventResource.ValidateResourceId(id); - return new TenantResourceHealthEventResource(client, id); - } - ); - } - #endregion - - #region ServiceEmergingIssueResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ServiceEmergingIssueResource GetServiceEmergingIssueResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ServiceEmergingIssueResource.ValidateResourceId(id); - return new ServiceEmergingIssueResource(client, id); - } - ); - } - #endregion - /// /// Gets current availability status for a single resource /// @@ -208,6 +52,10 @@ public static ServiceEmergingIssueResource GetServiceEmergingIssueResource(this /// AvailabilityStatuses_GetByResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -216,7 +64,7 @@ public static ServiceEmergingIssueResource GetServiceEmergingIssueResource(this /// The cancellation token to use. public static async Task> GetAvailabilityStatusAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusAsync(filter, expand, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusAsync(scope, filter, expand, cancellationToken).ConfigureAwait(false); } /// @@ -231,6 +79,10 @@ public static async Task> GetAvailabi /// AvailabilityStatuses_GetByResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -239,7 +91,7 @@ public static async Task> GetAvailabi /// The cancellation token to use. public static Response GetAvailabilityStatus(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatus(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatus(scope, filter, expand, cancellationToken); } /// @@ -254,6 +106,10 @@ public static Response GetAvailabilityStatus(t /// AvailabilityStatuses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -262,7 +118,7 @@ public static Response GetAvailabilityStatus(t /// The cancellation token to use. public static AsyncPageable GetAvailabilityStatusesAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusesAsync(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusesAsync(scope, filter, expand, cancellationToken); } /// @@ -277,6 +133,10 @@ public static AsyncPageable GetAvailabilitySta /// AvailabilityStatuses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -285,7 +145,7 @@ public static AsyncPageable GetAvailabilitySta /// The cancellation token to use. public static Pageable GetAvailabilityStatuses(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatuses(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatuses(scope, filter, expand, cancellationToken); } /// @@ -300,6 +160,10 @@ public static Pageable GetAvailabilityStatuses /// Events_ListBySingleResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -307,7 +171,7 @@ public static Pageable GetAvailabilityStatuses /// The cancellation token to use. public static AsyncPageable GetHealthEventsOfSingleResourceAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetHealthEventsOfSingleResourceAsync(filter, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetHealthEventsOfSingleResourceAsync(scope, filter, cancellationToken); } /// @@ -322,6 +186,10 @@ public static AsyncPageable GetHealthEventsOfSingleReso /// Events_ListBySingleResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -329,7 +197,7 @@ public static AsyncPageable GetHealthEventsOfSingleReso /// The cancellation token to use. public static Pageable GetHealthEventsOfSingleResource(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetHealthEventsOfSingleResource(filter, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetHealthEventsOfSingleResource(scope, filter, cancellationToken); } /// @@ -344,6 +212,10 @@ public static Pageable GetHealthEventsOfSingleResource( /// ChildAvailabilityStatuses_GetByResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -352,7 +224,7 @@ public static Pageable GetHealthEventsOfSingleResource( /// The cancellation token to use. public static async Task> GetAvailabilityStatusOfChildResourceAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusOfChildResourceAsync(filter, expand, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusOfChildResourceAsync(scope, filter, expand, cancellationToken).ConfigureAwait(false); } /// @@ -367,6 +239,10 @@ public static async Task> GetAvailabi /// ChildAvailabilityStatuses_GetByResource /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -375,7 +251,7 @@ public static async Task> GetAvailabi /// The cancellation token to use. public static Response GetAvailabilityStatusOfChildResource(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusOfChildResource(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusOfChildResource(scope, filter, expand, cancellationToken); } /// @@ -390,6 +266,10 @@ public static Response GetAvailabilityStatusOf /// ChildAvailabilityStatuses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -398,7 +278,7 @@ public static Response GetAvailabilityStatusOf /// The cancellation token to use. public static AsyncPageable GetHistoricalAvailabilityStatusesOfChildResourceAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetHistoricalAvailabilityStatusesOfChildResourceAsync(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetHistoricalAvailabilityStatusesOfChildResourceAsync(scope, filter, expand, cancellationToken); } /// @@ -413,6 +293,10 @@ public static AsyncPageable GetHistoricalAvail /// ChildAvailabilityStatuses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -421,7 +305,7 @@ public static AsyncPageable GetHistoricalAvail /// The cancellation token to use. public static Pageable GetHistoricalAvailabilityStatusesOfChildResource(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetHistoricalAvailabilityStatusesOfChildResource(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetHistoricalAvailabilityStatusesOfChildResource(scope, filter, expand, cancellationToken); } /// @@ -436,6 +320,10 @@ public static Pageable GetHistoricalAvailabili /// ChildResources_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -444,7 +332,7 @@ public static Pageable GetHistoricalAvailabili /// The cancellation token to use. public static AsyncPageable GetAvailabilityStatusOfChildResourcesAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusOfChildResourcesAsync(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusOfChildResourcesAsync(scope, filter, expand, cancellationToken); } /// @@ -459,6 +347,10 @@ public static AsyncPageable GetAvailabilitySta /// ChildResources_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -467,7 +359,103 @@ public static AsyncPageable GetAvailabilitySta /// The cancellation token to use. public static Pageable GetAvailabilityStatusOfChildResources(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetAvailabilityStatusOfChildResources(filter, expand, cancellationToken); + return GetResourceHealthArmClientMockingExtension(client).GetAvailabilityStatusOfChildResources(scope, filter, expand, 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. + /// Returns a object. + public static ResourceHealthMetadataEntityResource GetResourceHealthMetadataEntityResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetResourceHealthMetadataEntityResource(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. + /// Returns a object. + public static ResourceHealthEventImpactedResource GetResourceHealthEventImpactedResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetResourceHealthEventImpactedResource(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. + /// Returns a object. + public static TenantResourceHealthEventImpactedResource GetTenantResourceHealthEventImpactedResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetTenantResourceHealthEventImpactedResource(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. + /// Returns a object. + public static ResourceHealthEventResource GetResourceHealthEventResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetResourceHealthEventResource(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. + /// Returns a object. + public static TenantResourceHealthEventResource GetTenantResourceHealthEventResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetTenantResourceHealthEventResource(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. + /// Returns a object. + public static ServiceEmergingIssueResource GetServiceEmergingIssueResource(this ArmClient client, ResourceIdentifier id) + { + return GetResourceHealthArmClientMockingExtension(client).GetServiceEmergingIssueResource(id); } /// @@ -482,6 +470,10 @@ public static Pageable GetAvailabilityStatusOf /// AvailabilityStatuses_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. @@ -490,7 +482,7 @@ public static Pageable GetAvailabilityStatusOf /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailabilityStatusesByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailabilityStatusesByResourceGroupAsync(filter, expand, cancellationToken); + return GetResourceHealthResourceGroupMockingExtension(resourceGroupResource).GetAvailabilityStatusesByResourceGroupAsync(filter, expand, cancellationToken); } /// @@ -505,6 +497,10 @@ public static AsyncPageable GetAvailabilitySta /// AvailabilityStatuses_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. @@ -513,15 +509,21 @@ public static AsyncPageable GetAvailabilitySta /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailabilityStatusesByResourceGroup(this ResourceGroupResource resourceGroupResource, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailabilityStatusesByResourceGroup(filter, expand, cancellationToken); + return GetResourceHealthResourceGroupMockingExtension(resourceGroupResource).GetAvailabilityStatusesByResourceGroup(filter, expand, cancellationToken); } - /// Gets a collection of ResourceHealthEventResources in the SubscriptionResource. + /// + /// Gets a collection of ResourceHealthEventResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ResourceHealthEventResources and their operations over a ResourceHealthEventResource. public static ResourceHealthEventCollection GetResourceHealthEvents(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceHealthEvents(); + return GetResourceHealthSubscriptionMockingExtension(subscriptionResource).GetResourceHealthEvents(); } /// @@ -536,18 +538,22 @@ public static ResourceHealthEventCollection GetResourceHealthEvents(this Subscri /// Event_GetBySubscriptionIdAndTrackingId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Event Id which uniquely identifies ServiceHealth event. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. /// The cancellation token to use. - /// 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 static async Task> GetResourceHealthEventAsync(this SubscriptionResource subscriptionResource, string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetResourceHealthEvents().GetAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthSubscriptionMockingExtension(subscriptionResource).GetResourceHealthEventAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); } /// @@ -562,18 +568,22 @@ public static async Task> GetResourceHealt /// Event_GetBySubscriptionIdAndTrackingId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Event Id which uniquely identifies ServiceHealth event. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. /// The cancellation token to use. - /// 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 static Response GetResourceHealthEvent(this SubscriptionResource subscriptionResource, string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) { - return subscriptionResource.GetResourceHealthEvents().Get(eventTrackingId, filter, queryStartTime, cancellationToken); + return GetResourceHealthSubscriptionMockingExtension(subscriptionResource).GetResourceHealthEvent(eventTrackingId, filter, queryStartTime, cancellationToken); } /// @@ -588,6 +598,10 @@ public static Response GetResourceHealthEvent(this /// AvailabilityStatuses_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. @@ -596,7 +610,7 @@ public static Response GetResourceHealthEvent(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailabilityStatusesBySubscriptionAsync(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailabilityStatusesBySubscriptionAsync(filter, expand, cancellationToken); + return GetResourceHealthSubscriptionMockingExtension(subscriptionResource).GetAvailabilityStatusesBySubscriptionAsync(filter, expand, cancellationToken); } /// @@ -611,6 +625,10 @@ public static AsyncPageable GetAvailabilitySta /// AvailabilityStatuses_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. @@ -619,15 +637,21 @@ public static AsyncPageable GetAvailabilitySta /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailabilityStatusesBySubscription(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailabilityStatusesBySubscription(filter, expand, cancellationToken); + return GetResourceHealthSubscriptionMockingExtension(subscriptionResource).GetAvailabilityStatusesBySubscription(filter, expand, cancellationToken); } - /// Gets a collection of ResourceHealthMetadataEntityResources in the TenantResource. + /// + /// Gets a collection of ResourceHealthMetadataEntityResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ResourceHealthMetadataEntityResources and their operations over a ResourceHealthMetadataEntityResource. public static ResourceHealthMetadataEntityCollection GetResourceHealthMetadataEntities(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetResourceHealthMetadataEntities(); + return GetResourceHealthTenantMockingExtension(tenantResource).GetResourceHealthMetadataEntities(); } /// @@ -642,16 +666,20 @@ public static ResourceHealthMetadataEntityCollection GetResourceHealthMetadataEn /// Metadata_GetEntity /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of metadata entity. /// The cancellation token to use. - /// 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 static async Task> GetResourceHealthMetadataEntityAsync(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return await tenantResource.GetResourceHealthMetadataEntities().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthTenantMockingExtension(tenantResource).GetResourceHealthMetadataEntityAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -666,24 +694,34 @@ public static async Task> GetReso /// Metadata_GetEntity /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of metadata entity. /// The cancellation token to use. - /// 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 static Response GetResourceHealthMetadataEntity(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return tenantResource.GetResourceHealthMetadataEntities().Get(name, cancellationToken); + return GetResourceHealthTenantMockingExtension(tenantResource).GetResourceHealthMetadataEntity(name, cancellationToken); } - /// Gets a collection of TenantResourceHealthEventResources in the TenantResource. + /// + /// Gets a collection of TenantResourceHealthEventResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TenantResourceHealthEventResources and their operations over a TenantResourceHealthEventResource. public static TenantResourceHealthEventCollection GetTenantResourceHealthEvents(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantResourceHealthEvents(); + return GetResourceHealthTenantMockingExtension(tenantResource).GetTenantResourceHealthEvents(); } /// @@ -698,18 +736,22 @@ public static TenantResourceHealthEventCollection GetTenantResourceHealthEvents( /// Event_GetByTenantIdAndTrackingId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Event Id which uniquely identifies ServiceHealth event. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. /// The cancellation token to use. - /// 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 static async Task> GetTenantResourceHealthEventAsync(this TenantResource tenantResource, string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) { - return await tenantResource.GetTenantResourceHealthEvents().GetAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthTenantMockingExtension(tenantResource).GetTenantResourceHealthEventAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); } /// @@ -724,26 +766,36 @@ public static async Task> GetTenantR /// Event_GetByTenantIdAndTrackingId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Event Id which uniquely identifies ServiceHealth event. /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. /// The cancellation token to use. - /// 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 static Response GetTenantResourceHealthEvent(this TenantResource tenantResource, string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) { - return tenantResource.GetTenantResourceHealthEvents().Get(eventTrackingId, filter, queryStartTime, cancellationToken); + return GetResourceHealthTenantMockingExtension(tenantResource).GetTenantResourceHealthEvent(eventTrackingId, filter, queryStartTime, cancellationToken); } - /// Gets a collection of ServiceEmergingIssueResources in the TenantResource. + /// + /// Gets a collection of ServiceEmergingIssueResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceEmergingIssueResources and their operations over a ServiceEmergingIssueResource. public static ServiceEmergingIssueCollection GetServiceEmergingIssues(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetServiceEmergingIssues(); + return GetResourceHealthTenantMockingExtension(tenantResource).GetServiceEmergingIssues(); } /// @@ -758,6 +810,10 @@ public static ServiceEmergingIssueCollection GetServiceEmergingIssues(this Tenan /// EmergingIssues_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the emerging issue. @@ -765,7 +821,7 @@ public static ServiceEmergingIssueCollection GetServiceEmergingIssues(this Tenan [ForwardsClientCalls] public static async Task> GetServiceEmergingIssueAsync(this TenantResource tenantResource, EmergingIssueNameContent issueName, CancellationToken cancellationToken = default) { - return await tenantResource.GetServiceEmergingIssues().GetAsync(issueName, cancellationToken).ConfigureAwait(false); + return await GetResourceHealthTenantMockingExtension(tenantResource).GetServiceEmergingIssueAsync(issueName, cancellationToken).ConfigureAwait(false); } /// @@ -780,6 +836,10 @@ public static async Task> GetServiceEmerg /// EmergingIssues_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the emerging issue. @@ -787,7 +847,7 @@ public static async Task> GetServiceEmerg [ForwardsClientCalls] public static Response GetServiceEmergingIssue(this TenantResource tenantResource, EmergingIssueNameContent issueName, CancellationToken cancellationToken = default) { - return tenantResource.GetServiceEmergingIssues().Get(issueName, cancellationToken); + return GetResourceHealthTenantMockingExtension(tenantResource).GetServiceEmergingIssue(issueName, cancellationToken); } } } diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthResourceGroupMockingExtension.cs similarity index 86% rename from sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthResourceGroupMockingExtension.cs index 9a4d05980f72..6132334e8b2b 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthResourceGroupMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceHealth; using Azure.ResourceManager.ResourceHealth.Models; -namespace Azure.ResourceManager.ResourceHealth +namespace Azure.ResourceManager.ResourceHealth.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class ResourceHealthResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _availabilityStatusesClientDiagnostics; private AvailabilityStatusesRestOperations _availabilityStatusesRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceHealthResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceHealthResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetAvailabilitySt { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailabilityStatusesByResourceGroup", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthResourceGroupMockingExtension.GetAvailabilityStatusesByResourceGroup", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetAvailabilityStatuse { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailabilityStatusesByResourceGroup", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthResourceGroupMockingExtension.GetAvailabilityStatusesByResourceGroup", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthSubscriptionMockingExtension.cs similarity index 56% rename from sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthSubscriptionMockingExtension.cs index 8af0ad53a937..aec02aecc993 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthSubscriptionMockingExtension.cs @@ -5,31 +5,34 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceHealth; using Azure.ResourceManager.ResourceHealth.Models; -namespace Azure.ResourceManager.ResourceHealth +namespace Azure.ResourceManager.ResourceHealth.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ResourceHealthSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _availabilityStatusesClientDiagnostics; private AvailabilityStatusesRestOperations _availabilityStatusesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceHealthSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceHealthSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +49,57 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ResourceHealthEventResources and their operations over a ResourceHealthEventResource. public virtual ResourceHealthEventCollection GetResourceHealthEvents() { - return GetCachedClient(Client => new ResourceHealthEventCollection(Client, Id)); + return GetCachedClient(client => new ResourceHealthEventCollection(client, Id)); + } + + /// + /// Service health event in the subscription by event tracking id + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId} + /// + /// + /// Operation Id + /// Event_GetBySubscriptionIdAndTrackingId + /// + /// + /// + /// Event Id which uniquely identifies ServiceHealth event. + /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceHealthEventAsync(string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) + { + return await GetResourceHealthEvents().GetAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); + } + + /// + /// Service health event in the subscription by event tracking id + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId} + /// + /// + /// Operation Id + /// Event_GetBySubscriptionIdAndTrackingId + /// + /// + /// + /// Event Id which uniquely identifies ServiceHealth event. + /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceHealthEvent(string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) + { + return GetResourceHealthEvents().Get(eventTrackingId, filter, queryStartTime, cancellationToken); } /// @@ -70,7 +123,7 @@ public virtual AsyncPageable GetAvailabilitySt { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailabilityStatusesBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthSubscriptionMockingExtension.GetAvailabilityStatusesBySubscription", "value", "nextLink", cancellationToken); } /// @@ -94,7 +147,7 @@ public virtual Pageable GetAvailabilityStatuse { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilityStatusesRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilityStatusesRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailabilityStatusesBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceHealthAvailabilityStatus.DeserializeResourceHealthAvailabilityStatus, AvailabilityStatusesClientDiagnostics, Pipeline, "ResourceHealthSubscriptionMockingExtension.GetAvailabilityStatusesBySubscription", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthTenantMockingExtension.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthTenantMockingExtension.cs new file mode 100644 index 000000000000..0afe9181907c --- /dev/null +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/ResourceHealthTenantMockingExtension.cs @@ -0,0 +1,199 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ResourceHealth; +using Azure.ResourceManager.ResourceHealth.Models; + +namespace Azure.ResourceManager.ResourceHealth.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class ResourceHealthTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceHealthTenantMockingExtension() + { + } + + /// 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 ResourceHealthTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ResourceHealthMetadataEntityResources in the TenantResource. + /// An object representing collection of ResourceHealthMetadataEntityResources and their operations over a ResourceHealthMetadataEntityResource. + public virtual ResourceHealthMetadataEntityCollection GetResourceHealthMetadataEntities() + { + return GetCachedClient(client => new ResourceHealthMetadataEntityCollection(client, Id)); + } + + /// + /// Gets the list of metadata entities. + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/metadata/{name} + /// + /// + /// Operation Id + /// Metadata_GetEntity + /// + /// + /// + /// Name of metadata entity. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceHealthMetadataEntityAsync(string name, CancellationToken cancellationToken = default) + { + return await GetResourceHealthMetadataEntities().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the list of metadata entities. + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/metadata/{name} + /// + /// + /// Operation Id + /// Metadata_GetEntity + /// + /// + /// + /// Name of metadata entity. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceHealthMetadataEntity(string name, CancellationToken cancellationToken = default) + { + return GetResourceHealthMetadataEntities().Get(name, cancellationToken); + } + + /// Gets a collection of TenantResourceHealthEventResources in the TenantResource. + /// An object representing collection of TenantResourceHealthEventResources and their operations over a TenantResourceHealthEventResource. + public virtual TenantResourceHealthEventCollection GetTenantResourceHealthEvents() + { + return GetCachedClient(client => new TenantResourceHealthEventCollection(client, Id)); + } + + /// + /// Service health event in the tenant by event tracking id + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/events/{eventTrackingId} + /// + /// + /// Operation Id + /// Event_GetByTenantIdAndTrackingId + /// + /// + /// + /// Event Id which uniquely identifies ServiceHealth event. + /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTenantResourceHealthEventAsync(string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) + { + return await GetTenantResourceHealthEvents().GetAsync(eventTrackingId, filter, queryStartTime, cancellationToken).ConfigureAwait(false); + } + + /// + /// Service health event in the tenant by event tracking id + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/events/{eventTrackingId} + /// + /// + /// Operation Id + /// Event_GetByTenantIdAndTrackingId + /// + /// + /// + /// Event Id which uniquely identifies ServiceHealth event. + /// The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN. + /// Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTenantResourceHealthEvent(string eventTrackingId, string filter = null, string queryStartTime = null, CancellationToken cancellationToken = default) + { + return GetTenantResourceHealthEvents().Get(eventTrackingId, filter, queryStartTime, cancellationToken); + } + + /// Gets a collection of ServiceEmergingIssueResources in the TenantResource. + /// An object representing collection of ServiceEmergingIssueResources and their operations over a ServiceEmergingIssueResource. + public virtual ServiceEmergingIssueCollection GetServiceEmergingIssues() + { + return GetCachedClient(client => new ServiceEmergingIssueCollection(client, Id)); + } + + /// + /// Gets Azure services' emerging issues. + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/emergingIssues/{issueName} + /// + /// + /// Operation Id + /// EmergingIssues_Get + /// + /// + /// + /// The name of the emerging issue. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetServiceEmergingIssueAsync(EmergingIssueNameContent issueName, CancellationToken cancellationToken = default) + { + return await GetServiceEmergingIssues().GetAsync(issueName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets Azure services' emerging issues. + /// + /// + /// Request Path + /// /providers/Microsoft.ResourceHealth/emergingIssues/{issueName} + /// + /// + /// Operation Id + /// EmergingIssues_Get + /// + /// + /// + /// The name of the emerging issue. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetServiceEmergingIssue(EmergingIssueNameContent issueName, CancellationToken cancellationToken = default) + { + return GetServiceEmergingIssues().Get(issueName, cancellationToken); + } + } +} diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 4c04aeb0ced3..000000000000 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ResourceHealth -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ResourceHealthMetadataEntityResources in the TenantResource. - /// An object representing collection of ResourceHealthMetadataEntityResources and their operations over a ResourceHealthMetadataEntityResource. - public virtual ResourceHealthMetadataEntityCollection GetResourceHealthMetadataEntities() - { - return GetCachedClient(Client => new ResourceHealthMetadataEntityCollection(Client, Id)); - } - - /// Gets a collection of TenantResourceHealthEventResources in the TenantResource. - /// An object representing collection of TenantResourceHealthEventResources and their operations over a TenantResourceHealthEventResource. - public virtual TenantResourceHealthEventCollection GetTenantResourceHealthEvents() - { - return GetCachedClient(Client => new TenantResourceHealthEventCollection(Client, Id)); - } - - /// Gets a collection of ServiceEmergingIssueResources in the TenantResource. - /// An object representing collection of ServiceEmergingIssueResources and their operations over a ServiceEmergingIssueResource. - public virtual ServiceEmergingIssueCollection GetServiceEmergingIssues() - { - return GetCachedClient(Client => new ServiceEmergingIssueCollection(Client, Id)); - } - } -} diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ResourceHealthEventResource.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ResourceHealthEventResource.cs index 09b1556020a5..874e1c79c90f 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ResourceHealthEventResource.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/ResourceHealthEventResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ResourceHealthEventImpactedResources and their operations over a ResourceHealthEventImpactedResource. public virtual ResourceHealthEventImpactedResourceCollection GetResourceHealthEventImpactedResources() { - return GetCachedClient(Client => new ResourceHealthEventImpactedResourceCollection(Client, Id)); + return GetCachedClient(client => new ResourceHealthEventImpactedResourceCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual ResourceHealthEventImpactedResourceCollection GetResourceHealthEv /// /// Name of the Impacted Resource. /// The cancellation token to use. - /// 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> GetResourceHealthEventImpactedResourceAsync(string impactedResourceName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetReso /// /// Name of the Impacted Resource. /// The cancellation token to use. - /// 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 GetResourceHealthEventImpactedResource(string impactedResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/TenantResourceHealthEventResource.cs b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/TenantResourceHealthEventResource.cs index f7eae09250fd..5aadfd075801 100644 --- a/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/TenantResourceHealthEventResource.cs +++ b/sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/src/Generated/TenantResourceHealthEventResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of TenantResourceHealthEventImpactedResources and their operations over a TenantResourceHealthEventImpactedResource. public virtual TenantResourceHealthEventImpactedResourceCollection GetTenantResourceHealthEventImpactedResources() { - return GetCachedClient(Client => new TenantResourceHealthEventImpactedResourceCollection(Client, Id)); + return GetCachedClient(client => new TenantResourceHealthEventImpactedResourceCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual TenantResourceHealthEventImpactedResourceCollection GetTenantReso /// /// Name of the Impacted Resource. /// The cancellation token to use. - /// 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> GetTenantResourceHealthEventImpactedResourceAsync(string impactedResourceName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> G /// /// Name of the Impacted Resource. /// The cancellation token to use. - /// 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 GetTenantResourceHealthEventImpactedResource(string impactedResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/ArmClient.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/ArmClient.cs index a814527cc301..efe91fb3ac3f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/ArmClient.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/ArmClient.cs @@ -12,7 +12,6 @@ namespace Azure.ResourceManager { public partial class ArmClient { - #region ManagementGroupResource /// /// 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. @@ -24,6 +23,5 @@ public virtual ManagementGroupResource GetManagementGroupResource(ResourceIdenti ManagementGroupResource.ValidateResourceId(id); return new ManagementGroupResource(this, id); } - #endregion } } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/TenantResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/TenantResource.cs index 23b27abc58a1..a37ed36bd511 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/TenantResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Extensions/TenantResource.cs @@ -21,7 +21,7 @@ public partial class TenantResource /// An object representing collection of ManagementGroupResources and their operations over a ManagementGroupResource. public virtual ManagementGroupCollection GetManagementGroups() { - return GetCachedClient(Client => new ManagementGroupCollection(Client, Id)); + return GetCachedClient(client => new ManagementGroupCollection(client, Id)); } /// @@ -44,8 +44,8 @@ public virtual ManagementGroupCollection GetManagementGroups() /// A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription'). /// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches. /// The cancellation token to use. - /// 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> GetManagementGroupAsync(string groupId, ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default) { @@ -72,8 +72,8 @@ public virtual async Task> GetManagementGroupA /// A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription'). /// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches. /// The cancellation token to use. - /// 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 GetManagementGroup(string groupId, ManagementGroupExpandType? expand = null, bool? recurse = null, string filter = null, string cacheControl = null, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs index 343be1099c6e..aafe5e771b67 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs @@ -12,7 +12,6 @@ namespace Azure.ResourceManager { public partial class ArmClient { - #region PolicyAssignmentResource /// /// 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. @@ -24,9 +23,7 @@ public virtual PolicyAssignmentResource GetPolicyAssignmentResource(ResourceIden PolicyAssignmentResource.ValidateResourceId(id); return new PolicyAssignmentResource(this, id); } - #endregion - #region ResourceProviderResource /// /// 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. @@ -38,9 +35,7 @@ public virtual ResourceProviderResource GetResourceProviderResource(ResourceIden ResourceProviderResource.ValidateResourceId(id); return new ResourceProviderResource(this, id); } - #endregion - #region ResourceGroupResource /// /// 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. @@ -52,9 +47,7 @@ public virtual ResourceGroupResource GetResourceGroupResource(ResourceIdentifier ResourceGroupResource.ValidateResourceId(id); return new ResourceGroupResource(this, id); } - #endregion - #region TagResource /// /// 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. @@ -66,9 +59,7 @@ public virtual TagResource GetTagResource(ResourceIdentifier id) TagResource.ValidateResourceId(id); return new TagResource(this, id); } - #endregion - #region SubscriptionPolicyDefinitionResource /// /// 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. @@ -80,9 +71,7 @@ public virtual SubscriptionPolicyDefinitionResource GetSubscriptionPolicyDefinit SubscriptionPolicyDefinitionResource.ValidateResourceId(id); return new SubscriptionPolicyDefinitionResource(this, id); } - #endregion - #region TenantPolicyDefinitionResource /// /// 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. @@ -94,9 +83,7 @@ public virtual TenantPolicyDefinitionResource GetTenantPolicyDefinitionResource( TenantPolicyDefinitionResource.ValidateResourceId(id); return new TenantPolicyDefinitionResource(this, id); } - #endregion - #region ManagementGroupPolicyDefinitionResource /// /// 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. @@ -108,9 +95,7 @@ public virtual ManagementGroupPolicyDefinitionResource GetManagementGroupPolicyD ManagementGroupPolicyDefinitionResource.ValidateResourceId(id); return new ManagementGroupPolicyDefinitionResource(this, id); } - #endregion - #region SubscriptionPolicySetDefinitionResource /// /// 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. @@ -122,9 +107,7 @@ public virtual SubscriptionPolicySetDefinitionResource GetSubscriptionPolicySetD SubscriptionPolicySetDefinitionResource.ValidateResourceId(id); return new SubscriptionPolicySetDefinitionResource(this, id); } - #endregion - #region TenantPolicySetDefinitionResource /// /// 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. @@ -136,9 +119,7 @@ public virtual TenantPolicySetDefinitionResource GetTenantPolicySetDefinitionRes TenantPolicySetDefinitionResource.ValidateResourceId(id); return new TenantPolicySetDefinitionResource(this, id); } - #endregion - #region ManagementGroupPolicySetDefinitionResource /// /// 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. @@ -150,9 +131,7 @@ public virtual ManagementGroupPolicySetDefinitionResource GetManagementGroupPoli ManagementGroupPolicySetDefinitionResource.ValidateResourceId(id); return new ManagementGroupPolicySetDefinitionResource(this, id); } - #endregion - #region DataPolicyManifestResource /// /// 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. @@ -164,9 +143,7 @@ public virtual DataPolicyManifestResource GetDataPolicyManifestResource(Resource DataPolicyManifestResource.ValidateResourceId(id); return new DataPolicyManifestResource(this, id); } - #endregion - #region ManagementLockResource /// /// 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. @@ -178,9 +155,7 @@ public virtual ManagementLockResource GetManagementLockResource(ResourceIdentifi ManagementLockResource.ValidateResourceId(id); return new ManagementLockResource(this, id); } - #endregion - #region SubscriptionResource /// /// 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. @@ -192,9 +167,7 @@ public virtual SubscriptionResource GetSubscriptionResource(ResourceIdentifier i SubscriptionResource.ValidateResourceId(id); return new SubscriptionResource(this, id); } - #endregion - #region FeatureResource /// /// 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. @@ -206,6 +179,5 @@ public virtual FeatureResource GetFeatureResource(ResourceIdentifier id) FeatureResource.ValidateResourceId(id); return new FeatureResource(this, id); } - #endregion } } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmResource.cs deleted file mode 100644 index 17887414b18e..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmResource.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager -{ - public partial class ArmResource - { - /// Gets a collection of PolicyAssignmentResources in the ArmResource. - /// An object representing collection of PolicyAssignmentResources and their operations over a PolicyAssignmentResource. - public virtual PolicyAssignmentCollection GetPolicyAssignments() - { - return GetCachedClient(Client => new PolicyAssignmentCollection(Client, Id)); - } - - /// - /// This operation retrieves a single policy assignment, given its name and the scope it was created at. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName} - /// - /// - /// Operation Id - /// PolicyAssignments_Get - /// - /// - /// - /// The name of the policy assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetPolicyAssignmentAsync(string policyAssignmentName, CancellationToken cancellationToken = default) - { - return await GetPolicyAssignments().GetAsync(policyAssignmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// This operation retrieves a single policy assignment, given its name and the scope it was created at. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName} - /// - /// - /// Operation Id - /// PolicyAssignments_Get - /// - /// - /// - /// The name of the policy assignment to get. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetPolicyAssignment(string policyAssignmentName, CancellationToken cancellationToken = default) - { - return GetPolicyAssignments().Get(policyAssignmentName, cancellationToken); - } - - /// Gets a collection of ManagementLockResources in the ArmResource. - /// An object representing collection of ManagementLockResources and their operations over a ManagementLockResource. - public virtual ManagementLockCollection GetManagementLocks() - { - return GetCachedClient(Client => new ManagementLockCollection(Client, Id)); - } - - /// - /// Get a management lock by scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/locks/{lockName} - /// - /// - /// Operation Id - /// ManagementLocks_GetByScope - /// - /// - /// - /// The name of lock. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetManagementLockAsync(string lockName, CancellationToken cancellationToken = default) - { - return await GetManagementLocks().GetAsync(lockName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a management lock by scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Authorization/locks/{lockName} - /// - /// - /// Operation Id - /// ManagementLocks_GetByScope - /// - /// - /// - /// The name of lock. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetManagementLock(string lockName, CancellationToken cancellationToken = default) - { - return GetManagementLocks().Get(lockName, cancellationToken); - } - } -} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ManagementGroupResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ManagementGroupResource.cs index 7a691d92ccde..2ec479d582f2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ManagementGroupResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ManagementGroupResource.cs @@ -20,7 +20,7 @@ public partial class ManagementGroupResource /// An object representing collection of ManagementGroupPolicyDefinitionResources and their operations over a ManagementGroupPolicyDefinitionResource. public virtual ManagementGroupPolicyDefinitionCollection GetManagementGroupPolicyDefinitions() { - return GetCachedClient(Client => new ManagementGroupPolicyDefinitionCollection(Client, Id)); + return GetCachedClient(client => new ManagementGroupPolicyDefinitionCollection(client, Id)); } /// @@ -38,8 +38,8 @@ public virtual ManagementGroupPolicyDefinitionCollection GetManagementGroupPolic /// /// The name of the policy definition to get. /// The cancellation token to use. - /// 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> GetManagementGroupPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -61,8 +61,8 @@ public virtual async Task> Get /// /// The name of the policy definition to get. /// The cancellation token to use. - /// 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 GetManagementGroupPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -73,7 +73,7 @@ public virtual Response GetManagementGr /// An object representing collection of ManagementGroupPolicySetDefinitionResources and their operations over a ManagementGroupPolicySetDefinitionResource. public virtual ManagementGroupPolicySetDefinitionCollection GetManagementGroupPolicySetDefinitions() { - return GetCachedClient(Client => new ManagementGroupPolicySetDefinitionCollection(Client, Id)); + return GetCachedClient(client => new ManagementGroupPolicySetDefinitionCollection(client, Id)); } /// @@ -91,8 +91,8 @@ public virtual ManagementGroupPolicySetDefinitionCollection GetManagementGroupPo /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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> GetManagementGroupPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default) { @@ -114,8 +114,8 @@ public virtual async Task> /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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 GetManagementGroupPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderResource.cs index ff5de33788f6..ede6faa824e9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FeatureResources and their operations over a FeatureResource. public virtual FeatureCollection GetFeatures() { - return GetCachedClient(Client => new FeatureCollection(Client, Id)); + return GetCachedClient(client => new FeatureCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual FeatureCollection GetFeatures() /// /// The name of the feature to get. /// The cancellation token to use. - /// 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> GetFeatureAsync(string featureName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetFeatureAsync(string feat /// /// The name of the feature to get. /// The cancellation token to use. - /// 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 GetFeature(string featureName, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs index 54d1b93d2d76..0476b10da0ce 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs @@ -107,7 +107,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ResourceProviderResources and their operations over a ResourceProviderResource. public virtual ResourceProviderCollection GetResourceProviders() { - return GetCachedClient(Client => new ResourceProviderCollection(Client, Id)); + return GetCachedClient(client => new ResourceProviderCollection(client, Id)); } /// @@ -126,8 +126,8 @@ public virtual ResourceProviderCollection GetResourceProviders() /// The namespace of the resource provider. /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. /// The cancellation token to use. - /// 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> GetResourceProviderAsync(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { @@ -150,8 +150,8 @@ public virtual async Task> GetResourceProvide /// The namespace of the resource provider. /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. /// The cancellation token to use. - /// 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 GetResourceProvider(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { @@ -162,7 +162,7 @@ public virtual Response GetResourceProvider(string res /// An object representing collection of ResourceGroupResources and their operations over a ResourceGroupResource. public virtual ResourceGroupCollection GetResourceGroups() { - return GetCachedClient(Client => new ResourceGroupCollection(Client, Id)); + return GetCachedClient(client => new ResourceGroupCollection(client, Id)); } /// @@ -180,8 +180,8 @@ public virtual ResourceGroupCollection GetResourceGroups() /// /// The name of the resource group to get. The name is case insensitive. /// The cancellation token to use. - /// 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> GetResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) { @@ -203,8 +203,8 @@ public virtual async Task> GetResourceGroupAsync /// /// The name of the resource group to get. The name is case insensitive. /// The cancellation token to use. - /// 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 GetResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) { @@ -215,7 +215,7 @@ public virtual Response GetResourceGroup(string resourceG /// An object representing collection of SubscriptionPolicyDefinitionResources and their operations over a SubscriptionPolicyDefinitionResource. public virtual SubscriptionPolicyDefinitionCollection GetSubscriptionPolicyDefinitions() { - return GetCachedClient(Client => new SubscriptionPolicyDefinitionCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionPolicyDefinitionCollection(client, Id)); } /// @@ -233,8 +233,8 @@ public virtual SubscriptionPolicyDefinitionCollection GetSubscriptionPolicyDefin /// /// The name of the policy definition to get. /// The cancellation token to use. - /// 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> GetSubscriptionPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -256,8 +256,8 @@ public virtual async Task> GetSub /// /// The name of the policy definition to get. /// The cancellation token to use. - /// 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 GetSubscriptionPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -268,7 +268,7 @@ public virtual Response GetSubscriptionPol /// An object representing collection of SubscriptionPolicySetDefinitionResources and their operations over a SubscriptionPolicySetDefinitionResource. public virtual SubscriptionPolicySetDefinitionCollection GetSubscriptionPolicySetDefinitions() { - return GetCachedClient(Client => new SubscriptionPolicySetDefinitionCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionPolicySetDefinitionCollection(client, Id)); } /// @@ -286,8 +286,8 @@ public virtual SubscriptionPolicySetDefinitionCollection GetSubscriptionPolicySe /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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> GetSubscriptionPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default) { @@ -309,8 +309,8 @@ public virtual async Task> Get /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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 GetSubscriptionPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs index 8092739348b0..149f57bdf995 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs @@ -84,14 +84,14 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GenericResources and their operations over a GenericResource. public virtual GenericResourceCollection GetGenericResources() { - return GetCachedClient(Client => new GenericResourceCollection(Client, Id)); + return GetCachedClient(client => new GenericResourceCollection(client, Id)); } /// Gets a collection of TenantPolicyDefinitionResources in the Tenant. /// An object representing collection of TenantPolicyDefinitionResources and their operations over a TenantPolicyDefinitionResource. public virtual TenantPolicyDefinitionCollection GetTenantPolicyDefinitions() { - return GetCachedClient(Client => new TenantPolicyDefinitionCollection(Client, Id)); + return GetCachedClient(client => new TenantPolicyDefinitionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual TenantPolicyDefinitionCollection GetTenantPolicyDefinitions() /// /// The name of the built-in policy definition to get. /// The cancellation token to use. - /// 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> GetTenantPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetTenantPol /// /// The name of the built-in policy definition to get. /// The cancellation token to use. - /// 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 GetTenantPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetTenantPolicyDefinitio /// An object representing collection of TenantPolicySetDefinitionResources and their operations over a TenantPolicySetDefinitionResource. public virtual TenantPolicySetDefinitionCollection GetTenantPolicySetDefinitions() { - return GetCachedClient(Client => new TenantPolicySetDefinitionCollection(Client, Id)); + return GetCachedClient(client => new TenantPolicySetDefinitionCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual TenantPolicySetDefinitionCollection GetTenantPolicySetDefinitions /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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> GetTenantPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetTenant /// /// The name of the policy set definition to get. /// The cancellation token to use. - /// 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 GetTenantPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default) { @@ -197,7 +197,7 @@ public virtual Response GetTenantPolicySetDef /// An object representing collection of DataPolicyManifestResources and their operations over a DataPolicyManifestResource. public virtual DataPolicyManifestCollection GetDataPolicyManifests() { - return GetCachedClient(Client => new DataPolicyManifestCollection(Client, Id)); + return GetCachedClient(client => new DataPolicyManifestCollection(client, Id)); } /// @@ -215,8 +215,8 @@ public virtual DataPolicyManifestCollection GetDataPolicyManifests() /// /// The policy mode of the data policy manifest to get. /// The cancellation token to use. - /// 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> GetDataPolicyManifestAsync(string policyMode, CancellationToken cancellationToken = default) { @@ -238,8 +238,8 @@ public virtual async Task> GetDataPolicyMan /// /// The policy mode of the data policy manifest to get. /// The cancellation token to use. - /// 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 GetDataPolicyManifest(string policyMode, CancellationToken cancellationToken = default) { @@ -250,7 +250,7 @@ public virtual Response GetDataPolicyManifest(string /// An object representing collection of SubscriptionResources and their operations over a SubscriptionResource. public virtual SubscriptionCollection GetSubscriptions() { - return GetCachedClient(Client => new SubscriptionCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionCollection(client, Id)); } /// @@ -268,8 +268,8 @@ public virtual SubscriptionCollection GetSubscriptions() /// /// The ID of the target subscription. /// The cancellation token to use. - /// 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> GetSubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { @@ -291,8 +291,8 @@ public virtual async Task> GetSubscriptionAsync(s /// /// The ID of the target subscription. /// The cancellation token to use. - /// 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 GetSubscription(string subscriptionId, CancellationToken cancellationToken = default) { diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index feb150ce0fcf..000000000000 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ResourceMover -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of MoverResourceSetResources in the ResourceGroupResource. - /// An object representing collection of MoverResourceSetResources and their operations over a MoverResourceSetResource. - public virtual MoverResourceSetCollection GetMoverResourceSets() - { - return GetCachedClient(Client => new MoverResourceSetCollection(Client, Id)); - } - } -} diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverArmClientMockingExtension.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverArmClientMockingExtension.cs new file mode 100644 index 000000000000..23c834bfad34 --- /dev/null +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ResourceMover; + +namespace Azure.ResourceManager.ResourceMover.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ResourceMoverArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceMoverArmClientMockingExtension() + { + } + + /// 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 ResourceMoverArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ResourceMoverArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MoverResourceSetResource GetMoverResourceSetResource(ResourceIdentifier id) + { + MoverResourceSetResource.ValidateResourceId(id); + return new MoverResourceSetResource(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 MoverResource GetMoverResource(ResourceIdentifier id) + { + MoverResource.ValidateResourceId(id); + return new MoverResource(Client, id); + } + } +} diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverExtensions.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverExtensions.cs index 0bddce4bb2d3..f585010dc02e 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverExtensions.cs +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceMover.Mocking; using Azure.ResourceManager.ResourceMover.Models; using Azure.ResourceManager.Resources; @@ -19,97 +20,70 @@ namespace Azure.ResourceManager.ResourceMover /// A class to add extension methods to Azure.ResourceManager.ResourceMover. public static partial class ResourceMoverExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ResourceMoverArmClientMockingExtension GetResourceMoverArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ResourceMoverArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourceMoverResourceGroupMockingExtension GetResourceMoverResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceMoverResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ResourceMoverSubscriptionMockingExtension GetResourceMoverSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ResourceMoverSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourceMoverTenantMockingExtension GetResourceMoverTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourceMoverTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region MoverResourceSetResource /// /// 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. /// Returns a object. public static MoverResourceSetResource GetMoverResourceSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MoverResourceSetResource.ValidateResourceId(id); - return new MoverResourceSetResource(client, id); - } - ); + return GetResourceMoverArmClientMockingExtension(client).GetMoverResourceSetResource(id); } - #endregion - #region MoverResource /// /// 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. /// Returns a object. public static MoverResource GetMoverResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MoverResource.ValidateResourceId(id); - return new MoverResource(client, id); - } - ); + return GetResourceMoverArmClientMockingExtension(client).GetMoverResource(id); } - #endregion - /// Gets a collection of MoverResourceSetResources in the ResourceGroupResource. + /// + /// Gets a collection of MoverResourceSetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MoverResourceSetResources and their operations over a MoverResourceSetResource. public static MoverResourceSetCollection GetMoverResourceSets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMoverResourceSets(); + return GetResourceMoverResourceGroupMockingExtension(resourceGroupResource).GetMoverResourceSets(); } /// @@ -124,16 +98,20 @@ public static MoverResourceSetCollection GetMoverResourceSets(this ResourceGroup /// MoveCollections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Move Collection Name. /// The cancellation token to use. - /// 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 static async Task> GetMoverResourceSetAsync(this ResourceGroupResource resourceGroupResource, string moverResourceSetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMoverResourceSets().GetAsync(moverResourceSetName, cancellationToken).ConfigureAwait(false); + return await GetResourceMoverResourceGroupMockingExtension(resourceGroupResource).GetMoverResourceSetAsync(moverResourceSetName, cancellationToken).ConfigureAwait(false); } /// @@ -148,16 +126,20 @@ public static async Task> GetMoverResourceSet /// MoveCollections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Move Collection Name. /// The cancellation token to use. - /// 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 static Response GetMoverResourceSet(this ResourceGroupResource resourceGroupResource, string moverResourceSetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMoverResourceSets().Get(moverResourceSetName, cancellationToken); + return GetResourceMoverResourceGroupMockingExtension(resourceGroupResource).GetMoverResourceSet(moverResourceSetName, cancellationToken); } /// @@ -172,13 +154,17 @@ public static Response GetMoverResourceSet(this Resour /// MoveCollections_ListMoveCollectionsBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMoverResourceSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMoverResourceSetsAsync(cancellationToken); + return GetResourceMoverSubscriptionMockingExtension(subscriptionResource).GetMoverResourceSetsAsync(cancellationToken); } /// @@ -193,13 +179,17 @@ public static AsyncPageable GetMoverResourceSetsAsync( /// MoveCollections_ListMoveCollectionsBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMoverResourceSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMoverResourceSets(cancellationToken); + return GetResourceMoverSubscriptionMockingExtension(subscriptionResource).GetMoverResourceSets(cancellationToken); } /// @@ -213,13 +203,17 @@ public static Pageable GetMoverResourceSets(this Subsc /// OperationsDiscovery_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOperationsDiscoveriesAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsDiscoveriesAsync(cancellationToken); + return GetResourceMoverTenantMockingExtension(tenantResource).GetOperationsDiscoveriesAsync(cancellationToken); } /// @@ -233,13 +227,17 @@ public static AsyncPageable GetOperationsDiscoveriesAs /// OperationsDiscovery_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOperationsDiscoveries(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetOperationsDiscoveries(cancellationToken); + return GetResourceMoverTenantMockingExtension(tenantResource).GetOperationsDiscoveries(cancellationToken); } } } diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverResourceGroupMockingExtension.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..b548d3445490 --- /dev/null +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ResourceMover; + +namespace Azure.ResourceManager.ResourceMover.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ResourceMoverResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourceMoverResourceGroupMockingExtension() + { + } + + /// 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 ResourceMoverResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of MoverResourceSetResources in the ResourceGroupResource. + /// An object representing collection of MoverResourceSetResources and their operations over a MoverResourceSetResource. + public virtual MoverResourceSetCollection GetMoverResourceSets() + { + return GetCachedClient(client => new MoverResourceSetCollection(client, Id)); + } + + /// + /// Gets the move collection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName} + /// + /// + /// Operation Id + /// MoveCollections_Get + /// + /// + /// + /// The Move Collection Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMoverResourceSetAsync(string moverResourceSetName, CancellationToken cancellationToken = default) + { + return await GetMoverResourceSets().GetAsync(moverResourceSetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the move collection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName} + /// + /// + /// Operation Id + /// MoveCollections_Get + /// + /// + /// + /// The Move Collection Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMoverResourceSet(string moverResourceSetName, CancellationToken cancellationToken = default) + { + return GetMoverResourceSets().Get(moverResourceSetName, cancellationToken); + } + } +} diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverSubscriptionMockingExtension.cs similarity index 85% rename from sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverSubscriptionMockingExtension.cs index 6e266dc09c9f..1ad20ccea430 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceMover; -namespace Azure.ResourceManager.ResourceMover +namespace Azure.ResourceManager.ResourceMover.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ResourceMoverSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _moverResourceSetMoveCollectionsClientDiagnostics; private MoveCollectionsRestOperations _moverResourceSetMoveCollectionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceMoverSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceMoverSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetMoverResourceSetsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => MoverResourceSetMoveCollectionsRestClient.CreateListMoveCollectionsBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MoverResourceSetMoveCollectionsRestClient.CreateListMoveCollectionsBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MoverResourceSetResource(Client, MoverResourceSetData.DeserializeMoverResourceSetData(e)), MoverResourceSetMoveCollectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMoverResourceSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MoverResourceSetResource(Client, MoverResourceSetData.DeserializeMoverResourceSetData(e)), MoverResourceSetMoveCollectionsClientDiagnostics, Pipeline, "ResourceMoverSubscriptionMockingExtension.GetMoverResourceSets", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetMoverResourceSets(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => MoverResourceSetMoveCollectionsRestClient.CreateListMoveCollectionsBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MoverResourceSetMoveCollectionsRestClient.CreateListMoveCollectionsBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MoverResourceSetResource(Client, MoverResourceSetData.DeserializeMoverResourceSetData(e)), MoverResourceSetMoveCollectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMoverResourceSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MoverResourceSetResource(Client, MoverResourceSetData.DeserializeMoverResourceSetData(e)), MoverResourceSetMoveCollectionsClientDiagnostics, Pipeline, "ResourceMoverSubscriptionMockingExtension.GetMoverResourceSets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverTenantMockingExtension.cs similarity index 84% rename from sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverTenantMockingExtension.cs index 9298aae6345c..b20cc4946e64 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/Extensions/ResourceMoverTenantMockingExtension.cs @@ -11,25 +11,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ResourceMover; using Azure.ResourceManager.ResourceMover.Models; -namespace Azure.ResourceManager.ResourceMover +namespace Azure.ResourceManager.ResourceMover.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ResourceMoverTenantMockingExtension : ArmResource { private ClientDiagnostics _operationsDiscoveryClientDiagnostics; private OperationsDiscoveryRestOperations _operationsDiscoveryRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourceMoverTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourceMoverTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,7 +60,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetOperationsDiscoveriesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsDiscoveryRestClient.CreateGetRequest(); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MoverOperationsDiscovery.DeserializeMoverOperationsDiscovery, OperationsDiscoveryClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsDiscoveries", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MoverOperationsDiscovery.DeserializeMoverOperationsDiscovery, OperationsDiscoveryClientDiagnostics, Pipeline, "ResourceMoverTenantMockingExtension.GetOperationsDiscoveries", "value", null, cancellationToken); } /// @@ -79,7 +80,7 @@ public virtual AsyncPageable GetOperationsDiscoveriesA public virtual Pageable GetOperationsDiscoveries(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsDiscoveryRestClient.CreateGetRequest(); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MoverOperationsDiscovery.DeserializeMoverOperationsDiscovery, OperationsDiscoveryClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetOperationsDiscoveries", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MoverOperationsDiscovery.DeserializeMoverOperationsDiscovery, OperationsDiscoveryClientDiagnostics, Pipeline, "ResourceMoverTenantMockingExtension.GetOperationsDiscoveries", "value", null, cancellationToken); } } } diff --git a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/MoverResourceSetResource.cs b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/MoverResourceSetResource.cs index ac3459678141..5d473a99d0e9 100644 --- a/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/MoverResourceSetResource.cs +++ b/sdk/resourcemover/Azure.ResourceManager.ResourceMover/src/Generated/MoverResourceSetResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MoverResources and their operations over a MoverResource. public virtual MoverResourceCollection GetMoverResources() { - return GetCachedClient(Client => new MoverResourceCollection(Client, Id)); + return GetCachedClient(client => new MoverResourceCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual MoverResourceCollection GetMoverResources() /// /// The Move Resource Name. /// The cancellation token to use. - /// 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> GetMoverResourceAsync(string moverResourceName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetMoverResourceAsync(string /// /// The Move Resource Name. /// The cancellation token to use. - /// 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 GetMoverResource(string moverResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs deleted file mode 100644 index cd14dcc67e1f..000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Resources -{ - /// A class to add extension methods to ManagementGroupResource. - internal partial class ManagementGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ManagementGroupResourceExtensionClient() - { - } - - /// 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 ManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ArmDeploymentResources in the ManagementGroupResource. - /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. - public virtual ArmDeploymentCollection GetArmDeployments() - { - return GetCachedClient(Client => new ArmDeploymentCollection(Client, Id)); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index f4e37c164196..000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Resources -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ArmDeploymentResources in the ResourceGroupResource. - /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. - public virtual ArmDeploymentCollection GetArmDeployments() - { - return GetCachedClient(Client => new ArmDeploymentCollection(Client, Id)); - } - - /// Gets a collection of ArmApplicationResources in the ResourceGroupResource. - /// An object representing collection of ArmApplicationResources and their operations over a ArmApplicationResource. - public virtual ArmApplicationCollection GetArmApplications() - { - return GetCachedClient(Client => new ArmApplicationCollection(Client, Id)); - } - - /// Gets a collection of ArmApplicationDefinitionResources in the ResourceGroupResource. - /// An object representing collection of ArmApplicationDefinitionResources and their operations over a ArmApplicationDefinitionResource. - public virtual ArmApplicationDefinitionCollection GetArmApplicationDefinitions() - { - return GetCachedClient(Client => new ArmApplicationDefinitionCollection(Client, Id)); - } - - /// Gets a collection of JitRequestResources in the ResourceGroupResource. - /// An object representing collection of JitRequestResources and their operations over a JitRequestResource. - public virtual JitRequestCollection GetJitRequests() - { - return GetCachedClient(Client => new JitRequestCollection(Client, Id)); - } - - /// Gets a collection of ArmDeploymentScriptResources in the ResourceGroupResource. - /// An object representing collection of ArmDeploymentScriptResources and their operations over a ArmDeploymentScriptResource. - public virtual ArmDeploymentScriptCollection GetArmDeploymentScripts() - { - return GetCachedClient(Client => new ArmDeploymentScriptCollection(Client, Id)); - } - - /// Gets a collection of TemplateSpecResources in the ResourceGroupResource. - /// An object representing collection of TemplateSpecResources and their operations over a TemplateSpecResource. - public virtual TemplateSpecCollection GetTemplateSpecs() - { - return GetCachedClient(Client => new TemplateSpecCollection(Client, Id)); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesArmClientMockingExtension.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesArmClientMockingExtension.cs new file mode 100644 index 000000000000..9941218250bf --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesArmClientMockingExtension.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Resources.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ResourcesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourcesArmClientMockingExtension() + { + } + + /// 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 ResourcesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ResourcesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArmDeploymentResource GetArmDeploymentResource(ResourceIdentifier id) + { + ArmDeploymentResource.ValidateResourceId(id); + return new ArmDeploymentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArmApplicationResource GetArmApplicationResource(ResourceIdentifier id) + { + ArmApplicationResource.ValidateResourceId(id); + return new ArmApplicationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArmApplicationDefinitionResource GetArmApplicationDefinitionResource(ResourceIdentifier id) + { + ArmApplicationDefinitionResource.ValidateResourceId(id); + return new ArmApplicationDefinitionResource(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 JitRequestResource GetJitRequestResource(ResourceIdentifier id) + { + JitRequestResource.ValidateResourceId(id); + return new JitRequestResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArmDeploymentScriptResource GetArmDeploymentScriptResource(ResourceIdentifier id) + { + ArmDeploymentScriptResource.ValidateResourceId(id); + return new ArmDeploymentScriptResource(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 ScriptLogResource GetScriptLogResource(ResourceIdentifier id) + { + ScriptLogResource.ValidateResourceId(id); + return new ScriptLogResource(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 TemplateSpecResource GetTemplateSpecResource(ResourceIdentifier id) + { + TemplateSpecResource.ValidateResourceId(id); + return new TemplateSpecResource(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 TemplateSpecVersionResource GetTemplateSpecVersionResource(ResourceIdentifier id) + { + TemplateSpecVersionResource.ValidateResourceId(id); + return new TemplateSpecVersionResource(Client, id); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index 17114817c9de..ffcac2d39188 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.ManagementGroups; +using Azure.ResourceManager.Resources.Mocking; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Resources @@ -19,227 +20,171 @@ namespace Azure.ResourceManager.Resources /// A class to add extension methods to Azure.ResourceManager.Resources. public static partial class ResourcesExtensions { - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmResource resource) + private static ResourcesArmClientMockingExtension GetResourcesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ManagementGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ResourcesArmClientMockingExtension(client0)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourcesManagementGroupMockingExtension GetResourcesManagementGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ManagementGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourcesManagementGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ResourcesResourceGroupMockingExtension GetResourcesResourceGroupMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ResourcesResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ResourcesSubscriptionMockingExtension GetResourcesSubscriptionMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ResourcesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ResourcesTenantMockingExtension GetResourcesTenantMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ResourcesTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region ArmDeploymentResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArmDeploymentResource GetArmDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArmDeploymentResource.ValidateResourceId(id); - return new ArmDeploymentResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetArmDeploymentResource(id); } - #endregion - #region ArmApplicationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArmApplicationResource GetArmApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArmApplicationResource.ValidateResourceId(id); - return new ArmApplicationResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetArmApplicationResource(id); } - #endregion - #region ArmApplicationDefinitionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArmApplicationDefinitionResource GetArmApplicationDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArmApplicationDefinitionResource.ValidateResourceId(id); - return new ArmApplicationDefinitionResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetArmApplicationDefinitionResource(id); } - #endregion - #region JitRequestResource /// /// 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. /// Returns a object. public static JitRequestResource GetJitRequestResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - JitRequestResource.ValidateResourceId(id); - return new JitRequestResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetJitRequestResource(id); } - #endregion - #region ArmDeploymentScriptResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ArmDeploymentScriptResource GetArmDeploymentScriptResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ArmDeploymentScriptResource.ValidateResourceId(id); - return new ArmDeploymentScriptResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetArmDeploymentScriptResource(id); } - #endregion - #region ScriptLogResource /// /// 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. /// Returns a object. public static ScriptLogResource GetScriptLogResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScriptLogResource.ValidateResourceId(id); - return new ScriptLogResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetScriptLogResource(id); } - #endregion - #region TemplateSpecResource /// /// 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. /// Returns a object. public static TemplateSpecResource GetTemplateSpecResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TemplateSpecResource.ValidateResourceId(id); - return new TemplateSpecResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetTemplateSpecResource(id); } - #endregion - #region TemplateSpecVersionResource /// /// 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. /// Returns a object. public static TemplateSpecVersionResource GetTemplateSpecVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TemplateSpecVersionResource.ValidateResourceId(id); - return new TemplateSpecVersionResource(client, id); - } - ); + return GetResourcesArmClientMockingExtension(client).GetTemplateSpecVersionResource(id); } - #endregion - /// Gets a collection of ArmDeploymentResources in the ManagementGroupResource. + /// + /// Gets a collection of ArmDeploymentResources in the ManagementGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public static ArmDeploymentCollection GetArmDeployments(this ManagementGroupResource managementGroupResource) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetArmDeployments(); + return GetResourcesManagementGroupMockingExtension(managementGroupResource).GetArmDeployments(); } /// @@ -254,16 +199,20 @@ public static ArmDeploymentCollection GetArmDeployments(this ManagementGroupReso /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static async Task> GetArmDeploymentAsync(this ManagementGroupResource managementGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return await managementGroupResource.GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + return await GetResourcesManagementGroupMockingExtension(managementGroupResource).GetArmDeploymentAsync(deploymentName, cancellationToken).ConfigureAwait(false); } /// @@ -278,24 +227,34 @@ public static async Task> GetArmDeploymentAsync( /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static Response GetArmDeployment(this ManagementGroupResource managementGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return managementGroupResource.GetArmDeployments().Get(deploymentName, cancellationToken); + return GetResourcesManagementGroupMockingExtension(managementGroupResource).GetArmDeployment(deploymentName, cancellationToken); } - /// Gets a collection of ArmDeploymentResources in the ResourceGroupResource. + /// + /// Gets a collection of ArmDeploymentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public static ArmDeploymentCollection GetArmDeployments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetArmDeployments(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeployments(); } /// @@ -310,16 +269,20 @@ public static ArmDeploymentCollection GetArmDeployments(this ResourceGroupResour /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static async Task> GetArmDeploymentAsync(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeploymentAsync(deploymentName, cancellationToken).ConfigureAwait(false); } /// @@ -334,24 +297,34 @@ public static async Task> GetArmDeploymentAsync( /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static Response GetArmDeployment(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetArmDeployments().Get(deploymentName, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeployment(deploymentName, cancellationToken); } - /// Gets a collection of ArmApplicationResources in the ResourceGroupResource. + /// + /// Gets a collection of ArmApplicationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmApplicationResources and their operations over a ArmApplicationResource. public static ArmApplicationCollection GetArmApplications(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetArmApplications(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplications(); } /// @@ -366,16 +339,20 @@ public static ArmApplicationCollection GetArmApplications(this ResourceGroupReso /// Applications_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed application. /// The cancellation token to use. - /// 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 static async Task> GetArmApplicationAsync(this ResourceGroupResource resourceGroupResource, string applicationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetArmApplications().GetAsync(applicationName, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplicationAsync(applicationName, cancellationToken).ConfigureAwait(false); } /// @@ -390,24 +367,34 @@ public static async Task> GetArmApplicationAsyn /// Applications_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed application. /// The cancellation token to use. - /// 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 static Response GetArmApplication(this ResourceGroupResource resourceGroupResource, string applicationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetArmApplications().Get(applicationName, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplication(applicationName, cancellationToken); } - /// Gets a collection of ArmApplicationDefinitionResources in the ResourceGroupResource. + /// + /// Gets a collection of ArmApplicationDefinitionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmApplicationDefinitionResources and their operations over a ArmApplicationDefinitionResource. public static ArmApplicationDefinitionCollection GetArmApplicationDefinitions(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetArmApplicationDefinitions(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplicationDefinitions(); } /// @@ -422,16 +409,20 @@ public static ArmApplicationDefinitionCollection GetArmApplicationDefinitions(th /// ApplicationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed application definition. /// The cancellation token to use. - /// 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 static async Task> GetArmApplicationDefinitionAsync(this ResourceGroupResource resourceGroupResource, string applicationDefinitionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetArmApplicationDefinitions().GetAsync(applicationDefinitionName, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplicationDefinitionAsync(applicationDefinitionName, cancellationToken).ConfigureAwait(false); } /// @@ -446,24 +437,34 @@ public static async Task> GetArmAppli /// ApplicationDefinitions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed application definition. /// The cancellation token to use. - /// 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 static Response GetArmApplicationDefinition(this ResourceGroupResource resourceGroupResource, string applicationDefinitionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetArmApplicationDefinitions().Get(applicationDefinitionName, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmApplicationDefinition(applicationDefinitionName, cancellationToken); } - /// Gets a collection of JitRequestResources in the ResourceGroupResource. + /// + /// Gets a collection of JitRequestResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of JitRequestResources and their operations over a JitRequestResource. public static JitRequestCollection GetJitRequests(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetJitRequests(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetJitRequests(); } /// @@ -478,16 +479,20 @@ public static JitRequestCollection GetJitRequests(this ResourceGroupResource res /// JitRequests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the JIT request. /// The cancellation token to use. - /// 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 static async Task> GetJitRequestAsync(this ResourceGroupResource resourceGroupResource, string jitRequestName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetJitRequests().GetAsync(jitRequestName, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetJitRequestAsync(jitRequestName, cancellationToken).ConfigureAwait(false); } /// @@ -502,24 +507,34 @@ public static async Task> GetJitRequestAsync(this R /// JitRequests_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the JIT request. /// The cancellation token to use. - /// 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 static Response GetJitRequest(this ResourceGroupResource resourceGroupResource, string jitRequestName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetJitRequests().Get(jitRequestName, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetJitRequest(jitRequestName, cancellationToken); } - /// Gets a collection of ArmDeploymentScriptResources in the ResourceGroupResource. + /// + /// Gets a collection of ArmDeploymentScriptResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmDeploymentScriptResources and their operations over a ArmDeploymentScriptResource. public static ArmDeploymentScriptCollection GetArmDeploymentScripts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetArmDeploymentScripts(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeploymentScripts(); } /// @@ -534,16 +549,20 @@ public static ArmDeploymentScriptCollection GetArmDeploymentScripts(this Resourc /// DeploymentScripts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the deployment script. /// The cancellation token to use. - /// 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 static async Task> GetArmDeploymentScriptAsync(this ResourceGroupResource resourceGroupResource, string scriptName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetArmDeploymentScripts().GetAsync(scriptName, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeploymentScriptAsync(scriptName, cancellationToken).ConfigureAwait(false); } /// @@ -558,24 +577,34 @@ public static async Task> GetArmDeployment /// DeploymentScripts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the deployment script. /// The cancellation token to use. - /// 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 static Response GetArmDeploymentScript(this ResourceGroupResource resourceGroupResource, string scriptName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetArmDeploymentScripts().Get(scriptName, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetArmDeploymentScript(scriptName, cancellationToken); } - /// Gets a collection of TemplateSpecResources in the ResourceGroupResource. + /// + /// Gets a collection of TemplateSpecResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TemplateSpecResources and their operations over a TemplateSpecResource. public static TemplateSpecCollection GetTemplateSpecs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTemplateSpecs(); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetTemplateSpecs(); } /// @@ -590,17 +619,21 @@ public static TemplateSpecCollection GetTemplateSpecs(this ResourceGroupResource /// TemplateSpecs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Template Spec. /// Allows for expansion of additional Template Spec details in the response. Optional. /// The cancellation token to use. - /// 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 static async Task> GetTemplateSpecAsync(this ResourceGroupResource resourceGroupResource, string templateSpecName, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetTemplateSpecs().GetAsync(templateSpecName, expand, cancellationToken).ConfigureAwait(false); + return await GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetTemplateSpecAsync(templateSpecName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -615,25 +648,35 @@ public static async Task> GetTemplateSpecAsync(th /// TemplateSpecs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Template Spec. /// Allows for expansion of additional Template Spec details in the response. Optional. /// The cancellation token to use. - /// 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 static Response GetTemplateSpec(this ResourceGroupResource resourceGroupResource, string templateSpecName, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetTemplateSpecs().Get(templateSpecName, expand, cancellationToken); + return GetResourcesResourceGroupMockingExtension(resourceGroupResource).GetTemplateSpec(templateSpecName, expand, cancellationToken); } - /// Gets a collection of ArmDeploymentResources in the SubscriptionResource. + /// + /// Gets a collection of ArmDeploymentResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public static ArmDeploymentCollection GetArmDeployments(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetArmDeployments(); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmDeployments(); } /// @@ -648,16 +691,20 @@ public static ArmDeploymentCollection GetArmDeployments(this SubscriptionResourc /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static async Task> GetArmDeploymentAsync(this SubscriptionResource subscriptionResource, string deploymentName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + return await GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmDeploymentAsync(deploymentName, cancellationToken).ConfigureAwait(false); } /// @@ -672,16 +719,20 @@ public static async Task> GetArmDeploymentAsync( /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static Response GetArmDeployment(this SubscriptionResource subscriptionResource, string deploymentName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetArmDeployments().Get(deploymentName, cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmDeployment(deploymentName, cancellationToken); } /// @@ -696,13 +747,17 @@ public static Response GetArmDeployment(this Subscription /// Applications_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetArmApplicationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetArmApplicationsAsync(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmApplicationsAsync(cancellationToken); } /// @@ -717,13 +772,17 @@ public static AsyncPageable GetArmApplicationsAsync(this /// Applications_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetArmApplications(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetArmApplications(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmApplications(cancellationToken); } /// @@ -738,13 +797,17 @@ public static Pageable GetArmApplications(this Subscript /// jitRequests_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetJitRequestDefinitionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetJitRequestDefinitionsAsync(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetJitRequestDefinitionsAsync(cancellationToken); } /// @@ -759,13 +822,17 @@ public static AsyncPageable GetJitRequestDefinitionsAsync(th /// jitRequests_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetJitRequestDefinitions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetJitRequestDefinitions(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetJitRequestDefinitions(cancellationToken); } /// @@ -780,13 +847,17 @@ public static Pageable GetJitRequestDefinitions(this Subscri /// DeploymentScripts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetArmDeploymentScriptsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetArmDeploymentScriptsAsync(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmDeploymentScriptsAsync(cancellationToken); } /// @@ -801,13 +872,17 @@ public static AsyncPageable GetArmDeploymentScripts /// DeploymentScripts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetArmDeploymentScripts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetArmDeploymentScripts(cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetArmDeploymentScripts(cancellationToken); } /// @@ -822,6 +897,10 @@ public static Pageable GetArmDeploymentScripts(this /// TemplateSpecs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Allows for expansion of additional Template Spec details in the response. Optional. @@ -829,7 +908,7 @@ public static Pageable GetArmDeploymentScripts(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTemplateSpecsAsync(this SubscriptionResource subscriptionResource, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTemplateSpecsAsync(expand, cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetTemplateSpecsAsync(expand, cancellationToken); } /// @@ -844,6 +923,10 @@ public static AsyncPageable GetTemplateSpecsAsync(this Sub /// TemplateSpecs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Allows for expansion of additional Template Spec details in the response. Optional. @@ -851,15 +934,21 @@ public static AsyncPageable GetTemplateSpecsAsync(this Sub /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTemplateSpecs(this SubscriptionResource subscriptionResource, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTemplateSpecs(expand, cancellationToken); + return GetResourcesSubscriptionMockingExtension(subscriptionResource).GetTemplateSpecs(expand, cancellationToken); } - /// Gets a collection of ArmDeploymentResources in the TenantResource. + /// + /// Gets a collection of ArmDeploymentResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public static ArmDeploymentCollection GetArmDeployments(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetArmDeployments(); + return GetResourcesTenantMockingExtension(tenantResource).GetArmDeployments(); } /// @@ -874,16 +963,20 @@ public static ArmDeploymentCollection GetArmDeployments(this TenantResource tena /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static async Task> GetArmDeploymentAsync(this TenantResource tenantResource, string deploymentName, CancellationToken cancellationToken = default) { - return await tenantResource.GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + return await GetResourcesTenantMockingExtension(tenantResource).GetArmDeploymentAsync(deploymentName, cancellationToken).ConfigureAwait(false); } /// @@ -898,16 +991,20 @@ public static async Task> GetArmDeploymentAsync( /// Deployments_GetAtScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the deployment. /// The cancellation token to use. - /// 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 static Response GetArmDeployment(this TenantResource tenantResource, string deploymentName, CancellationToken cancellationToken = default) { - return tenantResource.GetArmDeployments().Get(deploymentName, cancellationToken); + return GetResourcesTenantMockingExtension(tenantResource).GetArmDeployment(deploymentName, cancellationToken); } /// @@ -922,6 +1019,10 @@ public static Response GetArmDeployment(this TenantResour /// Deployments_CalculateTemplateHash /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The template provided to calculate hash. @@ -929,9 +1030,7 @@ public static Response GetArmDeployment(this TenantResour /// is null. public static async Task> CalculateDeploymentTemplateHashAsync(this TenantResource tenantResource, BinaryData template, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(template, nameof(template)); - - return await GetTenantResourceExtensionClient(tenantResource).CalculateDeploymentTemplateHashAsync(template, cancellationToken).ConfigureAwait(false); + return await GetResourcesTenantMockingExtension(tenantResource).CalculateDeploymentTemplateHashAsync(template, cancellationToken).ConfigureAwait(false); } /// @@ -946,6 +1045,10 @@ public static async Task> CalculateDeploymentTempla /// Deployments_CalculateTemplateHash /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The template provided to calculate hash. @@ -953,9 +1056,7 @@ public static async Task> CalculateDeploymentTempla /// is null. public static Response CalculateDeploymentTemplateHash(this TenantResource tenantResource, BinaryData template, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(template, nameof(template)); - - return GetTenantResourceExtensionClient(tenantResource).CalculateDeploymentTemplateHash(template, cancellationToken); + return GetResourcesTenantMockingExtension(tenantResource).CalculateDeploymentTemplateHash(template, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesManagementGroupMockingExtension.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesManagementGroupMockingExtension.cs new file mode 100644 index 000000000000..11dea9cad1cb --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesManagementGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Resources.Mocking +{ + /// A class to add extension methods to ManagementGroupResource. + public partial class ResourcesManagementGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourcesManagementGroupMockingExtension() + { + } + + /// 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 ResourcesManagementGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ArmDeploymentResources in the ManagementGroupResource. + /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. + public virtual ArmDeploymentCollection GetArmDeployments() + { + return GetCachedClient(client => new ArmDeploymentCollection(client, Id)); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetArmDeployments().Get(deploymentName, cancellationToken); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesResourceGroupMockingExtension.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..e22f516c6212 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesResourceGroupMockingExtension.cs @@ -0,0 +1,360 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ResourcesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ResourcesResourceGroupMockingExtension() + { + } + + /// 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 ResourcesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ArmDeploymentResources in the ResourceGroupResource. + /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. + public virtual ArmDeploymentCollection GetArmDeployments() + { + return GetCachedClient(client => new ArmDeploymentCollection(client, Id)); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetArmDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of ArmApplicationResources in the ResourceGroupResource. + /// An object representing collection of ArmApplicationResources and their operations over a ArmApplicationResource. + public virtual ArmApplicationCollection GetArmApplications() + { + return GetCachedClient(client => new ArmApplicationCollection(client, Id)); + } + + /// + /// Gets the managed application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName} + /// + /// + /// Operation Id + /// Applications_Get + /// + /// + /// + /// The name of the managed application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmApplicationAsync(string applicationName, CancellationToken cancellationToken = default) + { + return await GetArmApplications().GetAsync(applicationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the managed application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName} + /// + /// + /// Operation Id + /// Applications_Get + /// + /// + /// + /// The name of the managed application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmApplication(string applicationName, CancellationToken cancellationToken = default) + { + return GetArmApplications().Get(applicationName, cancellationToken); + } + + /// Gets a collection of ArmApplicationDefinitionResources in the ResourceGroupResource. + /// An object representing collection of ArmApplicationDefinitionResources and their operations over a ArmApplicationDefinitionResource. + public virtual ArmApplicationDefinitionCollection GetArmApplicationDefinitions() + { + return GetCachedClient(client => new ArmApplicationDefinitionCollection(client, Id)); + } + + /// + /// Gets the managed application definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName} + /// + /// + /// Operation Id + /// ApplicationDefinitions_Get + /// + /// + /// + /// The name of the managed application definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmApplicationDefinitionAsync(string applicationDefinitionName, CancellationToken cancellationToken = default) + { + return await GetArmApplicationDefinitions().GetAsync(applicationDefinitionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the managed application definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applicationDefinitions/{applicationDefinitionName} + /// + /// + /// Operation Id + /// ApplicationDefinitions_Get + /// + /// + /// + /// The name of the managed application definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmApplicationDefinition(string applicationDefinitionName, CancellationToken cancellationToken = default) + { + return GetArmApplicationDefinitions().Get(applicationDefinitionName, cancellationToken); + } + + /// Gets a collection of JitRequestResources in the ResourceGroupResource. + /// An object representing collection of JitRequestResources and their operations over a JitRequestResource. + public virtual JitRequestCollection GetJitRequests() + { + return GetCachedClient(client => new JitRequestCollection(client, Id)); + } + + /// + /// Gets the JIT request. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName} + /// + /// + /// Operation Id + /// JitRequests_Get + /// + /// + /// + /// The name of the JIT request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetJitRequestAsync(string jitRequestName, CancellationToken cancellationToken = default) + { + return await GetJitRequests().GetAsync(jitRequestName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the JIT request. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/jitRequests/{jitRequestName} + /// + /// + /// Operation Id + /// JitRequests_Get + /// + /// + /// + /// The name of the JIT request. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetJitRequest(string jitRequestName, CancellationToken cancellationToken = default) + { + return GetJitRequests().Get(jitRequestName, cancellationToken); + } + + /// Gets a collection of ArmDeploymentScriptResources in the ResourceGroupResource. + /// An object representing collection of ArmDeploymentScriptResources and their operations over a ArmDeploymentScriptResource. + public virtual ArmDeploymentScriptCollection GetArmDeploymentScripts() + { + return GetCachedClient(client => new ArmDeploymentScriptCollection(client, Id)); + } + + /// + /// Gets a deployment script with a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} + /// + /// + /// Operation Id + /// DeploymentScripts_Get + /// + /// + /// + /// Name of the deployment script. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentScriptAsync(string scriptName, CancellationToken cancellationToken = default) + { + return await GetArmDeploymentScripts().GetAsync(scriptName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deployment script with a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} + /// + /// + /// Operation Id + /// DeploymentScripts_Get + /// + /// + /// + /// Name of the deployment script. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeploymentScript(string scriptName, CancellationToken cancellationToken = default) + { + return GetArmDeploymentScripts().Get(scriptName, cancellationToken); + } + + /// Gets a collection of TemplateSpecResources in the ResourceGroupResource. + /// An object representing collection of TemplateSpecResources and their operations over a TemplateSpecResource. + public virtual TemplateSpecCollection GetTemplateSpecs() + { + return GetCachedClient(client => new TemplateSpecCollection(client, Id)); + } + + /// + /// Gets a Template Spec with a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName} + /// + /// + /// Operation Id + /// TemplateSpecs_Get + /// + /// + /// + /// Name of the Template Spec. + /// Allows for expansion of additional Template Spec details in the response. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTemplateSpecAsync(string templateSpecName, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) + { + return await GetTemplateSpecs().GetAsync(templateSpecName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Template Spec with a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName} + /// + /// + /// Operation Id + /// TemplateSpecs_Get + /// + /// + /// + /// Name of the Template Spec. + /// Allows for expansion of additional Template Spec details in the response. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTemplateSpec(string templateSpecName, TemplateSpecExpandKind? expand = null, CancellationToken cancellationToken = default) + { + return GetTemplateSpecs().Get(templateSpecName, expand, cancellationToken); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesSubscriptionMockingExtension.cs similarity index 79% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesSubscriptionMockingExtension.cs index 40909fe4d801..46cc25541d79 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesSubscriptionMockingExtension.cs @@ -5,18 +5,21 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Resources; using Azure.ResourceManager.Resources.Models; -namespace Azure.ResourceManager.Resources +namespace Azure.ResourceManager.Resources.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ResourcesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _armApplicationApplicationsClientDiagnostics; private ApplicationsRestOperations _armApplicationApplicationsRestClient; @@ -27,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _templateSpecClientDiagnostics; private TemplateSpecsRestOperations _templateSpecRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourcesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourcesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,7 +61,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public virtual ArmDeploymentCollection GetArmDeployments() { - return GetCachedClient(Client => new ArmDeploymentCollection(Client, Id)); + return GetCachedClient(client => new ArmDeploymentCollection(client, Id)); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetArmDeployments().Get(deploymentName, cancellationToken); } /// @@ -80,7 +129,7 @@ public virtual AsyncPageable GetArmApplicationsAsync(Can { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => ArmApplicationApplicationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArmApplicationApplicationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmApplicationResource(Client, ArmApplicationData.DeserializeArmApplicationData(e)), ArmApplicationApplicationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetArmApplications", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmApplicationResource(Client, ArmApplicationData.DeserializeArmApplicationData(e)), ArmApplicationApplicationsClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetArmApplications", "value", "nextLink", cancellationToken); } /// @@ -102,7 +151,7 @@ public virtual Pageable GetArmApplications(CancellationT { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => ArmApplicationApplicationsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArmApplicationApplicationsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmApplicationResource(Client, ArmApplicationData.DeserializeArmApplicationData(e)), ArmApplicationApplicationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetArmApplications", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmApplicationResource(Client, ArmApplicationData.DeserializeArmApplicationData(e)), ArmApplicationApplicationsClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetArmApplications", "value", "nextLink", cancellationToken); } /// @@ -123,7 +172,7 @@ public virtual Pageable GetArmApplications(CancellationT public virtual AsyncPageable GetJitRequestDefinitionsAsync(CancellationToken cancellationToken = default) { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => JitRequestRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new JitRequestResource(Client, JitRequestData.DeserializeJitRequestData(e)), JitRequestClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitRequestDefinitions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new JitRequestResource(Client, JitRequestData.DeserializeJitRequestData(e)), JitRequestClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetJitRequestDefinitions", "value", null, cancellationToken); } /// @@ -144,7 +193,7 @@ public virtual AsyncPageable GetJitRequestDefinitionsAsync(C public virtual Pageable GetJitRequestDefinitions(CancellationToken cancellationToken = default) { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => JitRequestRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new JitRequestResource(Client, JitRequestData.DeserializeJitRequestData(e)), JitRequestClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitRequestDefinitions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new JitRequestResource(Client, JitRequestData.DeserializeJitRequestData(e)), JitRequestClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetJitRequestDefinitions", "value", null, cancellationToken); } /// @@ -166,7 +215,7 @@ public virtual AsyncPageable GetArmDeploymentScript { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => ArmDeploymentScriptDeploymentScriptsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArmDeploymentScriptDeploymentScriptsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentScriptResource(Client, ArmDeploymentScriptData.DeserializeArmDeploymentScriptData(e)), ArmDeploymentScriptDeploymentScriptsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetArmDeploymentScripts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentScriptResource(Client, ArmDeploymentScriptData.DeserializeArmDeploymentScriptData(e)), ArmDeploymentScriptDeploymentScriptsClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetArmDeploymentScripts", "value", "nextLink", cancellationToken); } /// @@ -188,7 +237,7 @@ public virtual Pageable GetArmDeploymentScripts(Can { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => ArmDeploymentScriptDeploymentScriptsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArmDeploymentScriptDeploymentScriptsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentScriptResource(Client, ArmDeploymentScriptData.DeserializeArmDeploymentScriptData(e)), ArmDeploymentScriptDeploymentScriptsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetArmDeploymentScripts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentScriptResource(Client, ArmDeploymentScriptData.DeserializeArmDeploymentScriptData(e)), ArmDeploymentScriptDeploymentScriptsClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetArmDeploymentScripts", "value", "nextLink", cancellationToken); } /// @@ -211,7 +260,7 @@ public virtual AsyncPageable GetTemplateSpecsAsync(Templat { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => TemplateSpecRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TemplateSpecRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TemplateSpecResource(Client, TemplateSpecData.DeserializeTemplateSpecData(e)), TemplateSpecClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTemplateSpecs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TemplateSpecResource(Client, TemplateSpecData.DeserializeTemplateSpecData(e)), TemplateSpecClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetTemplateSpecs", "value", "nextLink", cancellationToken); } /// @@ -234,7 +283,7 @@ public virtual Pageable GetTemplateSpecs(TemplateSpecExpan { Core.HttpMessage FirstPageRequest(int? pageSizeHint) => TemplateSpecRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); Core.HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TemplateSpecRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TemplateSpecResource(Client, TemplateSpecData.DeserializeTemplateSpecData(e)), TemplateSpecClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTemplateSpecs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TemplateSpecResource(Client, TemplateSpecData.DeserializeTemplateSpecData(e)), TemplateSpecClientDiagnostics, Pipeline, "ResourcesSubscriptionMockingExtension.GetTemplateSpecs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesTenantMockingExtension.cs similarity index 56% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesTenantMockingExtension.cs index 0335edab456f..0ad27cda1cee 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Resources; using Azure.ResourceManager.Resources.Models; -namespace Azure.ResourceManager.Resources +namespace Azure.ResourceManager.Resources.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ResourcesTenantMockingExtension : ArmResource { private ClientDiagnostics _armDeploymentDeploymentsClientDiagnostics; private DeploymentsRestOperations _armDeploymentDeploymentsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ResourcesTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ResourcesTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,7 +48,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ArmDeploymentResources and their operations over a ArmDeploymentResource. public virtual ArmDeploymentCollection GetArmDeployments() { - return GetCachedClient(Client => new ArmDeploymentCollection(Client, Id)); + return GetCachedClient(client => new ArmDeploymentCollection(client, Id)); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetArmDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deployment. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Deployments_GetAtScope + /// + /// + /// + /// The name of the deployment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetArmDeployments().Get(deploymentName, cancellationToken); } /// @@ -65,9 +112,12 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// The template provided to calculate hash. /// The cancellation token to use. + /// is null. public virtual async Task> CalculateDeploymentTemplateHashAsync(BinaryData template, CancellationToken cancellationToken = default) { - using var scope = ArmDeploymentDeploymentsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateDeploymentTemplateHash"); + Argument.AssertNotNull(template, nameof(template)); + + using var scope = ArmDeploymentDeploymentsClientDiagnostics.CreateScope("ResourcesTenantMockingExtension.CalculateDeploymentTemplateHash"); scope.Start(); try { @@ -96,9 +146,12 @@ public virtual async Task> CalculateDeploymentTempl /// /// The template provided to calculate hash. /// The cancellation token to use. + /// is null. public virtual Response CalculateDeploymentTemplateHash(BinaryData template, CancellationToken cancellationToken = default) { - using var scope = ArmDeploymentDeploymentsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CalculateDeploymentTemplateHash"); + Argument.AssertNotNull(template, nameof(template)); + + using var scope = ArmDeploymentDeploymentsClientDiagnostics.CreateScope("ResourcesTenantMockingExtension.CalculateDeploymentTemplateHash"); scope.Start(); try { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/TemplateSpecResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/TemplateSpecResource.cs index b7e0f04abb9f..53a8919eff79 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/TemplateSpecResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/TemplateSpecResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of TemplateSpecVersionResources and their operations over a TemplateSpecVersionResource. public virtual TemplateSpecVersionCollection GetTemplateSpecVersions() { - return GetCachedClient(Client => new TemplateSpecVersionCollection(Client, Id)); + return GetCachedClient(client => new TemplateSpecVersionCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual TemplateSpecVersionCollection GetTemplateSpecVersions() /// /// The version of the Template Spec. /// The cancellation token to use. - /// 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> GetTemplateSpecVersionAsync(string templateSpecVersion, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetTemplateSpec /// /// The version of the Template Spec. /// The cancellation token to use. - /// 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 GetTemplateSpecVersion(string templateSpecVersion, CancellationToken cancellationToken = default) { diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e4fd40c1cd7b..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Search -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SearchServiceResources in the ResourceGroupResource. - /// An object representing collection of SearchServiceResources and their operations over a SearchServiceResource. - public virtual SearchServiceCollection GetSearchServices() - { - return GetCachedClient(Client => new SearchServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchArmClientMockingExtension.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchArmClientMockingExtension.cs new file mode 100644 index 000000000000..ceac3d2b4b1b --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Search; + +namespace Azure.ResourceManager.Search.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SearchArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SearchArmClientMockingExtension() + { + } + + /// 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 SearchArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SearchArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SearchServiceResource GetSearchServiceResource(ResourceIdentifier id) + { + SearchServiceResource.ValidateResourceId(id); + return new SearchServiceResource(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 SearchPrivateEndpointConnectionResource GetSearchPrivateEndpointConnectionResource(ResourceIdentifier id) + { + SearchPrivateEndpointConnectionResource.ValidateResourceId(id); + return new SearchPrivateEndpointConnectionResource(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 SharedSearchServicePrivateLinkResource GetSharedSearchServicePrivateLinkResource(ResourceIdentifier id) + { + SharedSearchServicePrivateLinkResource.ValidateResourceId(id); + return new SharedSearchServicePrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs index 9c06291ee78a..05d1c26df4d2 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Search.Mocking; using Azure.ResourceManager.Search.Models; namespace Azure.ResourceManager.Search @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.Search /// A class to add extension methods to Azure.ResourceManager.Search. public static partial class SearchExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SearchArmClientMockingExtension GetSearchArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SearchArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SearchResourceGroupMockingExtension GetSearchResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SearchResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SearchSubscriptionMockingExtension GetSearchSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SearchSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SearchServiceResource /// /// 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. /// Returns a object. public static SearchServiceResource GetSearchServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SearchServiceResource.ValidateResourceId(id); - return new SearchServiceResource(client, id); - } - ); + return GetSearchArmClientMockingExtension(client).GetSearchServiceResource(id); } - #endregion - #region SearchPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SearchPrivateEndpointConnectionResource GetSearchPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SearchPrivateEndpointConnectionResource.ValidateResourceId(id); - return new SearchPrivateEndpointConnectionResource(client, id); - } - ); + return GetSearchArmClientMockingExtension(client).GetSearchPrivateEndpointConnectionResource(id); } - #endregion - #region SharedSearchServicePrivateLinkResource /// /// 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. /// Returns a object. public static SharedSearchServicePrivateLinkResource GetSharedSearchServicePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SharedSearchServicePrivateLinkResource.ValidateResourceId(id); - return new SharedSearchServicePrivateLinkResource(client, id); - } - ); + return GetSearchArmClientMockingExtension(client).GetSharedSearchServicePrivateLinkResource(id); } - #endregion - /// Gets a collection of SearchServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of SearchServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SearchServiceResources and their operations over a SearchServiceResource. public static SearchServiceCollection GetSearchServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSearchServices(); + return GetSearchResourceGroupMockingExtension(resourceGroupResource).GetSearchServices(); } /// @@ -127,17 +109,21 @@ public static SearchServiceCollection GetSearchServices(this ResourceGroupResour /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Cognitive Search service associated with the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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 static async Task> GetSearchServiceAsync(this ResourceGroupResource resourceGroupResource, string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSearchServices().GetAsync(searchServiceName, searchManagementRequestOptions, cancellationToken).ConfigureAwait(false); + return await GetSearchResourceGroupMockingExtension(resourceGroupResource).GetSearchServiceAsync(searchServiceName, searchManagementRequestOptions, cancellationToken).ConfigureAwait(false); } /// @@ -152,17 +138,21 @@ public static async Task> GetSearchServiceAsync( /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure Cognitive Search service associated with the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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 static Response GetSearchService(this ResourceGroupResource resourceGroupResource, string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSearchServices().Get(searchServiceName, searchManagementRequestOptions, cancellationToken); + return GetSearchResourceGroupMockingExtension(resourceGroupResource).GetSearchService(searchServiceName, searchManagementRequestOptions, cancellationToken); } /// @@ -177,6 +167,10 @@ public static Response GetSearchService(this ResourceGrou /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter group. @@ -184,7 +178,7 @@ public static Response GetSearchService(this ResourceGrou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSearchServicesAsync(this SubscriptionResource subscriptionResource, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSearchServicesAsync(searchManagementRequestOptions, cancellationToken); + return GetSearchSubscriptionMockingExtension(subscriptionResource).GetSearchServicesAsync(searchManagementRequestOptions, cancellationToken); } /// @@ -199,6 +193,10 @@ public static AsyncPageable GetSearchServicesAsync(this S /// Services_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameter group. @@ -206,7 +204,7 @@ public static AsyncPageable GetSearchServicesAsync(this S /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSearchServices(this SubscriptionResource subscriptionResource, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSearchServices(searchManagementRequestOptions, cancellationToken); + return GetSearchSubscriptionMockingExtension(subscriptionResource).GetSearchServices(searchManagementRequestOptions, cancellationToken); } /// @@ -221,6 +219,10 @@ public static Pageable GetSearchServices(this Subscriptio /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource name and type to check. @@ -229,9 +231,7 @@ public static Pageable GetSearchServices(this Subscriptio /// is null. public static async Task> CheckSearchServiceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, SearchServiceNameAvailabilityContent content, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSearchServiceNameAvailabilityAsync(content, searchManagementRequestOptions, cancellationToken).ConfigureAwait(false); + return await GetSearchSubscriptionMockingExtension(subscriptionResource).CheckSearchServiceNameAvailabilityAsync(content, searchManagementRequestOptions, cancellationToken).ConfigureAwait(false); } /// @@ -246,6 +246,10 @@ public static async Task> CheckSea /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource name and type to check. @@ -254,9 +258,7 @@ public static async Task> CheckSea /// is null. public static Response CheckSearchServiceNameAvailability(this SubscriptionResource subscriptionResource, SearchServiceNameAvailabilityContent content, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSearchServiceNameAvailability(content, searchManagementRequestOptions, cancellationToken); + return GetSearchSubscriptionMockingExtension(subscriptionResource).CheckSearchServiceNameAvailability(content, searchManagementRequestOptions, cancellationToken); } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchResourceGroupMockingExtension.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..52e4a0baf5fa --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchResourceGroupMockingExtension.cs @@ -0,0 +1,95 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Search; +using Azure.ResourceManager.Search.Models; + +namespace Azure.ResourceManager.Search.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SearchResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SearchResourceGroupMockingExtension() + { + } + + /// 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 SearchResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SearchServiceResources in the ResourceGroupResource. + /// An object representing collection of SearchServiceResources and their operations over a SearchServiceResource. + public virtual SearchServiceCollection GetSearchServices() + { + return GetCachedClient(client => new SearchServiceCollection(client, Id)); + } + + /// + /// Gets the search service with the given name in the given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the Azure Cognitive Search service associated with the specified resource group. + /// Parameter group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSearchServiceAsync(string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) + { + return await GetSearchServices().GetAsync(searchServiceName, searchManagementRequestOptions, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the search service with the given name in the given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// The name of the Azure Cognitive Search service associated with the specified resource group. + /// Parameter group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSearchService(string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) + { + return GetSearchServices().Get(searchServiceName, searchManagementRequestOptions, cancellationToken); + } + } +} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchSubscriptionMockingExtension.cs similarity index 86% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchSubscriptionMockingExtension.cs index 8c089073768a..38c20c21fd00 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Search; using Azure.ResourceManager.Search.Models; -namespace Azure.ResourceManager.Search +namespace Azure.ResourceManager.Search.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SearchSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _searchServiceServicesClientDiagnostics; private ServicesRestOperations _searchServiceServicesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SearchSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SearchSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ public virtual AsyncPageable GetSearchServicesAsync(Searc { HttpMessage FirstPageRequest(int? pageSizeHint) => SearchServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, searchManagementRequestOptions); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SearchServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, searchManagementRequestOptions); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SearchServiceResource(Client, SearchServiceData.DeserializeSearchServiceData(e)), SearchServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSearchServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SearchServiceResource(Client, SearchServiceData.DeserializeSearchServiceData(e)), SearchServiceServicesClientDiagnostics, Pipeline, "SearchSubscriptionMockingExtension.GetSearchServices", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetSearchServices(SearchManagemen { HttpMessage FirstPageRequest(int? pageSizeHint) => SearchServiceServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, searchManagementRequestOptions); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SearchServiceServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, searchManagementRequestOptions); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SearchServiceResource(Client, SearchServiceData.DeserializeSearchServiceData(e)), SearchServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSearchServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SearchServiceResource(Client, SearchServiceData.DeserializeSearchServiceData(e)), SearchServiceServicesClientDiagnostics, Pipeline, "SearchSubscriptionMockingExtension.GetSearchServices", "value", "nextLink", cancellationToken); } /// @@ -106,9 +107,12 @@ public virtual Pageable GetSearchServices(SearchManagemen /// The resource name and type to check. /// Parameter group. /// The cancellation token to use. + /// is null. public virtual async Task> CheckSearchServiceNameAvailabilityAsync(SearchServiceNameAvailabilityContent content, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - using var scope = SearchServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSearchServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SearchServiceServicesClientDiagnostics.CreateScope("SearchSubscriptionMockingExtension.CheckSearchServiceNameAvailability"); scope.Start(); try { @@ -138,9 +142,12 @@ public virtual async Task> CheckSe /// The resource name and type to check. /// Parameter group. /// The cancellation token to use. + /// is null. public virtual Response CheckSearchServiceNameAvailability(SearchServiceNameAvailabilityContent content, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - using var scope = SearchServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSearchServiceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SearchServiceServicesClientDiagnostics.CreateScope("SearchSubscriptionMockingExtension.CheckSearchServiceNameAvailability"); scope.Start(); try { diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs index 9402e5eebf3f..48e23a8d0721 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs @@ -106,7 +106,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SearchPrivateEndpointConnectionResources and their operations over a SearchPrivateEndpointConnectionResource. public virtual SearchPrivateEndpointConnectionCollection GetSearchPrivateEndpointConnections() { - return GetCachedClient(Client => new SearchPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SearchPrivateEndpointConnectionCollection(client, Id)); } /// @@ -125,8 +125,8 @@ public virtual SearchPrivateEndpointConnectionCollection GetSearchPrivateEndpoin /// The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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> GetSearchPrivateEndpointConnectionAsync(string privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { @@ -149,8 +149,8 @@ public virtual async Task> Get /// The name of the private endpoint connection to the Azure Cognitive Search service with the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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 GetSearchPrivateEndpointConnection(string privateEndpointConnectionName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { @@ -161,7 +161,7 @@ public virtual Response GetSearchPrivat /// An object representing collection of SharedSearchServicePrivateLinkResources and their operations over a SharedSearchServicePrivateLinkResource. public virtual SharedSearchServicePrivateLinkResourceCollection GetSharedSearchServicePrivateLinkResources() { - return GetCachedClient(Client => new SharedSearchServicePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new SharedSearchServicePrivateLinkResourceCollection(client, Id)); } /// @@ -180,8 +180,8 @@ public virtual SharedSearchServicePrivateLinkResourceCollection GetSharedSearchS /// The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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> GetSharedSearchServicePrivateLinkResourceAsync(string sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetS /// The name of the shared private link resource managed by the Azure Cognitive Search service within the specified resource group. /// Parameter group. /// The cancellation token to use. - /// 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 GetSharedSearchServicePrivateLinkResource(string sharedPrivateLinkResourceName, SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index e901b761e526..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _informationProtectionPoliciesClientDiagnostics; - private InformationProtectionPoliciesRestOperations _informationProtectionPoliciesRestClient; - private ClientDiagnostics _securitySubAssessmentSubAssessmentsClientDiagnostics; - private SubAssessmentsRestOperations _securitySubAssessmentSubAssessmentsRestClient; - private ClientDiagnostics _securityAssessmentAssessmentsClientDiagnostics; - private AssessmentsRestOperations _securityAssessmentAssessmentsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics InformationProtectionPoliciesClientDiagnostics => _informationProtectionPoliciesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private InformationProtectionPoliciesRestOperations InformationProtectionPoliciesRestClient => _informationProtectionPoliciesRestClient ??= new InformationProtectionPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecuritySubAssessmentSubAssessmentsClientDiagnostics => _securitySubAssessmentSubAssessmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecuritySubAssessmentResource.ResourceType.Namespace, Diagnostics); - private SubAssessmentsRestOperations SecuritySubAssessmentSubAssessmentsRestClient => _securitySubAssessmentSubAssessmentsRestClient ??= new SubAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecuritySubAssessmentResource.ResourceType)); - private ClientDiagnostics SecurityAssessmentAssessmentsClientDiagnostics => _securityAssessmentAssessmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAssessmentResource.ResourceType.Namespace, Diagnostics); - private AssessmentsRestOperations SecurityAssessmentAssessmentsRestClient => _securityAssessmentAssessmentsRestClient ??= new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecurityAssessmentResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ComplianceResultResources in the ArmResource. - /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. - public virtual ComplianceResultCollection GetComplianceResults() - { - return GetCachedClient(Client => new ComplianceResultCollection(Client, Id)); - } - - /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmResource. - /// Returns a object. - public virtual AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting() - { - return new AdvancedThreatProtectionSettingResource(Client, Id.AppendProviderResource("Microsoft.Security", "advancedThreatProtectionSettings", "current")); - } - - /// Gets a collection of DeviceSecurityGroupResources in the ArmResource. - /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. - public virtual DeviceSecurityGroupCollection GetDeviceSecurityGroups() - { - return GetCachedClient(Client => new DeviceSecurityGroupCollection(Client, Id)); - } - - /// Gets a collection of SecurityComplianceResources in the ArmResource. - /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. - public virtual SecurityComplianceCollection GetSecurityCompliances() - { - return GetCachedClient(Client => new SecurityComplianceCollection(Client, Id)); - } - - /// Gets a collection of SecurityAssessmentResources in the ArmResource. - /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. - public virtual SecurityAssessmentCollection GetSecurityAssessments() - { - return GetCachedClient(Client => new SecurityAssessmentCollection(Client, Id)); - } - - /// Gets a collection of GovernanceRuleResources in the ArmResource. - /// An object representing collection of GovernanceRuleResources and their operations over a GovernanceRuleResource. - public virtual GovernanceRuleCollection GetGovernanceRules() - { - return GetCachedClient(Client => new GovernanceRuleCollection(Client, Id)); - } - - /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmResource. - /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. - public virtual SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans() - { - return GetCachedClient(Client => new SqlVulnerabilityAssessmentScanCollection(Client, Id)); - } - - /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmResource. - /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. - public virtual SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules() - { - return GetCachedClient(Client => new SqlVulnerabilityAssessmentBaselineRuleCollection(Client, Id)); - } - - /// - /// Details of the information protection policy. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} - /// - /// - /// Operation Id - /// InformationProtectionPolicies_CreateOrUpdate - /// - /// - /// - /// Name of the information protection policy. - /// Information protection policy. - /// The cancellation token to use. - public virtual async Task> CreateOrUpdateInformationProtectionPolicyAsync(InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) - { - using var scope = InformationProtectionPoliciesClientDiagnostics.CreateScope("ArmResourceExtensionClient.CreateOrUpdateInformationProtectionPolicy"); - scope.Start(); - try - { - var response = await InformationProtectionPoliciesRestClient.CreateOrUpdateAsync(Id, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of the information protection policy. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} - /// - /// - /// Operation Id - /// InformationProtectionPolicies_CreateOrUpdate - /// - /// - /// - /// Name of the information protection policy. - /// Information protection policy. - /// The cancellation token to use. - public virtual Response CreateOrUpdateInformationProtectionPolicy(InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) - { - using var scope = InformationProtectionPoliciesClientDiagnostics.CreateScope("ArmResourceExtensionClient.CreateOrUpdateInformationProtectionPolicy"); - scope.Start(); - try - { - var response = InformationProtectionPoliciesRestClient.CreateOrUpdate(Id, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Information protection policies of a specific management group. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies - /// - /// - /// Operation Id - /// InformationProtectionPolicies_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetInformationProtectionPoliciesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => InformationProtectionPoliciesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InformationProtectionPoliciesRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, InformationProtectionPolicy.DeserializeInformationProtectionPolicy, InformationProtectionPoliciesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetInformationProtectionPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Information protection policies of a specific management group. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies - /// - /// - /// Operation Id - /// InformationProtectionPolicies_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetInformationProtectionPolicies(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => InformationProtectionPoliciesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InformationProtectionPoliciesRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, InformationProtectionPolicy.DeserializeInformationProtectionPolicy, InformationProtectionPoliciesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetInformationProtectionPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Get security sub-assessments on all your scanned resources inside a subscription scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/subAssessments - /// - /// - /// Operation Id - /// SubAssessments_ListAll - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecuritySubAssessmentsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), SecuritySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSecuritySubAssessments", "value", "nextLink", cancellationToken); - } - - /// - /// Get security sub-assessments on all your scanned resources inside a subscription scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/subAssessments - /// - /// - /// Operation Id - /// SubAssessments_ListAll - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecuritySubAssessments(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), SecuritySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSecuritySubAssessments", "value", "nextLink", cancellationToken); - } - - /// - /// Get security assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments - /// - /// - /// Operation Id - /// Assessments_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecurityAssessmentsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAssessmentAssessmentsRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAssessmentAssessmentsRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAssessmentResource(Client, SecurityAssessmentData.DeserializeSecurityAssessmentData(e)), SecurityAssessmentAssessmentsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSecurityAssessments", "value", "nextLink", cancellationToken); - } - - /// - /// Get security assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments - /// - /// - /// Operation Id - /// Assessments_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecurityAssessments(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAssessmentAssessmentsRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAssessmentAssessmentsRestClient.CreateListNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAssessmentResource(Client, SecurityAssessmentData.DeserializeSecurityAssessmentData(e)), SecurityAssessmentAssessmentsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSecurityAssessments", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 31dabc523aef..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _allowedConnectionsClientDiagnostics; - private AllowedConnectionsRestOperations _allowedConnectionsRestClient; - private ClientDiagnostics _topologyClientDiagnostics; - private TopologyRestOperations _topologyRestClient; - private ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private ClientDiagnostics _discoveredSecuritySolutionsClientDiagnostics; - private DiscoveredSecuritySolutionsRestOperations _discoveredSecuritySolutionsRestClient; - private ClientDiagnostics _externalSecuritySolutionsClientDiagnostics; - private ExternalSecuritySolutionsRestOperations _externalSecuritySolutionsRestClient; - private ClientDiagnostics _securitySolutionsClientDiagnostics; - private SecuritySolutionsRestOperations _securitySolutionsRestClient; - private ClientDiagnostics _alertsClientDiagnostics; - private AlertsRestOperations _alertsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics AllowedConnectionsClientDiagnostics => _allowedConnectionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AllowedConnectionsRestOperations AllowedConnectionsRestClient => _allowedConnectionsRestClient ??= new AllowedConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics TopologyClientDiagnostics => _topologyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TopologyRestOperations TopologyRestClient => _topologyRestClient ??= new TopologyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics JitNetworkAccessPolicyClientDiagnostics => _jitNetworkAccessPolicyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); - private JitNetworkAccessPoliciesRestOperations JitNetworkAccessPolicyRestClient => _jitNetworkAccessPolicyRestClient ??= new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(JitNetworkAccessPolicyResource.ResourceType)); - private ClientDiagnostics DiscoveredSecuritySolutionsClientDiagnostics => _discoveredSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private DiscoveredSecuritySolutionsRestOperations DiscoveredSecuritySolutionsRestClient => _discoveredSecuritySolutionsRestClient ??= new DiscoveredSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ExternalSecuritySolutionsClientDiagnostics => _externalSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ExternalSecuritySolutionsRestOperations ExternalSecuritySolutionsRestClient => _externalSecuritySolutionsRestClient ??= new ExternalSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecuritySolutionsClientDiagnostics => _securitySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecuritySolutionsRestOperations SecuritySolutionsRestClient => _securitySolutionsRestClient ??= new SecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics AlertsClientDiagnostics => _alertsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AlertsRestOperations AlertsRestClient => _alertsRestClient ??= new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. - /// An object representing collection of CustomAssessmentAutomationResources and their operations over a CustomAssessmentAutomationResource. - public virtual CustomAssessmentAutomationCollection GetCustomAssessmentAutomations() - { - return GetCachedClient(Client => new CustomAssessmentAutomationCollection(Client, Id)); - } - - /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. - /// An object representing collection of CustomEntityStoreAssignmentResources and their operations over a CustomEntityStoreAssignmentResource. - public virtual CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignments() - { - return GetCachedClient(Client => new CustomEntityStoreAssignmentCollection(Client, Id)); - } - - /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. - /// An object representing collection of IotSecuritySolutionResources and their operations over a IotSecuritySolutionResource. - public virtual IotSecuritySolutionCollection GetIotSecuritySolutions() - { - return GetCachedClient(Client => new IotSecuritySolutionCollection(Client, Id)); - } - - /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityTaskResources and their operations over a ResourceGroupSecurityTaskResource. - public virtual ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks(AzureLocation ascLocation) - { - return new ResourceGroupSecurityTaskCollection(Client, Id, ascLocation); - } - - /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. - /// An object representing collection of SecurityAutomationResources and their operations over a SecurityAutomationResource. - public virtual SecurityAutomationCollection GetSecurityAutomations() - { - return GetCachedClient(Client => new SecurityAutomationCollection(Client, Id)); - } - - /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of ServerVulnerabilityAssessmentResources and their operations over a ServerVulnerabilityAssessmentResource. - public virtual ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAssessments(string resourceNamespace, string resourceType, string resourceName) - { - return new ServerVulnerabilityAssessmentCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of AdaptiveNetworkHardeningResources and their operations over a AdaptiveNetworkHardeningResource. - public virtual AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(string resourceNamespace, string resourceType, string resourceName) - { - return new AdaptiveNetworkHardeningCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of JitNetworkAccessPolicyResources and their operations over a JitNetworkAccessPolicyResource. - public virtual JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(AzureLocation ascLocation) - { - return new JitNetworkAccessPolicyCollection(Client, Id, ascLocation); - } - - /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityAlertResources and their operations over a ResourceGroupSecurityAlertResource. - public virtual ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlerts(AzureLocation ascLocation) - { - return new ResourceGroupSecurityAlertCollection(Client, Id, ascLocation); - } - - /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of SoftwareInventoryResources and their operations over a SoftwareInventoryResource. - public virtual SoftwareInventoryCollection GetSoftwareInventories(string resourceNamespace, string resourceType, string resourceName) - { - return new SoftwareInventoryCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. - /// An object representing collection of SecurityConnectorResources and their operations over a SecurityConnectorResource. - public virtual SecurityConnectorCollection GetSecurityConnectors() - { - return GetCachedClient(Client => new SecurityConnectorCollection(Client, Id)); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public virtual async Task> GetAllowedConnectionAsync(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - using var scope = AllowedConnectionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetAllowedConnection"); - scope.Start(); - try - { - var response = await AllowedConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public virtual Response GetAllowedConnection(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - using var scope = AllowedConnectionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetAllowedConnection"); - scope.Start(); - try - { - var response = AllowedConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - public virtual async Task> GetTopologyAsync(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - using var scope = TopologyClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTopology"); - scope.Start(); - try - { - var response = await TopologyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - public virtual Response GetTopology(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - using var scope = TopologyClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTopology"); - scope.Start(); - try - { - var response = TopologyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJitNetworkAccessPoliciesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJitNetworkAccessPolicies(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - public virtual async Task> GetDiscoveredSecuritySolutionAsync(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetDiscoveredSecuritySolution"); - scope.Start(); - try - { - var response = await DiscoveredSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - public virtual Response GetDiscoveredSecuritySolution(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetDiscoveredSecuritySolution"); - scope.Start(); - try - { - var response = DiscoveredSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - public virtual async Task> GetExternalSecuritySolutionAsync(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetExternalSecuritySolution"); - scope.Start(); - try - { - var response = await ExternalSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - public virtual Response GetExternalSecuritySolution(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetExternalSecuritySolution"); - scope.Start(); - try - { - var response = ExternalSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - public virtual async Task> GetSecuritySolutionAsync(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - using var scope = SecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecuritySolution"); - scope.Start(); - try - { - var response = await SecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - public virtual Response GetSecuritySolution(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - using var scope = SecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecuritySolution"); - scope.Start(); - try - { - var response = SecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAlertsByResourceGroupAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); - } - - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAlertsByResourceGroup(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterArmClientMockingExtension.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterArmClientMockingExtension.cs new file mode 100644 index 000000000000..ba6c5445b66e --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterArmClientMockingExtension.cs @@ -0,0 +1,1203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.SecurityCenter; +using Azure.ResourceManager.SecurityCenter.Models; + +namespace Azure.ResourceManager.SecurityCenter.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SecurityCenterArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _informationProtectionPoliciesClientDiagnostics; + private InformationProtectionPoliciesRestOperations _informationProtectionPoliciesRestClient; + private ClientDiagnostics _securitySubAssessmentSubAssessmentsClientDiagnostics; + private SubAssessmentsRestOperations _securitySubAssessmentSubAssessmentsRestClient; + private ClientDiagnostics _securityAssessmentAssessmentsClientDiagnostics; + private AssessmentsRestOperations _securityAssessmentAssessmentsRestClient; + + /// Initializes a new instance of the class for mocking. + protected SecurityCenterArmClientMockingExtension() + { + } + + /// 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 SecurityCenterArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SecurityCenterArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics InformationProtectionPoliciesClientDiagnostics => _informationProtectionPoliciesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private InformationProtectionPoliciesRestOperations InformationProtectionPoliciesRestClient => _informationProtectionPoliciesRestClient ??= new InformationProtectionPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics SecuritySubAssessmentSubAssessmentsClientDiagnostics => _securitySubAssessmentSubAssessmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecuritySubAssessmentResource.ResourceType.Namespace, Diagnostics); + private SubAssessmentsRestOperations SecuritySubAssessmentSubAssessmentsRestClient => _securitySubAssessmentSubAssessmentsRestClient ??= new SubAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecuritySubAssessmentResource.ResourceType)); + private ClientDiagnostics SecurityAssessmentAssessmentsClientDiagnostics => _securityAssessmentAssessmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAssessmentResource.ResourceType.Namespace, Diagnostics); + private AssessmentsRestOperations SecurityAssessmentAssessmentsRestClient => _securityAssessmentAssessmentsRestClient ??= new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecurityAssessmentResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ComplianceResultResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. + public virtual ComplianceResultCollection GetComplianceResults(ResourceIdentifier scope) + { + return new ComplianceResultCollection(Client, scope); + } + + /// + /// Security Compliance Result + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} + /// + /// + /// Operation Id + /// ComplianceResults_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// name of the desired assessment compliance result. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetComplianceResultAsync(ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) + { + return await GetComplianceResults(scope).GetAsync(complianceResultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Security Compliance Result + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} + /// + /// + /// Operation Id + /// ComplianceResults_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// name of the desired assessment compliance result. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetComplianceResult(ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) + { + return GetComplianceResults(scope).Get(complianceResultName, cancellationToken); + } + + /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmClient. + /// The scope that the resource will apply against. + /// Returns a object. + public virtual AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting(ResourceIdentifier scope) + { + return new AdvancedThreatProtectionSettingResource(Client, scope.AppendProviderResource("Microsoft.Security", "advancedThreatProtectionSettings", "current")); + } + + /// Gets a collection of DeviceSecurityGroupResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. + public virtual DeviceSecurityGroupCollection GetDeviceSecurityGroups(ResourceIdentifier scope) + { + return new DeviceSecurityGroupCollection(Client, scope); + } + + /// + /// Use this method to get the device security group for the specified IoT Hub resource. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} + /// + /// + /// Operation Id + /// DeviceSecurityGroups_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the device security group. Note that the name of the device security group is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceSecurityGroupAsync(ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) + { + return await GetDeviceSecurityGroups(scope).GetAsync(deviceSecurityGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Use this method to get the device security group for the specified IoT Hub resource. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} + /// + /// + /// Operation Id + /// DeviceSecurityGroups_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name of the device security group. Note that the name of the device security group is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceSecurityGroup(ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) + { + return GetDeviceSecurityGroups(scope).Get(deviceSecurityGroupName, cancellationToken); + } + + /// Gets a collection of SecurityComplianceResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. + public virtual SecurityComplianceCollection GetSecurityCompliances(ResourceIdentifier scope) + { + return new SecurityComplianceCollection(Client, scope); + } + + /// + /// Details of a specific Compliance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} + /// + /// + /// Operation Id + /// Compliances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// name of the Compliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityComplianceAsync(ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) + { + return await GetSecurityCompliances(scope).GetAsync(complianceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Details of a specific Compliance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} + /// + /// + /// Operation Id + /// Compliances_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// name of the Compliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityCompliance(ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) + { + return GetSecurityCompliances(scope).Get(complianceName, cancellationToken); + } + + /// Gets a collection of SecurityAssessmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. + public virtual SecurityAssessmentCollection GetSecurityAssessments(ResourceIdentifier scope) + { + return new SecurityAssessmentCollection(Client, scope); + } + + /// + /// Get a security assessment on your scanned resource + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} + /// + /// + /// Operation Id + /// Assessments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The Assessment Key - Unique key for the assessment type. + /// OData expand. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityAssessmentAsync(ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) + { + return await GetSecurityAssessments(scope).GetAsync(assessmentName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a security assessment on your scanned resource + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} + /// + /// + /// Operation Id + /// Assessments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The Assessment Key - Unique key for the assessment type. + /// OData expand. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityAssessment(ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) + { + return GetSecurityAssessments(scope).Get(assessmentName, expand, cancellationToken); + } + + /// Gets a collection of GovernanceRuleResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of GovernanceRuleResources and their operations over a GovernanceRuleResource. + public virtual GovernanceRuleCollection GetGovernanceRules(ResourceIdentifier scope) + { + return new GovernanceRuleCollection(Client, scope); + } + + /// + /// Get a specific governance rule for the requested scope by ruleId + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} + /// + /// + /// Operation Id + /// GovernanceRules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The governance rule key - unique key for the standard governance rule (GUID). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGovernanceRuleAsync(ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) + { + return await GetGovernanceRules(scope).GetAsync(ruleId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific governance rule for the requested scope by ruleId + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} + /// + /// + /// Operation Id + /// GovernanceRules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The governance rule key - unique key for the standard governance rule (GUID). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGovernanceRule(ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) + { + return GetGovernanceRules(scope).Get(ruleId, cancellationToken); + } + + /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. + public virtual SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans(ResourceIdentifier scope) + { + return new SqlVulnerabilityAssessmentScanCollection(Client, scope); + } + + /// + /// Gets the scan details of a single scan record. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentScans_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The scan Id. Type 'latest' to get the scan record for the latest scan. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlVulnerabilityAssessmentScanAsync(ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) + { + return await GetSqlVulnerabilityAssessmentScans(scope).GetAsync(scanId, workspaceId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the scan details of a single scan record. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentScans_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The scan Id. Type 'latest' to get the scan record for the latest scan. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlVulnerabilityAssessmentScan(ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) + { + return GetSqlVulnerabilityAssessmentScans(scope).Get(scanId, workspaceId, cancellationToken); + } + + /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. + public virtual SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules(ResourceIdentifier scope) + { + return new SqlVulnerabilityAssessmentBaselineRuleCollection(Client, scope); + } + + /// + /// Gets the results for a given rule in the Baseline. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentBaselineRules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The rule Id. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlVulnerabilityAssessmentBaselineRuleAsync(ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) + { + return await GetSqlVulnerabilityAssessmentBaselineRules(scope).GetAsync(ruleId, workspaceId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the results for a given rule in the Baseline. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentBaselineRules_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The rule Id. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlVulnerabilityAssessmentBaselineRule(ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) + { + return GetSqlVulnerabilityAssessmentBaselineRules(scope).Get(ruleId, workspaceId, cancellationToken); + } + + /// + /// Details of the information protection policy. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} + /// + /// + /// Operation Id + /// InformationProtectionPolicies_CreateOrUpdate + /// + /// + /// + /// The scope to use. + /// Name of the information protection policy. + /// Information protection policy. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateInformationProtectionPolicyAsync(ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(informationProtectionPolicy, nameof(informationProtectionPolicy)); + + using var scope0 = InformationProtectionPoliciesClientDiagnostics.CreateScope("SecurityCenterArmClientMockingExtension.CreateOrUpdateInformationProtectionPolicy"); + scope0.Start(); + try + { + var response = await InformationProtectionPoliciesRestClient.CreateOrUpdateAsync(scope, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Details of the information protection policy. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} + /// + /// + /// Operation Id + /// InformationProtectionPolicies_CreateOrUpdate + /// + /// + /// + /// The scope to use. + /// Name of the information protection policy. + /// Information protection policy. + /// The cancellation token to use. + /// is null. + public virtual Response CreateOrUpdateInformationProtectionPolicy(ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(informationProtectionPolicy, nameof(informationProtectionPolicy)); + + using var scope0 = InformationProtectionPoliciesClientDiagnostics.CreateScope("SecurityCenterArmClientMockingExtension.CreateOrUpdateInformationProtectionPolicy"); + scope0.Start(); + try + { + var response = InformationProtectionPoliciesRestClient.CreateOrUpdate(scope, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Information protection policies of a specific management group. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies + /// + /// + /// Operation Id + /// InformationProtectionPolicies_List + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetInformationProtectionPoliciesAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => InformationProtectionPoliciesRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InformationProtectionPoliciesRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, InformationProtectionPolicy.DeserializeInformationProtectionPolicy, InformationProtectionPoliciesClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetInformationProtectionPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// Information protection policies of a specific management group. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies + /// + /// + /// Operation Id + /// InformationProtectionPolicies_List + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetInformationProtectionPolicies(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => InformationProtectionPoliciesRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InformationProtectionPoliciesRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, InformationProtectionPolicy.DeserializeInformationProtectionPolicy, InformationProtectionPoliciesClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetInformationProtectionPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// Get security sub-assessments on all your scanned resources inside a subscription scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/subAssessments + /// + /// + /// Operation Id + /// SubAssessments_ListAll + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSecuritySubAssessmentsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), SecuritySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetSecuritySubAssessments", "value", "nextLink", cancellationToken); + } + + /// + /// Get security sub-assessments on all your scanned resources inside a subscription scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/subAssessments + /// + /// + /// Operation Id + /// SubAssessments_ListAll + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSecuritySubAssessments(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySubAssessmentSubAssessmentsRestClient.CreateListAllNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), SecuritySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetSecuritySubAssessments", "value", "nextLink", cancellationToken); + } + + /// + /// Get security assessments on all your scanned resources inside a scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/assessments + /// + /// + /// Operation Id + /// Assessments_List + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSecurityAssessmentsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAssessmentAssessmentsRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAssessmentAssessmentsRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAssessmentResource(Client, SecurityAssessmentData.DeserializeSecurityAssessmentData(e)), SecurityAssessmentAssessmentsClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetSecurityAssessments", "value", "nextLink", cancellationToken); + } + + /// + /// Get security assessments on all your scanned resources inside a scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/assessments + /// + /// + /// Operation Id + /// Assessments_List + /// + /// + /// + /// The scope to use. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSecurityAssessments(ResourceIdentifier scope, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAssessmentAssessmentsRestClient.CreateListRequest(scope); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAssessmentAssessmentsRestClient.CreateListNextPageRequest(nextLink, scope); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAssessmentResource(Client, SecurityAssessmentData.DeserializeSecurityAssessmentData(e)), SecurityAssessmentAssessmentsClientDiagnostics, Pipeline, "SecurityCenterArmClientMockingExtension.GetSecurityAssessments", "value", "nextLink", 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 CustomAssessmentAutomationResource GetCustomAssessmentAutomationResource(ResourceIdentifier id) + { + CustomAssessmentAutomationResource.ValidateResourceId(id); + return new CustomAssessmentAutomationResource(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 CustomEntityStoreAssignmentResource GetCustomEntityStoreAssignmentResource(ResourceIdentifier id) + { + CustomEntityStoreAssignmentResource.ValidateResourceId(id); + return new CustomEntityStoreAssignmentResource(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 ComplianceResultResource GetComplianceResultResource(ResourceIdentifier id) + { + ComplianceResultResource.ValidateResourceId(id); + return new ComplianceResultResource(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 SecurityCenterPricingResource GetSecurityCenterPricingResource(ResourceIdentifier id) + { + SecurityCenterPricingResource.ValidateResourceId(id); + return new SecurityCenterPricingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSettingResource(ResourceIdentifier id) + { + AdvancedThreatProtectionSettingResource.ValidateResourceId(id); + return new AdvancedThreatProtectionSettingResource(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 DeviceSecurityGroupResource GetDeviceSecurityGroupResource(ResourceIdentifier id) + { + DeviceSecurityGroupResource.ValidateResourceId(id); + return new DeviceSecurityGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotSecuritySolutionResource GetIotSecuritySolutionResource(ResourceIdentifier id) + { + IotSecuritySolutionResource.ValidateResourceId(id); + return new IotSecuritySolutionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotSecuritySolutionAnalyticsModelResource GetIotSecuritySolutionAnalyticsModelResource(ResourceIdentifier id) + { + IotSecuritySolutionAnalyticsModelResource.ValidateResourceId(id); + return new IotSecuritySolutionAnalyticsModelResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotSecurityAggregatedAlertResource GetIotSecurityAggregatedAlertResource(ResourceIdentifier id) + { + IotSecurityAggregatedAlertResource.ValidateResourceId(id); + return new IotSecurityAggregatedAlertResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IotSecurityAggregatedRecommendationResource GetIotSecurityAggregatedRecommendationResource(ResourceIdentifier id) + { + IotSecurityAggregatedRecommendationResource.ValidateResourceId(id); + return new IotSecurityAggregatedRecommendationResource(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 SecurityCenterLocationResource GetSecurityCenterLocationResource(ResourceIdentifier id) + { + SecurityCenterLocationResource.ValidateResourceId(id); + return new SecurityCenterLocationResource(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 SubscriptionSecurityTaskResource GetSubscriptionSecurityTaskResource(ResourceIdentifier id) + { + SubscriptionSecurityTaskResource.ValidateResourceId(id); + return new SubscriptionSecurityTaskResource(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 ResourceGroupSecurityTaskResource GetResourceGroupSecurityTaskResource(ResourceIdentifier id) + { + ResourceGroupSecurityTaskResource.ValidateResourceId(id); + return new ResourceGroupSecurityTaskResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutoProvisioningSettingResource GetAutoProvisioningSettingResource(ResourceIdentifier id) + { + AutoProvisioningSettingResource.ValidateResourceId(id); + return new AutoProvisioningSettingResource(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 SecurityComplianceResource GetSecurityComplianceResource(ResourceIdentifier id) + { + SecurityComplianceResource.ValidateResourceId(id); + return new SecurityComplianceResource(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 SecurityContactResource GetSecurityContactResource(ResourceIdentifier id) + { + SecurityContactResource.ValidateResourceId(id); + return new SecurityContactResource(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 SecurityWorkspaceSettingResource GetSecurityWorkspaceSettingResource(ResourceIdentifier id) + { + SecurityWorkspaceSettingResource.ValidateResourceId(id); + return new SecurityWorkspaceSettingResource(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 RegulatoryComplianceStandardResource GetRegulatoryComplianceStandardResource(ResourceIdentifier id) + { + RegulatoryComplianceStandardResource.ValidateResourceId(id); + return new RegulatoryComplianceStandardResource(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 RegulatoryComplianceControlResource GetRegulatoryComplianceControlResource(ResourceIdentifier id) + { + RegulatoryComplianceControlResource.ValidateResourceId(id); + return new RegulatoryComplianceControlResource(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 RegulatoryComplianceAssessmentResource GetRegulatoryComplianceAssessmentResource(ResourceIdentifier id) + { + RegulatoryComplianceAssessmentResource.ValidateResourceId(id); + return new RegulatoryComplianceAssessmentResource(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 SecuritySubAssessmentResource GetSecuritySubAssessmentResource(ResourceIdentifier id) + { + SecuritySubAssessmentResource.ValidateResourceId(id); + return new SecuritySubAssessmentResource(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 SecurityAutomationResource GetSecurityAutomationResource(ResourceIdentifier id) + { + SecurityAutomationResource.ValidateResourceId(id); + return new SecurityAutomationResource(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 SecurityAlertsSuppressionRuleResource GetSecurityAlertsSuppressionRuleResource(ResourceIdentifier id) + { + SecurityAlertsSuppressionRuleResource.ValidateResourceId(id); + return new SecurityAlertsSuppressionRuleResource(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 ServerVulnerabilityAssessmentResource GetServerVulnerabilityAssessmentResource(ResourceIdentifier id) + { + ServerVulnerabilityAssessmentResource.ValidateResourceId(id); + return new ServerVulnerabilityAssessmentResource(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 TenantAssessmentMetadataResource GetTenantAssessmentMetadataResource(ResourceIdentifier id) + { + TenantAssessmentMetadataResource.ValidateResourceId(id); + return new TenantAssessmentMetadataResource(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 SubscriptionAssessmentMetadataResource GetSubscriptionAssessmentMetadataResource(ResourceIdentifier id) + { + SubscriptionAssessmentMetadataResource.ValidateResourceId(id); + return new SubscriptionAssessmentMetadataResource(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 SecurityAssessmentResource GetSecurityAssessmentResource(ResourceIdentifier id) + { + SecurityAssessmentResource.ValidateResourceId(id); + return new SecurityAssessmentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AdaptiveApplicationControlGroupResource GetAdaptiveApplicationControlGroupResource(ResourceIdentifier id) + { + AdaptiveApplicationControlGroupResource.ValidateResourceId(id); + return new AdaptiveApplicationControlGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AdaptiveNetworkHardeningResource GetAdaptiveNetworkHardeningResource(ResourceIdentifier id) + { + AdaptiveNetworkHardeningResource.ValidateResourceId(id); + return new AdaptiveNetworkHardeningResource(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 JitNetworkAccessPolicyResource GetJitNetworkAccessPolicyResource(ResourceIdentifier id) + { + JitNetworkAccessPolicyResource.ValidateResourceId(id); + return new JitNetworkAccessPolicyResource(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 SecureScoreResource GetSecureScoreResource(ResourceIdentifier id) + { + SecureScoreResource.ValidateResourceId(id); + return new SecureScoreResource(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 SecurityCloudConnectorResource GetSecurityCloudConnectorResource(ResourceIdentifier id) + { + SecurityCloudConnectorResource.ValidateResourceId(id); + return new SecurityCloudConnectorResource(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 SubscriptionSecurityAlertResource GetSubscriptionSecurityAlertResource(ResourceIdentifier id) + { + SubscriptionSecurityAlertResource.ValidateResourceId(id); + return new SubscriptionSecurityAlertResource(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 ResourceGroupSecurityAlertResource GetResourceGroupSecurityAlertResource(ResourceIdentifier id) + { + ResourceGroupSecurityAlertResource.ValidateResourceId(id); + return new ResourceGroupSecurityAlertResource(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 SecuritySettingResource GetSecuritySettingResource(ResourceIdentifier id) + { + SecuritySettingResource.ValidateResourceId(id); + return new SecuritySettingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IngestionSettingResource GetIngestionSettingResource(ResourceIdentifier id) + { + IngestionSettingResource.ValidateResourceId(id); + return new IngestionSettingResource(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 SoftwareInventoryResource GetSoftwareInventoryResource(ResourceIdentifier id) + { + SoftwareInventoryResource.ValidateResourceId(id); + return new SoftwareInventoryResource(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 SecurityConnectorResource GetSecurityConnectorResource(ResourceIdentifier id) + { + SecurityConnectorResource.ValidateResourceId(id); + return new SecurityConnectorResource(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 GovernanceRuleResource GetGovernanceRuleResource(ResourceIdentifier id) + { + GovernanceRuleResource.ValidateResourceId(id); + return new GovernanceRuleResource(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 GovernanceAssignmentResource GetGovernanceAssignmentResource(ResourceIdentifier id) + { + GovernanceAssignmentResource.ValidateResourceId(id); + return new GovernanceAssignmentResource(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 SubscriptionSecurityApplicationResource GetSubscriptionSecurityApplicationResource(ResourceIdentifier id) + { + SubscriptionSecurityApplicationResource.ValidateResourceId(id); + return new SubscriptionSecurityApplicationResource(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 SecurityConnectorApplicationResource GetSecurityConnectorApplicationResource(ResourceIdentifier id) + { + SecurityConnectorApplicationResource.ValidateResourceId(id); + return new SecurityConnectorApplicationResource(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 SqlVulnerabilityAssessmentScanResource GetSqlVulnerabilityAssessmentScanResource(ResourceIdentifier id) + { + SqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); + return new SqlVulnerabilityAssessmentScanResource(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 SqlVulnerabilityAssessmentBaselineRuleResource GetSqlVulnerabilityAssessmentBaselineRuleResource(ResourceIdentifier id) + { + SqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); + return new SqlVulnerabilityAssessmentBaselineRuleResource(Client, id); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs index 5b462fa6c1ba..a2a2fa61aa59 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SecurityCenter.Mocking; using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter @@ -19,1517 +20,1480 @@ namespace Azure.ResourceManager.SecurityCenter /// A class to add extension methods to Azure.ResourceManager.SecurityCenter. public static partial class SecurityCenterExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static SecurityCenterArmClientMockingExtension GetSecurityCenterArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SecurityCenterArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SecurityCenterResourceGroupMockingExtension GetSecurityCenterResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SecurityCenterResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SecurityCenterSubscriptionMockingExtension GetSecurityCenterSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SecurityCenterSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SecurityCenterTenantMockingExtension GetSecurityCenterTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SecurityCenterTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region CustomAssessmentAutomationResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CustomAssessmentAutomationResource GetCustomAssessmentAutomationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CustomAssessmentAutomationResource.ValidateResourceId(id); - return new CustomAssessmentAutomationResource(client, id); - } - ); - } - #endregion - - #region CustomEntityStoreAssignmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of ComplianceResultResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CustomEntityStoreAssignmentResource GetCustomEntityStoreAssignmentResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. + public static ComplianceResultCollection GetComplianceResults(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - CustomEntityStoreAssignmentResource.ValidateResourceId(id); - return new CustomEntityStoreAssignmentResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetComplianceResults(scope); } - #endregion - #region ComplianceResultResource /// - /// 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. + /// Security Compliance Result + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} + /// + /// + /// Operation Id + /// ComplianceResults_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ComplianceResultResource GetComplianceResultResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// name of the desired assessment compliance result. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetComplianceResultAsync(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - ComplianceResultResource.ValidateResourceId(id); - return new ComplianceResultResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetComplianceResultAsync(scope, complianceResultName, cancellationToken).ConfigureAwait(false); } - #endregion - #region SecurityCenterPricingResource /// - /// 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. + /// Security Compliance Result + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} + /// + /// + /// Operation Id + /// ComplianceResults_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCenterPricingResource GetSecurityCenterPricingResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// name of the desired assessment compliance result. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetComplianceResult(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityCenterPricingResource.ValidateResourceId(id); - return new SecurityCenterPricingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetComplianceResult(scope, complianceResultName, cancellationToken); } - #endregion - #region AdvancedThreatProtectionSettingResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. + /// The scope that the resource will apply against. /// Returns a object. - public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSettingResource(this ArmClient client, ResourceIdentifier id) + public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - AdvancedThreatProtectionSettingResource.ValidateResourceId(id); - return new AdvancedThreatProtectionSettingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetAdvancedThreatProtectionSetting(scope); } - #endregion - #region DeviceSecurityGroupResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of DeviceSecurityGroupResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DeviceSecurityGroupResource GetDeviceSecurityGroupResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. + public static DeviceSecurityGroupCollection GetDeviceSecurityGroups(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - DeviceSecurityGroupResource.ValidateResourceId(id); - return new DeviceSecurityGroupResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetDeviceSecurityGroups(scope); } - #endregion - #region IotSecuritySolutionResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Use this method to get the device security group for the specified IoT Hub resource. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} + /// + /// + /// Operation Id + /// DeviceSecurityGroups_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecuritySolutionResource GetIotSecuritySolutionResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The name of the device security group. Note that the name of the device security group is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeviceSecurityGroupAsync(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - IotSecuritySolutionResource.ValidateResourceId(id); - return new IotSecuritySolutionResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetDeviceSecurityGroupAsync(scope, deviceSecurityGroupName, cancellationToken).ConfigureAwait(false); } - #endregion - #region IotSecuritySolutionAnalyticsModelResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Use this method to get the device security group for the specified IoT Hub resource. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} + /// + /// + /// Operation Id + /// DeviceSecurityGroups_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecuritySolutionAnalyticsModelResource GetIotSecuritySolutionAnalyticsModelResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The name of the device security group. Note that the name of the device security group is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeviceSecurityGroup(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - IotSecuritySolutionAnalyticsModelResource.ValidateResourceId(id); - return new IotSecuritySolutionAnalyticsModelResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetDeviceSecurityGroup(scope, deviceSecurityGroupName, cancellationToken); } - #endregion - #region IotSecurityAggregatedAlertResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets a collection of SecurityComplianceResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecurityAggregatedAlertResource GetIotSecurityAggregatedAlertResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. + public static SecurityComplianceCollection GetSecurityCompliances(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - IotSecurityAggregatedAlertResource.ValidateResourceId(id); - return new IotSecurityAggregatedAlertResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityCompliances(scope); } - #endregion - #region IotSecurityAggregatedRecommendationResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Details of a specific Compliance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} + /// + /// + /// Operation Id + /// Compliances_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecurityAggregatedRecommendationResource GetIotSecurityAggregatedRecommendationResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// name of the Compliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSecurityComplianceAsync(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - IotSecurityAggregatedRecommendationResource.ValidateResourceId(id); - return new IotSecurityAggregatedRecommendationResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetSecurityComplianceAsync(scope, complianceName, cancellationToken).ConfigureAwait(false); } - #endregion - #region SecurityCenterLocationResource /// - /// 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. + /// Details of a specific Compliance. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} + /// + /// + /// Operation Id + /// Compliances_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCenterLocationResource GetSecurityCenterLocationResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// name of the Compliance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSecurityCompliance(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityCenterLocationResource.ValidateResourceId(id); - return new SecurityCenterLocationResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityCompliance(scope, complianceName, cancellationToken); } - #endregion - #region SubscriptionSecurityTaskResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of SecurityAssessmentResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityTaskResource GetSubscriptionSecurityTaskResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. + public static SecurityAssessmentCollection GetSecurityAssessments(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - SubscriptionSecurityTaskResource.ValidateResourceId(id); - return new SubscriptionSecurityTaskResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessments(scope); } - #endregion - #region ResourceGroupSecurityTaskResource /// - /// 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. + /// Get a security assessment on your scanned resource + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} + /// + /// + /// Operation Id + /// Assessments_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceGroupSecurityTaskResource GetResourceGroupSecurityTaskResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The Assessment Key - Unique key for the assessment type. + /// OData expand. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSecurityAssessmentAsync(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - ResourceGroupSecurityTaskResource.ValidateResourceId(id); - return new ResourceGroupSecurityTaskResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessmentAsync(scope, assessmentName, expand, cancellationToken).ConfigureAwait(false); } - #endregion - #region AutoProvisioningSettingResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Get a security assessment on your scanned resource + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} + /// + /// + /// Operation Id + /// Assessments_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutoProvisioningSettingResource GetAutoProvisioningSettingResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The Assessment Key - Unique key for the assessment type. + /// OData expand. Optional. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSecurityAssessment(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - AutoProvisioningSettingResource.ValidateResourceId(id); - return new AutoProvisioningSettingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessment(scope, assessmentName, expand, cancellationToken); } - #endregion - #region SecurityComplianceResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of GovernanceRuleResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityComplianceResource GetSecurityComplianceResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of GovernanceRuleResources and their operations over a GovernanceRuleResource. + public static GovernanceRuleCollection GetGovernanceRules(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - SecurityComplianceResource.ValidateResourceId(id); - return new SecurityComplianceResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetGovernanceRules(scope); } - #endregion - #region SecurityContactResource /// - /// 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. + /// Get a specific governance rule for the requested scope by ruleId + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} + /// + /// + /// Operation Id + /// GovernanceRules_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityContactResource GetSecurityContactResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The governance rule key - unique key for the standard governance rule (GUID). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetGovernanceRuleAsync(this ArmClient client, ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityContactResource.ValidateResourceId(id); - return new SecurityContactResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetGovernanceRuleAsync(scope, ruleId, cancellationToken).ConfigureAwait(false); } - #endregion - #region SecurityWorkspaceSettingResource /// - /// 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. + /// Get a specific governance rule for the requested scope by ruleId + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} + /// + /// + /// Operation Id + /// GovernanceRules_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityWorkspaceSettingResource GetSecurityWorkspaceSettingResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The governance rule key - unique key for the standard governance rule (GUID). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetGovernanceRule(this ArmClient client, ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityWorkspaceSettingResource.ValidateResourceId(id); - return new SecurityWorkspaceSettingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetGovernanceRule(scope, ruleId, cancellationToken); } - #endregion - #region RegulatoryComplianceStandardResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceStandardResource GetRegulatoryComplianceStandardResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. + public static SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - RegulatoryComplianceStandardResource.ValidateResourceId(id); - return new RegulatoryComplianceStandardResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentScans(scope); } - #endregion - #region RegulatoryComplianceControlResource /// - /// 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 the scan details of a single scan record. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentScans_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceControlResource GetRegulatoryComplianceControlResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The scan Id. Type 'latest' to get the scan record for the latest scan. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSqlVulnerabilityAssessmentScanAsync(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - RegulatoryComplianceControlResource.ValidateResourceId(id); - return new RegulatoryComplianceControlResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentScanAsync(scope, scanId, workspaceId, cancellationToken).ConfigureAwait(false); } - #endregion - #region RegulatoryComplianceAssessmentResource /// - /// 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 the scan details of a single scan record. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentScans_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceAssessmentResource GetRegulatoryComplianceAssessmentResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The scan Id. Type 'latest' to get the scan record for the latest scan. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSqlVulnerabilityAssessmentScan(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - RegulatoryComplianceAssessmentResource.ValidateResourceId(id); - return new RegulatoryComplianceAssessmentResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentScan(scope, scanId, workspaceId, cancellationToken); } - #endregion - #region SecuritySubAssessmentResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecuritySubAssessmentResource GetSecuritySubAssessmentResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. + public static SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - SecuritySubAssessmentResource.ValidateResourceId(id); - return new SecuritySubAssessmentResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentBaselineRules(scope); } - #endregion - #region SecurityAutomationResource /// - /// 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 the results for a given rule in the Baseline. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentBaselineRules_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAutomationResource GetSecurityAutomationResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The rule Id. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSqlVulnerabilityAssessmentBaselineRuleAsync(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityAutomationResource.ValidateResourceId(id); - return new SecurityAutomationResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentBaselineRuleAsync(scope, ruleId, workspaceId, cancellationToken).ConfigureAwait(false); } - #endregion - #region SecurityAlertsSuppressionRuleResource /// - /// 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 the results for a given rule in the Baseline. + /// + /// + /// Request Path + /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} + /// + /// + /// Operation Id + /// SqlVulnerabilityAssessmentBaselineRules_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAlertsSuppressionRuleResource GetSecurityAlertsSuppressionRuleResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The rule Id. + /// The workspace Id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSqlVulnerabilityAssessmentBaselineRule(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityAlertsSuppressionRuleResource.ValidateResourceId(id); - return new SecurityAlertsSuppressionRuleResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentBaselineRule(scope, ruleId, workspaceId, cancellationToken); } - #endregion - #region ServerVulnerabilityAssessmentResource /// - /// 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. + /// Details of the information protection policy. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} + /// + /// + /// Operation Id + /// InformationProtectionPolicies_CreateOrUpdate + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ServerVulnerabilityAssessmentResource GetServerVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// Name of the information protection policy. + /// Information protection policy. + /// The cancellation token to use. + /// is null. + public static async Task> CreateOrUpdateInformationProtectionPolicyAsync(this ArmClient client, ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - ServerVulnerabilityAssessmentResource.ValidateResourceId(id); - return new ServerVulnerabilityAssessmentResource(client, id); - } - ); + return await GetSecurityCenterArmClientMockingExtension(client).CreateOrUpdateInformationProtectionPolicyAsync(scope, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken).ConfigureAwait(false); } - #endregion - #region TenantAssessmentMetadataResource /// - /// 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. + /// Details of the information protection policy. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} + /// + /// + /// Operation Id + /// InformationProtectionPolicies_CreateOrUpdate + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantAssessmentMetadataResource GetTenantAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// Name of the information protection policy. + /// Information protection policy. + /// The cancellation token to use. + /// is null. + public static Response CreateOrUpdateInformationProtectionPolicy(this ArmClient client, ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - TenantAssessmentMetadataResource.ValidateResourceId(id); - return new TenantAssessmentMetadataResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).CreateOrUpdateInformationProtectionPolicy(scope, informationProtectionPolicyName, informationProtectionPolicy, cancellationToken); } - #endregion - #region SubscriptionAssessmentMetadataResource /// - /// 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. + /// Information protection policies of a specific management group. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies + /// + /// + /// Operation Id + /// InformationProtectionPolicies_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionAssessmentMetadataResource GetSubscriptionAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static AsyncPageable GetInformationProtectionPoliciesAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SubscriptionAssessmentMetadataResource.ValidateResourceId(id); - return new SubscriptionAssessmentMetadataResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetInformationProtectionPoliciesAsync(scope, cancellationToken); } - #endregion - #region SecurityAssessmentResource /// - /// 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. + /// Information protection policies of a specific management group. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies + /// + /// + /// Operation Id + /// InformationProtectionPolicies_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAssessmentResource GetSecurityAssessmentResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static Pageable GetInformationProtectionPolicies(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecurityAssessmentResource.ValidateResourceId(id); - return new SecurityAssessmentResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetInformationProtectionPolicies(scope, cancellationToken); } - #endregion - #region AdaptiveApplicationControlGroupResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Get security sub-assessments on all your scanned resources inside a subscription scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/subAssessments + /// + /// + /// Operation Id + /// SubAssessments_ListAll + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AdaptiveApplicationControlGroupResource GetAdaptiveApplicationControlGroupResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static AsyncPageable GetSecuritySubAssessmentsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - AdaptiveApplicationControlGroupResource.ValidateResourceId(id); - return new AdaptiveApplicationControlGroupResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecuritySubAssessmentsAsync(scope, cancellationToken); } - #endregion - #region AdaptiveNetworkHardeningResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Get security sub-assessments on all your scanned resources inside a subscription scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/subAssessments + /// + /// + /// Operation Id + /// SubAssessments_ListAll + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AdaptiveNetworkHardeningResource GetAdaptiveNetworkHardeningResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static Pageable GetSecuritySubAssessments(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - AdaptiveNetworkHardeningResource.ValidateResourceId(id); - return new AdaptiveNetworkHardeningResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecuritySubAssessments(scope, cancellationToken); } - #endregion - #region JitNetworkAccessPolicyResource /// - /// 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. + /// Get security assessments on all your scanned resources inside a scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/assessments + /// + /// + /// Operation Id + /// Assessments_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static JitNetworkAccessPolicyResource GetJitNetworkAccessPolicyResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static AsyncPageable GetSecurityAssessmentsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - JitNetworkAccessPolicyResource.ValidateResourceId(id); - return new JitNetworkAccessPolicyResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessmentsAsync(scope, cancellationToken); } - #endregion - #region SecureScoreResource /// - /// 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. + /// Get security assessments on all your scanned resources inside a scope + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Security/assessments + /// + /// + /// Operation Id + /// Assessments_List + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecureScoreResource GetSecureScoreResource(this ArmClient client, ResourceIdentifier id) + /// The scope that the resource will apply against. + /// The cancellation token to use. + public static Pageable GetSecurityAssessments(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - SecureScoreResource.ValidateResourceId(id); - return new SecureScoreResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessments(scope, cancellationToken); } - #endregion - #region SecurityCloudConnectorResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCloudConnectorResource GetSecurityCloudConnectorResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CustomAssessmentAutomationResource GetCustomAssessmentAutomationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityCloudConnectorResource.ValidateResourceId(id); - return new SecurityCloudConnectorResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetCustomAssessmentAutomationResource(id); } - #endregion - #region SubscriptionSecurityAlertResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityAlertResource GetSubscriptionSecurityAlertResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CustomEntityStoreAssignmentResource GetCustomEntityStoreAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionSecurityAlertResource.ValidateResourceId(id); - return new SubscriptionSecurityAlertResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetCustomEntityStoreAssignmentResource(id); } - #endregion - #region ResourceGroupSecurityAlertResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceGroupSecurityAlertResource GetResourceGroupSecurityAlertResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ComplianceResultResource GetComplianceResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGroupSecurityAlertResource.ValidateResourceId(id); - return new ResourceGroupSecurityAlertResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetComplianceResultResource(id); } - #endregion - #region SecuritySettingResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SecuritySettingResource GetSecuritySettingResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static SecurityCenterPricingResource GetSecurityCenterPricingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecuritySettingResource.ValidateResourceId(id); - return new SecuritySettingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityCenterPricingResource(id); } - #endregion - #region IngestionSettingResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static IngestionSettingResource GetIngestionSettingResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IngestionSettingResource.ValidateResourceId(id); - return new IngestionSettingResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetAdvancedThreatProtectionSettingResource(id); } - #endregion - #region SoftwareInventoryResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SoftwareInventoryResource GetSoftwareInventoryResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeviceSecurityGroupResource GetDeviceSecurityGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SoftwareInventoryResource.ValidateResourceId(id); - return new SoftwareInventoryResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetDeviceSecurityGroupResource(id); } - #endregion - #region SecurityConnectorResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityConnectorResource GetSecurityConnectorResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static IotSecuritySolutionResource GetIotSecuritySolutionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityConnectorResource.ValidateResourceId(id); - return new SecurityConnectorResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetIotSecuritySolutionResource(id); } - #endregion - #region GovernanceRuleResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static GovernanceRuleResource GetGovernanceRuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static IotSecuritySolutionAnalyticsModelResource GetIotSecuritySolutionAnalyticsModelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GovernanceRuleResource.ValidateResourceId(id); - return new GovernanceRuleResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetIotSecuritySolutionAnalyticsModelResource(id); } - #endregion - #region GovernanceAssignmentResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static GovernanceAssignmentResource GetGovernanceAssignmentResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static IotSecurityAggregatedAlertResource GetIotSecurityAggregatedAlertResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GovernanceAssignmentResource.ValidateResourceId(id); - return new GovernanceAssignmentResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetIotSecurityAggregatedAlertResource(id); } - #endregion - #region SubscriptionSecurityApplicationResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityApplicationResource GetSubscriptionSecurityApplicationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static IotSecurityAggregatedRecommendationResource GetIotSecurityAggregatedRecommendationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionSecurityApplicationResource.ValidateResourceId(id); - return new SubscriptionSecurityApplicationResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetIotSecurityAggregatedRecommendationResource(id); } - #endregion - #region SecurityConnectorApplicationResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityConnectorApplicationResource GetSecurityConnectorApplicationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static SecurityCenterLocationResource GetSecurityCenterLocationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityConnectorApplicationResource.ValidateResourceId(id); - return new SecurityConnectorApplicationResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityCenterLocationResource(id); } - #endregion - #region SqlVulnerabilityAssessmentScanResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SqlVulnerabilityAssessmentScanResource GetSqlVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static SubscriptionSecurityTaskResource GetSubscriptionSecurityTaskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new SqlVulnerabilityAssessmentScanResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetSubscriptionSecurityTaskResource(id); } - #endregion - #region SqlVulnerabilityAssessmentBaselineRuleResource /// - /// 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. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SqlVulnerabilityAssessmentBaselineRuleResource GetSqlVulnerabilityAssessmentBaselineRuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ResourceGroupSecurityTaskResource GetResourceGroupSecurityTaskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); - return new SqlVulnerabilityAssessmentBaselineRuleResource(client, id); - } - ); + return GetSecurityCenterArmClientMockingExtension(client).GetResourceGroupSecurityTaskResource(id); } - #endregion - /// Gets a collection of ComplianceResultResources in the ArmResource. + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. - public static ComplianceResultCollection GetComplianceResults(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static AutoProvisioningSettingResource GetAutoProvisioningSettingResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetComplianceResults(); + return GetSecurityCenterArmClientMockingExtension(client).GetAutoProvisioningSettingResource(id); } /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// + /// 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. /// - /// Operation Id - /// ComplianceResults_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetComplianceResultAsync(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityComplianceResource GetSecurityComplianceResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetComplianceResults(scope).GetAsync(complianceResultName, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityComplianceResource(id); } /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// + /// 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. /// - /// Operation Id - /// ComplianceResults_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetComplianceResult(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityContactResource GetSecurityContactResource(this ArmClient client, ResourceIdentifier id) { - return client.GetComplianceResults(scope).Get(complianceResultName, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityContactResource(id); } - /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// Returns a object. - public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityWorkspaceSettingResource GetSecurityWorkspaceSettingResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetAdvancedThreatProtectionSetting(); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityWorkspaceSettingResource(id); } - /// Gets a collection of DeviceSecurityGroupResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. - public static DeviceSecurityGroupCollection GetDeviceSecurityGroups(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static RegulatoryComplianceStandardResource GetRegulatoryComplianceStandardResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetDeviceSecurityGroups(); + return GetSecurityCenterArmClientMockingExtension(client).GetRegulatoryComplianceStandardResource(id); } /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// + /// 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. /// - /// Operation Id - /// DeviceSecurityGroups_Get + /// 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 device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetDeviceSecurityGroupAsync(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static RegulatoryComplianceControlResource GetRegulatoryComplianceControlResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetDeviceSecurityGroups(scope).GetAsync(deviceSecurityGroupName, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetRegulatoryComplianceControlResource(id); } /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// + /// 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. /// - /// Operation Id - /// DeviceSecurityGroups_Get + /// 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 device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetDeviceSecurityGroup(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static RegulatoryComplianceAssessmentResource GetRegulatoryComplianceAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetDeviceSecurityGroups(scope).Get(deviceSecurityGroupName, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetRegulatoryComplianceAssessmentResource(id); } - /// Gets a collection of SecurityComplianceResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. - public static SecurityComplianceCollection GetSecurityCompliances(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecuritySubAssessmentResource GetSecuritySubAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecurityCompliances(); + return GetSecurityCenterArmClientMockingExtension(client).GetSecuritySubAssessmentResource(id); } /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// + /// 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. /// - /// Operation Id - /// Compliances_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityComplianceAsync(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityAutomationResource GetSecurityAutomationResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetSecurityCompliances(scope).GetAsync(complianceName, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAutomationResource(id); } /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// + /// 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. /// - /// Operation Id - /// Compliances_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityCompliance(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityAlertsSuppressionRuleResource GetSecurityAlertsSuppressionRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetSecurityCompliances(scope).Get(complianceName, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAlertsSuppressionRuleResource(id); } - /// Gets a collection of SecurityAssessmentResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. - public static SecurityAssessmentCollection GetSecurityAssessments(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static ServerVulnerabilityAssessmentResource GetServerVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecurityAssessments(); + return GetSecurityCenterArmClientMockingExtension(client).GetServerVulnerabilityAssessmentResource(id); } /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// + /// 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. /// - /// Operation Id - /// Assessments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityAssessmentAsync(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static TenantAssessmentMetadataResource GetTenantAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetSecurityAssessments(scope).GetAsync(assessmentName, expand, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetTenantAssessmentMetadataResource(id); } /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// + /// 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. /// - /// Operation Id - /// Assessments_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityAssessment(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SubscriptionAssessmentMetadataResource GetSubscriptionAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) { - return client.GetSecurityAssessments(scope).Get(assessmentName, expand, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSubscriptionAssessmentMetadataResource(id); } - /// Gets a collection of GovernanceRuleResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of GovernanceRuleResources and their operations over a GovernanceRuleResource. - public static GovernanceRuleCollection GetGovernanceRules(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityAssessmentResource GetSecurityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetGovernanceRules(); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityAssessmentResource(id); } /// - /// Get a specific governance rule for the requested scope by ruleId - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} - /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// - /// Operation Id - /// GovernanceRules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The governance rule key - unique key for the standard governance rule (GUID). - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetGovernanceRuleAsync(this ArmClient client, ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static AdaptiveApplicationControlGroupResource GetAdaptiveApplicationControlGroupResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetGovernanceRules(scope).GetAsync(ruleId, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetAdaptiveApplicationControlGroupResource(id); } /// - /// Get a specific governance rule for the requested scope by ruleId - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} - /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// - /// Operation Id - /// GovernanceRules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The governance rule key - unique key for the standard governance rule (GUID). - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetGovernanceRule(this ArmClient client, ResourceIdentifier scope, string ruleId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static AdaptiveNetworkHardeningResource GetAdaptiveNetworkHardeningResource(this ArmClient client, ResourceIdentifier id) { - return client.GetGovernanceRules(scope).Get(ruleId, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetAdaptiveNetworkHardeningResource(id); } - /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. - public static SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static JitNetworkAccessPolicyResource GetJitNetworkAccessPolicyResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSqlVulnerabilityAssessmentScans(); + return GetSecurityCenterArmClientMockingExtension(client).GetJitNetworkAccessPolicyResource(id); } /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// + /// 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. /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSqlVulnerabilityAssessmentScanAsync(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecureScoreResource GetSecureScoreResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetSqlVulnerabilityAssessmentScans(scope).GetAsync(scanId, workspaceId, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetSecureScoreResource(id); } /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// + /// 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. /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSqlVulnerabilityAssessmentScan(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityCloudConnectorResource GetSecurityCloudConnectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetSqlVulnerabilityAssessmentScans(scope).Get(scanId, workspaceId, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityCloudConnectorResource(id); } - /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmResource. + /// + /// 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 scope that the resource will apply against. - /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. - public static SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules(this ArmClient client, ResourceIdentifier scope) + /// The resource ID of the resource to get. + /// Returns a object. + public static SubscriptionSecurityAlertResource GetSubscriptionSecurityAlertResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSqlVulnerabilityAssessmentBaselineRules(); + return GetSecurityCenterArmClientMockingExtension(client).GetSubscriptionSecurityAlertResource(id); } /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// + /// 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. /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSqlVulnerabilityAssessmentBaselineRuleAsync(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static ResourceGroupSecurityAlertResource GetResourceGroupSecurityAlertResource(this ArmClient client, ResourceIdentifier id) { - return await client.GetSqlVulnerabilityAssessmentBaselineRules(scope).GetAsync(ruleId, workspaceId, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetResourceGroupSecurityAlertResource(id); } /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// + /// 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. /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSqlVulnerabilityAssessmentBaselineRule(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecuritySettingResource GetSecuritySettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetSqlVulnerabilityAssessmentBaselineRules(scope).Get(ruleId, workspaceId, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSecuritySettingResource(id); } /// - /// Details of the information protection policy. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} - /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// - /// Operation Id - /// InformationProtectionPolicies_CreateOrUpdate + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the information protection policy. - /// Information protection policy. - /// The cancellation token to use. - /// is null. - public static async Task> CreateOrUpdateInformationProtectionPolicyAsync(this ArmClient client, ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static IngestionSettingResource GetIngestionSettingResource(this ArmClient client, ResourceIdentifier id) { - Argument.AssertNotNull(informationProtectionPolicy, nameof(informationProtectionPolicy)); - - return await GetArmResourceExtensionClient(client, scope).CreateOrUpdateInformationProtectionPolicyAsync(informationProtectionPolicyName, informationProtectionPolicy, cancellationToken).ConfigureAwait(false); + return GetSecurityCenterArmClientMockingExtension(client).GetIngestionSettingResource(id); } /// - /// Details of the information protection policy. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName} - /// + /// 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. /// - /// Operation Id - /// InformationProtectionPolicies_CreateOrUpdate + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the information protection policy. - /// Information protection policy. - /// The cancellation token to use. - /// is null. - public static Response CreateOrUpdateInformationProtectionPolicy(this ArmClient client, ResourceIdentifier scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicy informationProtectionPolicy, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SoftwareInventoryResource GetSoftwareInventoryResource(this ArmClient client, ResourceIdentifier id) { - Argument.AssertNotNull(informationProtectionPolicy, nameof(informationProtectionPolicy)); - - return GetArmResourceExtensionClient(client, scope).CreateOrUpdateInformationProtectionPolicy(informationProtectionPolicyName, informationProtectionPolicy, cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSoftwareInventoryResource(id); } /// - /// Information protection policies of a specific management group. - /// + /// 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. /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies + /// Mocking + /// To mock this method, please mock instead. /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityConnectorResource GetSecurityConnectorResource(this ArmClient client, ResourceIdentifier id) + { + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityConnectorResource(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. /// - /// Operation Id - /// InformationProtectionPolicies_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static AsyncPageable GetInformationProtectionPoliciesAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static GovernanceRuleResource GetGovernanceRuleResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetInformationProtectionPoliciesAsync(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetGovernanceRuleResource(id); } /// - /// Information protection policies of a specific management group. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/informationProtectionPolicies - /// + /// 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. /// - /// Operation Id - /// InformationProtectionPolicies_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static Pageable GetInformationProtectionPolicies(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static GovernanceAssignmentResource GetGovernanceAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetInformationProtectionPolicies(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetGovernanceAssignmentResource(id); } /// - /// Get security sub-assessments on all your scanned resources inside a subscription scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/subAssessments - /// + /// 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. /// - /// Operation Id - /// SubAssessments_ListAll + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static AsyncPageable GetSecuritySubAssessmentsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SubscriptionSecurityApplicationResource GetSubscriptionSecurityApplicationResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecuritySubAssessmentsAsync(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSubscriptionSecurityApplicationResource(id); } /// - /// Get security sub-assessments on all your scanned resources inside a subscription scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/subAssessments - /// + /// 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. /// - /// Operation Id - /// SubAssessments_ListAll + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static Pageable GetSecuritySubAssessments(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SecurityConnectorApplicationResource GetSecurityConnectorApplicationResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecuritySubAssessments(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSecurityConnectorApplicationResource(id); } /// - /// Get security assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments - /// + /// 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. /// - /// Operation Id - /// Assessments_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static AsyncPageable GetSecurityAssessmentsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SqlVulnerabilityAssessmentScanResource GetSqlVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecurityAssessmentsAsync(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentScanResource(id); } /// - /// Get security assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments - /// + /// 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. /// - /// Operation Id - /// Assessments_List + /// Mocking + /// To mock this method, please mock instead. /// - /// /// /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The cancellation token to use. - public static Pageable GetSecurityAssessments(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) + /// The resource ID of the resource to get. + /// Returns a object. + public static SqlVulnerabilityAssessmentBaselineRuleResource GetSqlVulnerabilityAssessmentBaselineRuleResource(this ArmClient client, ResourceIdentifier id) { - return GetArmResourceExtensionClient(client, scope).GetSecurityAssessments(cancellationToken); + return GetSecurityCenterArmClientMockingExtension(client).GetSqlVulnerabilityAssessmentBaselineRuleResource(id); } - /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. + /// + /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CustomAssessmentAutomationResources and their operations over a CustomAssessmentAutomationResource. public static CustomAssessmentAutomationCollection GetCustomAssessmentAutomations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCustomAssessmentAutomations(); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomAssessmentAutomations(); } /// @@ -1544,16 +1508,20 @@ public static CustomAssessmentAutomationCollection GetCustomAssessmentAutomation /// CustomAssessmentAutomations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Custom Assessment Automation. /// The cancellation token to use. - /// 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 static async Task> GetCustomAssessmentAutomationAsync(this ResourceGroupResource resourceGroupResource, string customAssessmentAutomationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCustomAssessmentAutomations().GetAsync(customAssessmentAutomationName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomAssessmentAutomationAsync(customAssessmentAutomationName, cancellationToken).ConfigureAwait(false); } /// @@ -1568,24 +1536,34 @@ public static async Task> GetCustom /// CustomAssessmentAutomations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Custom Assessment Automation. /// The cancellation token to use. - /// 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 static Response GetCustomAssessmentAutomation(this ResourceGroupResource resourceGroupResource, string customAssessmentAutomationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCustomAssessmentAutomations().Get(customAssessmentAutomationName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomAssessmentAutomation(customAssessmentAutomationName, cancellationToken); } - /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. + /// + /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CustomEntityStoreAssignmentResources and their operations over a CustomEntityStoreAssignmentResource. public static CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCustomEntityStoreAssignments(); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomEntityStoreAssignments(); } /// @@ -1600,16 +1578,20 @@ public static CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignme /// CustomEntityStoreAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the custom entity store assignment. Generated name is GUID. /// The cancellation token to use. - /// 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 static async Task> GetCustomEntityStoreAssignmentAsync(this ResourceGroupResource resourceGroupResource, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCustomEntityStoreAssignments().GetAsync(customEntityStoreAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomEntityStoreAssignmentAsync(customEntityStoreAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -1624,24 +1606,34 @@ public static async Task> GetCusto /// CustomEntityStoreAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the custom entity store assignment. Generated name is GUID. /// The cancellation token to use. - /// 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 static Response GetCustomEntityStoreAssignment(this ResourceGroupResource resourceGroupResource, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCustomEntityStoreAssignments().Get(customEntityStoreAssignmentName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetCustomEntityStoreAssignment(customEntityStoreAssignmentName, cancellationToken); } - /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. + /// + /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IotSecuritySolutionResources and their operations over a IotSecuritySolutionResource. public static IotSecuritySolutionCollection GetIotSecuritySolutions(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetIotSecuritySolutions(); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetIotSecuritySolutions(); } /// @@ -1656,16 +1648,20 @@ public static IotSecuritySolutionCollection GetIotSecuritySolutions(this Resourc /// IotSecuritySolution_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IoT Security solution. /// The cancellation token to use. - /// 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 static async Task> GetIotSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, string solutionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetIotSecuritySolutions().GetAsync(solutionName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetIotSecuritySolutionAsync(solutionName, cancellationToken).ConfigureAwait(false); } /// @@ -1680,25 +1676,35 @@ public static async Task> GetIotSecuritySo /// IotSecuritySolution_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the IoT Security solution. /// The cancellation token to use. - /// 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 static Response GetIotSecuritySolution(this ResourceGroupResource resourceGroupResource, string solutionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetIotSecuritySolutions().Get(solutionName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetIotSecuritySolution(solutionName, cancellationToken); } - /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// An object representing collection of ResourceGroupSecurityTaskResources and their operations over a ResourceGroupSecurityTaskResource. public static ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGroupSecurityTasks(ascLocation); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityTasks(ascLocation); } /// @@ -1713,17 +1719,21 @@ public static ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks( /// Tasks_GetResourceGroupLevelTask /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of the task object, will be a GUID. /// The cancellation token to use. - /// 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 static async Task> GetResourceGroupSecurityTaskAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGroupSecurityTasks(ascLocation).GetAsync(taskName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityTaskAsync(ascLocation, taskName, cancellationToken).ConfigureAwait(false); } /// @@ -1738,25 +1748,35 @@ public static async Task> GetResourc /// Tasks_GetResourceGroupLevelTask /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of the task object, will be a GUID. /// The cancellation token to use. - /// 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 static Response GetResourceGroupSecurityTask(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGroupSecurityTasks(ascLocation).Get(taskName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityTask(ascLocation, taskName, cancellationToken); } - /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. + /// + /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityAutomationResources and their operations over a SecurityAutomationResource. public static SecurityAutomationCollection GetSecurityAutomations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecurityAutomations(); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityAutomations(); } /// @@ -1771,16 +1791,20 @@ public static SecurityAutomationCollection GetSecurityAutomations(this ResourceG /// Automations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security automation name. /// The cancellation token to use. - /// 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 static async Task> GetSecurityAutomationAsync(this ResourceGroupResource resourceGroupResource, string automationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSecurityAutomations().GetAsync(automationName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityAutomationAsync(automationName, cancellationToken).ConfigureAwait(false); } /// @@ -1795,33 +1819,39 @@ public static async Task> GetSecurityAutoma /// Automations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security automation name. /// The cancellation token to use. - /// 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 static Response GetSecurityAutomation(this ResourceGroupResource resourceGroupResource, string automationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSecurityAutomations().Get(automationName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityAutomation(automationName, cancellationToken); } - /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. + /// + /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The Namespace of the resource. /// The type of the resource. /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of ServerVulnerabilityAssessmentResources and their operations over a ServerVulnerabilityAssessmentResource. public static ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAssessments(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName); } /// @@ -1836,18 +1866,22 @@ public static ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAsse /// ServerVulnerabilityAssessment_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace of the resource. /// The type of the resource. /// Name of the resource. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetServerVulnerabilityAssessmentAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).GetAsync(cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetServerVulnerabilityAssessmentAsync(resourceNamespace, resourceType, resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1862,35 +1896,41 @@ public static async Task> GetSer /// ServerVulnerabilityAssessment_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace of the resource. /// The type of the resource. /// Name of the resource. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetServerVulnerabilityAssessment(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).Get(cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetServerVulnerabilityAssessment(resourceNamespace, resourceType, resourceName, cancellationToken); } - /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. + /// + /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The Namespace of the resource. /// The type of the resource. /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of AdaptiveNetworkHardeningResources and their operations over a AdaptiveNetworkHardeningResource. public static AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName); } /// @@ -1905,6 +1945,10 @@ public static AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(th /// AdaptiveNetworkHardenings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace of the resource. @@ -1912,12 +1956,12 @@ public static AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(th /// Name of the resource. /// The name of the Adaptive Network Hardening resource. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetAdaptiveNetworkHardeningAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).GetAsync(adaptiveNetworkHardeningResourceName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAdaptiveNetworkHardeningAsync(resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, cancellationToken).ConfigureAwait(false); } /// @@ -1932,6 +1976,10 @@ public static async Task> GetAdaptive /// AdaptiveNetworkHardenings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace of the resource. @@ -1939,21 +1987,27 @@ public static async Task> GetAdaptive /// Name of the resource. /// The name of the Adaptive Network Hardening resource. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetAdaptiveNetworkHardening(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).Get(adaptiveNetworkHardeningResourceName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAdaptiveNetworkHardening(resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, cancellationToken); } - /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// An object representing collection of JitNetworkAccessPolicyResources and their operations over a JitNetworkAccessPolicyResource. public static JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetJitNetworkAccessPolicies(ascLocation); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetJitNetworkAccessPolicies(ascLocation); } /// @@ -1968,17 +2022,21 @@ public static JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(this /// JitNetworkAccessPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of a Just-in-Time access configuration policy. /// The cancellation token to use. - /// 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 static async Task> GetJitNetworkAccessPolicyAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetJitNetworkAccessPolicies(ascLocation).GetAsync(jitNetworkAccessPolicyName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetJitNetworkAccessPolicyAsync(ascLocation, jitNetworkAccessPolicyName, cancellationToken).ConfigureAwait(false); } /// @@ -1993,26 +2051,36 @@ public static async Task> GetJitNetwork /// JitNetworkAccessPolicies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of a Just-in-Time access configuration policy. /// The cancellation token to use. - /// 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 static Response GetJitNetworkAccessPolicy(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetJitNetworkAccessPolicies(ascLocation).Get(jitNetworkAccessPolicyName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetJitNetworkAccessPolicy(ascLocation, jitNetworkAccessPolicyName, cancellationToken); } - /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// An object representing collection of ResourceGroupSecurityAlertResources and their operations over a ResourceGroupSecurityAlertResource. public static ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlerts(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGroupSecurityAlerts(ascLocation); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityAlerts(ascLocation); } /// @@ -2027,17 +2095,21 @@ public static ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlert /// Alerts_GetResourceGroupLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of the alert object. /// The cancellation token to use. - /// 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 static async Task> GetResourceGroupSecurityAlertAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGroupSecurityAlerts(ascLocation).GetAsync(alertName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityAlertAsync(ascLocation, alertName, cancellationToken).ConfigureAwait(false); } /// @@ -2052,34 +2124,40 @@ public static async Task> GetResour /// Alerts_GetResourceGroupLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. /// Name of the alert object. /// The cancellation token to use. - /// 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 static Response GetResourceGroupSecurityAlert(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGroupSecurityAlerts(ascLocation).Get(alertName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupSecurityAlert(ascLocation, alertName, cancellationToken); } - /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. + /// + /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The namespace of the resource. /// The type of the resource. /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. /// An object representing collection of SoftwareInventoryResources and their operations over a SoftwareInventoryResource. public static SoftwareInventoryCollection GetSoftwareInventories(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSoftwareInventories(resourceNamespace, resourceType, resourceName); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSoftwareInventories(resourceNamespace, resourceType, resourceName); } /// @@ -2094,6 +2172,10 @@ public static SoftwareInventoryCollection GetSoftwareInventories(this ResourceGr /// SoftwareInventories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource. @@ -2101,12 +2183,12 @@ public static SoftwareInventoryCollection GetSoftwareInventories(this ResourceGr /// Name of the resource. /// Name of the installed software. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSoftwareInventoryAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSoftwareInventories(resourceNamespace, resourceType, resourceName).GetAsync(softwareName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSoftwareInventoryAsync(resourceNamespace, resourceType, resourceName, softwareName, cancellationToken).ConfigureAwait(false); } /// @@ -2121,6 +2203,10 @@ public static async Task> GetSoftwareInvento /// SoftwareInventories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace of the resource. @@ -2128,20 +2214,26 @@ public static async Task> GetSoftwareInvento /// Name of the resource. /// Name of the installed software. /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSoftwareInventory(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSoftwareInventories(resourceNamespace, resourceType, resourceName).Get(softwareName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSoftwareInventory(resourceNamespace, resourceType, resourceName, softwareName, cancellationToken); } - /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. + /// + /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityConnectorResources and their operations over a SecurityConnectorResource. public static SecurityConnectorCollection GetSecurityConnectors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecurityConnectors(); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityConnectors(); } /// @@ -2156,16 +2248,20 @@ public static SecurityConnectorCollection GetSecurityConnectors(this ResourceGro /// SecurityConnectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security connector name. /// The cancellation token to use. - /// 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 static async Task> GetSecurityConnectorAsync(this ResourceGroupResource resourceGroupResource, string securityConnectorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSecurityConnectors().GetAsync(securityConnectorName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityConnectorAsync(securityConnectorName, cancellationToken).ConfigureAwait(false); } /// @@ -2180,16 +2276,20 @@ public static async Task> GetSecurityConnect /// SecurityConnectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security connector name. /// The cancellation token to use. - /// 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 static Response GetSecurityConnector(this ResourceGroupResource resourceGroupResource, string securityConnectorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSecurityConnectors().Get(securityConnectorName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecurityConnector(securityConnectorName, cancellationToken); } /// @@ -2204,6 +2304,10 @@ public static Response GetSecurityConnector(this Reso /// AllowedConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2211,7 +2315,7 @@ public static Response GetSecurityConnector(this Reso /// The cancellation token to use. public static async Task> GetAllowedConnectionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) { - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAllowedConnectionAsync(ascLocation, connectionType, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAllowedConnectionAsync(ascLocation, connectionType, cancellationToken).ConfigureAwait(false); } /// @@ -2226,6 +2330,10 @@ public static async Task> GetAllowedCo /// AllowedConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2233,7 +2341,7 @@ public static async Task> GetAllowedCo /// The cancellation token to use. public static Response GetAllowedConnection(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAllowedConnection(ascLocation, connectionType, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAllowedConnection(ascLocation, connectionType, cancellationToken); } /// @@ -2248,6 +2356,10 @@ public static Response GetAllowedConnection(thi /// Topology_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2257,9 +2369,7 @@ public static Response GetAllowedConnection(thi /// is null. public static async Task> GetTopologyAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTopologyAsync(ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetTopologyAsync(ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); } /// @@ -2274,6 +2384,10 @@ public static async Task> GetTopologyAsync(th /// Topology_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2283,9 +2397,7 @@ public static async Task> GetTopologyAsync(th /// is null. public static Response GetTopology(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTopology(ascLocation, topologyResourceName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetTopology(ascLocation, topologyResourceName, cancellationToken); } /// @@ -2300,13 +2412,17 @@ public static Response GetTopology(this ResourceGroupR /// JitNetworkAccessPolicies_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetJitNetworkAccessPoliciesAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); } /// @@ -2321,13 +2437,17 @@ public static AsyncPageable GetJitNetworkAccessP /// JitNetworkAccessPolicies_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetJitNetworkAccessPolicies(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetJitNetworkAccessPolicies(cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetJitNetworkAccessPolicies(cancellationToken); } /// @@ -2342,6 +2462,10 @@ public static Pageable GetJitNetworkAccessPolici /// DiscoveredSecuritySolutions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2351,9 +2475,7 @@ public static Pageable GetJitNetworkAccessPolici /// is null. public static async Task> GetDiscoveredSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiscoveredSecuritySolutionAsync(ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetDiscoveredSecuritySolutionAsync(ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); } /// @@ -2368,6 +2490,10 @@ public static async Task> GetDiscoveredSecu /// DiscoveredSecuritySolutions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2377,9 +2503,7 @@ public static async Task> GetDiscoveredSecu /// is null. public static Response GetDiscoveredSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiscoveredSecuritySolution(ascLocation, discoveredSecuritySolutionName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetDiscoveredSecuritySolution(ascLocation, discoveredSecuritySolutionName, cancellationToken); } /// @@ -2394,6 +2518,10 @@ public static Response GetDiscoveredSecuritySolution /// ExternalSecuritySolutions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2403,9 +2531,7 @@ public static Response GetDiscoveredSecuritySolution /// is null. public static async Task> GetExternalSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExternalSecuritySolutionAsync(ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetExternalSecuritySolutionAsync(ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); } /// @@ -2419,7 +2545,11 @@ public static async Task> GetExternalSecurity /// Operation Id /// ExternalSecuritySolutions_Get /// - /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2429,9 +2559,7 @@ public static async Task> GetExternalSecurity /// is null. public static Response GetExternalSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetExternalSecuritySolution(ascLocation, externalSecuritySolutionsName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetExternalSecuritySolution(ascLocation, externalSecuritySolutionsName, cancellationToken); } /// @@ -2446,6 +2574,10 @@ public static Response GetExternalSecuritySolution(thi /// SecuritySolutions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2455,9 +2587,7 @@ public static Response GetExternalSecuritySolution(thi /// is null. public static async Task> GetSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecuritySolutionAsync(ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecuritySolutionAsync(ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); } /// @@ -2472,6 +2602,10 @@ public static async Task> GetSecuritySolutionAsync(th /// SecuritySolutions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2481,9 +2615,7 @@ public static async Task> GetSecuritySolutionAsync(th /// is null. public static Response GetSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSecuritySolution(ascLocation, securitySolutionName, cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetSecuritySolution(ascLocation, securitySolutionName, cancellationToken); } /// @@ -2498,13 +2630,17 @@ public static Response GetSecuritySolution(this ResourceGroupR /// Alerts_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAlertsByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAlertsByResourceGroupAsync(cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAlertsByResourceGroupAsync(cancellationToken); } /// @@ -2519,21 +2655,31 @@ public static AsyncPageable GetAlertsByResourceGroupAsync(thi /// Alerts_ListByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAlertsByResourceGroup(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAlertsByResourceGroup(cancellationToken); + return GetSecurityCenterResourceGroupMockingExtension(resourceGroupResource).GetAlertsByResourceGroup(cancellationToken); } - /// Gets a collection of SecurityCenterPricingResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityCenterPricingResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityCenterPricingResources and their operations over a SecurityCenterPricingResource. public static SecurityCenterPricingCollection GetSecurityCenterPricings(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityCenterPricings(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterPricings(); } /// @@ -2548,16 +2694,20 @@ public static SecurityCenterPricingCollection GetSecurityCenterPricings(this Sub /// Pricings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// name of the pricing configuration. /// The cancellation token to use. - /// 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 static async Task> GetSecurityCenterPricingAsync(this SubscriptionResource subscriptionResource, string pricingName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityCenterPricings().GetAsync(pricingName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterPricingAsync(pricingName, cancellationToken).ConfigureAwait(false); } /// @@ -2572,24 +2722,34 @@ public static async Task> GetSecurityCen /// Pricings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// name of the pricing configuration. /// The cancellation token to use. - /// 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 static Response GetSecurityCenterPricing(this SubscriptionResource subscriptionResource, string pricingName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityCenterPricings().Get(pricingName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterPricing(pricingName, cancellationToken); } - /// Gets a collection of SecurityCenterLocationResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityCenterLocationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityCenterLocationResources and their operations over a SecurityCenterLocationResource. public static SecurityCenterLocationCollection GetSecurityCenterLocations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityCenterLocations(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterLocations(); } /// @@ -2604,6 +2764,10 @@ public static SecurityCenterLocationCollection GetSecurityCenterLocations(this S /// Locations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2611,7 +2775,7 @@ public static SecurityCenterLocationCollection GetSecurityCenterLocations(this S [ForwardsClientCalls] public static async Task> GetSecurityCenterLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation ascLocation, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityCenterLocations().GetAsync(ascLocation, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterLocationAsync(ascLocation, cancellationToken).ConfigureAwait(false); } /// @@ -2626,6 +2790,10 @@ public static async Task> GetSecurityCe /// Locations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. @@ -2633,15 +2801,21 @@ public static async Task> GetSecurityCe [ForwardsClientCalls] public static Response GetSecurityCenterLocation(this SubscriptionResource subscriptionResource, AzureLocation ascLocation, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityCenterLocations().Get(ascLocation, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCenterLocation(ascLocation, cancellationToken); } - /// Gets a collection of AutoProvisioningSettingResources in the SubscriptionResource. + /// + /// Gets a collection of AutoProvisioningSettingResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AutoProvisioningSettingResources and their operations over a AutoProvisioningSettingResource. public static AutoProvisioningSettingCollection GetAutoProvisioningSettings(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAutoProvisioningSettings(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAutoProvisioningSettings(); } /// @@ -2656,16 +2830,20 @@ public static AutoProvisioningSettingCollection GetAutoProvisioningSettings(this /// AutoProvisioningSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Auto provisioning setting key. /// The cancellation token to use. - /// 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 static async Task> GetAutoProvisioningSettingAsync(this SubscriptionResource subscriptionResource, string settingName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAutoProvisioningSettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAutoProvisioningSettingAsync(settingName, cancellationToken).ConfigureAwait(false); } /// @@ -2680,24 +2858,34 @@ public static async Task> GetAutoProvi /// AutoProvisioningSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Auto provisioning setting key. /// The cancellation token to use. - /// 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 static Response GetAutoProvisioningSetting(this SubscriptionResource subscriptionResource, string settingName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAutoProvisioningSettings().Get(settingName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAutoProvisioningSetting(settingName, cancellationToken); } - /// Gets a collection of SecurityContactResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityContactResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityContactResources and their operations over a SecurityContactResource. public static SecurityContactCollection GetSecurityContacts(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityContacts(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityContacts(); } /// @@ -2712,16 +2900,20 @@ public static SecurityContactCollection GetSecurityContacts(this SubscriptionRes /// SecurityContacts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the security contact object. /// The cancellation token to use. - /// 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 static async Task> GetSecurityContactAsync(this SubscriptionResource subscriptionResource, string securityContactName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityContacts().GetAsync(securityContactName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityContactAsync(securityContactName, cancellationToken).ConfigureAwait(false); } /// @@ -2736,24 +2928,34 @@ public static async Task> GetSecurityContactAs /// SecurityContacts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the security contact object. /// The cancellation token to use. - /// 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 static Response GetSecurityContact(this SubscriptionResource subscriptionResource, string securityContactName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityContacts().Get(securityContactName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityContact(securityContactName, cancellationToken); } - /// Gets a collection of SecurityWorkspaceSettingResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityWorkspaceSettingResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityWorkspaceSettingResources and their operations over a SecurityWorkspaceSettingResource. public static SecurityWorkspaceSettingCollection GetSecurityWorkspaceSettings(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityWorkspaceSettings(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityWorkspaceSettings(); } /// @@ -2768,16 +2970,20 @@ public static SecurityWorkspaceSettingCollection GetSecurityWorkspaceSettings(th /// WorkspaceSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the security setting. /// The cancellation token to use. - /// 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 static async Task> GetSecurityWorkspaceSettingAsync(this SubscriptionResource subscriptionResource, string workspaceSettingName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityWorkspaceSettings().GetAsync(workspaceSettingName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityWorkspaceSettingAsync(workspaceSettingName, cancellationToken).ConfigureAwait(false); } /// @@ -2792,24 +2998,34 @@ public static async Task> GetSecurity /// WorkspaceSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the security setting. /// The cancellation token to use. - /// 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 static Response GetSecurityWorkspaceSetting(this SubscriptionResource subscriptionResource, string workspaceSettingName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityWorkspaceSettings().Get(workspaceSettingName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityWorkspaceSetting(workspaceSettingName, cancellationToken); } - /// Gets a collection of RegulatoryComplianceStandardResources in the SubscriptionResource. + /// + /// Gets a collection of RegulatoryComplianceStandardResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RegulatoryComplianceStandardResources and their operations over a RegulatoryComplianceStandardResource. public static RegulatoryComplianceStandardCollection GetRegulatoryComplianceStandards(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRegulatoryComplianceStandards(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetRegulatoryComplianceStandards(); } /// @@ -2824,16 +3040,20 @@ public static RegulatoryComplianceStandardCollection GetRegulatoryComplianceStan /// RegulatoryComplianceStandards_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the regulatory compliance standard object. /// The cancellation token to use. - /// 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 static async Task> GetRegulatoryComplianceStandardAsync(this SubscriptionResource subscriptionResource, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetRegulatoryComplianceStandards().GetAsync(regulatoryComplianceStandardName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetRegulatoryComplianceStandardAsync(regulatoryComplianceStandardName, cancellationToken).ConfigureAwait(false); } /// @@ -2848,24 +3068,34 @@ public static async Task> GetRegu /// RegulatoryComplianceStandards_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the regulatory compliance standard object. /// The cancellation token to use. - /// 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 static Response GetRegulatoryComplianceStandard(this SubscriptionResource subscriptionResource, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetRegulatoryComplianceStandards().Get(regulatoryComplianceStandardName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetRegulatoryComplianceStandard(regulatoryComplianceStandardName, cancellationToken); } - /// Gets a collection of SecurityAlertsSuppressionRuleResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityAlertsSuppressionRuleResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityAlertsSuppressionRuleResources and their operations over a SecurityAlertsSuppressionRuleResource. public static SecurityAlertsSuppressionRuleCollection GetSecurityAlertsSuppressionRules(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityAlertsSuppressionRules(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityAlertsSuppressionRules(); } /// @@ -2880,16 +3110,20 @@ public static SecurityAlertsSuppressionRuleCollection GetSecurityAlertsSuppressi /// AlertsSuppressionRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The unique name of the suppression alert rule. /// The cancellation token to use. - /// 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 static async Task> GetSecurityAlertsSuppressionRuleAsync(this SubscriptionResource subscriptionResource, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityAlertsSuppressionRules().GetAsync(alertsSuppressionRuleName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityAlertsSuppressionRuleAsync(alertsSuppressionRuleName, cancellationToken).ConfigureAwait(false); } /// @@ -2904,24 +3138,34 @@ public static async Task> GetSec /// AlertsSuppressionRules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The unique name of the suppression alert rule. /// The cancellation token to use. - /// 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 static Response GetSecurityAlertsSuppressionRule(this SubscriptionResource subscriptionResource, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityAlertsSuppressionRules().Get(alertsSuppressionRuleName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityAlertsSuppressionRule(alertsSuppressionRuleName, cancellationToken); } - /// Gets a collection of SubscriptionAssessmentMetadataResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionAssessmentMetadataResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SubscriptionAssessmentMetadataResources and their operations over a SubscriptionAssessmentMetadataResource. public static SubscriptionAssessmentMetadataCollection GetAllSubscriptionAssessmentMetadata(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllSubscriptionAssessmentMetadata(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAllSubscriptionAssessmentMetadata(); } /// @@ -2936,16 +3180,20 @@ public static SubscriptionAssessmentMetadataCollection GetAllSubscriptionAssessm /// AssessmentsMetadata_GetInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Assessment Key - Unique key for the assessment type. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionAssessmentMetadataAsync(this SubscriptionResource subscriptionResource, string assessmentMetadataName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAllSubscriptionAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSubscriptionAssessmentMetadataAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); } /// @@ -2960,24 +3208,34 @@ public static async Task> GetSu /// AssessmentsMetadata_GetInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Assessment Key - Unique key for the assessment type. /// The cancellation token to use. - /// 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 static Response GetSubscriptionAssessmentMetadata(this SubscriptionResource subscriptionResource, string assessmentMetadataName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetAllSubscriptionAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSubscriptionAssessmentMetadata(assessmentMetadataName, cancellationToken); } - /// Gets a collection of SecureScoreResources in the SubscriptionResource. + /// + /// Gets a collection of SecureScoreResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecureScoreResources and their operations over a SecureScoreResource. public static SecureScoreCollection GetSecureScores(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecureScores(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScores(); } /// @@ -2992,16 +3250,20 @@ public static SecureScoreCollection GetSecureScores(this SubscriptionResource su /// SecureScores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. /// The cancellation token to use. - /// 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 static async Task> GetSecureScoreAsync(this SubscriptionResource subscriptionResource, string secureScoreName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecureScores().GetAsync(secureScoreName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScoreAsync(secureScoreName, cancellationToken).ConfigureAwait(false); } /// @@ -3016,24 +3278,34 @@ public static async Task> GetSecureScoreAsync(this /// SecureScores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. /// The cancellation token to use. - /// 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 static Response GetSecureScore(this SubscriptionResource subscriptionResource, string secureScoreName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecureScores().Get(secureScoreName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScore(secureScoreName, cancellationToken); } - /// Gets a collection of SecurityCloudConnectorResources in the SubscriptionResource. + /// + /// Gets a collection of SecurityCloudConnectorResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecurityCloudConnectorResources and their operations over a SecurityCloudConnectorResource. public static SecurityCloudConnectorCollection GetSecurityCloudConnectors(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityCloudConnectors(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCloudConnectors(); } /// @@ -3048,16 +3320,20 @@ public static SecurityCloudConnectorCollection GetSecurityCloudConnectors(this S /// Connectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cloud account connector. /// The cancellation token to use. - /// 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 static async Task> GetSecurityCloudConnectorAsync(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityCloudConnectors().GetAsync(connectorName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCloudConnectorAsync(connectorName, cancellationToken).ConfigureAwait(false); } /// @@ -3072,24 +3348,34 @@ public static async Task> GetSecurityCl /// Connectors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cloud account connector. /// The cancellation token to use. - /// 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 static Response GetSecurityCloudConnector(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityCloudConnectors().Get(connectorName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityCloudConnector(connectorName, cancellationToken); } - /// Gets a collection of SecuritySettingResources in the SubscriptionResource. + /// + /// Gets a collection of SecuritySettingResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SecuritySettingResources and their operations over a SecuritySettingResource. public static SecuritySettingCollection GetSecuritySettings(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecuritySettings(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecuritySettings(); } /// @@ -3104,6 +3390,10 @@ public static SecuritySettingCollection GetSecuritySettings(this SubscriptionRes /// Settings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the setting. @@ -3111,7 +3401,7 @@ public static SecuritySettingCollection GetSecuritySettings(this SubscriptionRes [ForwardsClientCalls] public static async Task> GetSecuritySettingAsync(this SubscriptionResource subscriptionResource, SecuritySettingName settingName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecuritySettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecuritySettingAsync(settingName, cancellationToken).ConfigureAwait(false); } /// @@ -3126,6 +3416,10 @@ public static async Task> GetSecuritySettingAs /// Settings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the setting. @@ -3133,15 +3427,21 @@ public static async Task> GetSecuritySettingAs [ForwardsClientCalls] public static Response GetSecuritySetting(this SubscriptionResource subscriptionResource, SecuritySettingName settingName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecuritySettings().Get(settingName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecuritySetting(settingName, cancellationToken); } - /// Gets a collection of IngestionSettingResources in the SubscriptionResource. + /// + /// Gets a collection of IngestionSettingResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of IngestionSettingResources and their operations over a IngestionSettingResource. public static IngestionSettingCollection GetIngestionSettings(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIngestionSettings(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetIngestionSettings(); } /// @@ -3156,16 +3456,20 @@ public static IngestionSettingCollection GetIngestionSettings(this SubscriptionR /// IngestionSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the ingestion setting. /// The cancellation token to use. - /// 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 static async Task> GetIngestionSettingAsync(this SubscriptionResource subscriptionResource, string ingestionSettingName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetIngestionSettings().GetAsync(ingestionSettingName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetIngestionSettingAsync(ingestionSettingName, cancellationToken).ConfigureAwait(false); } /// @@ -3180,24 +3484,34 @@ public static async Task> GetIngestionSetting /// IngestionSettings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the ingestion setting. /// The cancellation token to use. - /// 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 static Response GetIngestionSetting(this SubscriptionResource subscriptionResource, string ingestionSettingName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetIngestionSettings().Get(ingestionSettingName, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetIngestionSetting(ingestionSettingName, cancellationToken); } - /// Gets a collection of SubscriptionSecurityApplicationResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionSecurityApplicationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SubscriptionSecurityApplicationResources and their operations over a SubscriptionSecurityApplicationResource. public static SubscriptionSecurityApplicationCollection GetSubscriptionSecurityApplications(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionSecurityApplications(); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSubscriptionSecurityApplications(); } /// @@ -3212,16 +3526,20 @@ public static SubscriptionSecurityApplicationCollection GetSubscriptionSecurityA /// Application_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security Application key - unique key for the standard application. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionSecurityApplicationAsync(this SubscriptionResource subscriptionResource, string applicationId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionSecurityApplications().GetAsync(applicationId, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSubscriptionSecurityApplicationAsync(applicationId, cancellationToken).ConfigureAwait(false); } /// @@ -3236,16 +3554,20 @@ public static async Task> GetS /// Application_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The security Application key - unique key for the standard application. /// The cancellation token to use. - /// 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 static Response GetSubscriptionSecurityApplication(this SubscriptionResource subscriptionResource, string applicationId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionSecurityApplications().Get(applicationId, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSubscriptionSecurityApplication(applicationId, cancellationToken); } /// @@ -3260,13 +3582,17 @@ public static Response GetSubscriptionS /// MdeOnboardings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMdeOnboardingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMdeOnboardingsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetMdeOnboardingsAsync(cancellationToken); } /// @@ -3281,13 +3607,17 @@ public static AsyncPageable GetMdeOnboardingsAsync(this Subscript /// MdeOnboardings_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMdeOnboardings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMdeOnboardings(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetMdeOnboardings(cancellationToken); } /// @@ -3302,12 +3632,16 @@ public static Pageable GetMdeOnboardings(this SubscriptionResourc /// MdeOnboardings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static async Task> GetMdeOnboardingAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetMdeOnboardingAsync(cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetMdeOnboardingAsync(cancellationToken).ConfigureAwait(false); } /// @@ -3322,12 +3656,16 @@ public static async Task> GetMdeOnboardingAsync(this Sub /// MdeOnboardings_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. public static Response GetMdeOnboarding(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMdeOnboarding(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetMdeOnboarding(cancellationToken); } /// @@ -3342,13 +3680,17 @@ public static Response GetMdeOnboarding(this SubscriptionResource /// CustomAssessmentAutomations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCustomAssessmentAutomationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomAssessmentAutomationsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetCustomAssessmentAutomationsAsync(cancellationToken); } /// @@ -3363,13 +3705,17 @@ public static AsyncPageable GetCustomAssessm /// CustomAssessmentAutomations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCustomAssessmentAutomations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomAssessmentAutomations(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetCustomAssessmentAutomations(cancellationToken); } /// @@ -3384,13 +3730,17 @@ public static Pageable GetCustomAssessmentAu /// CustomEntityStoreAssignments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCustomEntityStoreAssignmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomEntityStoreAssignmentsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetCustomEntityStoreAssignmentsAsync(cancellationToken); } /// @@ -3405,13 +3755,17 @@ public static AsyncPageable GetCustomEntity /// CustomEntityStoreAssignments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCustomEntityStoreAssignments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomEntityStoreAssignments(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetCustomEntityStoreAssignments(cancellationToken); } /// @@ -3426,6 +3780,10 @@ public static Pageable GetCustomEntityStore /// IotSecuritySolution_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. @@ -3433,7 +3791,7 @@ public static Pageable GetCustomEntityStore /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetIotSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotSecuritySolutionsAsync(filter, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetIotSecuritySolutionsAsync(filter, cancellationToken); } /// @@ -3448,6 +3806,10 @@ public static AsyncPageable GetIotSecuritySolutions /// IotSecuritySolution_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. @@ -3455,7 +3817,7 @@ public static AsyncPageable GetIotSecuritySolutions /// A collection of that may take multiple service requests to iterate over. public static Pageable GetIotSecuritySolutions(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetIotSecuritySolutions(filter, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetIotSecuritySolutions(filter, cancellationToken); } /// @@ -3470,6 +3832,10 @@ public static Pageable GetIotSecuritySolutions(this /// Tasks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData filter. Optional. @@ -3477,7 +3843,7 @@ public static Pageable GetIotSecuritySolutions(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTasksAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTasksAsync(filter, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetTasksAsync(filter, cancellationToken); } /// @@ -3492,6 +3858,10 @@ public static AsyncPageable GetTasksAsync(this SubscriptionRes /// Tasks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData filter. Optional. @@ -3499,7 +3869,7 @@ public static AsyncPageable GetTasksAsync(this SubscriptionRes /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTasks(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTasks(filter, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetTasks(filter, cancellationToken); } /// @@ -3514,13 +3884,17 @@ public static Pageable GetTasks(this SubscriptionResource subs /// Automations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecurityAutomationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityAutomationsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityAutomationsAsync(cancellationToken); } /// @@ -3535,13 +3909,17 @@ public static AsyncPageable GetSecurityAutomationsAs /// Automations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecurityAutomations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityAutomations(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityAutomations(cancellationToken); } /// @@ -3556,6 +3934,10 @@ public static Pageable GetSecurityAutomations(this S /// AdaptiveApplicationControls_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Include the policy rules. @@ -3564,7 +3946,7 @@ public static Pageable GetSecurityAutomations(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAdaptiveApplicationControlGroupsAsync(this SubscriptionResource subscriptionResource, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAdaptiveApplicationControlGroupsAsync(includePathRecommendations, summary, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAdaptiveApplicationControlGroupsAsync(includePathRecommendations, summary, cancellationToken); } /// @@ -3579,6 +3961,10 @@ public static AsyncPageable GetAdaptive /// AdaptiveApplicationControls_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Include the policy rules. @@ -3587,7 +3973,7 @@ public static AsyncPageable GetAdaptive /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAdaptiveApplicationControlGroups(this SubscriptionResource subscriptionResource, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAdaptiveApplicationControlGroups(includePathRecommendations, summary, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAdaptiveApplicationControlGroups(includePathRecommendations, summary, cancellationToken); } /// @@ -3602,13 +3988,17 @@ public static Pageable GetAdaptiveAppli /// AllowedConnections_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAllowedConnectionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllowedConnectionsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAllowedConnectionsAsync(cancellationToken); } /// @@ -3623,13 +4013,17 @@ public static AsyncPageable GetAllowedConnectio /// AllowedConnections_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAllowedConnections(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllowedConnections(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAllowedConnections(cancellationToken); } /// @@ -3644,13 +4038,17 @@ public static Pageable GetAllowedConnections(th /// Topology_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTopologiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTopologiesAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetTopologiesAsync(cancellationToken); } /// @@ -3665,13 +4063,17 @@ public static AsyncPageable GetTopologiesAsync(this Su /// Topology_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTopologies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTopologies(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetTopologies(cancellationToken); } /// @@ -3686,13 +4088,17 @@ public static Pageable GetTopologies(this Subscription /// JitNetworkAccessPolicies_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetJitNetworkAccessPoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); } /// @@ -3707,13 +4113,17 @@ public static AsyncPageable GetJitNetworkAccessP /// JitNetworkAccessPolicies_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetJitNetworkAccessPolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetJitNetworkAccessPolicies(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetJitNetworkAccessPolicies(cancellationToken); } /// @@ -3728,13 +4138,17 @@ public static Pageable GetJitNetworkAccessPolici /// DiscoveredSecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiscoveredSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiscoveredSecuritySolutionsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetDiscoveredSecuritySolutionsAsync(cancellationToken); } /// @@ -3749,13 +4163,17 @@ public static AsyncPageable GetDiscoveredSecuritySol /// DiscoveredSecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiscoveredSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiscoveredSecuritySolutions(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetDiscoveredSecuritySolutions(cancellationToken); } /// @@ -3770,13 +4188,17 @@ public static Pageable GetDiscoveredSecuritySolution /// securitySolutionsReferenceData_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAllSecuritySolutionsReferenceDataAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllSecuritySolutionsReferenceDataAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAllSecuritySolutionsReferenceDataAsync(cancellationToken); } /// @@ -3791,13 +4213,17 @@ public static AsyncPageable GetAllSecuritySoluti /// securitySolutionsReferenceData_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAllSecuritySolutionsReferenceData(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAllSecuritySolutionsReferenceData(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAllSecuritySolutionsReferenceData(cancellationToken); } /// @@ -3812,13 +4238,17 @@ public static Pageable GetAllSecuritySolutionsRe /// ExternalSecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetExternalSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExternalSecuritySolutionsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetExternalSecuritySolutionsAsync(cancellationToken); } /// @@ -3833,13 +4263,17 @@ public static AsyncPageable GetExternalSecuritySolutio /// ExternalSecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetExternalSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExternalSecuritySolutions(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetExternalSecuritySolutions(cancellationToken); } /// @@ -3854,6 +4288,10 @@ public static Pageable GetExternalSecuritySolutions(th /// SecureScoreControls_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData expand. Optional. @@ -3861,7 +4299,7 @@ public static Pageable GetExternalSecuritySolutions(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecureScoreControlsAsync(this SubscriptionResource subscriptionResource, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecureScoreControlsAsync(expand, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScoreControlsAsync(expand, cancellationToken); } /// @@ -3876,6 +4314,10 @@ public static AsyncPageable GetSecureScoreControlsAsy /// SecureScoreControls_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData expand. Optional. @@ -3883,7 +4325,7 @@ public static AsyncPageable GetSecureScoreControlsAsy /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecureScoreControls(this SubscriptionResource subscriptionResource, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecureScoreControls(expand, cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScoreControls(expand, cancellationToken); } /// @@ -3898,13 +4340,17 @@ public static Pageable GetSecureScoreControls(this Su /// SecureScoreControlDefinitions_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecureScoreControlDefinitionsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecureScoreControlDefinitionsBySubscriptionAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScoreControlDefinitionsBySubscriptionAsync(cancellationToken); } /// @@ -3919,13 +4365,17 @@ public static AsyncPageable GetSecureScoreCont /// SecureScoreControlDefinitions_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecureScoreControlDefinitionsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecureScoreControlDefinitionsBySubscription(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecureScoreControlDefinitionsBySubscription(cancellationToken); } /// @@ -3940,13 +4390,17 @@ public static Pageable GetSecureScoreControlDe /// SecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecuritySolutionsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecuritySolutionsAsync(cancellationToken); } /// @@ -3961,13 +4415,17 @@ public static AsyncPageable GetSecuritySolutionsAsync(this Sub /// SecuritySolutions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecuritySolutions(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecuritySolutions(cancellationToken); } /// @@ -3982,13 +4440,17 @@ public static Pageable GetSecuritySolutions(this SubscriptionR /// Alerts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAlertsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlertsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAlertsAsync(cancellationToken); } /// @@ -4003,13 +4465,17 @@ public static AsyncPageable GetAlertsAsync(this SubscriptionR /// Alerts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAlerts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAlerts(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetAlerts(cancellationToken); } /// @@ -4024,13 +4490,17 @@ public static Pageable GetAlerts(this SubscriptionResource su /// SoftwareInventories_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSoftwareInventoriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSoftwareInventoriesAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSoftwareInventoriesAsync(cancellationToken); } /// @@ -4045,13 +4515,17 @@ public static AsyncPageable GetSoftwareInventoriesAsy /// SoftwareInventories_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSoftwareInventories(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSoftwareInventories(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSoftwareInventories(cancellationToken); } /// @@ -4066,13 +4540,17 @@ public static Pageable GetSoftwareInventories(this Su /// SecurityConnectors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecurityConnectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityConnectorsAsync(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityConnectorsAsync(cancellationToken); } /// @@ -4087,21 +4565,31 @@ public static AsyncPageable GetSecurityConnectorsAsyn /// SecurityConnectors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecurityConnectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSecurityConnectors(cancellationToken); + return GetSecurityCenterSubscriptionMockingExtension(subscriptionResource).GetSecurityConnectors(cancellationToken); } - /// Gets a collection of TenantAssessmentMetadataResources in the TenantResource. + /// + /// Gets a collection of TenantAssessmentMetadataResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TenantAssessmentMetadataResources and their operations over a TenantAssessmentMetadataResource. public static TenantAssessmentMetadataCollection GetAllTenantAssessmentMetadata(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAllTenantAssessmentMetadata(); + return GetSecurityCenterTenantMockingExtension(tenantResource).GetAllTenantAssessmentMetadata(); } /// @@ -4116,16 +4604,20 @@ public static TenantAssessmentMetadataCollection GetAllTenantAssessmentMetadata( /// AssessmentsMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Assessment Key - Unique key for the assessment type. /// The cancellation token to use. - /// 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 static async Task> GetTenantAssessmentMetadataAsync(this TenantResource tenantResource, string assessmentMetadataName, CancellationToken cancellationToken = default) { - return await tenantResource.GetAllTenantAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); + return await GetSecurityCenterTenantMockingExtension(tenantResource).GetTenantAssessmentMetadataAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); } /// @@ -4140,16 +4632,20 @@ public static async Task> GetTenantAs /// AssessmentsMetadata_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Assessment Key - Unique key for the assessment type. /// The cancellation token to use. - /// 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 static Response GetTenantAssessmentMetadata(this TenantResource tenantResource, string assessmentMetadataName, CancellationToken cancellationToken = default) { - return tenantResource.GetAllTenantAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); + return GetSecurityCenterTenantMockingExtension(tenantResource).GetTenantAssessmentMetadata(assessmentMetadataName, cancellationToken); } /// @@ -4164,13 +4660,17 @@ public static Response GetTenantAssessmentMeta /// SecureScoreControlDefinitions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSecureScoreControlDefinitionsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetSecureScoreControlDefinitionsAsync(cancellationToken); + return GetSecurityCenterTenantMockingExtension(tenantResource).GetSecureScoreControlDefinitionsAsync(cancellationToken); } /// @@ -4185,13 +4685,17 @@ public static AsyncPageable GetSecureScoreCont /// SecureScoreControlDefinitions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSecureScoreControlDefinitions(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).GetSecureScoreControlDefinitions(cancellationToken); + return GetSecurityCenterTenantMockingExtension(tenantResource).GetSecureScoreControlDefinitions(cancellationToken); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterResourceGroupMockingExtension.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..7c111a899d55 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterResourceGroupMockingExtension.cs @@ -0,0 +1,1135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.SecurityCenter; +using Azure.ResourceManager.SecurityCenter.Models; + +namespace Azure.ResourceManager.SecurityCenter.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SecurityCenterResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _allowedConnectionsClientDiagnostics; + private AllowedConnectionsRestOperations _allowedConnectionsRestClient; + private ClientDiagnostics _topologyClientDiagnostics; + private TopologyRestOperations _topologyRestClient; + private ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; + private JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; + private ClientDiagnostics _discoveredSecuritySolutionsClientDiagnostics; + private DiscoveredSecuritySolutionsRestOperations _discoveredSecuritySolutionsRestClient; + private ClientDiagnostics _externalSecuritySolutionsClientDiagnostics; + private ExternalSecuritySolutionsRestOperations _externalSecuritySolutionsRestClient; + private ClientDiagnostics _securitySolutionsClientDiagnostics; + private SecuritySolutionsRestOperations _securitySolutionsRestClient; + private ClientDiagnostics _alertsClientDiagnostics; + private AlertsRestOperations _alertsRestClient; + + /// Initializes a new instance of the class for mocking. + protected SecurityCenterResourceGroupMockingExtension() + { + } + + /// 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 SecurityCenterResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics AllowedConnectionsClientDiagnostics => _allowedConnectionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AllowedConnectionsRestOperations AllowedConnectionsRestClient => _allowedConnectionsRestClient ??= new AllowedConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics TopologyClientDiagnostics => _topologyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private TopologyRestOperations TopologyRestClient => _topologyRestClient ??= new TopologyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics JitNetworkAccessPolicyClientDiagnostics => _jitNetworkAccessPolicyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); + private JitNetworkAccessPoliciesRestOperations JitNetworkAccessPolicyRestClient => _jitNetworkAccessPolicyRestClient ??= new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(JitNetworkAccessPolicyResource.ResourceType)); + private ClientDiagnostics DiscoveredSecuritySolutionsClientDiagnostics => _discoveredSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private DiscoveredSecuritySolutionsRestOperations DiscoveredSecuritySolutionsRestClient => _discoveredSecuritySolutionsRestClient ??= new DiscoveredSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ExternalSecuritySolutionsClientDiagnostics => _externalSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ExternalSecuritySolutionsRestOperations ExternalSecuritySolutionsRestClient => _externalSecuritySolutionsRestClient ??= new ExternalSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics SecuritySolutionsClientDiagnostics => _securitySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private SecuritySolutionsRestOperations SecuritySolutionsRestClient => _securitySolutionsRestClient ??= new SecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics AlertsClientDiagnostics => _alertsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AlertsRestOperations AlertsRestClient => _alertsRestClient ??= new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. + /// An object representing collection of CustomAssessmentAutomationResources and their operations over a CustomAssessmentAutomationResource. + public virtual CustomAssessmentAutomationCollection GetCustomAssessmentAutomations() + { + return GetCachedClient(client => new CustomAssessmentAutomationCollection(client, Id)); + } + + /// + /// Gets a single custom assessment automation by name for the provided subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} + /// + /// + /// Operation Id + /// CustomAssessmentAutomations_Get + /// + /// + /// + /// Name of the Custom Assessment Automation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCustomAssessmentAutomationAsync(string customAssessmentAutomationName, CancellationToken cancellationToken = default) + { + return await GetCustomAssessmentAutomations().GetAsync(customAssessmentAutomationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a single custom assessment automation by name for the provided subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} + /// + /// + /// Operation Id + /// CustomAssessmentAutomations_Get + /// + /// + /// + /// Name of the Custom Assessment Automation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCustomAssessmentAutomation(string customAssessmentAutomationName, CancellationToken cancellationToken = default) + { + return GetCustomAssessmentAutomations().Get(customAssessmentAutomationName, cancellationToken); + } + + /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. + /// An object representing collection of CustomEntityStoreAssignmentResources and their operations over a CustomEntityStoreAssignmentResource. + public virtual CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignments() + { + return GetCachedClient(client => new CustomEntityStoreAssignmentCollection(client, Id)); + } + + /// + /// Gets a single custom entity store assignment by name for the provided subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} + /// + /// + /// Operation Id + /// CustomEntityStoreAssignments_Get + /// + /// + /// + /// Name of the custom entity store assignment. Generated name is GUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCustomEntityStoreAssignmentAsync(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + { + return await GetCustomEntityStoreAssignments().GetAsync(customEntityStoreAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a single custom entity store assignment by name for the provided subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} + /// + /// + /// Operation Id + /// CustomEntityStoreAssignments_Get + /// + /// + /// + /// Name of the custom entity store assignment. Generated name is GUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCustomEntityStoreAssignment(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + { + return GetCustomEntityStoreAssignments().Get(customEntityStoreAssignmentName, cancellationToken); + } + + /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. + /// An object representing collection of IotSecuritySolutionResources and their operations over a IotSecuritySolutionResource. + public virtual IotSecuritySolutionCollection GetIotSecuritySolutions() + { + return GetCachedClient(client => new IotSecuritySolutionCollection(client, Id)); + } + + /// + /// User this method to get details of a specific IoT Security solution based on solution name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// + /// + /// Operation Id + /// IotSecuritySolution_Get + /// + /// + /// + /// The name of the IoT Security solution. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIotSecuritySolutionAsync(string solutionName, CancellationToken cancellationToken = default) + { + return await GetIotSecuritySolutions().GetAsync(solutionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// User this method to get details of a specific IoT Security solution based on solution name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// + /// + /// Operation Id + /// IotSecuritySolution_Get + /// + /// + /// + /// The name of the IoT Security solution. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIotSecuritySolution(string solutionName, CancellationToken cancellationToken = default) + { + return GetIotSecuritySolutions().Get(solutionName, cancellationToken); + } + + /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// An object representing collection of ResourceGroupSecurityTaskResources and their operations over a ResourceGroupSecurityTaskResource. + public virtual ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks(AzureLocation ascLocation) + { + return new ResourceGroupSecurityTaskCollection(Client, Id, ascLocation); + } + + /// + /// Recommended tasks that will help improve the security of the subscription proactively + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} + /// + /// + /// Operation Id + /// Tasks_GetResourceGroupLevelTask + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of the task object, will be a GUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGroupSecurityTaskAsync(AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) + { + return await GetResourceGroupSecurityTasks(ascLocation).GetAsync(taskName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Recommended tasks that will help improve the security of the subscription proactively + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} + /// + /// + /// Operation Id + /// Tasks_GetResourceGroupLevelTask + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of the task object, will be a GUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGroupSecurityTask(AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) + { + return GetResourceGroupSecurityTasks(ascLocation).Get(taskName, cancellationToken); + } + + /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. + /// An object representing collection of SecurityAutomationResources and their operations over a SecurityAutomationResource. + public virtual SecurityAutomationCollection GetSecurityAutomations() + { + return GetCachedClient(client => new SecurityAutomationCollection(client, Id)); + } + + /// + /// Retrieves information about the model of a security automation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// + /// + /// Operation Id + /// Automations_Get + /// + /// + /// + /// The security automation name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityAutomationAsync(string automationName, CancellationToken cancellationToken = default) + { + return await GetSecurityAutomations().GetAsync(automationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about the model of a security automation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// + /// + /// Operation Id + /// Automations_Get + /// + /// + /// + /// The security automation name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityAutomation(string automationName, CancellationToken cancellationToken = default) + { + return GetSecurityAutomations().Get(automationName, cancellationToken); + } + + /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of ServerVulnerabilityAssessmentResources and their operations over a ServerVulnerabilityAssessmentResource. + public virtual ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAssessments(string resourceNamespace, string resourceType, string resourceName) + { + return new ServerVulnerabilityAssessmentCollection(Client, Id, resourceNamespace, resourceType, resourceName); + } + + /// + /// Gets a server vulnerability assessment onboarding statuses on a given resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} + /// + /// + /// Operation Id + /// ServerVulnerabilityAssessment_Get + /// + /// + /// + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServerVulnerabilityAssessmentAsync(string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) + { + return await GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).GetAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a server vulnerability assessment onboarding statuses on a given resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} + /// + /// + /// Operation Id + /// ServerVulnerabilityAssessment_Get + /// + /// + /// + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServerVulnerabilityAssessment(string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) + { + return GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).Get(cancellationToken); + } + + /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of AdaptiveNetworkHardeningResources and their operations over a AdaptiveNetworkHardeningResource. + public virtual AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(string resourceNamespace, string resourceType, string resourceName) + { + return new AdaptiveNetworkHardeningCollection(Client, Id, resourceNamespace, resourceType, resourceName); + } + + /// + /// Gets a single Adaptive Network Hardening resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} + /// + /// + /// Operation Id + /// AdaptiveNetworkHardenings_Get + /// + /// + /// + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// The name of the Adaptive Network Hardening resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAdaptiveNetworkHardeningAsync(string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) + { + return await GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).GetAsync(adaptiveNetworkHardeningResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a single Adaptive Network Hardening resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} + /// + /// + /// Operation Id + /// AdaptiveNetworkHardenings_Get + /// + /// + /// + /// The Namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// The name of the Adaptive Network Hardening resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAdaptiveNetworkHardening(string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) + { + return GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).Get(adaptiveNetworkHardeningResourceName, cancellationToken); + } + + /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// An object representing collection of JitNetworkAccessPolicyResources and their operations over a JitNetworkAccessPolicyResource. + public virtual JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(AzureLocation ascLocation) + { + return new JitNetworkAccessPolicyCollection(Client, Id, ascLocation); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the subscription, location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} + /// + /// + /// Operation Id + /// JitNetworkAccessPolicies_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a Just-in-Time access configuration policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetJitNetworkAccessPolicyAsync(AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) + { + return await GetJitNetworkAccessPolicies(ascLocation).GetAsync(jitNetworkAccessPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the subscription, location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} + /// + /// + /// Operation Id + /// JitNetworkAccessPolicies_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a Just-in-Time access configuration policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetJitNetworkAccessPolicy(AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) + { + return GetJitNetworkAccessPolicies(ascLocation).Get(jitNetworkAccessPolicyName, cancellationToken); + } + + /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// An object representing collection of ResourceGroupSecurityAlertResources and their operations over a ResourceGroupSecurityAlertResource. + public virtual ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlerts(AzureLocation ascLocation) + { + return new ResourceGroupSecurityAlertCollection(Client, Id, ascLocation); + } + + /// + /// Get an alert that is associated a resource group or a resource in a resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} + /// + /// + /// Operation Id + /// Alerts_GetResourceGroupLevel + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of the alert object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGroupSecurityAlertAsync(AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) + { + return await GetResourceGroupSecurityAlerts(ascLocation).GetAsync(alertName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an alert that is associated a resource group or a resource in a resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} + /// + /// + /// Operation Id + /// Alerts_GetResourceGroupLevel + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of the alert object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGroupSecurityAlert(AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) + { + return GetResourceGroupSecurityAlerts(ascLocation).Get(alertName, cancellationToken); + } + + /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. + /// The namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of SoftwareInventoryResources and their operations over a SoftwareInventoryResource. + public virtual SoftwareInventoryCollection GetSoftwareInventories(string resourceNamespace, string resourceType, string resourceName) + { + return new SoftwareInventoryCollection(Client, Id, resourceNamespace, resourceType, resourceName); + } + + /// + /// Gets a single software data of the virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} + /// + /// + /// Operation Id + /// SoftwareInventories_Get + /// + /// + /// + /// The namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// Name of the installed software. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSoftwareInventoryAsync(string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) + { + return await GetSoftwareInventories(resourceNamespace, resourceType, resourceName).GetAsync(softwareName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a single software data of the virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} + /// + /// + /// Operation Id + /// SoftwareInventories_Get + /// + /// + /// + /// The namespace of the resource. + /// The type of the resource. + /// Name of the resource. + /// Name of the installed software. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSoftwareInventory(string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) + { + return GetSoftwareInventories(resourceNamespace, resourceType, resourceName).Get(softwareName, cancellationToken); + } + + /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. + /// An object representing collection of SecurityConnectorResources and their operations over a SecurityConnectorResource. + public virtual SecurityConnectorCollection GetSecurityConnectors() + { + return GetCachedClient(client => new SecurityConnectorCollection(client, Id)); + } + + /// + /// Retrieves details of a specific security connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} + /// + /// + /// Operation Id + /// SecurityConnectors_Get + /// + /// + /// + /// The security connector name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityConnectorAsync(string securityConnectorName, CancellationToken cancellationToken = default) + { + return await GetSecurityConnectors().GetAsync(securityConnectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves details of a specific security connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} + /// + /// + /// Operation Id + /// SecurityConnectors_Get + /// + /// + /// + /// The security connector name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityConnector(string securityConnectorName, CancellationToken cancellationToken = default) + { + return GetSecurityConnectors().Get(securityConnectorName, cancellationToken); + } + + /// + /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} + /// + /// + /// Operation Id + /// AllowedConnections_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// The type of allowed connections (Internal, External). + /// The cancellation token to use. + public virtual async Task> GetAllowedConnectionAsync(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) + { + using var scope = AllowedConnectionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetAllowedConnection"); + scope.Start(); + try + { + var response = await AllowedConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} + /// + /// + /// Operation Id + /// AllowedConnections_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// The type of allowed connections (Internal, External). + /// The cancellation token to use. + public virtual Response GetAllowedConnection(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) + { + using var scope = AllowedConnectionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetAllowedConnection"); + scope.Start(); + try + { + var response = AllowedConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific topology component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} + /// + /// + /// Operation Id + /// Topology_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a topology resources collection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetTopologyAsync(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); + + using var scope = TopologyClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetTopology"); + scope.Start(); + try + { + var response = await TopologyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific topology component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} + /// + /// + /// Operation Id + /// Topology_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a topology resources collection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetTopology(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); + + using var scope = TopologyClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetTopology"); + scope.Start(); + try + { + var response = TopologyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the subscription, location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies + /// + /// + /// Operation Id + /// JitNetworkAccessPolicies_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetJitNetworkAccessPoliciesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterResourceGroupMockingExtension.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// Policies for protecting resources using Just-in-Time access control for the subscription, location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies + /// + /// + /// Operation Id + /// JitNetworkAccessPolicies_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetJitNetworkAccessPolicies(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterResourceGroupMockingExtension.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} + /// + /// + /// Operation Id + /// DiscoveredSecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a discovered security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetDiscoveredSecuritySolutionAsync(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); + + using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetDiscoveredSecuritySolution"); + scope.Start(); + try + { + var response = await DiscoveredSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific discovered Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} + /// + /// + /// Operation Id + /// DiscoveredSecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of a discovered security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetDiscoveredSecuritySolution(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); + + using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetDiscoveredSecuritySolution"); + scope.Start(); + try + { + var response = DiscoveredSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific external Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} + /// + /// + /// Operation Id + /// ExternalSecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of an external security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetExternalSecuritySolutionAsync(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); + + using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetExternalSecuritySolution"); + scope.Start(); + try + { + var response = await ExternalSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific external Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} + /// + /// + /// Operation Id + /// ExternalSecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of an external security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetExternalSecuritySolution(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); + + using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetExternalSecuritySolution"); + scope.Start(); + try + { + var response = ExternalSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} + /// + /// + /// Operation Id + /// SecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetSecuritySolutionAsync(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); + + using var scope = SecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetSecuritySolution"); + scope.Start(); + try + { + var response = await SecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a specific Security Solution. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} + /// + /// + /// Operation Id + /// SecuritySolutions_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// Name of security solution. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetSecuritySolution(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); + + using var scope = SecuritySolutionsClientDiagnostics.CreateScope("SecurityCenterResourceGroupMockingExtension.GetSecuritySolution"); + scope.Start(); + try + { + var response = SecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all the alerts that are associated with the resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts + /// + /// + /// Operation Id + /// Alerts_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAlertsByResourceGroupAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SecurityCenterResourceGroupMockingExtension.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// List all the alerts that are associated with the resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts + /// + /// + /// Operation Id + /// Alerts_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAlertsByResourceGroup(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SecurityCenterResourceGroupMockingExtension.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterSubscriptionMockingExtension.cs similarity index 65% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterSubscriptionMockingExtension.cs index bde99e4dee66..a625a4aeb072 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SecurityCenter; using Azure.ResourceManager.SecurityCenter.Models; -namespace Azure.ResourceManager.SecurityCenter +namespace Azure.ResourceManager.SecurityCenter.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SecurityCenterSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _mdeOnboardingsClientDiagnostics; private MdeOnboardingsRestOperations _mdeOnboardingsRestClient; @@ -59,15 +60,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _securityConnectorClientDiagnostics; private SecurityConnectorsRestOperations _securityConnectorRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SecurityCenterSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SecurityCenterSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -120,91 +121,681 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of SecurityCenterPricingResources and their operations over a SecurityCenterPricingResource. public virtual SecurityCenterPricingCollection GetSecurityCenterPricings() { - return GetCachedClient(Client => new SecurityCenterPricingCollection(Client, Id)); + return GetCachedClient(client => new SecurityCenterPricingCollection(client, Id)); + } + + /// + /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} + /// + /// + /// Operation Id + /// Pricings_Get + /// + /// + /// + /// name of the pricing configuration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityCenterPricingAsync(string pricingName, CancellationToken cancellationToken = default) + { + return await GetSecurityCenterPricings().GetAsync(pricingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} + /// + /// + /// Operation Id + /// Pricings_Get + /// + /// + /// + /// name of the pricing configuration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityCenterPricing(string pricingName, CancellationToken cancellationToken = default) + { + return GetSecurityCenterPricings().Get(pricingName, cancellationToken); } /// Gets a collection of SecurityCenterLocationResources in the SubscriptionResource. /// An object representing collection of SecurityCenterLocationResources and their operations over a SecurityCenterLocationResource. public virtual SecurityCenterLocationCollection GetSecurityCenterLocations() { - return GetCachedClient(Client => new SecurityCenterLocationCollection(Client, Id)); + return GetCachedClient(client => new SecurityCenterLocationCollection(client, Id)); + } + + /// + /// Details of a specific location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} + /// + /// + /// Operation Id + /// Locations_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetSecurityCenterLocationAsync(AzureLocation ascLocation, CancellationToken cancellationToken = default) + { + return await GetSecurityCenterLocations().GetAsync(ascLocation, cancellationToken).ConfigureAwait(false); + } + + /// + /// Details of a specific location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} + /// + /// + /// Operation Id + /// Locations_Get + /// + /// + /// + /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetSecurityCenterLocation(AzureLocation ascLocation, CancellationToken cancellationToken = default) + { + return GetSecurityCenterLocations().Get(ascLocation, cancellationToken); } /// Gets a collection of AutoProvisioningSettingResources in the SubscriptionResource. /// An object representing collection of AutoProvisioningSettingResources and their operations over a AutoProvisioningSettingResource. public virtual AutoProvisioningSettingCollection GetAutoProvisioningSettings() { - return GetCachedClient(Client => new AutoProvisioningSettingCollection(Client, Id)); + return GetCachedClient(client => new AutoProvisioningSettingCollection(client, Id)); + } + + /// + /// Details of a specific setting + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} + /// + /// + /// Operation Id + /// AutoProvisioningSettings_Get + /// + /// + /// + /// Auto provisioning setting key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutoProvisioningSettingAsync(string settingName, CancellationToken cancellationToken = default) + { + return await GetAutoProvisioningSettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Details of a specific setting + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} + /// + /// + /// Operation Id + /// AutoProvisioningSettings_Get + /// + /// + /// + /// Auto provisioning setting key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutoProvisioningSetting(string settingName, CancellationToken cancellationToken = default) + { + return GetAutoProvisioningSettings().Get(settingName, cancellationToken); } /// Gets a collection of SecurityContactResources in the SubscriptionResource. /// An object representing collection of SecurityContactResources and their operations over a SecurityContactResource. public virtual SecurityContactCollection GetSecurityContacts() { - return GetCachedClient(Client => new SecurityContactCollection(Client, Id)); + return GetCachedClient(client => new SecurityContactCollection(client, Id)); + } + + /// + /// Get Default Security contact configurations for the subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} + /// + /// + /// Operation Id + /// SecurityContacts_Get + /// + /// + /// + /// Name of the security contact object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityContactAsync(string securityContactName, CancellationToken cancellationToken = default) + { + return await GetSecurityContacts().GetAsync(securityContactName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Default Security contact configurations for the subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} + /// + /// + /// Operation Id + /// SecurityContacts_Get + /// + /// + /// + /// Name of the security contact object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityContact(string securityContactName, CancellationToken cancellationToken = default) + { + return GetSecurityContacts().Get(securityContactName, cancellationToken); } /// Gets a collection of SecurityWorkspaceSettingResources in the SubscriptionResource. /// An object representing collection of SecurityWorkspaceSettingResources and their operations over a SecurityWorkspaceSettingResource. public virtual SecurityWorkspaceSettingCollection GetSecurityWorkspaceSettings() { - return GetCachedClient(Client => new SecurityWorkspaceSettingCollection(Client, Id)); + return GetCachedClient(client => new SecurityWorkspaceSettingCollection(client, Id)); + } + + /// + /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} + /// + /// + /// Operation Id + /// WorkspaceSettings_Get + /// + /// + /// + /// Name of the security setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityWorkspaceSettingAsync(string workspaceSettingName, CancellationToken cancellationToken = default) + { + return await GetSecurityWorkspaceSettings().GetAsync(workspaceSettingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} + /// + /// + /// Operation Id + /// WorkspaceSettings_Get + /// + /// + /// + /// Name of the security setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityWorkspaceSetting(string workspaceSettingName, CancellationToken cancellationToken = default) + { + return GetSecurityWorkspaceSettings().Get(workspaceSettingName, cancellationToken); } /// Gets a collection of RegulatoryComplianceStandardResources in the SubscriptionResource. /// An object representing collection of RegulatoryComplianceStandardResources and their operations over a RegulatoryComplianceStandardResource. public virtual RegulatoryComplianceStandardCollection GetRegulatoryComplianceStandards() { - return GetCachedClient(Client => new RegulatoryComplianceStandardCollection(Client, Id)); + return GetCachedClient(client => new RegulatoryComplianceStandardCollection(client, Id)); + } + + /// + /// Supported regulatory compliance details state for selected standard + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} + /// + /// + /// Operation Id + /// RegulatoryComplianceStandards_Get + /// + /// + /// + /// Name of the regulatory compliance standard object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRegulatoryComplianceStandardAsync(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) + { + return await GetRegulatoryComplianceStandards().GetAsync(regulatoryComplianceStandardName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Supported regulatory compliance details state for selected standard + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} + /// + /// + /// Operation Id + /// RegulatoryComplianceStandards_Get + /// + /// + /// + /// Name of the regulatory compliance standard object. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRegulatoryComplianceStandard(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) + { + return GetRegulatoryComplianceStandards().Get(regulatoryComplianceStandardName, cancellationToken); } /// Gets a collection of SecurityAlertsSuppressionRuleResources in the SubscriptionResource. /// An object representing collection of SecurityAlertsSuppressionRuleResources and their operations over a SecurityAlertsSuppressionRuleResource. public virtual SecurityAlertsSuppressionRuleCollection GetSecurityAlertsSuppressionRules() { - return GetCachedClient(Client => new SecurityAlertsSuppressionRuleCollection(Client, Id)); + return GetCachedClient(client => new SecurityAlertsSuppressionRuleCollection(client, Id)); + } + + /// + /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} + /// + /// + /// Operation Id + /// AlertsSuppressionRules_Get + /// + /// + /// + /// The unique name of the suppression alert rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityAlertsSuppressionRuleAsync(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) + { + return await GetSecurityAlertsSuppressionRules().GetAsync(alertsSuppressionRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} + /// + /// + /// Operation Id + /// AlertsSuppressionRules_Get + /// + /// + /// + /// The unique name of the suppression alert rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityAlertsSuppressionRule(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) + { + return GetSecurityAlertsSuppressionRules().Get(alertsSuppressionRuleName, cancellationToken); } /// Gets a collection of SubscriptionAssessmentMetadataResources in the SubscriptionResource. /// An object representing collection of SubscriptionAssessmentMetadataResources and their operations over a SubscriptionAssessmentMetadataResource. public virtual SubscriptionAssessmentMetadataCollection GetAllSubscriptionAssessmentMetadata() { - return GetCachedClient(Client => new SubscriptionAssessmentMetadataCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionAssessmentMetadataCollection(client, Id)); + } + + /// + /// Get metadata information on an assessment type in a specific subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// + /// + /// Operation Id + /// AssessmentsMetadata_GetInSubscription + /// + /// + /// + /// The Assessment Key - Unique key for the assessment type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionAssessmentMetadataAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) + { + return await GetAllSubscriptionAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get metadata information on an assessment type in a specific subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// + /// + /// Operation Id + /// AssessmentsMetadata_GetInSubscription + /// + /// + /// + /// The Assessment Key - Unique key for the assessment type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionAssessmentMetadata(string assessmentMetadataName, CancellationToken cancellationToken = default) + { + return GetAllSubscriptionAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); } /// Gets a collection of SecureScoreResources in the SubscriptionResource. /// An object representing collection of SecureScoreResources and their operations over a SecureScoreResource. public virtual SecureScoreCollection GetSecureScores() { - return GetCachedClient(Client => new SecureScoreCollection(Client, Id)); + return GetCachedClient(client => new SecureScoreCollection(client, Id)); + } + + /// + /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} + /// + /// + /// Operation Id + /// SecureScores_Get + /// + /// + /// + /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecureScoreAsync(string secureScoreName, CancellationToken cancellationToken = default) + { + return await GetSecureScores().GetAsync(secureScoreName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} + /// + /// + /// Operation Id + /// SecureScores_Get + /// + /// + /// + /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecureScore(string secureScoreName, CancellationToken cancellationToken = default) + { + return GetSecureScores().Get(secureScoreName, cancellationToken); } /// Gets a collection of SecurityCloudConnectorResources in the SubscriptionResource. /// An object representing collection of SecurityCloudConnectorResources and their operations over a SecurityCloudConnectorResource. public virtual SecurityCloudConnectorCollection GetSecurityCloudConnectors() { - return GetCachedClient(Client => new SecurityCloudConnectorCollection(Client, Id)); + return GetCachedClient(client => new SecurityCloudConnectorCollection(client, Id)); + } + + /// + /// Details of a specific cloud account connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connectors_Get + /// + /// + /// + /// Name of the cloud account connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSecurityCloudConnectorAsync(string connectorName, CancellationToken cancellationToken = default) + { + return await GetSecurityCloudConnectors().GetAsync(connectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Details of a specific cloud account connector + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} + /// + /// + /// Operation Id + /// Connectors_Get + /// + /// + /// + /// Name of the cloud account connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSecurityCloudConnector(string connectorName, CancellationToken cancellationToken = default) + { + return GetSecurityCloudConnectors().Get(connectorName, cancellationToken); } /// Gets a collection of SecuritySettingResources in the SubscriptionResource. /// An object representing collection of SecuritySettingResources and their operations over a SecuritySettingResource. public virtual SecuritySettingCollection GetSecuritySettings() { - return GetCachedClient(Client => new SecuritySettingCollection(Client, Id)); + return GetCachedClient(client => new SecuritySettingCollection(client, Id)); + } + + /// + /// Settings of different configurations in Microsoft Defender for Cloud + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} + /// + /// + /// Operation Id + /// Settings_Get + /// + /// + /// + /// The name of the setting. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetSecuritySettingAsync(SecuritySettingName settingName, CancellationToken cancellationToken = default) + { + return await GetSecuritySettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Settings of different configurations in Microsoft Defender for Cloud + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} + /// + /// + /// Operation Id + /// Settings_Get + /// + /// + /// + /// The name of the setting. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetSecuritySetting(SecuritySettingName settingName, CancellationToken cancellationToken = default) + { + return GetSecuritySettings().Get(settingName, cancellationToken); } /// Gets a collection of IngestionSettingResources in the SubscriptionResource. /// An object representing collection of IngestionSettingResources and their operations over a IngestionSettingResource. public virtual IngestionSettingCollection GetIngestionSettings() { - return GetCachedClient(Client => new IngestionSettingCollection(Client, Id)); + return GetCachedClient(client => new IngestionSettingCollection(client, Id)); + } + + /// + /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} + /// + /// + /// Operation Id + /// IngestionSettings_Get + /// + /// + /// + /// Name of the ingestion setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetIngestionSettingAsync(string ingestionSettingName, CancellationToken cancellationToken = default) + { + return await GetIngestionSettings().GetAsync(ingestionSettingName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} + /// + /// + /// Operation Id + /// IngestionSettings_Get + /// + /// + /// + /// Name of the ingestion setting. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetIngestionSetting(string ingestionSettingName, CancellationToken cancellationToken = default) + { + return GetIngestionSettings().Get(ingestionSettingName, cancellationToken); } /// Gets a collection of SubscriptionSecurityApplicationResources in the SubscriptionResource. /// An object representing collection of SubscriptionSecurityApplicationResources and their operations over a SubscriptionSecurityApplicationResource. public virtual SubscriptionSecurityApplicationCollection GetSubscriptionSecurityApplications() { - return GetCachedClient(Client => new SubscriptionSecurityApplicationCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionSecurityApplicationCollection(client, Id)); + } + + /// + /// Get a specific application for the requested scope by applicationId + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} + /// + /// + /// Operation Id + /// Application_Get + /// + /// + /// + /// The security Application key - unique key for the standard application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionSecurityApplicationAsync(string applicationId, CancellationToken cancellationToken = default) + { + return await GetSubscriptionSecurityApplications().GetAsync(applicationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a specific application for the requested scope by applicationId + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} + /// + /// + /// Operation Id + /// Application_Get + /// + /// + /// + /// The security Application key - unique key for the standard application. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionSecurityApplication(string applicationId, CancellationToken cancellationToken = default) + { + return GetSubscriptionSecurityApplications().Get(applicationId, cancellationToken); } /// @@ -225,7 +816,7 @@ public virtual SubscriptionSecurityApplicationCollection GetSubscriptionSecurity public virtual AsyncPageable GetMdeOnboardingsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MdeOnboardingsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMdeOnboardings", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetMdeOnboardings", "value", null, cancellationToken); } /// @@ -246,7 +837,7 @@ public virtual AsyncPageable GetMdeOnboardingsAsync(CancellationT public virtual Pageable GetMdeOnboardings(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => MdeOnboardingsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMdeOnboardings", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetMdeOnboardings", "value", null, cancellationToken); } /// @@ -265,7 +856,7 @@ public virtual Pageable GetMdeOnboardings(CancellationToken cance /// The cancellation token to use. public virtual async Task> GetMdeOnboardingAsync(CancellationToken cancellationToken = default) { - using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetMdeOnboarding"); + using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SecurityCenterSubscriptionMockingExtension.GetMdeOnboarding"); scope.Start(); try { @@ -295,7 +886,7 @@ public virtual async Task> GetMdeOnboardingAsync(Cancell /// The cancellation token to use. public virtual Response GetMdeOnboarding(CancellationToken cancellationToken = default) { - using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetMdeOnboarding"); + using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SecurityCenterSubscriptionMockingExtension.GetMdeOnboarding"); scope.Start(); try { @@ -328,7 +919,7 @@ public virtual AsyncPageable GetCustomAssess { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); } /// @@ -350,7 +941,7 @@ public virtual Pageable GetCustomAssessmentA { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); } /// @@ -372,7 +963,7 @@ public virtual AsyncPageable GetCustomEntit { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); } /// @@ -394,7 +985,7 @@ public virtual Pageable GetCustomEntityStor { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); } /// @@ -417,7 +1008,7 @@ public virtual AsyncPageable GetIotSecuritySolution { HttpMessage FirstPageRequest(int? pageSizeHint) => IotSecuritySolutionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotSecuritySolutionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -440,7 +1031,7 @@ public virtual Pageable GetIotSecuritySolutions(str { HttpMessage FirstPageRequest(int? pageSizeHint) => IotSecuritySolutionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotSecuritySolutionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -463,7 +1054,7 @@ public virtual AsyncPageable GetTasksAsync(string filter = nul { HttpMessage FirstPageRequest(int? pageSizeHint) => TasksRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTasks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetTasks", "value", "nextLink", cancellationToken); } /// @@ -486,7 +1077,7 @@ public virtual Pageable GetTasks(string filter = null, Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => TasksRestClient.CreateListRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTasks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetTasks", "value", "nextLink", cancellationToken); } /// @@ -508,7 +1099,7 @@ public virtual AsyncPageable GetSecurityAutomationsA { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAutomationAutomationsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAutomationAutomationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityAutomations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecurityAutomations", "value", "nextLink", cancellationToken); } /// @@ -530,7 +1121,7 @@ public virtual Pageable GetSecurityAutomations(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAutomationAutomationsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAutomationAutomationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityAutomations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecurityAutomations", "value", "nextLink", cancellationToken); } /// @@ -553,7 +1144,7 @@ public virtual Pageable GetSecurityAutomations(Cance public virtual AsyncPageable GetAdaptiveApplicationControlGroupsAsync(bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AdaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.CreateListRequest(Id.SubscriptionId, includePathRecommendations, summary); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); } /// @@ -576,7 +1167,7 @@ public virtual AsyncPageable GetAdaptiv public virtual Pageable GetAdaptiveApplicationControlGroups(bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => AdaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.CreateListRequest(Id.SubscriptionId, includePathRecommendations, summary); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); } /// @@ -598,7 +1189,7 @@ public virtual AsyncPageable GetAllowedConnecti { HttpMessage FirstPageRequest(int? pageSizeHint) => AllowedConnectionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AllowedConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllowedConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAllowedConnections", "value", "nextLink", cancellationToken); } /// @@ -620,7 +1211,7 @@ public virtual Pageable GetAllowedConnections(C { HttpMessage FirstPageRequest(int? pageSizeHint) => AllowedConnectionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AllowedConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllowedConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAllowedConnections", "value", "nextLink", cancellationToken); } /// @@ -642,7 +1233,7 @@ public virtual AsyncPageable GetTopologiesAsync(Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => TopologyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TopologyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTopologies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetTopologies", "value", "nextLink", cancellationToken); } /// @@ -664,7 +1255,7 @@ public virtual Pageable GetTopologies(CancellationToke { HttpMessage FirstPageRequest(int? pageSizeHint) => TopologyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TopologyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTopologies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetTopologies", "value", "nextLink", cancellationToken); } /// @@ -686,7 +1277,7 @@ public virtual AsyncPageable GetJitNetworkAccess { HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); } /// @@ -708,7 +1299,7 @@ public virtual Pageable GetJitNetworkAccessPolic { HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); } /// @@ -730,7 +1321,7 @@ public virtual AsyncPageable GetDiscoveredSecuritySo { HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoveredSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoveredSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -752,7 +1343,7 @@ public virtual Pageable GetDiscoveredSecuritySolutio { HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoveredSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoveredSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -773,7 +1364,7 @@ public virtual Pageable GetDiscoveredSecuritySolutio public virtual AsyncPageable GetAllSecuritySolutionsReferenceDataAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => securitySolutionsReferenceDataRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); } /// @@ -794,7 +1385,7 @@ public virtual AsyncPageable GetAllSecuritySolut public virtual Pageable GetAllSecuritySolutionsReferenceData(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => securitySolutionsReferenceDataRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); } /// @@ -816,7 +1407,7 @@ public virtual AsyncPageable GetExternalSecuritySoluti { HttpMessage FirstPageRequest(int? pageSizeHint) => ExternalSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExternalSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -838,7 +1429,7 @@ public virtual Pageable GetExternalSecuritySolutions(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ExternalSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExternalSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -861,7 +1452,7 @@ public virtual AsyncPageable GetSecureScoreControlsAs { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlsRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecureScoreControls", "value", "nextLink", cancellationToken); } /// @@ -884,7 +1475,7 @@ public virtual Pageable GetSecureScoreControls(Securi { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlsRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControls", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecureScoreControls", "value", "nextLink", cancellationToken); } /// @@ -906,7 +1497,7 @@ public virtual AsyncPageable GetSecureScoreCon { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); } /// @@ -928,7 +1519,7 @@ public virtual Pageable GetSecureScoreControlD { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); } /// @@ -950,7 +1541,7 @@ public virtual AsyncPageable GetSecuritySolutionsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -972,7 +1563,7 @@ public virtual Pageable GetSecuritySolutions(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecuritySolutions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecuritySolutions", "value", "nextLink", cancellationToken); } /// @@ -994,7 +1585,7 @@ public virtual AsyncPageable GetAlertsAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlerts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAlerts", "value", "nextLink", cancellationToken); } /// @@ -1016,7 +1607,7 @@ public virtual Pageable GetAlerts(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlerts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetAlerts", "value", "nextLink", cancellationToken); } /// @@ -1038,7 +1629,7 @@ public virtual AsyncPageable GetSoftwareInventoriesAs { HttpMessage FirstPageRequest(int? pageSizeHint) => SoftwareInventoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SoftwareInventoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSoftwareInventories", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSoftwareInventories", "value", "nextLink", cancellationToken); } /// @@ -1060,7 +1651,7 @@ public virtual Pageable GetSoftwareInventories(Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => SoftwareInventoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SoftwareInventoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSoftwareInventories", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSoftwareInventories", "value", "nextLink", cancellationToken); } /// @@ -1082,7 +1673,7 @@ public virtual AsyncPageable GetSecurityConnectorsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityConnectorRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecurityConnectors", "value", "nextLink", cancellationToken); } /// @@ -1104,7 +1695,7 @@ public virtual Pageable GetSecurityConnectors(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityConnectorRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SecurityCenterSubscriptionMockingExtension.GetSecurityConnectors", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterTenantMockingExtension.cs similarity index 57% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterTenantMockingExtension.cs index ed5a09bddc2d..e681658f4734 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterTenantMockingExtension.cs @@ -5,31 +5,34 @@ #nullable disable +using System; using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SecurityCenter; using Azure.ResourceManager.SecurityCenter.Models; -namespace Azure.ResourceManager.SecurityCenter +namespace Azure.ResourceManager.SecurityCenter.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class SecurityCenterTenantMockingExtension : ArmResource { private ClientDiagnostics _secureScoreControlDefinitionsClientDiagnostics; private SecureScoreControlDefinitionsRestOperations _secureScoreControlDefinitionsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SecurityCenterTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SecurityCenterTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +49,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of TenantAssessmentMetadataResources and their operations over a TenantAssessmentMetadataResource. public virtual TenantAssessmentMetadataCollection GetAllTenantAssessmentMetadata() { - return GetCachedClient(Client => new TenantAssessmentMetadataCollection(Client, Id)); + return GetCachedClient(client => new TenantAssessmentMetadataCollection(client, Id)); + } + + /// + /// Get metadata information on an assessment type + /// + /// + /// Request Path + /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// + /// + /// Operation Id + /// AssessmentsMetadata_Get + /// + /// + /// + /// The Assessment Key - Unique key for the assessment type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTenantAssessmentMetadataAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) + { + return await GetAllTenantAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get metadata information on an assessment type + /// + /// + /// Request Path + /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// + /// + /// Operation Id + /// AssessmentsMetadata_Get + /// + /// + /// + /// The Assessment Key - Unique key for the assessment type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTenantAssessmentMetadata(string assessmentMetadataName, CancellationToken cancellationToken = default) + { + return GetAllTenantAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); } /// @@ -68,7 +117,7 @@ public virtual AsyncPageable GetSecureScoreCon { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SecurityCenterTenantMockingExtension.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); } /// @@ -90,7 +139,7 @@ public virtual Pageable GetSecureScoreControlD { HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListRequest(); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListNextPageRequest(nextLink); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SecurityCenterTenantMockingExtension.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs index 68a56801c3fa..aeb887e2f629 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of IotSecurityAggregatedAlertResources and their operations over a IotSecurityAggregatedAlertResource. public virtual IotSecurityAggregatedAlertCollection GetIotSecurityAggregatedAlerts() { - return GetCachedClient(Client => new IotSecurityAggregatedAlertCollection(Client, Id)); + return GetCachedClient(client => new IotSecurityAggregatedAlertCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual IotSecurityAggregatedAlertCollection GetIotSecurityAggregatedAler /// /// Identifier of the aggregated alert. /// The cancellation token to use. - /// 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> GetIotSecurityAggregatedAlertAsync(string aggregatedAlertName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetIotSe /// /// Identifier of the aggregated alert. /// The cancellation token to use. - /// 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 GetIotSecurityAggregatedAlert(string aggregatedAlertName, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetIotSecurityAggreg /// An object representing collection of IotSecurityAggregatedRecommendationResources and their operations over a IotSecurityAggregatedRecommendationResource. public virtual IotSecurityAggregatedRecommendationCollection GetIotSecurityAggregatedRecommendations() { - return GetCachedClient(Client => new IotSecurityAggregatedRecommendationCollection(Client, Id)); + return GetCachedClient(client => new IotSecurityAggregatedRecommendationCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual IotSecurityAggregatedRecommendationCollection GetIotSecurityAggre /// /// Name of the recommendation aggregated for this query. /// The cancellation token to use. - /// 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> GetIotSecurityAggregatedRecommendationAsync(string aggregatedRecommendationName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> /// /// Name of the recommendation aggregated for this query. /// The cancellation token to use. - /// 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 GetIotSecurityAggregatedRecommendation(string aggregatedRecommendationName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs index a26741d95031..70f0c50ef2a2 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RegulatoryComplianceAssessmentResources and their operations over a RegulatoryComplianceAssessmentResource. public virtual RegulatoryComplianceAssessmentCollection GetRegulatoryComplianceAssessments() { - return GetCachedClient(Client => new RegulatoryComplianceAssessmentCollection(Client, Id)); + return GetCachedClient(client => new RegulatoryComplianceAssessmentCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual RegulatoryComplianceAssessmentCollection GetRegulatoryComplianceA /// /// Name of the regulatory compliance assessment object. /// The cancellation token to use. - /// 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> GetRegulatoryComplianceAssessmentAsync(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetR /// /// Name of the regulatory compliance assessment object. /// The cancellation token to use. - /// 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 GetRegulatoryComplianceAssessment(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs index f271c4a10e30..a53b9e09c745 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RegulatoryComplianceControlResources and their operations over a RegulatoryComplianceControlResource. public virtual RegulatoryComplianceControlCollection GetRegulatoryComplianceControls() { - return GetCachedClient(Client => new RegulatoryComplianceControlCollection(Client, Id)); + return GetCachedClient(client => new RegulatoryComplianceControlCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual RegulatoryComplianceControlCollection GetRegulatoryComplianceCont /// /// Name of the regulatory compliance control object. /// The cancellation token to use. - /// 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> GetRegulatoryComplianceControlAsync(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetRegu /// /// Name of the regulatory compliance control object. /// The cancellation token to use. - /// 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 GetRegulatoryComplianceControl(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs index 89270bc272c2..197b53bbf385 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecuritySubAssessmentResources and their operations over a SecuritySubAssessmentResource. public virtual SecuritySubAssessmentCollection GetSecuritySubAssessments() { - return GetCachedClient(Client => new SecuritySubAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SecuritySubAssessmentCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SecuritySubAssessmentCollection GetSecuritySubAssessments() /// /// The Sub-Assessment Key - Unique key for the sub-assessment type. /// The cancellation token to use. - /// 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> GetSecuritySubAssessmentAsync(string subAssessmentName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetSecuritySu /// /// The Sub-Assessment Key - Unique key for the sub-assessment type. /// The cancellation token to use. - /// 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 GetSecuritySubAssessment(string subAssessmentName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetSecuritySubAssessment( /// An object representing collection of GovernanceAssignmentResources and their operations over a GovernanceAssignmentResource. public virtual GovernanceAssignmentCollection GetGovernanceAssignments() { - return GetCachedClient(Client => new GovernanceAssignmentCollection(Client, Id)); + return GetCachedClient(client => new GovernanceAssignmentCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual GovernanceAssignmentCollection GetGovernanceAssignments() /// /// The governance assignment key - the assessment key of the required governance assignment. /// The cancellation token to use. - /// 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> GetGovernanceAssignmentAsync(string assignmentKey, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetGovernanceA /// /// The governance assignment key - the assessment key of the required governance assignment. /// The cancellation token to use. - /// 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 GetGovernanceAssignment(string assignmentKey, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs index 9d76a610e7c7..59ece8607099 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs @@ -118,7 +118,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SubscriptionSecurityTaskResources and their operations over a SubscriptionSecurityTaskResource. public virtual SubscriptionSecurityTaskCollection GetSubscriptionSecurityTasks() { - return GetCachedClient(Client => new SubscriptionSecurityTaskCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionSecurityTaskCollection(client, Id)); } /// @@ -136,8 +136,8 @@ public virtual SubscriptionSecurityTaskCollection GetSubscriptionSecurityTasks() /// /// Name of the task object, will be a GUID. /// The cancellation token to use. - /// 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> GetSubscriptionSecurityTaskAsync(string taskName, CancellationToken cancellationToken = default) { @@ -159,8 +159,8 @@ public virtual async Task> GetSubscri /// /// Name of the task object, will be a GUID. /// The cancellation token to use. - /// 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 GetSubscriptionSecurityTask(string taskName, CancellationToken cancellationToken = default) { @@ -171,7 +171,7 @@ public virtual Response GetSubscriptionSecurit /// An object representing collection of AdaptiveApplicationControlGroupResources and their operations over a AdaptiveApplicationControlGroupResource. public virtual AdaptiveApplicationControlGroupCollection GetAdaptiveApplicationControlGroups() { - return GetCachedClient(Client => new AdaptiveApplicationControlGroupCollection(Client, Id)); + return GetCachedClient(client => new AdaptiveApplicationControlGroupCollection(client, Id)); } /// @@ -189,8 +189,8 @@ public virtual AdaptiveApplicationControlGroupCollection GetAdaptiveApplicationC /// /// Name of an application control machine group. /// The cancellation token to use. - /// 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> GetAdaptiveApplicationControlGroupAsync(string groupName, CancellationToken cancellationToken = default) { @@ -212,8 +212,8 @@ public virtual async Task> Get /// /// Name of an application control machine group. /// The cancellation token to use. - /// 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 GetAdaptiveApplicationControlGroup(string groupName, CancellationToken cancellationToken = default) { @@ -224,7 +224,7 @@ public virtual Response GetAdaptiveAppl /// An object representing collection of SubscriptionSecurityAlertResources and their operations over a SubscriptionSecurityAlertResource. public virtual SubscriptionSecurityAlertCollection GetSubscriptionSecurityAlerts() { - return GetCachedClient(Client => new SubscriptionSecurityAlertCollection(Client, Id)); + return GetCachedClient(client => new SubscriptionSecurityAlertCollection(client, Id)); } /// @@ -242,8 +242,8 @@ public virtual SubscriptionSecurityAlertCollection GetSubscriptionSecurityAlerts /// /// Name of the alert object. /// The cancellation token to use. - /// 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> GetSubscriptionSecurityAlertAsync(string alertName, CancellationToken cancellationToken = default) { @@ -265,8 +265,8 @@ public virtual async Task> GetSubscr /// /// Name of the alert object. /// The cancellation token to use. - /// 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 GetSubscriptionSecurityAlert(string alertName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs index c88e577875ca..3df13e19f5c8 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityConnectorApplicationResources and their operations over a SecurityConnectorApplicationResource. public virtual SecurityConnectorApplicationCollection GetSecurityConnectorApplications() { - return GetCachedClient(Client => new SecurityConnectorApplicationCollection(Client, Id)); + return GetCachedClient(client => new SecurityConnectorApplicationCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SecurityConnectorApplicationCollection GetSecurityConnectorApplic /// /// The security Application key - unique key for the standard application. /// The cancellation token to use. - /// 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> GetSecurityConnectorApplicationAsync(string applicationId, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSec /// /// The security Application key - unique key for the standard application. /// The cancellation token to use. - /// 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 GetSecurityConnectorApplication(string applicationId, CancellationToken cancellationToken = default) { diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsConnectorResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsConnectorResource.cs index ecc1412ef679..a70bac3d7506 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsConnectorResource.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsConnectorResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AzureDevOpsOrgResources and their operations over a AzureDevOpsOrgResource. public virtual AzureDevOpsOrgCollection GetAzureDevOpsOrgs() { - return GetCachedClient(Client => new AzureDevOpsOrgCollection(Client, Id)); + return GetCachedClient(client => new AzureDevOpsOrgCollection(client, Id)); } /// @@ -121,8 +121,8 @@ public virtual AzureDevOpsOrgCollection GetAzureDevOpsOrgs() /// /// Name of the AzureDevOps Org. /// The cancellation token to use. - /// 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> GetAzureDevOpsOrgAsync(string azureDevOpsOrgName, CancellationToken cancellationToken = default) { @@ -144,8 +144,8 @@ public virtual async Task> GetAzureDevOpsOrgAsy /// /// Name of the AzureDevOps Org. /// The cancellation token to use. - /// 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 GetAzureDevOpsOrg(string azureDevOpsOrgName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsOrgResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsOrgResource.cs index e74d2177be67..046973a9d36d 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsOrgResource.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsOrgResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AzureDevOpsProjectResources and their operations over a AzureDevOpsProjectResource. public virtual AzureDevOpsProjectCollection GetAzureDevOpsProjects() { - return GetCachedClient(Client => new AzureDevOpsProjectCollection(Client, Id)); + return GetCachedClient(client => new AzureDevOpsProjectCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AzureDevOpsProjectCollection GetAzureDevOpsProjects() /// /// Name of the AzureDevOps Project. /// The cancellation token to use. - /// 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> GetAzureDevOpsProjectAsync(string azureDevOpsProjectName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetAzureDevOpsPr /// /// Name of the AzureDevOps Project. /// The cancellation token to use. - /// 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 GetAzureDevOpsProject(string azureDevOpsProjectName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsProjectResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsProjectResource.cs index fd28dd88590a..5202e9925c59 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsProjectResource.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/AzureDevOpsProjectResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AzureDevOpsRepoResources and their operations over a AzureDevOpsRepoResource. public virtual AzureDevOpsRepoCollection GetAzureDevOpsRepos() { - return GetCachedClient(Client => new AzureDevOpsRepoCollection(Client, Id)); + return GetCachedClient(client => new AzureDevOpsRepoCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual AzureDevOpsRepoCollection GetAzureDevOpsRepos() /// /// Name of the AzureDevOps Repo. /// The cancellation token to use. - /// 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> GetAzureDevOpsRepoAsync(string azureDevOpsRepoName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetAzureDevOpsRepoA /// /// Name of the AzureDevOps Repo. /// The cancellation token to use. - /// 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 GetAzureDevOpsRepo(string azureDevOpsRepoName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ec763b017b04..000000000000 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityDevOps -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of AzureDevOpsConnectorResources in the ResourceGroupResource. - /// An object representing collection of AzureDevOpsConnectorResources and their operations over a AzureDevOpsConnectorResource. - public virtual AzureDevOpsConnectorCollection GetAzureDevOpsConnectors() - { - return GetCachedClient(Client => new AzureDevOpsConnectorCollection(Client, Id)); - } - - /// Gets a collection of GitHubConnectorResources in the ResourceGroupResource. - /// An object representing collection of GitHubConnectorResources and their operations over a GitHubConnectorResource. - public virtual GitHubConnectorCollection GetGitHubConnectors() - { - return GetCachedClient(Client => new GitHubConnectorCollection(Client, Id)); - } - } -} diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsArmClientMockingExtension.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsArmClientMockingExtension.cs new file mode 100644 index 000000000000..ac97e2501c11 --- /dev/null +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SecurityDevOps; + +namespace Azure.ResourceManager.SecurityDevOps.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SecurityDevOpsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SecurityDevOpsArmClientMockingExtension() + { + } + + /// 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 SecurityDevOpsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SecurityDevOpsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureDevOpsConnectorResource GetAzureDevOpsConnectorResource(ResourceIdentifier id) + { + AzureDevOpsConnectorResource.ValidateResourceId(id); + return new AzureDevOpsConnectorResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureDevOpsRepoResource GetAzureDevOpsRepoResource(ResourceIdentifier id) + { + AzureDevOpsRepoResource.ValidateResourceId(id); + return new AzureDevOpsRepoResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureDevOpsOrgResource GetAzureDevOpsOrgResource(ResourceIdentifier id) + { + AzureDevOpsOrgResource.ValidateResourceId(id); + return new AzureDevOpsOrgResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AzureDevOpsProjectResource GetAzureDevOpsProjectResource(ResourceIdentifier id) + { + AzureDevOpsProjectResource.ValidateResourceId(id); + return new AzureDevOpsProjectResource(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 GitHubConnectorResource GetGitHubConnectorResource(ResourceIdentifier id) + { + GitHubConnectorResource.ValidateResourceId(id); + return new GitHubConnectorResource(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 GitHubRepoResource GetGitHubRepoResource(ResourceIdentifier id) + { + GitHubRepoResource.ValidateResourceId(id); + return new GitHubRepoResource(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 GitHubOwnerResource GetGitHubOwnerResource(ResourceIdentifier id) + { + GitHubOwnerResource.ValidateResourceId(id); + return new GitHubOwnerResource(Client, id); + } + } +} diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsExtensions.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsExtensions.cs index ac48fc5d20c2..1c69e1cd6862 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsExtensions.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsExtensions.cs @@ -12,182 +12,152 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SecurityDevOps.Mocking; namespace Azure.ResourceManager.SecurityDevOps { /// A class to add extension methods to Azure.ResourceManager.SecurityDevOps. public static partial class SecurityDevOpsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SecurityDevOpsArmClientMockingExtension GetSecurityDevOpsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SecurityDevOpsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SecurityDevOpsResourceGroupMockingExtension GetSecurityDevOpsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SecurityDevOpsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SecurityDevOpsSubscriptionMockingExtension GetSecurityDevOpsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SecurityDevOpsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region AzureDevOpsConnectorResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureDevOpsConnectorResource GetAzureDevOpsConnectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureDevOpsConnectorResource.ValidateResourceId(id); - return new AzureDevOpsConnectorResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetAzureDevOpsConnectorResource(id); } - #endregion - #region AzureDevOpsRepoResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureDevOpsRepoResource GetAzureDevOpsRepoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureDevOpsRepoResource.ValidateResourceId(id); - return new AzureDevOpsRepoResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetAzureDevOpsRepoResource(id); } - #endregion - #region AzureDevOpsOrgResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureDevOpsOrgResource GetAzureDevOpsOrgResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureDevOpsOrgResource.ValidateResourceId(id); - return new AzureDevOpsOrgResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetAzureDevOpsOrgResource(id); } - #endregion - #region AzureDevOpsProjectResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AzureDevOpsProjectResource GetAzureDevOpsProjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AzureDevOpsProjectResource.ValidateResourceId(id); - return new AzureDevOpsProjectResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetAzureDevOpsProjectResource(id); } - #endregion - #region GitHubConnectorResource /// /// 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. /// Returns a object. public static GitHubConnectorResource GetGitHubConnectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GitHubConnectorResource.ValidateResourceId(id); - return new GitHubConnectorResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetGitHubConnectorResource(id); } - #endregion - #region GitHubRepoResource /// /// 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. /// Returns a object. public static GitHubRepoResource GetGitHubRepoResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GitHubRepoResource.ValidateResourceId(id); - return new GitHubRepoResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetGitHubRepoResource(id); } - #endregion - #region GitHubOwnerResource /// /// 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. /// Returns a object. public static GitHubOwnerResource GetGitHubOwnerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GitHubOwnerResource.ValidateResourceId(id); - return new GitHubOwnerResource(client, id); - } - ); + return GetSecurityDevOpsArmClientMockingExtension(client).GetGitHubOwnerResource(id); } - #endregion - /// Gets a collection of AzureDevOpsConnectorResources in the ResourceGroupResource. + /// + /// Gets a collection of AzureDevOpsConnectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AzureDevOpsConnectorResources and their operations over a AzureDevOpsConnectorResource. public static AzureDevOpsConnectorCollection GetAzureDevOpsConnectors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAzureDevOpsConnectors(); + return GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetAzureDevOpsConnectors(); } /// @@ -202,16 +172,20 @@ public static AzureDevOpsConnectorCollection GetAzureDevOpsConnectors(this Resou /// AzureDevOpsConnector_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the AzureDevOps Connector. /// The cancellation token to use. - /// 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 static async Task> GetAzureDevOpsConnectorAsync(this ResourceGroupResource resourceGroupResource, string azureDevOpsConnectorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAzureDevOpsConnectors().GetAsync(azureDevOpsConnectorName, cancellationToken).ConfigureAwait(false); + return await GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetAzureDevOpsConnectorAsync(azureDevOpsConnectorName, cancellationToken).ConfigureAwait(false); } /// @@ -226,24 +200,34 @@ public static async Task> GetAzureDevOpsC /// AzureDevOpsConnector_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the AzureDevOps Connector. /// The cancellation token to use. - /// 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 static Response GetAzureDevOpsConnector(this ResourceGroupResource resourceGroupResource, string azureDevOpsConnectorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAzureDevOpsConnectors().Get(azureDevOpsConnectorName, cancellationToken); + return GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetAzureDevOpsConnector(azureDevOpsConnectorName, cancellationToken); } - /// Gets a collection of GitHubConnectorResources in the ResourceGroupResource. + /// + /// Gets a collection of GitHubConnectorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of GitHubConnectorResources and their operations over a GitHubConnectorResource. public static GitHubConnectorCollection GetGitHubConnectors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetGitHubConnectors(); + return GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetGitHubConnectors(); } /// @@ -258,16 +242,20 @@ public static GitHubConnectorCollection GetGitHubConnectors(this ResourceGroupRe /// GitHubConnector_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the GitHub Connector. /// The cancellation token to use. - /// 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 static async Task> GetGitHubConnectorAsync(this ResourceGroupResource resourceGroupResource, string gitHubConnectorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetGitHubConnectors().GetAsync(gitHubConnectorName, cancellationToken).ConfigureAwait(false); + return await GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetGitHubConnectorAsync(gitHubConnectorName, cancellationToken).ConfigureAwait(false); } /// @@ -282,16 +270,20 @@ public static async Task> GetGitHubConnectorAs /// GitHubConnector_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the GitHub Connector. /// The cancellation token to use. - /// 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 static Response GetGitHubConnector(this ResourceGroupResource resourceGroupResource, string gitHubConnectorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetGitHubConnectors().Get(gitHubConnectorName, cancellationToken); + return GetSecurityDevOpsResourceGroupMockingExtension(resourceGroupResource).GetGitHubConnector(gitHubConnectorName, cancellationToken); } /// @@ -306,13 +298,17 @@ public static Response GetGitHubConnector(this Resource /// AzureDevOpsConnector_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAzureDevOpsConnectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureDevOpsConnectorsAsync(cancellationToken); + return GetSecurityDevOpsSubscriptionMockingExtension(subscriptionResource).GetAzureDevOpsConnectorsAsync(cancellationToken); } /// @@ -327,13 +323,17 @@ public static AsyncPageable GetAzureDevOpsConnecto /// AzureDevOpsConnector_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAzureDevOpsConnectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAzureDevOpsConnectors(cancellationToken); + return GetSecurityDevOpsSubscriptionMockingExtension(subscriptionResource).GetAzureDevOpsConnectors(cancellationToken); } /// @@ -348,13 +348,17 @@ public static Pageable GetAzureDevOpsConnectors(th /// GitHubConnector_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetGitHubConnectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGitHubConnectorsAsync(cancellationToken); + return GetSecurityDevOpsSubscriptionMockingExtension(subscriptionResource).GetGitHubConnectorsAsync(cancellationToken); } /// @@ -369,13 +373,17 @@ public static AsyncPageable GetGitHubConnectorsAsync(th /// GitHubConnector_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetGitHubConnectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGitHubConnectors(cancellationToken); + return GetSecurityDevOpsSubscriptionMockingExtension(subscriptionResource).GetGitHubConnectors(cancellationToken); } } } diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsResourceGroupMockingExtension.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c969034fb4e9 --- /dev/null +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SecurityDevOps; + +namespace Azure.ResourceManager.SecurityDevOps.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SecurityDevOpsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SecurityDevOpsResourceGroupMockingExtension() + { + } + + /// 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 SecurityDevOpsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of AzureDevOpsConnectorResources in the ResourceGroupResource. + /// An object representing collection of AzureDevOpsConnectorResources and their operations over a AzureDevOpsConnectorResource. + public virtual AzureDevOpsConnectorCollection GetAzureDevOpsConnectors() + { + return GetCachedClient(client => new AzureDevOpsConnectorCollection(client, Id)); + } + + /// + /// Returns a monitored AzureDevOps Connector resource for a given ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityDevOps/azureDevOpsConnectors/{azureDevOpsConnectorName} + /// + /// + /// Operation Id + /// AzureDevOpsConnector_Get + /// + /// + /// + /// Name of the AzureDevOps Connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAzureDevOpsConnectorAsync(string azureDevOpsConnectorName, CancellationToken cancellationToken = default) + { + return await GetAzureDevOpsConnectors().GetAsync(azureDevOpsConnectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a monitored AzureDevOps Connector resource for a given ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityDevOps/azureDevOpsConnectors/{azureDevOpsConnectorName} + /// + /// + /// Operation Id + /// AzureDevOpsConnector_Get + /// + /// + /// + /// Name of the AzureDevOps Connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAzureDevOpsConnector(string azureDevOpsConnectorName, CancellationToken cancellationToken = default) + { + return GetAzureDevOpsConnectors().Get(azureDevOpsConnectorName, cancellationToken); + } + + /// Gets a collection of GitHubConnectorResources in the ResourceGroupResource. + /// An object representing collection of GitHubConnectorResources and their operations over a GitHubConnectorResource. + public virtual GitHubConnectorCollection GetGitHubConnectors() + { + return GetCachedClient(client => new GitHubConnectorCollection(client, Id)); + } + + /// + /// Returns a monitored GitHub Connector resource for a given ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityDevOps/gitHubConnectors/{gitHubConnectorName} + /// + /// + /// Operation Id + /// GitHubConnector_Get + /// + /// + /// + /// Name of the GitHub Connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGitHubConnectorAsync(string gitHubConnectorName, CancellationToken cancellationToken = default) + { + return await GetGitHubConnectors().GetAsync(gitHubConnectorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a monitored GitHub Connector resource for a given ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityDevOps/gitHubConnectors/{gitHubConnectorName} + /// + /// + /// Operation Id + /// GitHubConnector_Get + /// + /// + /// + /// Name of the GitHub Connector. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGitHubConnector(string gitHubConnectorName, CancellationToken cancellationToken = default) + { + return GetGitHubConnectors().Get(gitHubConnectorName, cancellationToken); + } + } +} diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsSubscriptionMockingExtension.cs similarity index 88% rename from sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsSubscriptionMockingExtension.cs index 339f090321a9..209df5e2769d 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/Extensions/SecurityDevOpsSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SecurityDevOps; -namespace Azure.ResourceManager.SecurityDevOps +namespace Azure.ResourceManager.SecurityDevOps.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SecurityDevOpsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _azureDevOpsConnectorClientDiagnostics; private AzureDevOpsConnectorRestOperations _azureDevOpsConnectorRestClient; private ClientDiagnostics _gitHubConnectorClientDiagnostics; private GitHubConnectorRestOperations _gitHubConnectorRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SecurityDevOpsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SecurityDevOpsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +65,7 @@ public virtual AsyncPageable GetAzureDevOpsConnect { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureDevOpsConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureDevOpsConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureDevOpsConnectorResource(Client, AzureDevOpsConnectorData.DeserializeAzureDevOpsConnectorData(e)), AzureDevOpsConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureDevOpsConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AzureDevOpsConnectorResource(Client, AzureDevOpsConnectorData.DeserializeAzureDevOpsConnectorData(e)), AzureDevOpsConnectorClientDiagnostics, Pipeline, "SecurityDevOpsSubscriptionMockingExtension.GetAzureDevOpsConnectors", "value", "nextLink", cancellationToken); } /// @@ -86,7 +87,7 @@ public virtual Pageable GetAzureDevOpsConnectors(C { HttpMessage FirstPageRequest(int? pageSizeHint) => AzureDevOpsConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AzureDevOpsConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureDevOpsConnectorResource(Client, AzureDevOpsConnectorData.DeserializeAzureDevOpsConnectorData(e)), AzureDevOpsConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAzureDevOpsConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AzureDevOpsConnectorResource(Client, AzureDevOpsConnectorData.DeserializeAzureDevOpsConnectorData(e)), AzureDevOpsConnectorClientDiagnostics, Pipeline, "SecurityDevOpsSubscriptionMockingExtension.GetAzureDevOpsConnectors", "value", "nextLink", cancellationToken); } /// @@ -108,7 +109,7 @@ public virtual AsyncPageable GetGitHubConnectorsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => GitHubConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GitHubConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GitHubConnectorResource(Client, GitHubConnectorData.DeserializeGitHubConnectorData(e)), GitHubConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGitHubConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GitHubConnectorResource(Client, GitHubConnectorData.DeserializeGitHubConnectorData(e)), GitHubConnectorClientDiagnostics, Pipeline, "SecurityDevOpsSubscriptionMockingExtension.GetGitHubConnectors", "value", "nextLink", cancellationToken); } /// @@ -130,7 +131,7 @@ public virtual Pageable GetGitHubConnectors(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => GitHubConnectorRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GitHubConnectorRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GitHubConnectorResource(Client, GitHubConnectorData.DeserializeGitHubConnectorData(e)), GitHubConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGitHubConnectors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GitHubConnectorResource(Client, GitHubConnectorData.DeserializeGitHubConnectorData(e)), GitHubConnectorClientDiagnostics, Pipeline, "SecurityDevOpsSubscriptionMockingExtension.GetGitHubConnectors", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubConnectorResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubConnectorResource.cs index 101cc31e51a2..deccb734478c 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubConnectorResource.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubConnectorResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GitHubOwnerResources and their operations over a GitHubOwnerResource. public virtual GitHubOwnerCollection GetGitHubOwners() { - return GetCachedClient(Client => new GitHubOwnerCollection(Client, Id)); + return GetCachedClient(client => new GitHubOwnerCollection(client, Id)); } /// @@ -121,8 +121,8 @@ public virtual GitHubOwnerCollection GetGitHubOwners() /// /// Name of the GitHub Owner. /// The cancellation token to use. - /// 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> GetGitHubOwnerAsync(string gitHubOwnerName, CancellationToken cancellationToken = default) { @@ -144,8 +144,8 @@ public virtual async Task> GetGitHubOwnerAsync(str /// /// Name of the GitHub Owner. /// The cancellation token to use. - /// 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 GetGitHubOwner(string gitHubOwnerName, CancellationToken cancellationToken = default) { diff --git a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubOwnerResource.cs b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubOwnerResource.cs index 96d927437c3e..1b39fadc2616 100644 --- a/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubOwnerResource.cs +++ b/sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/src/Generated/GitHubOwnerResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GitHubRepoResources and their operations over a GitHubRepoResource. public virtual GitHubRepoCollection GetGitHubRepos() { - return GetCachedClient(Client => new GitHubRepoCollection(Client, Id)); + return GetCachedClient(client => new GitHubRepoCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual GitHubRepoCollection GetGitHubRepos() /// /// Name of the GitHub Repo. /// The cancellation token to use. - /// 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> GetGitHubRepoAsync(string gitHubRepoName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetGitHubRepoAsync(strin /// /// Name of the GitHub Repo. /// The cancellation token to use. - /// 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 GetGitHubRepo(string gitHubRepoName, CancellationToken cancellationToken = default) { diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsArmClientMockingExtension.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsArmClientMockingExtension.cs new file mode 100644 index 000000000000..3008ea080e66 --- /dev/null +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsArmClientMockingExtension.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SecurityInsights; + +namespace Azure.ResourceManager.SecurityInsights.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SecurityInsightsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SecurityInsightsArmClientMockingExtension() + { + } + + /// 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 SecurityInsightsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SecurityInsightsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SecurityInsightsAlertRuleResource GetSecurityInsightsAlertRuleResource(ResourceIdentifier id) + { + SecurityInsightsAlertRuleResource.ValidateResourceId(id); + return new SecurityInsightsAlertRuleResource(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 SecurityInsightsAlertRuleActionResource GetSecurityInsightsAlertRuleActionResource(ResourceIdentifier id) + { + SecurityInsightsAlertRuleActionResource.ValidateResourceId(id); + return new SecurityInsightsAlertRuleActionResource(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 SecurityInsightsAlertRuleTemplateResource GetSecurityInsightsAlertRuleTemplateResource(ResourceIdentifier id) + { + SecurityInsightsAlertRuleTemplateResource.ValidateResourceId(id); + return new SecurityInsightsAlertRuleTemplateResource(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 SecurityInsightsAutomationRuleResource GetSecurityInsightsAutomationRuleResource(ResourceIdentifier id) + { + SecurityInsightsAutomationRuleResource.ValidateResourceId(id); + return new SecurityInsightsAutomationRuleResource(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 SecurityInsightsBookmarkResource GetSecurityInsightsBookmarkResource(ResourceIdentifier id) + { + SecurityInsightsBookmarkResource.ValidateResourceId(id); + return new SecurityInsightsBookmarkResource(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 SecurityInsightsDataConnectorResource GetSecurityInsightsDataConnectorResource(ResourceIdentifier id) + { + SecurityInsightsDataConnectorResource.ValidateResourceId(id); + return new SecurityInsightsDataConnectorResource(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 SecurityInsightsIncidentResource GetSecurityInsightsIncidentResource(ResourceIdentifier id) + { + SecurityInsightsIncidentResource.ValidateResourceId(id); + return new SecurityInsightsIncidentResource(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 SecurityInsightsIncidentCommentResource GetSecurityInsightsIncidentCommentResource(ResourceIdentifier id) + { + SecurityInsightsIncidentCommentResource.ValidateResourceId(id); + return new SecurityInsightsIncidentCommentResource(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 SecurityInsightsIncidentRelationResource GetSecurityInsightsIncidentRelationResource(ResourceIdentifier id) + { + SecurityInsightsIncidentRelationResource.ValidateResourceId(id); + return new SecurityInsightsIncidentRelationResource(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 SecurityInsightsSentinelOnboardingStateResource GetSecurityInsightsSentinelOnboardingStateResource(ResourceIdentifier id) + { + SecurityInsightsSentinelOnboardingStateResource.ValidateResourceId(id); + return new SecurityInsightsSentinelOnboardingStateResource(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 SecurityMLAnalyticsSettingResource GetSecurityMLAnalyticsSettingResource(ResourceIdentifier id) + { + SecurityMLAnalyticsSettingResource.ValidateResourceId(id); + return new SecurityMLAnalyticsSettingResource(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 SecurityInsightsThreatIntelligenceIndicatorResource GetSecurityInsightsThreatIntelligenceIndicatorResource(ResourceIdentifier id) + { + SecurityInsightsThreatIntelligenceIndicatorResource.ValidateResourceId(id); + return new SecurityInsightsThreatIntelligenceIndicatorResource(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 SecurityInsightsWatchlistResource GetSecurityInsightsWatchlistResource(ResourceIdentifier id) + { + SecurityInsightsWatchlistResource.ValidateResourceId(id); + return new SecurityInsightsWatchlistResource(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 SecurityInsightsWatchlistItemResource GetSecurityInsightsWatchlistItemResource(ResourceIdentifier id) + { + SecurityInsightsWatchlistItemResource.ValidateResourceId(id); + return new SecurityInsightsWatchlistItemResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperationalInsightsWorkspaceSecurityInsightsResource GetOperationalInsightsWorkspaceSecurityInsightsResource(ResourceIdentifier id) + { + OperationalInsightsWorkspaceSecurityInsightsResource.ValidateResourceId(id); + return new OperationalInsightsWorkspaceSecurityInsightsResource(Client, id); + } + } +} diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsExtensions.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsExtensions.cs index 59e6473a9cd9..bd4e88434733 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsExtensions.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsExtensions.cs @@ -7,310 +7,261 @@ using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.SecurityInsights.Mocking; namespace Azure.ResourceManager.SecurityInsights { /// A class to add extension methods to Azure.ResourceManager.SecurityInsights. public static partial class SecurityInsightsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SecurityInsightsArmClientMockingExtension GetSecurityInsightsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SecurityInsightsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SecurityInsightsResourceGroupMockingExtension GetSecurityInsightsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SecurityInsightsResourceGroupMockingExtension(client, resource.Id)); } - #region SecurityInsightsAlertRuleResource + /// /// 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. /// Returns a object. public static SecurityInsightsAlertRuleResource GetSecurityInsightsAlertRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsAlertRuleResource.ValidateResourceId(id); - return new SecurityInsightsAlertRuleResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsAlertRuleResource(id); } - #endregion - #region SecurityInsightsAlertRuleActionResource /// /// 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. /// Returns a object. public static SecurityInsightsAlertRuleActionResource GetSecurityInsightsAlertRuleActionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsAlertRuleActionResource.ValidateResourceId(id); - return new SecurityInsightsAlertRuleActionResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsAlertRuleActionResource(id); } - #endregion - #region SecurityInsightsAlertRuleTemplateResource /// /// 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. /// Returns a object. public static SecurityInsightsAlertRuleTemplateResource GetSecurityInsightsAlertRuleTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsAlertRuleTemplateResource.ValidateResourceId(id); - return new SecurityInsightsAlertRuleTemplateResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsAlertRuleTemplateResource(id); } - #endregion - #region SecurityInsightsAutomationRuleResource /// /// 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. /// Returns a object. public static SecurityInsightsAutomationRuleResource GetSecurityInsightsAutomationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsAutomationRuleResource.ValidateResourceId(id); - return new SecurityInsightsAutomationRuleResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsAutomationRuleResource(id); } - #endregion - #region SecurityInsightsBookmarkResource /// /// 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. /// Returns a object. public static SecurityInsightsBookmarkResource GetSecurityInsightsBookmarkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsBookmarkResource.ValidateResourceId(id); - return new SecurityInsightsBookmarkResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsBookmarkResource(id); } - #endregion - #region SecurityInsightsDataConnectorResource /// /// 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. /// Returns a object. public static SecurityInsightsDataConnectorResource GetSecurityInsightsDataConnectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsDataConnectorResource.ValidateResourceId(id); - return new SecurityInsightsDataConnectorResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsDataConnectorResource(id); } - #endregion - #region SecurityInsightsIncidentResource /// /// 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. /// Returns a object. public static SecurityInsightsIncidentResource GetSecurityInsightsIncidentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsIncidentResource.ValidateResourceId(id); - return new SecurityInsightsIncidentResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsIncidentResource(id); } - #endregion - #region SecurityInsightsIncidentCommentResource /// /// 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. /// Returns a object. public static SecurityInsightsIncidentCommentResource GetSecurityInsightsIncidentCommentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsIncidentCommentResource.ValidateResourceId(id); - return new SecurityInsightsIncidentCommentResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsIncidentCommentResource(id); } - #endregion - #region SecurityInsightsIncidentRelationResource /// /// 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. /// Returns a object. public static SecurityInsightsIncidentRelationResource GetSecurityInsightsIncidentRelationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsIncidentRelationResource.ValidateResourceId(id); - return new SecurityInsightsIncidentRelationResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsIncidentRelationResource(id); } - #endregion - #region SecurityInsightsSentinelOnboardingStateResource /// /// 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. /// Returns a object. public static SecurityInsightsSentinelOnboardingStateResource GetSecurityInsightsSentinelOnboardingStateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsSentinelOnboardingStateResource.ValidateResourceId(id); - return new SecurityInsightsSentinelOnboardingStateResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsSentinelOnboardingStateResource(id); } - #endregion - #region SecurityMLAnalyticsSettingResource /// /// 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. /// Returns a object. public static SecurityMLAnalyticsSettingResource GetSecurityMLAnalyticsSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityMLAnalyticsSettingResource.ValidateResourceId(id); - return new SecurityMLAnalyticsSettingResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityMLAnalyticsSettingResource(id); } - #endregion - #region SecurityInsightsThreatIntelligenceIndicatorResource /// /// 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. /// Returns a object. public static SecurityInsightsThreatIntelligenceIndicatorResource GetSecurityInsightsThreatIntelligenceIndicatorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsThreatIntelligenceIndicatorResource.ValidateResourceId(id); - return new SecurityInsightsThreatIntelligenceIndicatorResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsThreatIntelligenceIndicatorResource(id); } - #endregion - #region SecurityInsightsWatchlistResource /// /// 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. /// Returns a object. public static SecurityInsightsWatchlistResource GetSecurityInsightsWatchlistResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsWatchlistResource.ValidateResourceId(id); - return new SecurityInsightsWatchlistResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsWatchlistResource(id); } - #endregion - #region SecurityInsightsWatchlistItemResource /// /// 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. /// Returns a object. public static SecurityInsightsWatchlistItemResource GetSecurityInsightsWatchlistItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SecurityInsightsWatchlistItemResource.ValidateResourceId(id); - return new SecurityInsightsWatchlistItemResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetSecurityInsightsWatchlistItemResource(id); } - #endregion - #region OperationalInsightsWorkspaceSecurityInsightsResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OperationalInsightsWorkspaceSecurityInsightsResource GetOperationalInsightsWorkspaceSecurityInsightsResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OperationalInsightsWorkspaceSecurityInsightsResource.ValidateResourceId(id); - return new OperationalInsightsWorkspaceSecurityInsightsResource(client, id); - } - ); + return GetSecurityInsightsArmClientMockingExtension(client).GetOperationalInsightsWorkspaceSecurityInsightsResource(id); } - #endregion } } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsResourceGroupMockingExtension.cs similarity index 63% rename from sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsResourceGroupMockingExtension.cs index c510da1b67e2..dd1a686085f7 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/Extensions/SecurityInsightsResourceGroupMockingExtension.cs @@ -8,20 +8,20 @@ using Azure.Core; using Azure.ResourceManager; -namespace Azure.ResourceManager.SecurityInsights +namespace Azure.ResourceManager.SecurityInsights.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class SecurityInsightsResourceGroupMockingExtension : ArmResource { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SecurityInsightsResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SecurityInsightsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/OperationalInsightsWorkspaceSecurityInsightsResource.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/OperationalInsightsWorkspaceSecurityInsightsResource.cs index 4e17138e3044..0cdefd3cb2ed 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/OperationalInsightsWorkspaceSecurityInsightsResource.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/OperationalInsightsWorkspaceSecurityInsightsResource.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityInsightsAlertRuleResources and their operations over a SecurityInsightsAlertRuleResource. public virtual SecurityInsightsAlertRuleCollection GetSecurityInsightsAlertRules() { - return GetCachedClient(Client => new SecurityInsightsAlertRuleCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsAlertRuleCollection(client, Id)); } /// @@ -86,8 +86,8 @@ public virtual SecurityInsightsAlertRuleCollection GetSecurityInsightsAlertRules /// /// Alert rule ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsAlertRuleAsync(string ruleId, CancellationToken cancellationToken = default) { @@ -109,8 +109,8 @@ public virtual async Task> GetSecuri /// /// Alert rule ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsAlertRule(string ruleId, CancellationToken cancellationToken = default) { @@ -121,7 +121,7 @@ public virtual Response GetSecurityInsightsAl /// An object representing collection of SecurityInsightsAlertRuleTemplateResources and their operations over a SecurityInsightsAlertRuleTemplateResource. public virtual SecurityInsightsAlertRuleTemplateCollection GetSecurityInsightsAlertRuleTemplates() { - return GetCachedClient(Client => new SecurityInsightsAlertRuleTemplateCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsAlertRuleTemplateCollection(client, Id)); } /// @@ -139,8 +139,8 @@ public virtual SecurityInsightsAlertRuleTemplateCollection GetSecurityInsightsAl /// /// Alert rule template ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsAlertRuleTemplateAsync(string alertRuleTemplateId, CancellationToken cancellationToken = default) { @@ -162,8 +162,8 @@ public virtual async Task> G /// /// Alert rule template ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsAlertRuleTemplate(string alertRuleTemplateId, CancellationToken cancellationToken = default) { @@ -174,7 +174,7 @@ public virtual Response GetSecurityIn /// An object representing collection of SecurityInsightsAutomationRuleResources and their operations over a SecurityInsightsAutomationRuleResource. public virtual SecurityInsightsAutomationRuleCollection GetSecurityInsightsAutomationRules() { - return GetCachedClient(Client => new SecurityInsightsAutomationRuleCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsAutomationRuleCollection(client, Id)); } /// @@ -192,8 +192,8 @@ public virtual SecurityInsightsAutomationRuleCollection GetSecurityInsightsAutom /// /// Automation rule ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsAutomationRuleAsync(string automationRuleId, CancellationToken cancellationToken = default) { @@ -215,8 +215,8 @@ public virtual async Task> GetS /// /// Automation rule ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsAutomationRule(string automationRuleId, CancellationToken cancellationToken = default) { @@ -227,7 +227,7 @@ public virtual Response GetSecurityInsig /// An object representing collection of SecurityInsightsBookmarkResources and their operations over a SecurityInsightsBookmarkResource. public virtual SecurityInsightsBookmarkCollection GetSecurityInsightsBookmarks() { - return GetCachedClient(Client => new SecurityInsightsBookmarkCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsBookmarkCollection(client, Id)); } /// @@ -245,8 +245,8 @@ public virtual SecurityInsightsBookmarkCollection GetSecurityInsightsBookmarks() /// /// Bookmark ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsBookmarkAsync(string bookmarkId, CancellationToken cancellationToken = default) { @@ -268,8 +268,8 @@ public virtual async Task> GetSecurit /// /// Bookmark ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsBookmark(string bookmarkId, CancellationToken cancellationToken = default) { @@ -280,7 +280,7 @@ public virtual Response GetSecurityInsightsBoo /// An object representing collection of SecurityInsightsDataConnectorResources and their operations over a SecurityInsightsDataConnectorResource. public virtual SecurityInsightsDataConnectorCollection GetSecurityInsightsDataConnectors() { - return GetCachedClient(Client => new SecurityInsightsDataConnectorCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsDataConnectorCollection(client, Id)); } /// @@ -298,8 +298,8 @@ public virtual SecurityInsightsDataConnectorCollection GetSecurityInsightsDataCo /// /// Connector ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsDataConnectorAsync(string dataConnectorId, CancellationToken cancellationToken = default) { @@ -321,8 +321,8 @@ public virtual async Task> GetSe /// /// Connector ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsDataConnector(string dataConnectorId, CancellationToken cancellationToken = default) { @@ -333,7 +333,7 @@ public virtual Response GetSecurityInsigh /// An object representing collection of SecurityInsightsIncidentResources and their operations over a SecurityInsightsIncidentResource. public virtual SecurityInsightsIncidentCollection GetSecurityInsightsIncidents() { - return GetCachedClient(Client => new SecurityInsightsIncidentCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsIncidentCollection(client, Id)); } /// @@ -351,8 +351,8 @@ public virtual SecurityInsightsIncidentCollection GetSecurityInsightsIncidents() /// /// Incident ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsIncidentAsync(string incidentId, CancellationToken cancellationToken = default) { @@ -374,8 +374,8 @@ public virtual async Task> GetSecurit /// /// Incident ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsIncident(string incidentId, CancellationToken cancellationToken = default) { @@ -386,7 +386,7 @@ public virtual Response GetSecurityInsightsInc /// An object representing collection of SecurityInsightsSentinelOnboardingStateResources and their operations over a SecurityInsightsSentinelOnboardingStateResource. public virtual SecurityInsightsSentinelOnboardingStateCollection GetSecurityInsightsSentinelOnboardingStates() { - return GetCachedClient(Client => new SecurityInsightsSentinelOnboardingStateCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsSentinelOnboardingStateCollection(client, Id)); } /// @@ -404,8 +404,8 @@ public virtual SecurityInsightsSentinelOnboardingStateCollection GetSecurityInsi /// /// The Sentinel onboarding state name. Supports - default. /// The cancellation token to use. - /// 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> GetSecurityInsightsSentinelOnboardingStateAsync(string sentinelOnboardingStateName, CancellationToken cancellationToken = default) { @@ -427,8 +427,8 @@ public virtual async Task /// The Sentinel onboarding state name. Supports - default. /// The cancellation token to use. - /// 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 GetSecurityInsightsSentinelOnboardingState(string sentinelOnboardingStateName, CancellationToken cancellationToken = default) { @@ -439,7 +439,7 @@ public virtual Response GetSecu /// An object representing collection of SecurityMLAnalyticsSettingResources and their operations over a SecurityMLAnalyticsSettingResource. public virtual SecurityMLAnalyticsSettingCollection GetSecurityMLAnalyticsSettings() { - return GetCachedClient(Client => new SecurityMLAnalyticsSettingCollection(Client, Id)); + return GetCachedClient(client => new SecurityMLAnalyticsSettingCollection(client, Id)); } /// @@ -457,8 +457,8 @@ public virtual SecurityMLAnalyticsSettingCollection GetSecurityMLAnalyticsSettin /// /// Security ML Analytics Settings resource name. /// The cancellation token to use. - /// 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> GetSecurityMLAnalyticsSettingAsync(string settingsResourceName, CancellationToken cancellationToken = default) { @@ -480,8 +480,8 @@ public virtual async Task> GetSecur /// /// Security ML Analytics Settings resource name. /// The cancellation token to use. - /// 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 GetSecurityMLAnalyticsSetting(string settingsResourceName, CancellationToken cancellationToken = default) { @@ -492,7 +492,7 @@ public virtual Response GetSecurityMLAnalyti /// An object representing collection of SecurityInsightsThreatIntelligenceIndicatorResources and their operations over a SecurityInsightsThreatIntelligenceIndicatorResource. public virtual SecurityInsightsThreatIntelligenceIndicatorCollection GetSecurityInsightsThreatIntelligenceIndicators() { - return GetCachedClient(Client => new SecurityInsightsThreatIntelligenceIndicatorCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsThreatIntelligenceIndicatorCollection(client, Id)); } /// @@ -510,8 +510,8 @@ public virtual SecurityInsightsThreatIntelligenceIndicatorCollection GetSecurity /// /// Threat intelligence indicator name field. /// The cancellation token to use. - /// 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> GetSecurityInsightsThreatIntelligenceIndicatorAsync(string name, CancellationToken cancellationToken = default) { @@ -533,8 +533,8 @@ public virtual async Task /// Threat intelligence indicator name field. /// The cancellation token to use. - /// 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 GetSecurityInsightsThreatIntelligenceIndicator(string name, CancellationToken cancellationToken = default) { @@ -545,7 +545,7 @@ public virtual Response Get /// An object representing collection of SecurityInsightsWatchlistResources and their operations over a SecurityInsightsWatchlistResource. public virtual SecurityInsightsWatchlistCollection GetSecurityInsightsWatchlists() { - return GetCachedClient(Client => new SecurityInsightsWatchlistCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsWatchlistCollection(client, Id)); } /// @@ -563,8 +563,8 @@ public virtual SecurityInsightsWatchlistCollection GetSecurityInsightsWatchlists /// /// The watchlist alias. /// The cancellation token to use. - /// 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> GetSecurityInsightsWatchlistAsync(string watchlistAlias, CancellationToken cancellationToken = default) { @@ -586,8 +586,8 @@ public virtual async Task> GetSecuri /// /// The watchlist alias. /// The cancellation token to use. - /// 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 GetSecurityInsightsWatchlist(string watchlistAlias, CancellationToken cancellationToken = default) { diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsAlertRuleResource.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsAlertRuleResource.cs index 90618390c009..0f9e56015790 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsAlertRuleResource.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsAlertRuleResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityInsightsAlertRuleActionResources and their operations over a SecurityInsightsAlertRuleActionResource. public virtual SecurityInsightsAlertRuleActionCollection GetSecurityInsightsAlertRuleActions() { - return GetCachedClient(Client => new SecurityInsightsAlertRuleActionCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsAlertRuleActionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SecurityInsightsAlertRuleActionCollection GetSecurityInsightsAler /// /// Action ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsAlertRuleActionAsync(string actionId, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> Get /// /// Action ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsAlertRuleAction(string actionId, CancellationToken cancellationToken = default) { diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsIncidentResource.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsIncidentResource.cs index bd213dd82b00..4cff6bd8a7fe 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsIncidentResource.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsIncidentResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityInsightsIncidentCommentResources and their operations over a SecurityInsightsIncidentCommentResource. public virtual SecurityInsightsIncidentCommentCollection GetSecurityInsightsIncidentComments() { - return GetCachedClient(Client => new SecurityInsightsIncidentCommentCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsIncidentCommentCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SecurityInsightsIncidentCommentCollection GetSecurityInsightsInci /// /// Incident comment ID. /// The cancellation token to use. - /// 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> GetSecurityInsightsIncidentCommentAsync(string incidentCommentId, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Get /// /// Incident comment ID. /// The cancellation token to use. - /// 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 GetSecurityInsightsIncidentComment(string incidentCommentId, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetSecurityInsi /// An object representing collection of SecurityInsightsIncidentRelationResources and their operations over a SecurityInsightsIncidentRelationResource. public virtual SecurityInsightsIncidentRelationCollection GetSecurityInsightsIncidentRelations() { - return GetCachedClient(Client => new SecurityInsightsIncidentRelationCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsIncidentRelationCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual SecurityInsightsIncidentRelationCollection GetSecurityInsightsInc /// /// Relation Name. /// The cancellation token to use. - /// 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> GetSecurityInsightsIncidentRelationAsync(string relationName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> Ge /// /// Relation Name. /// The cancellation token to use. - /// 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 GetSecurityInsightsIncidentRelation(string relationName, CancellationToken cancellationToken = default) { diff --git a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsWatchlistResource.cs b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsWatchlistResource.cs index fc44183f98a1..942fec690aab 100644 --- a/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsWatchlistResource.cs +++ b/sdk/securityinsights/Azure.ResourceManager.SecurityInsights/src/Generated/SecurityInsightsWatchlistResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SecurityInsightsWatchlistItemResources and their operations over a SecurityInsightsWatchlistItemResource. public virtual SecurityInsightsWatchlistItemCollection GetSecurityInsightsWatchlistItems() { - return GetCachedClient(Client => new SecurityInsightsWatchlistItemCollection(Client, Id)); + return GetCachedClient(client => new SecurityInsightsWatchlistItemCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SecurityInsightsWatchlistItemCollection GetSecurityInsightsWatchl /// /// The watchlist item id (GUID). /// The cancellation token to use. - /// 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> GetSecurityInsightsWatchlistItemAsync(string watchlistItemId, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSe /// /// The watchlist item id (GUID). /// The cancellation token to use. - /// 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 GetSecurityInsightsWatchlistItem(string watchlistItemId, CancellationToken cancellationToken = default) { diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpArmClientMockingExtension.cs similarity index 58% rename from sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/ArmResourceExtensionClient.cs rename to sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpArmClientMockingExtension.cs index a7ff29fc7b83..23c38c7ca225 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpArmClientMockingExtension.cs @@ -13,27 +13,32 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SelfHelp; using Azure.ResourceManager.SelfHelp.Models; -namespace Azure.ResourceManager.SelfHelp +namespace Azure.ResourceManager.SelfHelp.Mocking { - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource + /// A class to add extension methods to ArmClient. + public partial class SelfHelpArmClientMockingExtension : ArmResource { private ClientDiagnostics _selfHelpDiagnosticDiagnosticsClientDiagnostics; private DiagnosticsRestOperations _selfHelpDiagnosticDiagnosticsRestClient; private ClientDiagnostics _discoverySolutionClientDiagnostics; private DiscoverySolutionRestOperations _discoverySolutionRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SelfHelpArmClientMockingExtension() { } - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SelfHelpArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SelfHelpArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) { } @@ -48,11 +53,60 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of SelfHelpDiagnosticResources in the ArmResource. + /// Gets a collection of SelfHelpDiagnosticResources in the ArmClient. + /// The scope that the resource will apply against. /// An object representing collection of SelfHelpDiagnosticResources and their operations over a SelfHelpDiagnosticResource. - public virtual SelfHelpDiagnosticCollection GetSelfHelpDiagnostics() + public virtual SelfHelpDiagnosticCollection GetSelfHelpDiagnostics(ResourceIdentifier scope) + { + return new SelfHelpDiagnosticCollection(Client, scope); + } + + /// + /// Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName} + /// + /// + /// Operation Id + /// Diagnostics_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Unique resource name for insight resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSelfHelpDiagnosticAsync(ResourceIdentifier scope, string diagnosticsResourceName, CancellationToken cancellationToken = default) { - return GetCachedClient(Client => new SelfHelpDiagnosticCollection(Client, Id)); + return await GetSelfHelpDiagnostics(scope).GetAsync(diagnosticsResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName} + /// + /// + /// Operation Id + /// Diagnostics_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Unique resource name for insight resources. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSelfHelpDiagnostic(ResourceIdentifier scope, string diagnosticsResourceName, CancellationToken cancellationToken = default) + { + return GetSelfHelpDiagnostics(scope).Get(diagnosticsResourceName, cancellationToken); } /// @@ -68,20 +122,21 @@ public virtual SelfHelpDiagnosticCollection GetSelfHelpDiagnostics() /// /// /// + /// The scope to use. /// The required parameters for availability check. /// The cancellation token to use. - public virtual async Task> CheckSelfHelpNameAvailabilityAsync(SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + public virtual async Task> CheckSelfHelpNameAvailabilityAsync(ResourceIdentifier scope, SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - using var scope = SelfHelpDiagnosticDiagnosticsClientDiagnostics.CreateScope("ArmResourceExtensionClient.CheckSelfHelpNameAvailability"); - scope.Start(); + using var scope0 = SelfHelpDiagnosticDiagnosticsClientDiagnostics.CreateScope("SelfHelpArmClientMockingExtension.CheckSelfHelpNameAvailability"); + scope0.Start(); try { - var response = await SelfHelpDiagnosticDiagnosticsRestClient.CheckNameAvailabilityAsync(Id, content, cancellationToken).ConfigureAwait(false); + var response = await SelfHelpDiagnosticDiagnosticsRestClient.CheckNameAvailabilityAsync(scope, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -99,20 +154,21 @@ public virtual async Task> CheckSelfHel /// /// /// + /// The scope to use. /// The required parameters for availability check. /// The cancellation token to use. - public virtual Response CheckSelfHelpNameAvailability(SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + public virtual Response CheckSelfHelpNameAvailability(ResourceIdentifier scope, SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - using var scope = SelfHelpDiagnosticDiagnosticsClientDiagnostics.CreateScope("ArmResourceExtensionClient.CheckSelfHelpNameAvailability"); - scope.Start(); + using var scope0 = SelfHelpDiagnosticDiagnosticsClientDiagnostics.CreateScope("SelfHelpArmClientMockingExtension.CheckSelfHelpNameAvailability"); + scope0.Start(); try { - var response = SelfHelpDiagnosticDiagnosticsRestClient.CheckNameAvailability(Id, content, cancellationToken); + var response = SelfHelpDiagnosticDiagnosticsRestClient.CheckNameAvailability(scope, content, cancellationToken); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -130,15 +186,16 @@ public virtual Response CheckSelfHelpNameAvailab /// /// /// + /// The scope to use. /// Can be used to filter solutionIds by 'ProblemClassificationId'. The filter supports only 'and' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' and ProblemClassificationId eq '0a9673c2-7af6-4e19-90d3-4ee2461076d9'. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSelfHelpDiscoverySolutionsAsync(string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetSelfHelpDiscoverySolutionsAsync(ResourceIdentifier scope, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoverySolutionRestClient.CreateListRequest(Id, filter, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoverySolutionRestClient.CreateListNextPageRequest(nextLink, Id, filter, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SelfHelpSolutionMetadata.DeserializeSelfHelpSolutionMetadata, DiscoverySolutionClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSelfHelpDiscoverySolutions", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoverySolutionRestClient.CreateListRequest(scope, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoverySolutionRestClient.CreateListNextPageRequest(nextLink, scope, filter, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SelfHelpSolutionMetadata.DeserializeSelfHelpSolutionMetadata, DiscoverySolutionClientDiagnostics, Pipeline, "SelfHelpArmClientMockingExtension.GetSelfHelpDiscoverySolutions", "value", "nextLink", cancellationToken); } /// @@ -154,15 +211,27 @@ public virtual AsyncPageable GetSelfHelpDiscoverySolut /// /// /// + /// The scope to use. /// Can be used to filter solutionIds by 'ProblemClassificationId'. The filter supports only 'and' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' and ProblemClassificationId eq '0a9673c2-7af6-4e19-90d3-4ee2461076d9'. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSelfHelpDiscoverySolutions(string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetSelfHelpDiscoverySolutions(ResourceIdentifier scope, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoverySolutionRestClient.CreateListRequest(scope, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoverySolutionRestClient.CreateListNextPageRequest(nextLink, scope, filter, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SelfHelpSolutionMetadata.DeserializeSelfHelpSolutionMetadata, DiscoverySolutionClientDiagnostics, Pipeline, "SelfHelpArmClientMockingExtension.GetSelfHelpDiscoverySolutions", "value", "nextLink", 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 SelfHelpDiagnosticResource GetSelfHelpDiagnosticResource(ResourceIdentifier id) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoverySolutionRestClient.CreateListRequest(Id, filter, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoverySolutionRestClient.CreateListNextPageRequest(nextLink, Id, filter, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SelfHelpSolutionMetadata.DeserializeSelfHelpSolutionMetadata, DiscoverySolutionClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetSelfHelpDiscoverySolutions", "value", "nextLink", cancellationToken); + SelfHelpDiagnosticResource.ValidateResourceId(id); + return new SelfHelpDiagnosticResource(Client, id); } } } diff --git a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpExtensions.cs b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpExtensions.cs index 6014931d31f7..e3fdadf4ed2e 100644 --- a/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpExtensions.cs +++ b/sdk/selfhelp/Azure.ResourceManager.SelfHelp/src/Generated/Extensions/SelfHelpExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.SelfHelp.Mocking; using Azure.ResourceManager.SelfHelp.Models; namespace Azure.ResourceManager.SelfHelp @@ -18,47 +19,24 @@ namespace Azure.ResourceManager.SelfHelp /// A class to add extension methods to Azure.ResourceManager.SelfHelp. public static partial class SelfHelpExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static SelfHelpArmClientMockingExtension GetSelfHelpArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SelfHelpArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); - } - #region SelfHelpDiagnosticResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of SelfHelpDiagnosticResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SelfHelpDiagnosticResource GetSelfHelpDiagnosticResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SelfHelpDiagnosticResource.ValidateResourceId(id); - return new SelfHelpDiagnosticResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of SelfHelpDiagnosticResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of SelfHelpDiagnosticResources and their operations over a SelfHelpDiagnosticResource. public static SelfHelpDiagnosticCollection GetSelfHelpDiagnostics(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetSelfHelpDiagnostics(); + return GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiagnostics(scope); } /// @@ -73,17 +51,21 @@ public static SelfHelpDiagnosticCollection GetSelfHelpDiagnostics(this ArmClient /// Diagnostics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Unique resource name for insight resources. /// The cancellation token to use. - /// 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 static async Task> GetSelfHelpDiagnosticAsync(this ArmClient client, ResourceIdentifier scope, string diagnosticsResourceName, CancellationToken cancellationToken = default) { - return await client.GetSelfHelpDiagnostics(scope).GetAsync(diagnosticsResourceName, cancellationToken).ConfigureAwait(false); + return await GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiagnosticAsync(scope, diagnosticsResourceName, cancellationToken).ConfigureAwait(false); } /// @@ -98,17 +80,21 @@ public static async Task> GetSelfHelpDiagno /// Diagnostics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Unique resource name for insight resources. /// The cancellation token to use. - /// 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 static Response GetSelfHelpDiagnostic(this ArmClient client, ResourceIdentifier scope, string diagnosticsResourceName, CancellationToken cancellationToken = default) { - return client.GetSelfHelpDiagnostics(scope).Get(diagnosticsResourceName, cancellationToken); + return GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiagnostic(scope, diagnosticsResourceName, cancellationToken); } /// @@ -123,6 +109,10 @@ public static Response GetSelfHelpDiagnostic(this Ar /// Diagnostics_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -130,7 +120,7 @@ public static Response GetSelfHelpDiagnostic(this Ar /// The cancellation token to use. public static async Task> CheckSelfHelpNameAvailabilityAsync(this ArmClient client, ResourceIdentifier scope, SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).CheckSelfHelpNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetSelfHelpArmClientMockingExtension(client).CheckSelfHelpNameAvailabilityAsync(scope, content, cancellationToken).ConfigureAwait(false); } /// @@ -145,6 +135,10 @@ public static async Task> CheckSelfHelp /// Diagnostics_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -152,7 +146,7 @@ public static async Task> CheckSelfHelp /// The cancellation token to use. public static Response CheckSelfHelpNameAvailability(this ArmClient client, ResourceIdentifier scope, SelfHelpNameAvailabilityContent content = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).CheckSelfHelpNameAvailability(content, cancellationToken); + return GetSelfHelpArmClientMockingExtension(client).CheckSelfHelpNameAvailability(scope, content, cancellationToken); } /// @@ -167,6 +161,10 @@ public static Response CheckSelfHelpNameAvailabi /// DiscoverySolution_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -175,7 +173,7 @@ public static Response CheckSelfHelpNameAvailabi /// The cancellation token to use. public static AsyncPageable GetSelfHelpDiscoverySolutionsAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetSelfHelpDiscoverySolutionsAsync(filter, skiptoken, cancellationToken); + return GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiscoverySolutionsAsync(scope, filter, skiptoken, cancellationToken); } /// @@ -190,6 +188,10 @@ public static AsyncPageable GetSelfHelpDiscoverySoluti /// DiscoverySolution_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -198,7 +200,23 @@ public static AsyncPageable GetSelfHelpDiscoverySoluti /// The cancellation token to use. public static Pageable GetSelfHelpDiscoverySolutions(this ArmClient client, ResourceIdentifier scope, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetSelfHelpDiscoverySolutions(filter, skiptoken, cancellationToken); + return GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiscoverySolutions(scope, filter, skiptoken, 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. + /// Returns a object. + public static SelfHelpDiagnosticResource GetSelfHelpDiagnosticResource(this ArmClient client, ResourceIdentifier id) + { + return GetSelfHelpArmClientMockingExtension(client).GetSelfHelpDiagnosticResource(id); } } } diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6652f51f2486..000000000000 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceBus -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ServiceBusNamespaceResources in the ResourceGroupResource. - /// An object representing collection of ServiceBusNamespaceResources and their operations over a ServiceBusNamespaceResource. - public virtual ServiceBusNamespaceCollection GetServiceBusNamespaces() - { - return GetCachedClient(Client => new ServiceBusNamespaceCollection(Client, Id)); - } - } -} diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusArmClientMockingExtension.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusArmClientMockingExtension.cs new file mode 100644 index 000000000000..ef5159feede7 --- /dev/null +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusArmClientMockingExtension.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceBus; + +namespace Azure.ResourceManager.ServiceBus.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ServiceBusArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceBusArmClientMockingExtension() + { + } + + /// 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 ServiceBusArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ServiceBusArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServiceBusNamespaceResource GetServiceBusNamespaceResource(ResourceIdentifier id) + { + ServiceBusNamespaceResource.ValidateResourceId(id); + return new ServiceBusNamespaceResource(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 ServiceBusNetworkRuleSetResource GetServiceBusNetworkRuleSetResource(ResourceIdentifier id) + { + ServiceBusNetworkRuleSetResource.ValidateResourceId(id); + return new ServiceBusNetworkRuleSetResource(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 ServiceBusPrivateEndpointConnectionResource GetServiceBusPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ServiceBusPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ServiceBusPrivateEndpointConnectionResource(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 ServiceBusDisasterRecoveryResource GetServiceBusDisasterRecoveryResource(ResourceIdentifier id) + { + ServiceBusDisasterRecoveryResource.ValidateResourceId(id); + return new ServiceBusDisasterRecoveryResource(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 MigrationConfigurationResource GetMigrationConfigurationResource(ResourceIdentifier id) + { + MigrationConfigurationResource.ValidateResourceId(id); + return new MigrationConfigurationResource(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 ServiceBusNamespaceAuthorizationRuleResource GetServiceBusNamespaceAuthorizationRuleResource(ResourceIdentifier id) + { + ServiceBusNamespaceAuthorizationRuleResource.ValidateResourceId(id); + return new ServiceBusNamespaceAuthorizationRuleResource(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 ServiceBusQueueAuthorizationRuleResource GetServiceBusQueueAuthorizationRuleResource(ResourceIdentifier id) + { + ServiceBusQueueAuthorizationRuleResource.ValidateResourceId(id); + return new ServiceBusQueueAuthorizationRuleResource(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 ServiceBusTopicAuthorizationRuleResource GetServiceBusTopicAuthorizationRuleResource(ResourceIdentifier id) + { + ServiceBusTopicAuthorizationRuleResource.ValidateResourceId(id); + return new ServiceBusTopicAuthorizationRuleResource(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 ServiceBusDisasterRecoveryAuthorizationRuleResource GetServiceBusDisasterRecoveryAuthorizationRuleResource(ResourceIdentifier id) + { + ServiceBusDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); + return new ServiceBusDisasterRecoveryAuthorizationRuleResource(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 ServiceBusQueueResource GetServiceBusQueueResource(ResourceIdentifier id) + { + ServiceBusQueueResource.ValidateResourceId(id); + return new ServiceBusQueueResource(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 ServiceBusTopicResource GetServiceBusTopicResource(ResourceIdentifier id) + { + ServiceBusTopicResource.ValidateResourceId(id); + return new ServiceBusTopicResource(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 ServiceBusRuleResource GetServiceBusRuleResource(ResourceIdentifier id) + { + ServiceBusRuleResource.ValidateResourceId(id); + return new ServiceBusRuleResource(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 ServiceBusSubscriptionResource GetServiceBusSubscriptionResource(ResourceIdentifier id) + { + ServiceBusSubscriptionResource.ValidateResourceId(id); + return new ServiceBusSubscriptionResource(Client, id); + } + } +} diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusExtensions.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusExtensions.cs index fef5f9ebf64b..c3fd6cda3658 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusExtensions.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceBus.Mocking; using Azure.ResourceManager.ServiceBus.Models; namespace Azure.ResourceManager.ServiceBus @@ -19,290 +20,241 @@ namespace Azure.ResourceManager.ServiceBus /// A class to add extension methods to Azure.ResourceManager.ServiceBus. public static partial class ServiceBusExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ServiceBusArmClientMockingExtension GetServiceBusArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ServiceBusArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ServiceBusResourceGroupMockingExtension GetServiceBusResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ServiceBusResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ServiceBusSubscriptionMockingExtension GetServiceBusSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ServiceBusSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ServiceBusNamespaceResource /// /// 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. /// Returns a object. public static ServiceBusNamespaceResource GetServiceBusNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusNamespaceResource.ValidateResourceId(id); - return new ServiceBusNamespaceResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusNamespaceResource(id); } - #endregion - #region ServiceBusNetworkRuleSetResource /// /// 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. /// Returns a object. public static ServiceBusNetworkRuleSetResource GetServiceBusNetworkRuleSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusNetworkRuleSetResource.ValidateResourceId(id); - return new ServiceBusNetworkRuleSetResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusNetworkRuleSetResource(id); } - #endregion - #region ServiceBusPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ServiceBusPrivateEndpointConnectionResource GetServiceBusPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ServiceBusPrivateEndpointConnectionResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusPrivateEndpointConnectionResource(id); } - #endregion - #region ServiceBusDisasterRecoveryResource /// /// 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. /// Returns a object. public static ServiceBusDisasterRecoveryResource GetServiceBusDisasterRecoveryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusDisasterRecoveryResource.ValidateResourceId(id); - return new ServiceBusDisasterRecoveryResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusDisasterRecoveryResource(id); } - #endregion - #region MigrationConfigurationResource /// /// 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. /// Returns a object. public static MigrationConfigurationResource GetMigrationConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MigrationConfigurationResource.ValidateResourceId(id); - return new MigrationConfigurationResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetMigrationConfigurationResource(id); } - #endregion - #region ServiceBusNamespaceAuthorizationRuleResource /// /// 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. /// Returns a object. public static ServiceBusNamespaceAuthorizationRuleResource GetServiceBusNamespaceAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusNamespaceAuthorizationRuleResource.ValidateResourceId(id); - return new ServiceBusNamespaceAuthorizationRuleResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusNamespaceAuthorizationRuleResource(id); } - #endregion - #region ServiceBusQueueAuthorizationRuleResource /// /// 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. /// Returns a object. public static ServiceBusQueueAuthorizationRuleResource GetServiceBusQueueAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusQueueAuthorizationRuleResource.ValidateResourceId(id); - return new ServiceBusQueueAuthorizationRuleResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusQueueAuthorizationRuleResource(id); } - #endregion - #region ServiceBusTopicAuthorizationRuleResource /// /// 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. /// Returns a object. public static ServiceBusTopicAuthorizationRuleResource GetServiceBusTopicAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusTopicAuthorizationRuleResource.ValidateResourceId(id); - return new ServiceBusTopicAuthorizationRuleResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusTopicAuthorizationRuleResource(id); } - #endregion - #region ServiceBusDisasterRecoveryAuthorizationRuleResource /// /// 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. /// Returns a object. public static ServiceBusDisasterRecoveryAuthorizationRuleResource GetServiceBusDisasterRecoveryAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); - return new ServiceBusDisasterRecoveryAuthorizationRuleResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusDisasterRecoveryAuthorizationRuleResource(id); } - #endregion - #region ServiceBusQueueResource /// /// 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. /// Returns a object. public static ServiceBusQueueResource GetServiceBusQueueResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusQueueResource.ValidateResourceId(id); - return new ServiceBusQueueResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusQueueResource(id); } - #endregion - #region ServiceBusTopicResource /// /// 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. /// Returns a object. public static ServiceBusTopicResource GetServiceBusTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusTopicResource.ValidateResourceId(id); - return new ServiceBusTopicResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusTopicResource(id); } - #endregion - #region ServiceBusRuleResource /// /// 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. /// Returns a object. public static ServiceBusRuleResource GetServiceBusRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusRuleResource.ValidateResourceId(id); - return new ServiceBusRuleResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusRuleResource(id); } - #endregion - #region ServiceBusSubscriptionResource /// /// 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. /// Returns a object. public static ServiceBusSubscriptionResource GetServiceBusSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceBusSubscriptionResource.ValidateResourceId(id); - return new ServiceBusSubscriptionResource(client, id); - } - ); + return GetServiceBusArmClientMockingExtension(client).GetServiceBusSubscriptionResource(id); } - #endregion - /// Gets a collection of ServiceBusNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of ServiceBusNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceBusNamespaceResources and their operations over a ServiceBusNamespaceResource. public static ServiceBusNamespaceCollection GetServiceBusNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetServiceBusNamespaces(); + return GetServiceBusResourceGroupMockingExtension(resourceGroupResource).GetServiceBusNamespaces(); } /// @@ -317,16 +269,20 @@ public static ServiceBusNamespaceCollection GetServiceBusNamespaces(this Resourc /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static async Task> GetServiceBusNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetServiceBusNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetServiceBusResourceGroupMockingExtension(resourceGroupResource).GetServiceBusNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -341,16 +297,20 @@ public static async Task> GetServiceBusNam /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The namespace name. /// The cancellation token to use. - /// 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 static Response GetServiceBusNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetServiceBusNamespaces().Get(namespaceName, cancellationToken); + return GetServiceBusResourceGroupMockingExtension(resourceGroupResource).GetServiceBusNamespace(namespaceName, cancellationToken); } /// @@ -365,13 +325,17 @@ public static Response GetServiceBusNamespace(this /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetServiceBusNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceBusNamespacesAsync(cancellationToken); + return GetServiceBusSubscriptionMockingExtension(subscriptionResource).GetServiceBusNamespacesAsync(cancellationToken); } /// @@ -386,13 +350,17 @@ public static AsyncPageable GetServiceBusNamespaces /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetServiceBusNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceBusNamespaces(cancellationToken); + return GetServiceBusSubscriptionMockingExtension(subscriptionResource).GetServiceBusNamespaces(cancellationToken); } /// @@ -407,6 +375,10 @@ public static Pageable GetServiceBusNamespaces(this /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the given namespace name. @@ -414,9 +386,7 @@ public static Pageable GetServiceBusNamespaces(this /// is null. public static async Task> CheckServiceBusNamespaceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ServiceBusNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckServiceBusNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetServiceBusSubscriptionMockingExtension(subscriptionResource).CheckServiceBusNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -431,6 +401,10 @@ public static async Task> CheckServic /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the given namespace name. @@ -438,9 +412,7 @@ public static async Task> CheckServic /// is null. public static Response CheckServiceBusNamespaceNameAvailability(this SubscriptionResource subscriptionResource, ServiceBusNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckServiceBusNamespaceNameAvailability(content, cancellationToken); + return GetServiceBusSubscriptionMockingExtension(subscriptionResource).CheckServiceBusNamespaceNameAvailability(content, cancellationToken); } } } diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusResourceGroupMockingExtension.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..65e9497fc559 --- /dev/null +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceBus; + +namespace Azure.ResourceManager.ServiceBus.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ServiceBusResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceBusResourceGroupMockingExtension() + { + } + + /// 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 ServiceBusResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ServiceBusNamespaceResources in the ResourceGroupResource. + /// An object representing collection of ServiceBusNamespaceResources and their operations over a ServiceBusNamespaceResource. + public virtual ServiceBusNamespaceCollection GetServiceBusNamespaces() + { + return GetCachedClient(client => new ServiceBusNamespaceCollection(client, Id)); + } + + /// + /// Gets a description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceBusNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + { + return await GetServiceBusNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a description for the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceBusNamespace(string namespaceName, CancellationToken cancellationToken = default) + { + return GetServiceBusNamespaces().Get(namespaceName, cancellationToken); + } + } +} diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusSubscriptionMockingExtension.cs similarity index 85% rename from sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusSubscriptionMockingExtension.cs index d1e70e9f81de..6aa48ad9a99c 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/Extensions/ServiceBusSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ServiceBus; using Azure.ResourceManager.ServiceBus.Models; -namespace Azure.ResourceManager.ServiceBus +namespace Azure.ResourceManager.ServiceBus.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ServiceBusSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _serviceBusNamespaceNamespacesClientDiagnostics; private NamespacesRestOperations _serviceBusNamespaceNamespacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ServiceBusSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ServiceBusSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetServiceBusNamespace { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceBusNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceBusNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceBusNamespaceResource(Client, ServiceBusNamespaceData.DeserializeServiceBusNamespaceData(e)), ServiceBusNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceBusNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceBusNamespaceResource(Client, ServiceBusNamespaceData.DeserializeServiceBusNamespaceData(e)), ServiceBusNamespaceNamespacesClientDiagnostics, Pipeline, "ServiceBusSubscriptionMockingExtension.GetServiceBusNamespaces", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetServiceBusNamespaces(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceBusNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceBusNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceBusNamespaceResource(Client, ServiceBusNamespaceData.DeserializeServiceBusNamespaceData(e)), ServiceBusNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceBusNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceBusNamespaceResource(Client, ServiceBusNamespaceData.DeserializeServiceBusNamespaceData(e)), ServiceBusNamespaceNamespacesClientDiagnostics, Pipeline, "ServiceBusSubscriptionMockingExtension.GetServiceBusNamespaces", "value", "nextLink", cancellationToken); } /// @@ -103,9 +104,12 @@ public virtual Pageable GetServiceBusNamespaces(Can /// /// Parameters to check availability of the given namespace name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckServiceBusNamespaceNameAvailabilityAsync(ServiceBusNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceBusNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckServiceBusNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceBusNamespaceNamespacesClientDiagnostics.CreateScope("ServiceBusSubscriptionMockingExtension.CheckServiceBusNamespaceNameAvailability"); scope.Start(); try { @@ -134,9 +138,12 @@ public virtual async Task> CheckServi /// /// Parameters to check availability of the given namespace name. /// The cancellation token to use. + /// is null. public virtual Response CheckServiceBusNamespaceNameAvailability(ServiceBusNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceBusNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckServiceBusNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceBusNamespaceNamespacesClientDiagnostics.CreateScope("ServiceBusSubscriptionMockingExtension.CheckServiceBusNamespaceNameAvailability"); scope.Start(); try { diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusDisasterRecoveryResource.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusDisasterRecoveryResource.cs index 72ab87823819..ee85b4560d69 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusDisasterRecoveryResource.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusDisasterRecoveryResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceBusDisasterRecoveryAuthorizationRuleResources and their operations over a ServiceBusDisasterRecoveryAuthorizationRuleResource. public virtual ServiceBusDisasterRecoveryAuthorizationRuleCollection GetServiceBusDisasterRecoveryAuthorizationRules() { - return GetCachedClient(Client => new ServiceBusDisasterRecoveryAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusDisasterRecoveryAuthorizationRuleCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ServiceBusDisasterRecoveryAuthorizationRuleCollection GetServiceB /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetServiceBusDisasterRecoveryAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task /// The authorization rule name. /// The cancellation token to use. - /// 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 GetServiceBusDisasterRecoveryAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusNamespaceResource.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusNamespaceResource.cs index 6d75e151295f..4bbcf3a831b4 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusNamespaceResource.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusNamespaceResource.cs @@ -110,7 +110,7 @@ public virtual ServiceBusNetworkRuleSetResource GetServiceBusNetworkRuleSet() /// An object representing collection of ServiceBusPrivateEndpointConnectionResources and their operations over a ServiceBusPrivateEndpointConnectionResource. public virtual ServiceBusPrivateEndpointConnectionCollection GetServiceBusPrivateEndpointConnections() { - return GetCachedClient(Client => new ServiceBusPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusPrivateEndpointConnectionCollection(client, Id)); } /// @@ -128,8 +128,8 @@ public virtual ServiceBusPrivateEndpointConnectionCollection GetServiceBusPrivat /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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> GetServiceBusPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task> /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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 GetServiceBusPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -163,7 +163,7 @@ public virtual Response GetServiceB /// An object representing collection of ServiceBusDisasterRecoveryResources and their operations over a ServiceBusDisasterRecoveryResource. public virtual ServiceBusDisasterRecoveryCollection GetServiceBusDisasterRecoveries() { - return GetCachedClient(Client => new ServiceBusDisasterRecoveryCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusDisasterRecoveryCollection(client, Id)); } /// @@ -181,12 +181,12 @@ public virtual ServiceBusDisasterRecoveryCollection GetServiceBusDisasterRecover /// /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// 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> GetServiceBusDisasterRecoveryAsync(string @alias, CancellationToken cancellationToken = default) { - return await GetServiceBusDisasterRecoveries().GetAsync(alias, cancellationToken).ConfigureAwait(false); + return await GetServiceBusDisasterRecoveries().GetAsync(@alias, cancellationToken).ConfigureAwait(false); } /// @@ -204,19 +204,19 @@ public virtual async Task> GetServi /// /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// 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 GetServiceBusDisasterRecovery(string @alias, CancellationToken cancellationToken = default) { - return GetServiceBusDisasterRecoveries().Get(alias, cancellationToken); + return GetServiceBusDisasterRecoveries().Get(@alias, cancellationToken); } /// Gets a collection of MigrationConfigurationResources in the ServiceBusNamespace. /// An object representing collection of MigrationConfigurationResources and their operations over a MigrationConfigurationResource. public virtual MigrationConfigurationCollection GetMigrationConfigurations() { - return GetCachedClient(Client => new MigrationConfigurationCollection(Client, Id)); + return GetCachedClient(client => new MigrationConfigurationCollection(client, Id)); } /// @@ -265,7 +265,7 @@ public virtual Response GetMigrationConfiguratio /// An object representing collection of ServiceBusNamespaceAuthorizationRuleResources and their operations over a ServiceBusNamespaceAuthorizationRuleResource. public virtual ServiceBusNamespaceAuthorizationRuleCollection GetServiceBusNamespaceAuthorizationRules() { - return GetCachedClient(Client => new ServiceBusNamespaceAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusNamespaceAuthorizationRuleCollection(client, Id)); } /// @@ -283,8 +283,8 @@ public virtual ServiceBusNamespaceAuthorizationRuleCollection GetServiceBusNames /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetServiceBusNamespaceAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -306,8 +306,8 @@ public virtual async Task /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetServiceBusNamespaceAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -318,7 +318,7 @@ public virtual Response GetService /// An object representing collection of ServiceBusQueueResources and their operations over a ServiceBusQueueResource. public virtual ServiceBusQueueCollection GetServiceBusQueues() { - return GetCachedClient(Client => new ServiceBusQueueCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusQueueCollection(client, Id)); } /// @@ -336,8 +336,8 @@ public virtual ServiceBusQueueCollection GetServiceBusQueues() /// /// The queue name. /// The cancellation token to use. - /// 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> GetServiceBusQueueAsync(string queueName, CancellationToken cancellationToken = default) { @@ -359,8 +359,8 @@ public virtual async Task> GetServiceBusQueueA /// /// The queue name. /// The cancellation token to use. - /// 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 GetServiceBusQueue(string queueName, CancellationToken cancellationToken = default) { @@ -371,7 +371,7 @@ public virtual Response GetServiceBusQueue(string queue /// An object representing collection of ServiceBusTopicResources and their operations over a ServiceBusTopicResource. public virtual ServiceBusTopicCollection GetServiceBusTopics() { - return GetCachedClient(Client => new ServiceBusTopicCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusTopicCollection(client, Id)); } /// @@ -389,8 +389,8 @@ public virtual ServiceBusTopicCollection GetServiceBusTopics() /// /// The topic name. /// The cancellation token to use. - /// 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> GetServiceBusTopicAsync(string topicName, CancellationToken cancellationToken = default) { @@ -412,8 +412,8 @@ public virtual async Task> GetServiceBusTopicA /// /// The topic name. /// The cancellation token to use. - /// 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 GetServiceBusTopic(string topicName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusQueueResource.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusQueueResource.cs index 8163b51ca37c..80ff3b29271f 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusQueueResource.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusQueueResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceBusQueueAuthorizationRuleResources and their operations over a ServiceBusQueueAuthorizationRuleResource. public virtual ServiceBusQueueAuthorizationRuleCollection GetServiceBusQueueAuthorizationRules() { - return GetCachedClient(Client => new ServiceBusQueueAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusQueueAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ServiceBusQueueAuthorizationRuleCollection GetServiceBusQueueAuth /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetServiceBusQueueAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> Ge /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetServiceBusQueueAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusSubscriptionResource.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusSubscriptionResource.cs index fa61339166d8..2c1262e02481 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusSubscriptionResource.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusSubscriptionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceBusRuleResources and their operations over a ServiceBusRuleResource. public virtual ServiceBusRuleCollection GetServiceBusRules() { - return GetCachedClient(Client => new ServiceBusRuleCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ServiceBusRuleCollection GetServiceBusRules() /// /// The rule name. /// The cancellation token to use. - /// 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> GetServiceBusRuleAsync(string ruleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetServiceBusRuleAsy /// /// The rule name. /// The cancellation token to use. - /// 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 GetServiceBusRule(string ruleName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusTopicResource.cs b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusTopicResource.cs index fd951cfd0708..af190a9e4c86 100644 --- a/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusTopicResource.cs +++ b/sdk/servicebus/Azure.ResourceManager.ServiceBus/src/Generated/ServiceBusTopicResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceBusTopicAuthorizationRuleResources and their operations over a ServiceBusTopicAuthorizationRuleResource. public virtual ServiceBusTopicAuthorizationRuleCollection GetServiceBusTopicAuthorizationRules() { - return GetCachedClient(Client => new ServiceBusTopicAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusTopicAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ServiceBusTopicAuthorizationRuleCollection GetServiceBusTopicAuth /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetServiceBusTopicAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> Ge /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetServiceBusTopicAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetServiceBusT /// An object representing collection of ServiceBusSubscriptionResources and their operations over a ServiceBusSubscriptionResource. public virtual ServiceBusSubscriptionCollection GetServiceBusSubscriptions() { - return GetCachedClient(Client => new ServiceBusSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new ServiceBusSubscriptionCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual ServiceBusSubscriptionCollection GetServiceBusSubscriptions() /// /// The subscription name. /// The cancellation token to use. - /// 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> GetServiceBusSubscriptionAsync(string subscriptionName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> GetServiceBu /// /// The subscription name. /// The cancellation token to use. - /// 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 GetServiceBusSubscription(string subscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 28ce17f04db2..000000000000 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceFabric -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ServiceFabricClusterResources in the ResourceGroupResource. - /// An object representing collection of ServiceFabricClusterResources and their operations over a ServiceFabricClusterResource. - public virtual ServiceFabricClusterCollection GetServiceFabricClusters() - { - return GetCachedClient(Client => new ServiceFabricClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricArmClientMockingExtension.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricArmClientMockingExtension.cs new file mode 100644 index 000000000000..d34ce06ff41c --- /dev/null +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabric; + +namespace Azure.ResourceManager.ServiceFabric.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ServiceFabricArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceFabricArmClientMockingExtension() + { + } + + /// 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 ServiceFabricArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ServiceFabricArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServiceFabricClusterResource GetServiceFabricClusterResource(ResourceIdentifier id) + { + ServiceFabricClusterResource.ValidateResourceId(id); + return new ServiceFabricClusterResource(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 ServiceFabricApplicationTypeResource GetServiceFabricApplicationTypeResource(ResourceIdentifier id) + { + ServiceFabricApplicationTypeResource.ValidateResourceId(id); + return new ServiceFabricApplicationTypeResource(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 ServiceFabricApplicationTypeVersionResource GetServiceFabricApplicationTypeVersionResource(ResourceIdentifier id) + { + ServiceFabricApplicationTypeVersionResource.ValidateResourceId(id); + return new ServiceFabricApplicationTypeVersionResource(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 ServiceFabricApplicationResource GetServiceFabricApplicationResource(ResourceIdentifier id) + { + ServiceFabricApplicationResource.ValidateResourceId(id); + return new ServiceFabricApplicationResource(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 ServiceFabricServiceResource GetServiceFabricServiceResource(ResourceIdentifier id) + { + ServiceFabricServiceResource.ValidateResourceId(id); + return new ServiceFabricServiceResource(Client, id); + } + } +} diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricExtensions.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricExtensions.cs index bb1b205f68c4..3b42a247f4a6 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricExtensions.cs +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceFabric.Mocking; using Azure.ResourceManager.ServiceFabric.Models; namespace Azure.ResourceManager.ServiceFabric @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.ServiceFabric /// A class to add extension methods to Azure.ResourceManager.ServiceFabric. public static partial class ServiceFabricExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ServiceFabricArmClientMockingExtension GetServiceFabricArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ServiceFabricArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ServiceFabricResourceGroupMockingExtension GetServiceFabricResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ServiceFabricResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ServiceFabricSubscriptionMockingExtension GetServiceFabricSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ServiceFabricSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ServiceFabricClusterResource /// /// 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. /// Returns a object. public static ServiceFabricClusterResource GetServiceFabricClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricClusterResource.ValidateResourceId(id); - return new ServiceFabricClusterResource(client, id); - } - ); + return GetServiceFabricArmClientMockingExtension(client).GetServiceFabricClusterResource(id); } - #endregion - #region ServiceFabricApplicationTypeResource /// /// 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. /// Returns a object. public static ServiceFabricApplicationTypeResource GetServiceFabricApplicationTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricApplicationTypeResource.ValidateResourceId(id); - return new ServiceFabricApplicationTypeResource(client, id); - } - ); + return GetServiceFabricArmClientMockingExtension(client).GetServiceFabricApplicationTypeResource(id); } - #endregion - #region ServiceFabricApplicationTypeVersionResource /// /// 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. /// Returns a object. public static ServiceFabricApplicationTypeVersionResource GetServiceFabricApplicationTypeVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricApplicationTypeVersionResource.ValidateResourceId(id); - return new ServiceFabricApplicationTypeVersionResource(client, id); - } - ); + return GetServiceFabricArmClientMockingExtension(client).GetServiceFabricApplicationTypeVersionResource(id); } - #endregion - #region ServiceFabricApplicationResource /// /// 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. /// Returns a object. public static ServiceFabricApplicationResource GetServiceFabricApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricApplicationResource.ValidateResourceId(id); - return new ServiceFabricApplicationResource(client, id); - } - ); + return GetServiceFabricArmClientMockingExtension(client).GetServiceFabricApplicationResource(id); } - #endregion - #region ServiceFabricServiceResource /// /// 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. /// Returns a object. public static ServiceFabricServiceResource GetServiceFabricServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricServiceResource.ValidateResourceId(id); - return new ServiceFabricServiceResource(client, id); - } - ); + return GetServiceFabricArmClientMockingExtension(client).GetServiceFabricServiceResource(id); } - #endregion - /// Gets a collection of ServiceFabricClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of ServiceFabricClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceFabricClusterResources and their operations over a ServiceFabricClusterResource. public static ServiceFabricClusterCollection GetServiceFabricClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetServiceFabricClusters(); + return GetServiceFabricResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricClusters(); } /// @@ -165,16 +141,20 @@ public static ServiceFabricClusterCollection GetServiceFabricClusters(this Resou /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster resource. /// The cancellation token to use. - /// 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 static async Task> GetServiceFabricClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetServiceFabricClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetServiceFabri /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster resource. /// The cancellation token to use. - /// 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 static Response GetServiceFabricCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetServiceFabricClusters().Get(clusterName, cancellationToken); + return GetServiceFabricResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricCluster(clusterName, cancellationToken); } /// @@ -213,13 +197,17 @@ public static Response GetServiceFabricCluster(thi /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetServiceFabricClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceFabricClustersAsync(cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetServiceFabricClustersAsync(cancellationToken); } /// @@ -234,13 +222,17 @@ public static AsyncPageable GetServiceFabricCluste /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetServiceFabricClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceFabricClusters(cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetServiceFabricClusters(cancellationToken); } /// @@ -255,6 +247,10 @@ public static Pageable GetServiceFabricClusters(th /// ClusterVersions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -265,9 +261,7 @@ public static Pageable GetServiceFabricClusters(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetClusterVersionsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsAsync(location, clusterVersion, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsAsync(location, clusterVersion, cancellationToken); } /// @@ -282,6 +276,10 @@ public static AsyncPageable GetClusterVersionsAsync(t /// ClusterVersions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -292,9 +290,7 @@ public static AsyncPageable GetClusterVersionsAsync(t /// A collection of that may take multiple service requests to iterate over. public static Pageable GetClusterVersions(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersions(location, clusterVersion, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersions(location, clusterVersion, cancellationToken); } /// @@ -309,6 +305,10 @@ public static Pageable GetClusterVersions(this Subscr /// ClusterVersions_GetByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -320,9 +320,7 @@ public static Pageable GetClusterVersions(this Subscr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetClusterVersionsByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ClusterVersionsEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsByEnvironmentAsync(location, environment, clusterVersion, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsByEnvironmentAsync(location, environment, clusterVersion, cancellationToken); } /// @@ -337,6 +335,10 @@ public static AsyncPageable GetClusterVersionsByEnvir /// ClusterVersions_GetByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -348,9 +350,7 @@ public static AsyncPageable GetClusterVersionsByEnvir /// A collection of that may take multiple service requests to iterate over. public static Pageable GetClusterVersionsByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ClusterVersionsEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsByEnvironment(location, environment, clusterVersion, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsByEnvironment(location, environment, clusterVersion, cancellationToken); } /// @@ -365,6 +365,10 @@ public static Pageable GetClusterVersionsByEnvironmen /// ClusterVersions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -372,7 +376,7 @@ public static Pageable GetClusterVersionsByEnvironmen /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetClusterVersionsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsAsync(location, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsAsync(location, cancellationToken); } /// @@ -387,6 +391,10 @@ public static AsyncPageable GetClusterVersionsAsync(t /// ClusterVersions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -394,7 +402,7 @@ public static AsyncPageable GetClusterVersionsAsync(t /// A collection of that may take multiple service requests to iterate over. public static Pageable GetClusterVersions(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersions(location, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersions(location, cancellationToken); } /// @@ -409,6 +417,10 @@ public static Pageable GetClusterVersions(this Subscr /// ClusterVersions_ListByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -417,7 +429,7 @@ public static Pageable GetClusterVersions(this Subscr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetClusterVersionsByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ClusterVersionsEnvironment environment, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); } /// @@ -432,6 +444,10 @@ public static AsyncPageable GetClusterVersionsByEnvir /// ClusterVersions_ListByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -440,7 +456,7 @@ public static AsyncPageable GetClusterVersionsByEnvir /// A collection of that may take multiple service requests to iterate over. public static Pageable GetClusterVersionsByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ClusterVersionsEnvironment environment, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetClusterVersionsByEnvironment(location, environment, cancellationToken); + return GetServiceFabricSubscriptionMockingExtension(subscriptionResource).GetClusterVersionsByEnvironment(location, environment, cancellationToken); } } } diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricResourceGroupMockingExtension.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..b269b39db537 --- /dev/null +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabric; + +namespace Azure.ResourceManager.ServiceFabric.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ServiceFabricResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceFabricResourceGroupMockingExtension() + { + } + + /// 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 ServiceFabricResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ServiceFabricClusterResources in the ResourceGroupResource. + /// An object representing collection of ServiceFabricClusterResources and their operations over a ServiceFabricClusterResource. + public virtual ServiceFabricClusterCollection GetServiceFabricClusters() + { + return GetCachedClient(client => new ServiceFabricClusterCollection(client, Id)); + } + + /// + /// Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceFabricClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetServiceFabricClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceFabricCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetServiceFabricClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricSubscriptionMockingExtension.cs similarity index 85% rename from sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricSubscriptionMockingExtension.cs index 34822c3d9aac..c3d5b6cedada 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/Extensions/ServiceFabricSubscriptionMockingExtension.cs @@ -5,33 +5,35 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabric; using Azure.ResourceManager.ServiceFabric.Models; -namespace Azure.ResourceManager.ServiceFabric +namespace Azure.ResourceManager.ServiceFabric.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ServiceFabricSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _serviceFabricClusterClustersClientDiagnostics; private ClustersRestOperations _serviceFabricClusterClustersRestClient; private ClientDiagnostics _clusterVersionsClientDiagnostics; private ClusterVersionsRestOperations _clusterVersionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ServiceFabricSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ServiceFabricSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,7 +66,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetServiceFabricClustersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ServiceFabricClusterResource(Client, ServiceFabricClusterData.DeserializeServiceFabricClusterData(e)), ServiceFabricClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceFabricClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ServiceFabricClusterResource(Client, ServiceFabricClusterData.DeserializeServiceFabricClusterData(e)), ServiceFabricClusterClustersClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetServiceFabricClusters", "value", null, cancellationToken); } /// @@ -85,7 +87,7 @@ public virtual AsyncPageable GetServiceFabricClust public virtual Pageable GetServiceFabricClusters(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ServiceFabricClusterResource(Client, ServiceFabricClusterData.DeserializeServiceFabricClusterData(e)), ServiceFabricClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceFabricClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ServiceFabricClusterResource(Client, ServiceFabricClusterData.DeserializeServiceFabricClusterData(e)), ServiceFabricClusterClustersClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetServiceFabricClusters", "value", null, cancellationToken); } /// @@ -104,11 +106,15 @@ public virtual Pageable GetServiceFabricClusters(C /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetClusterVersionsAsync(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateGetRequest(Id.SubscriptionId, location, clusterVersion); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersions", "value", null, cancellationToken); } /// @@ -127,11 +133,15 @@ public virtual AsyncPageable GetClusterVersionsAsync( /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetClusterVersions(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateGetRequest(Id.SubscriptionId, location, clusterVersion); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersions", "value", null, cancellationToken); } /// @@ -151,11 +161,15 @@ public virtual Pageable GetClusterVersions(AzureLocat /// The operating system of the cluster. The default means all. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetClusterVersionsByEnvironmentAsync(AzureLocation location, ClusterVersionsEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateGetByEnvironmentRequest(Id.SubscriptionId, location, environment, clusterVersion); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersionsByEnvironment", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersionsByEnvironment", "value", null, cancellationToken); } /// @@ -175,11 +189,15 @@ public virtual AsyncPageable GetClusterVersionsByEnvi /// The operating system of the cluster. The default means all. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetClusterVersionsByEnvironment(AzureLocation location, ClusterVersionsEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateGetByEnvironmentRequest(Id.SubscriptionId, location, environment, clusterVersion); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersionsByEnvironment", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersionsByEnvironment", "value", null, cancellationToken); } /// @@ -201,7 +219,7 @@ public virtual Pageable GetClusterVersionsByEnvironme public virtual AsyncPageable GetClusterVersionsAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersions", "value", null, cancellationToken); } /// @@ -223,7 +241,7 @@ public virtual AsyncPageable GetClusterVersionsAsync( public virtual Pageable GetClusterVersions(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersions", "value", null, cancellationToken); } /// @@ -246,7 +264,7 @@ public virtual Pageable GetClusterVersions(AzureLocat public virtual AsyncPageable GetClusterVersionsByEnvironmentAsync(AzureLocation location, ClusterVersionsEnvironment environment, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersionsByEnvironment", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersionsByEnvironment", "value", null, cancellationToken); } /// @@ -269,7 +287,7 @@ public virtual AsyncPageable GetClusterVersionsByEnvi public virtual Pageable GetClusterVersionsByEnvironment(AzureLocation location, ClusterVersionsEnvironment environment, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ClusterVersionsRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetClusterVersionsByEnvironment", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ClusterCodeVersionsResult.DeserializeClusterCodeVersionsResult, ClusterVersionsClientDiagnostics, Pipeline, "ServiceFabricSubscriptionMockingExtension.GetClusterVersionsByEnvironment", "value", null, cancellationToken); } } } diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationResource.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationResource.cs index a3c166e993ba..7d4ced4a4e55 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationResource.cs +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricServiceResources and their operations over a ServiceFabricServiceResource. public virtual ServiceFabricServiceCollection GetServiceFabricServices() { - return GetCachedClient(Client => new ServiceFabricServiceCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricServiceCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ServiceFabricServiceCollection GetServiceFabricServices() /// /// The name of the service resource in the format of {applicationName}~{serviceName}. /// The cancellation token to use. - /// 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> GetServiceFabricServiceAsync(string serviceName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetServiceFabr /// /// The name of the service resource in the format of {applicationName}~{serviceName}. /// The cancellation token to use. - /// 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 GetServiceFabricService(string serviceName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationTypeResource.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationTypeResource.cs index f085f49c2ac1..53c0c2b62bdd 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationTypeResource.cs +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricApplicationTypeResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricApplicationTypeVersionResources and their operations over a ServiceFabricApplicationTypeVersionResource. public virtual ServiceFabricApplicationTypeVersionCollection GetServiceFabricApplicationTypeVersions() { - return GetCachedClient(Client => new ServiceFabricApplicationTypeVersionCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricApplicationTypeVersionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ServiceFabricApplicationTypeVersionCollection GetServiceFabricApp /// /// The application type version. /// The cancellation token to use. - /// 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> GetServiceFabricApplicationTypeVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> /// /// The application type version. /// The cancellation token to use. - /// 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 GetServiceFabricApplicationTypeVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricClusterResource.cs b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricClusterResource.cs index df7de23164ac..16dc09bb8c8b 100644 --- a/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricClusterResource.cs +++ b/sdk/servicefabric/Azure.ResourceManager.ServiceFabric/src/Generated/ServiceFabricClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricApplicationTypeResources and their operations over a ServiceFabricApplicationTypeResource. public virtual ServiceFabricApplicationTypeCollection GetServiceFabricApplicationTypes() { - return GetCachedClient(Client => new ServiceFabricApplicationTypeCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricApplicationTypeCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ServiceFabricApplicationTypeCollection GetServiceFabricApplicatio /// /// The name of the application type name resource. /// The cancellation token to use. - /// 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> GetServiceFabricApplicationTypeAsync(string applicationTypeName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSer /// /// The name of the application type name resource. /// The cancellation token to use. - /// 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 GetServiceFabricApplicationType(string applicationTypeName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetServiceFabricAp /// An object representing collection of ServiceFabricApplicationResources and their operations over a ServiceFabricApplicationResource. public virtual ServiceFabricApplicationCollection GetServiceFabricApplications() { - return GetCachedClient(Client => new ServiceFabricApplicationCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricApplicationCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ServiceFabricApplicationCollection GetServiceFabricApplications() /// /// The name of the application resource. /// The cancellation token to use. - /// 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> GetServiceFabricApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetService /// /// The name of the application resource. /// The cancellation token to use. - /// 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 GetServiceFabricApplication(string applicationName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 31de4bc614fa..000000000000 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceFabricManagedClusters -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ServiceFabricManagedClusterResources in the ResourceGroupResource. - /// An object representing collection of ServiceFabricManagedClusterResources and their operations over a ServiceFabricManagedClusterResource. - public virtual ServiceFabricManagedClusterCollection GetServiceFabricManagedClusters() - { - return GetCachedClient(Client => new ServiceFabricManagedClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersArmClientMockingExtension.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersArmClientMockingExtension.cs new file mode 100644 index 000000000000..db8135a062c8 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabricManagedClusters; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ServiceFabricManagedClustersArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceFabricManagedClustersArmClientMockingExtension() + { + } + + /// 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 ServiceFabricManagedClustersArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ServiceFabricManagedClustersArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServiceFabricManagedApplicationTypeResource GetServiceFabricManagedApplicationTypeResource(ResourceIdentifier id) + { + ServiceFabricManagedApplicationTypeResource.ValidateResourceId(id); + return new ServiceFabricManagedApplicationTypeResource(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 ServiceFabricManagedApplicationTypeVersionResource GetServiceFabricManagedApplicationTypeVersionResource(ResourceIdentifier id) + { + ServiceFabricManagedApplicationTypeVersionResource.ValidateResourceId(id); + return new ServiceFabricManagedApplicationTypeVersionResource(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 ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(ResourceIdentifier id) + { + ServiceFabricManagedApplicationResource.ValidateResourceId(id); + return new ServiceFabricManagedApplicationResource(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 ServiceFabricManagedServiceResource GetServiceFabricManagedServiceResource(ResourceIdentifier id) + { + ServiceFabricManagedServiceResource.ValidateResourceId(id); + return new ServiceFabricManagedServiceResource(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 ServiceFabricManagedClusterResource GetServiceFabricManagedClusterResource(ResourceIdentifier id) + { + ServiceFabricManagedClusterResource.ValidateResourceId(id); + return new ServiceFabricManagedClusterResource(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 ServiceFabricManagedNodeTypeResource GetServiceFabricManagedNodeTypeResource(ResourceIdentifier id) + { + ServiceFabricManagedNodeTypeResource.ValidateResourceId(id); + return new ServiceFabricManagedNodeTypeResource(Client, id); + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs index a0e90ab9a1f7..b743568f298f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceFabricManagedClusters.Mocking; using Azure.ResourceManager.ServiceFabricManagedClusters.Models; namespace Azure.ResourceManager.ServiceFabricManagedClusters @@ -19,157 +20,129 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters /// A class to add extension methods to Azure.ResourceManager.ServiceFabricManagedClusters. public static partial class ServiceFabricManagedClustersExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ServiceFabricManagedClustersArmClientMockingExtension GetServiceFabricManagedClustersArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ServiceFabricManagedClustersArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ServiceFabricManagedClustersResourceGroupMockingExtension GetServiceFabricManagedClustersResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ServiceFabricManagedClustersResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ServiceFabricManagedClustersSubscriptionMockingExtension GetServiceFabricManagedClustersSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ServiceFabricManagedClustersSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ServiceFabricManagedApplicationTypeResource /// /// 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. /// Returns a object. public static ServiceFabricManagedApplicationTypeResource GetServiceFabricManagedApplicationTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedApplicationTypeResource.ValidateResourceId(id); - return new ServiceFabricManagedApplicationTypeResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedApplicationTypeResource(id); } - #endregion - #region ServiceFabricManagedApplicationTypeVersionResource /// /// 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. /// Returns a object. public static ServiceFabricManagedApplicationTypeVersionResource GetServiceFabricManagedApplicationTypeVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedApplicationTypeVersionResource.ValidateResourceId(id); - return new ServiceFabricManagedApplicationTypeVersionResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedApplicationTypeVersionResource(id); } - #endregion - #region ServiceFabricManagedApplicationResource /// /// 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. /// Returns a object. public static ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedApplicationResource.ValidateResourceId(id); - return new ServiceFabricManagedApplicationResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedApplicationResource(id); } - #endregion - #region ServiceFabricManagedServiceResource /// /// 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. /// Returns a object. public static ServiceFabricManagedServiceResource GetServiceFabricManagedServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedServiceResource.ValidateResourceId(id); - return new ServiceFabricManagedServiceResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedServiceResource(id); } - #endregion - #region ServiceFabricManagedClusterResource /// /// 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. /// Returns a object. public static ServiceFabricManagedClusterResource GetServiceFabricManagedClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedClusterResource.ValidateResourceId(id); - return new ServiceFabricManagedClusterResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedClusterResource(id); } - #endregion - #region ServiceFabricManagedNodeTypeResource /// /// 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. /// Returns a object. public static ServiceFabricManagedNodeTypeResource GetServiceFabricManagedNodeTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceFabricManagedNodeTypeResource.ValidateResourceId(id); - return new ServiceFabricManagedNodeTypeResource(client, id); - } - ); + return GetServiceFabricManagedClustersArmClientMockingExtension(client).GetServiceFabricManagedNodeTypeResource(id); } - #endregion - /// Gets a collection of ServiceFabricManagedClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of ServiceFabricManagedClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ServiceFabricManagedClusterResources and their operations over a ServiceFabricManagedClusterResource. public static ServiceFabricManagedClusterCollection GetServiceFabricManagedClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetServiceFabricManagedClusters(); + return GetServiceFabricManagedClustersResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricManagedClusters(); } /// @@ -184,16 +157,20 @@ public static ServiceFabricManagedClusterCollection GetServiceFabricManagedClust /// ManagedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster resource. /// The cancellation token to use. - /// 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 static async Task> GetServiceFabricManagedClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetServiceFabricManagedClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedClustersResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricManagedClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -208,16 +185,20 @@ public static async Task> GetServi /// ManagedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster resource. /// The cancellation token to use. - /// 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 static Response GetServiceFabricManagedCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetServiceFabricManagedClusters().Get(clusterName, cancellationToken); + return GetServiceFabricManagedClustersResourceGroupMockingExtension(resourceGroupResource).GetServiceFabricManagedCluster(clusterName, cancellationToken); } /// @@ -232,13 +213,17 @@ public static Response GetServiceFabricMana /// ManagedClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetServiceFabricManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceFabricManagedClustersAsync(cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetServiceFabricManagedClustersAsync(cancellationToken); } /// @@ -253,13 +238,17 @@ public static AsyncPageable GetServiceFabri /// ManagedClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetServiceFabricManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetServiceFabricManagedClusters(cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetServiceFabricManagedClusters(cancellationToken); } /// @@ -274,6 +263,10 @@ public static Pageable GetServiceFabricMana /// ManagedClusterVersion_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -283,9 +276,7 @@ public static Pageable GetServiceFabricMana /// is null. public static async Task> GetManagedClusterVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionAsync(location, clusterVersion, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionAsync(location, clusterVersion, cancellationToken).ConfigureAwait(false); } /// @@ -300,6 +291,10 @@ public static async Task> GetManage /// ManagedClusterVersion_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -309,9 +304,7 @@ public static async Task> GetManage /// is null. public static Response GetManagedClusterVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersion(location, clusterVersion, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersion(location, clusterVersion, cancellationToken); } /// @@ -326,6 +319,10 @@ public static Response GetManagedClusterVers /// ManagedClusterVersion_GetByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -336,9 +333,7 @@ public static Response GetManagedClusterVers /// is null. public static async Task> GetManagedClusterVersionByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionByEnvironmentAsync(location, environment, clusterVersion, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionByEnvironmentAsync(location, environment, clusterVersion, cancellationToken).ConfigureAwait(false); } /// @@ -353,6 +348,10 @@ public static async Task> GetManage /// ManagedClusterVersion_GetByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -363,9 +362,7 @@ public static async Task> GetManage /// is null. public static Response GetManagedClusterVersionByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionByEnvironment(location, environment, clusterVersion, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionByEnvironment(location, environment, clusterVersion, cancellationToken); } /// @@ -380,6 +377,10 @@ public static Response GetManagedClusterVers /// ManagedClusterVersion_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -387,7 +388,7 @@ public static Response GetManagedClusterVers /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedClusterVersionsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionsAsync(location, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionsAsync(location, cancellationToken); } /// @@ -402,6 +403,10 @@ public static AsyncPageable GetManagedCluste /// ManagedClusterVersion_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -409,7 +414,7 @@ public static AsyncPageable GetManagedCluste /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedClusterVersions(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersions(location, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersions(location, cancellationToken); } /// @@ -424,6 +429,10 @@ public static Pageable GetManagedClusterVers /// ManagedClusterVersion_ListByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -432,7 +441,7 @@ public static Pageable GetManagedClusterVers /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); } /// @@ -447,6 +456,10 @@ public static AsyncPageable GetManagedCluste /// ManagedClusterVersion_ListByEnvironment /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -455,7 +468,7 @@ public static AsyncPageable GetManagedCluste /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedClusterVersionsByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterVersionsByEnvironment(location, environment, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedClusterVersionsByEnvironment(location, environment, cancellationToken); } /// @@ -470,6 +483,10 @@ public static Pageable GetManagedClusterVers /// managedUnsupportedVMSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -477,7 +494,7 @@ public static Pageable GetManagedClusterVers /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedUnsupportedVmSizesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedUnsupportedVmSizesAsync(location, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedUnsupportedVmSizesAsync(location, cancellationToken); } /// @@ -492,6 +509,10 @@ public static AsyncPageable GetManagedUns /// managedUnsupportedVMSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -499,7 +520,7 @@ public static AsyncPageable GetManagedUns /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedUnsupportedVmSizes(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedUnsupportedVmSizes(location, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedUnsupportedVmSizes(location, cancellationToken); } /// @@ -514,6 +535,10 @@ public static Pageable GetManagedUnsuppor /// managedUnsupportedVMSizes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -523,9 +548,7 @@ public static Pageable GetManagedUnsuppor /// is null. public static async Task> GetManagedUnsupportedVmSizeAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string vmSize, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedUnsupportedVmSizeAsync(location, vmSize, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedUnsupportedVmSizeAsync(location, vmSize, cancellationToken).ConfigureAwait(false); } /// @@ -540,6 +563,10 @@ public static async Task> GetMan /// managedUnsupportedVMSizes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. @@ -549,9 +576,7 @@ public static async Task> GetMan /// is null. public static Response GetManagedUnsupportedVmSize(this SubscriptionResource subscriptionResource, AzureLocation location, string vmSize, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedUnsupportedVmSize(location, vmSize, cancellationToken); + return GetServiceFabricManagedClustersSubscriptionMockingExtension(subscriptionResource).GetManagedUnsupportedVmSize(location, vmSize, cancellationToken); } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersResourceGroupMockingExtension.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f6b7ac3c6a94 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabricManagedClusters; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ServiceFabricManagedClustersResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceFabricManagedClustersResourceGroupMockingExtension() + { + } + + /// 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 ServiceFabricManagedClustersResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ServiceFabricManagedClusterResources in the ResourceGroupResource. + /// An object representing collection of ServiceFabricManagedClusterResources and their operations over a ServiceFabricManagedClusterResource. + public virtual ServiceFabricManagedClusterCollection GetServiceFabricManagedClusters() + { + return GetCachedClient(client => new ServiceFabricManagedClusterCollection(client, Id)); + } + + /// + /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName} + /// + /// + /// Operation Id + /// ManagedClusters_Get + /// + /// + /// + /// The name of the cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServiceFabricManagedClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetServiceFabricManagedClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName} + /// + /// + /// Operation Id + /// ManagedClusters_Get + /// + /// + /// + /// The name of the cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServiceFabricManagedCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetServiceFabricManagedClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersSubscriptionMockingExtension.cs similarity index 84% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersSubscriptionMockingExtension.cs index 16abc5487dab..6dab5a143dde 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ServiceFabricManagedClusters; using Azure.ResourceManager.ServiceFabricManagedClusters.Models; -namespace Azure.ResourceManager.ServiceFabricManagedClusters +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ServiceFabricManagedClustersSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _serviceFabricManagedClusterManagedClustersClientDiagnostics; private ManagedClustersRestOperations _serviceFabricManagedClusterManagedClustersRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _managedUnsupportedVmSizesClientDiagnostics; private ManagedUnsupportedVMSizesRestOperations _managedUnsupportedVmSizesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ServiceFabricManagedClustersSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ServiceFabricManagedClustersSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +72,7 @@ public virtual AsyncPageable GetServiceFabr { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); } /// @@ -93,7 +94,7 @@ public virtual Pageable GetServiceFabricMan { HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); } /// @@ -112,9 +113,13 @@ public virtual Pageable GetServiceFabricMan /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetManagedClusterVersionAsync(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedClusterVersion"); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersion"); scope.Start(); try { @@ -144,9 +149,13 @@ public virtual async Task> GetManag /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetManagedClusterVersion(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) { - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedClusterVersion"); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersion"); scope.Start(); try { @@ -177,9 +186,13 @@ public virtual Response GetManagedClusterVer /// The operating system of the cluster. The default means all. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetManagedClusterVersionByEnvironmentAsync(AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedClusterVersionByEnvironment"); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersionByEnvironment"); scope.Start(); try { @@ -210,9 +223,13 @@ public virtual async Task> GetManag /// The operating system of the cluster. The default means all. /// The cluster code version. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetManagedClusterVersionByEnvironment(AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedClusterVersionByEnvironment"); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersionByEnvironment"); scope.Start(); try { @@ -245,7 +262,7 @@ public virtual Response GetManagedClusterVer public virtual AsyncPageable GetManagedClusterVersionsAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterVersions", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersions", "", null, cancellationToken); } /// @@ -267,7 +284,7 @@ public virtual AsyncPageable GetManagedClust public virtual Pageable GetManagedClusterVersions(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterVersions", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersions", "", null, cancellationToken); } /// @@ -290,7 +307,7 @@ public virtual Pageable GetManagedClusterVer public virtual AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); } /// @@ -313,7 +330,7 @@ public virtual AsyncPageable GetManagedClust public virtual Pageable GetManagedClusterVersionsByEnvironment(AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion, ManagedClusterVersionClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); } /// @@ -336,7 +353,7 @@ public virtual AsyncPageable GetManagedUn { HttpMessage FirstPageRequest(int? pageSizeHint) => managedUnsupportedVMSizesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => managedUnsupportedVMSizesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize, managedUnsupportedVMSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize, managedUnsupportedVMSizesClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); } /// @@ -359,7 +376,7 @@ public virtual Pageable GetManagedUnsuppo { HttpMessage FirstPageRequest(int? pageSizeHint) => managedUnsupportedVMSizesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => managedUnsupportedVMSizesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize, managedUnsupportedVMSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize, managedUnsupportedVMSizesClientDiagnostics, Pipeline, "ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); } /// @@ -378,9 +395,13 @@ public virtual Pageable GetManagedUnsuppo /// The location for the cluster code versions. This is different from cluster location. /// VM Size name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetManagedUnsupportedVmSizeAsync(AzureLocation location, string vmSize, CancellationToken cancellationToken = default) { - using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedUnsupportedVmSize"); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + + using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedUnsupportedVmSize"); scope.Start(); try { @@ -410,9 +431,13 @@ public virtual async Task> GetMa /// The location for the cluster code versions. This is different from cluster location. /// VM Size name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetManagedUnsupportedVmSize(AzureLocation location, string vmSize, CancellationToken cancellationToken = default) { - using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetManagedUnsupportedVmSize"); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + + using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("ServiceFabricManagedClustersSubscriptionMockingExtension.GetManagedUnsupportedVmSize"); scope.Start(); try { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs index de84ce3b3da2..813b99adc122 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricManagedServiceResources and their operations over a ServiceFabricManagedServiceResource. public virtual ServiceFabricManagedServiceCollection GetServiceFabricManagedServices() { - return GetCachedClient(Client => new ServiceFabricManagedServiceCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricManagedServiceCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ServiceFabricManagedServiceCollection GetServiceFabricManagedServ /// /// The name of the service resource in the format of {applicationName}~{serviceName}. /// The cancellation token to use. - /// 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> GetServiceFabricManagedServiceAsync(string serviceName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetServ /// /// The name of the service resource in the format of {applicationName}~{serviceName}. /// The cancellation token to use. - /// 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 GetServiceFabricManagedService(string serviceName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs index a04764e44fea..3f399a98317f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricManagedApplicationTypeVersionResources and their operations over a ServiceFabricManagedApplicationTypeVersionResource. public virtual ServiceFabricManagedApplicationTypeVersionCollection GetServiceFabricManagedApplicationTypeVersions() { - return GetCachedClient(Client => new ServiceFabricManagedApplicationTypeVersionCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricManagedApplicationTypeVersionCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ServiceFabricManagedApplicationTypeVersionCollection GetServiceFa /// /// The application type version. /// The cancellation token to use. - /// 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> GetServiceFabricManagedApplicationTypeVersionAsync(string version, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task /// The application type version. /// The cancellation token to use. - /// 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 GetServiceFabricManagedApplicationTypeVersion(string version, CancellationToken cancellationToken = default) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs index 68004e3871cb..240884b62214 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceFabricManagedApplicationTypeResources and their operations over a ServiceFabricManagedApplicationTypeResource. public virtual ServiceFabricManagedApplicationTypeCollection GetServiceFabricManagedApplicationTypes() { - return GetCachedClient(Client => new ServiceFabricManagedApplicationTypeCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricManagedApplicationTypeCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual ServiceFabricManagedApplicationTypeCollection GetServiceFabricMan /// /// The name of the application type name resource. /// The cancellation token to use. - /// 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> GetServiceFabricManagedApplicationTypeAsync(string applicationTypeName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> /// /// The name of the application type name resource. /// The cancellation token to use. - /// 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 GetServiceFabricManagedApplicationType(string applicationTypeName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetServiceF /// An object representing collection of ServiceFabricManagedApplicationResources and their operations over a ServiceFabricManagedApplicationResource. public virtual ServiceFabricManagedApplicationCollection GetServiceFabricManagedApplications() { - return GetCachedClient(Client => new ServiceFabricManagedApplicationCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricManagedApplicationCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual ServiceFabricManagedApplicationCollection GetServiceFabricManaged /// /// The name of the application resource. /// The cancellation token to use. - /// 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> GetServiceFabricManagedApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> Get /// /// The name of the application resource. /// The cancellation token to use. - /// 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 GetServiceFabricManagedApplication(string applicationName, CancellationToken cancellationToken = default) { @@ -203,7 +203,7 @@ public virtual Response GetServiceFabri /// An object representing collection of ServiceFabricManagedNodeTypeResources and their operations over a ServiceFabricManagedNodeTypeResource. public virtual ServiceFabricManagedNodeTypeCollection GetServiceFabricManagedNodeTypes() { - return GetCachedClient(Client => new ServiceFabricManagedNodeTypeCollection(Client, Id)); + return GetCachedClient(client => new ServiceFabricManagedNodeTypeCollection(client, Id)); } /// @@ -221,8 +221,8 @@ public virtual ServiceFabricManagedNodeTypeCollection GetServiceFabricManagedNod /// /// The name of the node type. /// The cancellation token to use. - /// 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> GetServiceFabricManagedNodeTypeAsync(string nodeTypeName, CancellationToken cancellationToken = default) { @@ -244,8 +244,8 @@ public virtual async Task> GetSer /// /// The name of the node type. /// The cancellation token to use. - /// 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 GetServiceFabricManagedNodeType(string nodeTypeName, CancellationToken cancellationToken = default) { diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 940967455699..000000000000 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceLinker -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public virtual LinkerResourceCollection GetLinkerResources() - { - return GetCachedClient(Client => new LinkerResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmClientMockingExtension.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmClientMockingExtension.cs new file mode 100644 index 000000000000..9beb3492d174 --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceLinker; + +namespace Azure.ResourceManager.ServiceLinker.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ServiceLinkerArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerArmClientMockingExtension() + { + } + + /// 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 ServiceLinkerArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ServiceLinkerArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of LinkerResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of LinkerResources and their operations over a LinkerResource. + public virtual LinkerResourceCollection GetLinkerResources(ResourceIdentifier scope) + { + return new LinkerResourceCollection(Client, scope); + } + + /// + /// Returns Linker resource for a given name. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// + /// + /// Operation Id + /// Linker_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name Linker resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLinkerResourceAsync(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + { + return await GetLinkerResources(scope).GetAsync(linkerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns Linker resource for a given name. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// + /// + /// Operation Id + /// Linker_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The name Linker resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLinkerResource(ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + { + return GetLinkerResources(scope).Get(linkerName, 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 LinkerResource GetLinkerResource(ResourceIdentifier id) + { + LinkerResource.ValidateResourceId(id); + return new LinkerResource(Client, id); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmMockingExtension.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmMockingExtension.cs new file mode 100644 index 000000000000..b5f5d1ceae0f --- /dev/null +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerArmMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceLinker; + +namespace Azure.ResourceManager.ServiceLinker.Mocking +{ + /// A class to add extension methods to ArmResource. + public partial class ServiceLinkerArmMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceLinkerArmMockingExtension() + { + } + + /// 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 ServiceLinkerArmMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of LinkerResources in the ArmResource. + /// An object representing collection of LinkerResources and their operations over a LinkerResource. + public virtual LinkerResourceCollection GetLinkerResources() + { + return GetCachedClient(client => new LinkerResourceCollection(client, Id)); + } + + /// + /// Returns Linker resource for a given name. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// + /// + /// Operation Id + /// Linker_Get + /// + /// + /// + /// The name Linker resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLinkerResourceAsync(string linkerName, CancellationToken cancellationToken = default) + { + return await GetLinkerResources().GetAsync(linkerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns Linker resource for a given name. + /// + /// + /// Request Path + /// /{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName} + /// + /// + /// Operation Id + /// Linker_Get + /// + /// + /// + /// The name Linker resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLinkerResource(string linkerName, CancellationToken cancellationToken = default) + { + return GetLinkerResources().Get(linkerName, cancellationToken); + } + } +} diff --git a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs index f1a3409e3a64..8c0c28d7171d 100644 --- a/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs +++ b/sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Generated/Extensions/ServiceLinkerExtensions.cs @@ -11,61 +11,36 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ServiceLinker.Mocking; namespace Azure.ResourceManager.ServiceLinker { /// A class to add extension methods to Azure.ResourceManager.ServiceLinker. public static partial class ServiceLinkerExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ServiceLinkerArmClientMockingExtension GetServiceLinkerArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ServiceLinkerArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ServiceLinkerArmMockingExtension GetServiceLinkerArmMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ServiceLinkerArmMockingExtension(client, resource.Id)); } - #region LinkerResource + /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of LinkerResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static LinkerResource GetLinkerResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - LinkerResource.ValidateResourceId(id); - return new LinkerResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of LinkerResources in the ArmResource. - /// The instance the method will execute against. - /// An object representing collection of LinkerResources and their operations over a LinkerResource. - public static LinkerResourceCollection GetLinkerResources(this ArmResource armResource) - { - return GetArmResourceExtensionClient(armResource).GetLinkerResources(); - } - - /// Gets a collection of LinkerResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of LinkerResources and their operations over a LinkerResource. public static LinkerResourceCollection GetLinkerResources(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetLinkerResources(); + return GetServiceLinkerArmClientMockingExtension(client).GetLinkerResources(scope); } /// @@ -80,16 +55,21 @@ public static LinkerResourceCollection GetLinkerResources(this ArmClient client, /// Linker_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// The scope that the resource will apply against. /// The name Linker resource. /// The cancellation token to use. - /// 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 static async Task> GetLinkerResourceAsync(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) + public static async Task> GetLinkerResourceAsync(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - return await armResource.GetLinkerResources().GetAsync(linkerName, cancellationToken).ConfigureAwait(false); + return await GetServiceLinkerArmClientMockingExtension(client).GetLinkerResourceAsync(scope, linkerName, cancellationToken).ConfigureAwait(false); } /// @@ -104,17 +84,51 @@ public static async Task> GetLinkerResourceAsync(this A /// Linker_Get /// /// + /// + /// 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 Linker resource. /// The cancellation token to use. - /// 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 static async Task> GetLinkerResourceAsync(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + public static Response GetLinkerResource(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) { - return await client.GetLinkerResources(scope).GetAsync(linkerName, cancellationToken).ConfigureAwait(false); + return GetServiceLinkerArmClientMockingExtension(client).GetLinkerResource(scope, linkerName, 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. + /// Returns a object. + public static LinkerResource GetLinkerResource(this ArmClient client, ResourceIdentifier id) + { + return GetServiceLinkerArmClientMockingExtension(client).GetLinkerResource(id); + } + + /// + /// Gets a collection of LinkerResources in the ArmResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// An object representing collection of LinkerResources and their operations over a LinkerResource. + public static LinkerResourceCollection GetLinkerResources(this ArmResource armResource) + { + return GetServiceLinkerArmMockingExtension(armResource).GetLinkerResources(); } /// @@ -129,16 +143,20 @@ public static async Task> GetLinkerResourceAsync(this A /// Linker_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name Linker resource. /// The cancellation token to use. - /// 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 static Response GetLinkerResource(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) + public static async Task> GetLinkerResourceAsync(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) { - return armResource.GetLinkerResources().Get(linkerName, cancellationToken); + return await GetServiceLinkerArmMockingExtension(armResource).GetLinkerResourceAsync(linkerName, cancellationToken).ConfigureAwait(false); } /// @@ -153,17 +171,20 @@ public static Response GetLinkerResource(this ArmResource armRes /// Linker_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. + /// The instance the method will execute against. /// The name Linker resource. /// The cancellation token to use. - /// 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 static Response GetLinkerResource(this ArmClient client, ResourceIdentifier scope, string linkerName, CancellationToken cancellationToken = default) + public static Response GetLinkerResource(this ArmResource armResource, string linkerName, CancellationToken cancellationToken = default) { - return client.GetLinkerResources(scope).Get(linkerName, cancellationToken); + return GetServiceLinkerArmMockingExtension(armResource).GetLinkerResource(linkerName, cancellationToken); } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 20b630f516e4..000000000000 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ServiceNetworking -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of TrafficControllerResources in the ResourceGroupResource. - /// An object representing collection of TrafficControllerResources and their operations over a TrafficControllerResource. - public virtual TrafficControllerCollection GetTrafficControllers() - { - return GetCachedClient(Client => new TrafficControllerCollection(Client, Id)); - } - } -} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingArmClientMockingExtension.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingArmClientMockingExtension.cs new file mode 100644 index 000000000000..f1a57e286458 --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceNetworking; + +namespace Azure.ResourceManager.ServiceNetworking.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ServiceNetworkingArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceNetworkingArmClientMockingExtension() + { + } + + /// 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 ServiceNetworkingArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ServiceNetworkingArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual TrafficControllerResource GetTrafficControllerResource(ResourceIdentifier id) + { + TrafficControllerResource.ValidateResourceId(id); + return new TrafficControllerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AssociationResource GetAssociationResource(ResourceIdentifier id) + { + AssociationResource.ValidateResourceId(id); + return new AssociationResource(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 FrontendResource GetFrontendResource(ResourceIdentifier id) + { + FrontendResource.ValidateResourceId(id); + return new FrontendResource(Client, id); + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs index a15715cccf4d..02708f06c423 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingExtensions.cs @@ -12,106 +12,88 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.ServiceNetworking.Mocking; namespace Azure.ResourceManager.ServiceNetworking { /// A class to add extension methods to Azure.ResourceManager.ServiceNetworking. public static partial class ServiceNetworkingExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ServiceNetworkingArmClientMockingExtension GetServiceNetworkingArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ServiceNetworkingArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ServiceNetworkingResourceGroupMockingExtension GetServiceNetworkingResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ServiceNetworkingResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ServiceNetworkingSubscriptionMockingExtension GetServiceNetworkingSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ServiceNetworkingSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region TrafficControllerResource /// /// 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. /// Returns a object. public static TrafficControllerResource GetTrafficControllerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TrafficControllerResource.ValidateResourceId(id); - return new TrafficControllerResource(client, id); - } - ); + return GetServiceNetworkingArmClientMockingExtension(client).GetTrafficControllerResource(id); } - #endregion - #region AssociationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AssociationResource GetAssociationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AssociationResource.ValidateResourceId(id); - return new AssociationResource(client, id); - } - ); + return GetServiceNetworkingArmClientMockingExtension(client).GetAssociationResource(id); } - #endregion - #region FrontendResource /// /// 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. /// Returns a object. public static FrontendResource GetFrontendResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontendResource.ValidateResourceId(id); - return new FrontendResource(client, id); - } - ); + return GetServiceNetworkingArmClientMockingExtension(client).GetFrontendResource(id); } - #endregion - /// Gets a collection of TrafficControllerResources in the ResourceGroupResource. + /// + /// Gets a collection of TrafficControllerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TrafficControllerResources and their operations over a TrafficControllerResource. public static TrafficControllerCollection GetTrafficControllers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetTrafficControllers(); + return GetServiceNetworkingResourceGroupMockingExtension(resourceGroupResource).GetTrafficControllers(); } /// @@ -126,16 +108,20 @@ public static TrafficControllerCollection GetTrafficControllers(this ResourceGro /// TrafficControllerInterface_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// traffic controller name for path. /// The cancellation token to use. - /// 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 static async Task> GetTrafficControllerAsync(this ResourceGroupResource resourceGroupResource, string trafficControllerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetTrafficControllers().GetAsync(trafficControllerName, cancellationToken).ConfigureAwait(false); + return await GetServiceNetworkingResourceGroupMockingExtension(resourceGroupResource).GetTrafficControllerAsync(trafficControllerName, cancellationToken).ConfigureAwait(false); } /// @@ -150,16 +136,20 @@ public static async Task> GetTrafficControll /// TrafficControllerInterface_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// traffic controller name for path. /// The cancellation token to use. - /// 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 static Response GetTrafficController(this ResourceGroupResource resourceGroupResource, string trafficControllerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetTrafficControllers().Get(trafficControllerName, cancellationToken); + return GetServiceNetworkingResourceGroupMockingExtension(resourceGroupResource).GetTrafficController(trafficControllerName, cancellationToken); } /// @@ -174,13 +164,17 @@ public static Response GetTrafficController(this Reso /// TrafficControllerInterface_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTrafficControllersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrafficControllersAsync(cancellationToken); + return GetServiceNetworkingSubscriptionMockingExtension(subscriptionResource).GetTrafficControllersAsync(cancellationToken); } /// @@ -195,13 +189,17 @@ public static AsyncPageable GetTrafficControllersAsyn /// TrafficControllerInterface_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTrafficControllers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrafficControllers(cancellationToken); + return GetServiceNetworkingSubscriptionMockingExtension(subscriptionResource).GetTrafficControllers(cancellationToken); } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingResourceGroupMockingExtension.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..5b6c8327129e --- /dev/null +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ServiceNetworking; + +namespace Azure.ResourceManager.ServiceNetworking.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ServiceNetworkingResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ServiceNetworkingResourceGroupMockingExtension() + { + } + + /// 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 ServiceNetworkingResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of TrafficControllerResources in the ResourceGroupResource. + /// An object representing collection of TrafficControllerResources and their operations over a TrafficControllerResource. + public virtual TrafficControllerCollection GetTrafficControllers() + { + return GetCachedClient(client => new TrafficControllerCollection(client, Id)); + } + + /// + /// Get a TrafficController + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName} + /// + /// + /// Operation Id + /// TrafficControllerInterface_Get + /// + /// + /// + /// traffic controller name for path. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTrafficControllerAsync(string trafficControllerName, CancellationToken cancellationToken = default) + { + return await GetTrafficControllers().GetAsync(trafficControllerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a TrafficController + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName} + /// + /// + /// Operation Id + /// TrafficControllerInterface_Get + /// + /// + /// + /// traffic controller name for path. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTrafficController(string trafficControllerName, CancellationToken cancellationToken = default) + { + return GetTrafficControllers().Get(trafficControllerName, cancellationToken); + } + } +} diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingSubscriptionMockingExtension.cs similarity index 86% rename from sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingSubscriptionMockingExtension.cs index 46fbf10fb19d..89733861e7cb 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/Extensions/ServiceNetworkingSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ServiceNetworking; -namespace Azure.ResourceManager.ServiceNetworking +namespace Azure.ResourceManager.ServiceNetworking.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ServiceNetworkingSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _trafficControllerTrafficControllerInterfaceClientDiagnostics; private TrafficControllerInterfaceRestOperations _trafficControllerTrafficControllerInterfaceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ServiceNetworkingSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ServiceNetworkingSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetTrafficControllersAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => TrafficControllerTrafficControllerInterfaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrafficControllerTrafficControllerInterfaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TrafficControllerResource(Client, TrafficControllerData.DeserializeTrafficControllerData(e)), TrafficControllerTrafficControllerInterfaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrafficControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TrafficControllerResource(Client, TrafficControllerData.DeserializeTrafficControllerData(e)), TrafficControllerTrafficControllerInterfaceClientDiagnostics, Pipeline, "ServiceNetworkingSubscriptionMockingExtension.GetTrafficControllers", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetTrafficControllers(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => TrafficControllerTrafficControllerInterfaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrafficControllerTrafficControllerInterfaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TrafficControllerResource(Client, TrafficControllerData.DeserializeTrafficControllerData(e)), TrafficControllerTrafficControllerInterfaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrafficControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TrafficControllerResource(Client, TrafficControllerData.DeserializeTrafficControllerData(e)), TrafficControllerTrafficControllerInterfaceClientDiagnostics, Pipeline, "ServiceNetworkingSubscriptionMockingExtension.GetTrafficControllers", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs index d5fbc6c07239..d761c6dbdb69 100644 --- a/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs +++ b/sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/src/Generated/TrafficControllerResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AssociationResources and their operations over a AssociationResource. public virtual AssociationCollection GetAssociations() { - return GetCachedClient(Client => new AssociationCollection(Client, Id)); + return GetCachedClient(client => new AssociationCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual AssociationCollection GetAssociations() /// /// Name of Association. /// The cancellation token to use. - /// 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> GetAssociationAsync(string associationName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetAssociationAsync(str /// /// Name of Association. /// The cancellation token to use. - /// 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 GetAssociation(string associationName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetAssociation(string associationNa /// An object representing collection of FrontendResources and their operations over a FrontendResource. public virtual FrontendCollection GetFrontends() { - return GetCachedClient(Client => new FrontendCollection(Client, Id)); + return GetCachedClient(client => new FrontendCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual FrontendCollection GetFrontends() /// /// Frontends. /// The cancellation token to use. - /// 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> GetFrontendAsync(string frontendName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetFrontendAsync(string fr /// /// Frontends. /// The cancellation token to use. - /// 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 GetFrontend(string frontendName, CancellationToken cancellationToken = default) { diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4788d040f89d..000000000000 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SignalR -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SignalRResources in the ResourceGroupResource. - /// An object representing collection of SignalRResources and their operations over a SignalRResource. - public virtual SignalRCollection GetSignalRs() - { - return GetCachedClient(Client => new SignalRCollection(Client, Id)); - } - } -} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRArmClientMockingExtension.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRArmClientMockingExtension.cs new file mode 100644 index 000000000000..8aac6ea52b99 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SignalR; + +namespace Azure.ResourceManager.SignalR.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SignalRArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SignalRArmClientMockingExtension() + { + } + + /// 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 SignalRArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SignalRArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SignalRResource GetSignalRResource(ResourceIdentifier id) + { + SignalRResource.ValidateResourceId(id); + return new SignalRResource(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 SignalRCustomCertificateResource GetSignalRCustomCertificateResource(ResourceIdentifier id) + { + SignalRCustomCertificateResource.ValidateResourceId(id); + return new SignalRCustomCertificateResource(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 SignalRCustomDomainResource GetSignalRCustomDomainResource(ResourceIdentifier id) + { + SignalRCustomDomainResource.ValidateResourceId(id); + return new SignalRCustomDomainResource(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 SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpointConnectionResource(ResourceIdentifier id) + { + SignalRPrivateEndpointConnectionResource.ValidateResourceId(id); + return new SignalRPrivateEndpointConnectionResource(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 SignalRSharedPrivateLinkResource GetSignalRSharedPrivateLinkResource(ResourceIdentifier id) + { + SignalRSharedPrivateLinkResource.ValidateResourceId(id); + return new SignalRSharedPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs index 351a90fc8fa1..822d4c12d8fb 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs @@ -12,6 +12,7 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.SignalR.Mocking; using Azure.ResourceManager.SignalR.Models; namespace Azure.ResourceManager.SignalR @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.SignalR /// A class to add extension methods to Azure.ResourceManager.SignalR. public static partial class SignalRExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SignalRArmClientMockingExtension GetSignalRArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SignalRArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SignalRResourceGroupMockingExtension GetSignalRResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SignalRResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SignalRSubscriptionMockingExtension GetSignalRSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SignalRSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SignalRResource /// /// 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. /// Returns a object. public static SignalRResource GetSignalRResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SignalRResource.ValidateResourceId(id); - return new SignalRResource(client, id); - } - ); + return GetSignalRArmClientMockingExtension(client).GetSignalRResource(id); } - #endregion - #region SignalRCustomCertificateResource /// /// 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. /// Returns a object. public static SignalRCustomCertificateResource GetSignalRCustomCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SignalRCustomCertificateResource.ValidateResourceId(id); - return new SignalRCustomCertificateResource(client, id); - } - ); + return GetSignalRArmClientMockingExtension(client).GetSignalRCustomCertificateResource(id); } - #endregion - #region SignalRCustomDomainResource /// /// 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. /// Returns a object. public static SignalRCustomDomainResource GetSignalRCustomDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SignalRCustomDomainResource.ValidateResourceId(id); - return new SignalRCustomDomainResource(client, id); - } - ); + return GetSignalRArmClientMockingExtension(client).GetSignalRCustomDomainResource(id); } - #endregion - #region SignalRPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SignalRPrivateEndpointConnectionResource.ValidateResourceId(id); - return new SignalRPrivateEndpointConnectionResource(client, id); - } - ); + return GetSignalRArmClientMockingExtension(client).GetSignalRPrivateEndpointConnectionResource(id); } - #endregion - #region SignalRSharedPrivateLinkResource /// /// 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. /// Returns a object. public static SignalRSharedPrivateLinkResource GetSignalRSharedPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SignalRSharedPrivateLinkResource.ValidateResourceId(id); - return new SignalRSharedPrivateLinkResource(client, id); - } - ); + return GetSignalRArmClientMockingExtension(client).GetSignalRSharedPrivateLinkResource(id); } - #endregion - /// Gets a collection of SignalRResources in the ResourceGroupResource. + /// + /// Gets a collection of SignalRResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SignalRResources and their operations over a SignalRResource. public static SignalRCollection GetSignalRs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSignalRs(); + return GetSignalRResourceGroupMockingExtension(resourceGroupResource).GetSignalRs(); } /// @@ -165,16 +141,20 @@ public static SignalRCollection GetSignalRs(this ResourceGroupResource resourceG /// SignalR_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static async Task> GetSignalRAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSignalRs().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetSignalRResourceGroupMockingExtension(resourceGroupResource).GetSignalRAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetSignalRAsync(this Resourc /// SignalR_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static Response GetSignalR(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSignalRs().Get(resourceName, cancellationToken); + return GetSignalRResourceGroupMockingExtension(resourceGroupResource).GetSignalR(resourceName, cancellationToken); } /// @@ -213,6 +197,10 @@ public static Response GetSignalR(this ResourceGroupResource re /// SignalR_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -221,9 +209,7 @@ public static Response GetSignalR(this ResourceGroupResource re /// is null. public static async Task> CheckSignalRNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SignalRNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSignalRNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetSignalRSubscriptionMockingExtension(subscriptionResource).CheckSignalRNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -238,6 +224,10 @@ public static async Task> CheckSignalRNa /// SignalR_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the region. @@ -246,9 +236,7 @@ public static async Task> CheckSignalRNa /// is null. public static Response CheckSignalRNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, SignalRNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSignalRNameAvailability(location, content, cancellationToken); + return GetSignalRSubscriptionMockingExtension(subscriptionResource).CheckSignalRNameAvailability(location, content, cancellationToken); } /// @@ -263,13 +251,17 @@ public static Response CheckSignalRNameAvailabili /// SignalR_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSignalRsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSignalRsAsync(cancellationToken); + return GetSignalRSubscriptionMockingExtension(subscriptionResource).GetSignalRsAsync(cancellationToken); } /// @@ -284,13 +276,17 @@ public static AsyncPageable GetSignalRsAsync(this SubscriptionR /// SignalR_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSignalRs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSignalRs(cancellationToken); + return GetSignalRSubscriptionMockingExtension(subscriptionResource).GetSignalRs(cancellationToken); } /// @@ -305,6 +301,10 @@ public static Pageable GetSignalRs(this SubscriptionResource su /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the location like "eastus". @@ -312,7 +312,7 @@ public static Pageable GetSignalRs(this SubscriptionResource su /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, cancellationToken); + return GetSignalRSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, cancellationToken); } /// @@ -327,6 +327,10 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// the location like "eastus". @@ -334,7 +338,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, cancellationToken); + return GetSignalRSubscriptionMockingExtension(subscriptionResource).GetUsages(location, cancellationToken); } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRResourceGroupMockingExtension.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..7661ef674655 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.SignalR; + +namespace Azure.ResourceManager.SignalR.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SignalRResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SignalRResourceGroupMockingExtension() + { + } + + /// 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 SignalRResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SignalRResources in the ResourceGroupResource. + /// An object representing collection of SignalRResources and their operations over a SignalRResource. + public virtual SignalRCollection GetSignalRs() + { + return GetCachedClient(client => new SignalRCollection(client, Id)); + } + + /// + /// Get the resource and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName} + /// + /// + /// Operation Id + /// SignalR_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSignalRAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetSignalRs().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the resource and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName} + /// + /// + /// Operation Id + /// SignalR_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSignalR(string resourceName, CancellationToken cancellationToken = default) + { + return GetSignalRs().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRSubscriptionMockingExtension.cs similarity index 89% rename from sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRSubscriptionMockingExtension.cs index 6c46ba833069..00af577d5434 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.SignalR; using Azure.ResourceManager.SignalR.Models; -namespace Azure.ResourceManager.SignalR +namespace Azure.ResourceManager.SignalR.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SignalRSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _signalRClientDiagnostics; private SignalRRestOperations _signalRRestClient; private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SignalRSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SignalRSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -64,9 +65,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckSignalRNameAvailabilityAsync(AzureLocation location, SignalRNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SignalRClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSignalRNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SignalRClientDiagnostics.CreateScope("SignalRSubscriptionMockingExtension.CheckSignalRNameAvailability"); scope.Start(); try { @@ -96,9 +100,12 @@ public virtual async Task> CheckSignalRN /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual Response CheckSignalRNameAvailability(AzureLocation location, SignalRNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SignalRClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSignalRNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SignalRClientDiagnostics.CreateScope("SignalRSubscriptionMockingExtension.CheckSignalRNameAvailability"); scope.Start(); try { @@ -131,7 +138,7 @@ public virtual AsyncPageable GetSignalRsAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => SignalRRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SignalRRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SignalRResource(Client, SignalRData.DeserializeSignalRData(e)), SignalRClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSignalRs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SignalRResource(Client, SignalRData.DeserializeSignalRData(e)), SignalRClientDiagnostics, Pipeline, "SignalRSubscriptionMockingExtension.GetSignalRs", "value", "nextLink", cancellationToken); } /// @@ -153,7 +160,7 @@ public virtual Pageable GetSignalRs(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => SignalRRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SignalRRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SignalRResource(Client, SignalRData.DeserializeSignalRData(e)), SignalRClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSignalRs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SignalRResource(Client, SignalRData.DeserializeSignalRData(e)), SignalRClientDiagnostics, Pipeline, "SignalRSubscriptionMockingExtension.GetSignalRs", "value", "nextLink", cancellationToken); } /// @@ -176,7 +183,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SignalRUsage.DeserializeSignalRUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SignalRUsage.DeserializeSignalRUsage, UsagesClientDiagnostics, Pipeline, "SignalRSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -199,7 +206,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SignalRUsage.DeserializeSignalRUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SignalRUsage.DeserializeSignalRUsage, UsagesClientDiagnostics, Pipeline, "SignalRSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs index bc6fc8286e1d..09846a12138d 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SignalRCustomCertificateResources and their operations over a SignalRCustomCertificateResource. public virtual SignalRCustomCertificateCollection GetSignalRCustomCertificates() { - return GetCachedClient(Client => new SignalRCustomCertificateCollection(Client, Id)); + return GetCachedClient(client => new SignalRCustomCertificateCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual SignalRCustomCertificateCollection GetSignalRCustomCertificates() /// /// Custom certificate name. /// The cancellation token to use. - /// 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> GetSignalRCustomCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetSignalR /// /// Custom certificate name. /// The cancellation token to use. - /// 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 GetSignalRCustomCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetSignalRCustomCertif /// An object representing collection of SignalRCustomDomainResources and their operations over a SignalRCustomDomainResource. public virtual SignalRCustomDomainCollection GetSignalRCustomDomains() { - return GetCachedClient(Client => new SignalRCustomDomainCollection(Client, Id)); + return GetCachedClient(client => new SignalRCustomDomainCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual SignalRCustomDomainCollection GetSignalRCustomDomains() /// /// Custom domain name. /// The cancellation token to use. - /// 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> GetSignalRCustomDomainAsync(string name, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetSignalRCusto /// /// Custom domain name. /// The cancellation token to use. - /// 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 GetSignalRCustomDomain(string name, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetSignalRCustomDomain(stri /// An object representing collection of SignalRPrivateEndpointConnectionResources and their operations over a SignalRPrivateEndpointConnectionResource. public virtual SignalRPrivateEndpointConnectionCollection GetSignalRPrivateEndpointConnections() { - return GetCachedClient(Client => new SignalRPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SignalRPrivateEndpointConnectionCollection(client, Id)); } /// @@ -222,8 +222,8 @@ public virtual SignalRPrivateEndpointConnectionCollection GetSignalRPrivateEndpo /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetSignalRPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task> Ge /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetSignalRPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -257,7 +257,7 @@ public virtual Response GetSignalRPriv /// An object representing collection of SignalRSharedPrivateLinkResources and their operations over a SignalRSharedPrivateLinkResource. public virtual SignalRSharedPrivateLinkResourceCollection GetSignalRSharedPrivateLinkResources() { - return GetCachedClient(Client => new SignalRSharedPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new SignalRSharedPrivateLinkResourceCollection(client, Id)); } /// @@ -275,8 +275,8 @@ public virtual SignalRSharedPrivateLinkResourceCollection GetSignalRSharedPrivat /// /// The name of the shared private link resource. /// The cancellation token to use. - /// 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> GetSignalRSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) { @@ -298,8 +298,8 @@ public virtual async Task> GetSignalR /// /// The name of the shared private link resource. /// The cancellation token to use. - /// 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 GetSignalRSharedPrivateLinkResource(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 0e9a62ddc4be..000000000000 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Sphere -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of SphereCatalogResources in the ResourceGroupResource. - /// An object representing collection of SphereCatalogResources and their operations over a SphereCatalogResource. - public virtual SphereCatalogCollection GetSphereCatalogs() - { - return GetCachedClient(Client => new SphereCatalogCollection(Client, Id)); - } - } -} diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereArmClientMockingExtension.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereArmClientMockingExtension.cs new file mode 100644 index 000000000000..87ff6e4ce39e --- /dev/null +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Sphere; + +namespace Azure.ResourceManager.Sphere.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SphereArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SphereArmClientMockingExtension() + { + } + + /// 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 SphereArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SphereArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SphereCatalogResource GetSphereCatalogResource(ResourceIdentifier id) + { + SphereCatalogResource.ValidateResourceId(id); + return new SphereCatalogResource(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 SphereCertificateResource GetSphereCertificateResource(ResourceIdentifier id) + { + SphereCertificateResource.ValidateResourceId(id); + return new SphereCertificateResource(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 SphereImageResource GetSphereImageResource(ResourceIdentifier id) + { + SphereImageResource.ValidateResourceId(id); + return new SphereImageResource(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 SphereProductResource GetSphereProductResource(ResourceIdentifier id) + { + SphereProductResource.ValidateResourceId(id); + return new SphereProductResource(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 SphereDeviceGroupResource GetSphereDeviceGroupResource(ResourceIdentifier id) + { + SphereDeviceGroupResource.ValidateResourceId(id); + return new SphereDeviceGroupResource(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 SphereDeploymentResource GetSphereDeploymentResource(ResourceIdentifier id) + { + SphereDeploymentResource.ValidateResourceId(id); + return new SphereDeploymentResource(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 SphereDeviceResource GetSphereDeviceResource(ResourceIdentifier id) + { + SphereDeviceResource.ValidateResourceId(id); + return new SphereDeviceResource(Client, id); + } + } +} diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs index 2440fbd67ed1..1ee89f903de8 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereExtensions.cs @@ -12,182 +12,152 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Sphere.Mocking; namespace Azure.ResourceManager.Sphere { /// A class to add extension methods to Azure.ResourceManager.Sphere. public static partial class SphereExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SphereArmClientMockingExtension GetSphereArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SphereArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SphereResourceGroupMockingExtension GetSphereResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SphereResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SphereSubscriptionMockingExtension GetSphereSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SphereSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region SphereCatalogResource /// /// 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. /// Returns a object. public static SphereCatalogResource GetSphereCatalogResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereCatalogResource.ValidateResourceId(id); - return new SphereCatalogResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereCatalogResource(id); } - #endregion - #region SphereCertificateResource /// /// 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. /// Returns a object. public static SphereCertificateResource GetSphereCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereCertificateResource.ValidateResourceId(id); - return new SphereCertificateResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereCertificateResource(id); } - #endregion - #region SphereImageResource /// /// 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. /// Returns a object. public static SphereImageResource GetSphereImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereImageResource.ValidateResourceId(id); - return new SphereImageResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereImageResource(id); } - #endregion - #region SphereProductResource /// /// 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. /// Returns a object. public static SphereProductResource GetSphereProductResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereProductResource.ValidateResourceId(id); - return new SphereProductResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereProductResource(id); } - #endregion - #region SphereDeviceGroupResource /// /// 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. /// Returns a object. public static SphereDeviceGroupResource GetSphereDeviceGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereDeviceGroupResource.ValidateResourceId(id); - return new SphereDeviceGroupResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereDeviceGroupResource(id); } - #endregion - #region SphereDeploymentResource /// /// 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. /// Returns a object. public static SphereDeploymentResource GetSphereDeploymentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereDeploymentResource.ValidateResourceId(id); - return new SphereDeploymentResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereDeploymentResource(id); } - #endregion - #region SphereDeviceResource /// /// 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. /// Returns a object. public static SphereDeviceResource GetSphereDeviceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SphereDeviceResource.ValidateResourceId(id); - return new SphereDeviceResource(client, id); - } - ); + return GetSphereArmClientMockingExtension(client).GetSphereDeviceResource(id); } - #endregion - /// Gets a collection of SphereCatalogResources in the ResourceGroupResource. + /// + /// Gets a collection of SphereCatalogResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SphereCatalogResources and their operations over a SphereCatalogResource. public static SphereCatalogCollection GetSphereCatalogs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSphereCatalogs(); + return GetSphereResourceGroupMockingExtension(resourceGroupResource).GetSphereCatalogs(); } /// @@ -202,16 +172,20 @@ public static SphereCatalogCollection GetSphereCatalogs(this ResourceGroupResour /// Catalogs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of catalog. /// The cancellation token to use. - /// 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 static async Task> GetSphereCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSphereCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); + return await GetSphereResourceGroupMockingExtension(resourceGroupResource).GetSphereCatalogAsync(catalogName, cancellationToken).ConfigureAwait(false); } /// @@ -226,16 +200,20 @@ public static async Task> GetSphereCatalogAsync( /// Catalogs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of catalog. /// The cancellation token to use. - /// 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 static Response GetSphereCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSphereCatalogs().Get(catalogName, cancellationToken); + return GetSphereResourceGroupMockingExtension(resourceGroupResource).GetSphereCatalog(catalogName, cancellationToken); } /// @@ -250,13 +228,17 @@ public static Response GetSphereCatalog(this ResourceGrou /// Catalogs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSphereCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSphereCatalogsAsync(cancellationToken); + return GetSphereSubscriptionMockingExtension(subscriptionResource).GetSphereCatalogsAsync(cancellationToken); } /// @@ -271,13 +253,17 @@ public static AsyncPageable GetSphereCatalogsAsync(this S /// Catalogs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSphereCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSphereCatalogs(cancellationToken); + return GetSphereSubscriptionMockingExtension(subscriptionResource).GetSphereCatalogs(cancellationToken); } } } diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereResourceGroupMockingExtension.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..90b25edbabc6 --- /dev/null +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Sphere; + +namespace Azure.ResourceManager.Sphere.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SphereResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SphereResourceGroupMockingExtension() + { + } + + /// 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 SphereResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SphereCatalogResources in the ResourceGroupResource. + /// An object representing collection of SphereCatalogResources and their operations over a SphereCatalogResource. + public virtual SphereCatalogCollection GetSphereCatalogs() + { + return GetCachedClient(client => new SphereCatalogCollection(client, Id)); + } + + /// + /// Get a Catalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName} + /// + /// + /// Operation Id + /// Catalogs_Get + /// + /// + /// + /// Name of catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSphereCatalogAsync(string catalogName, CancellationToken cancellationToken = default) + { + return await GetSphereCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Catalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName} + /// + /// + /// Operation Id + /// Catalogs_Get + /// + /// + /// + /// Name of catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSphereCatalog(string catalogName, CancellationToken cancellationToken = default) + { + return GetSphereCatalogs().Get(catalogName, cancellationToken); + } + } +} diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereSubscriptionMockingExtension.cs similarity index 85% rename from sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereSubscriptionMockingExtension.cs index 602d50e4c441..1877d4089415 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/Extensions/SphereSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Sphere; -namespace Azure.ResourceManager.Sphere +namespace Azure.ResourceManager.Sphere.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SphereSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _sphereCatalogCatalogsClientDiagnostics; private CatalogsRestOperations _sphereCatalogCatalogsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SphereSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SphereSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetSphereCatalogsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => SphereCatalogCatalogsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SphereCatalogCatalogsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SphereCatalogResource(Client, SphereCatalogData.DeserializeSphereCatalogData(e)), SphereCatalogCatalogsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSphereCatalogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SphereCatalogResource(Client, SphereCatalogData.DeserializeSphereCatalogData(e)), SphereCatalogCatalogsClientDiagnostics, Pipeline, "SphereSubscriptionMockingExtension.GetSphereCatalogs", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetSphereCatalogs(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => SphereCatalogCatalogsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SphereCatalogCatalogsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SphereCatalogResource(Client, SphereCatalogData.DeserializeSphereCatalogData(e)), SphereCatalogCatalogsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSphereCatalogs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SphereCatalogResource(Client, SphereCatalogData.DeserializeSphereCatalogData(e)), SphereCatalogCatalogsClientDiagnostics, Pipeline, "SphereSubscriptionMockingExtension.GetSphereCatalogs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs index 4602db841878..381ae1bd62ac 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereCatalogResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SphereCertificateResources and their operations over a SphereCertificateResource. public virtual SphereCertificateCollection GetSphereCertificates() { - return GetCachedClient(Client => new SphereCertificateCollection(Client, Id)); + return GetCachedClient(client => new SphereCertificateCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual SphereCertificateCollection GetSphereCertificates() /// /// Serial number of the certificate. Use '.default' to get current active certificate. /// The cancellation token to use. - /// 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> GetSphereCertificateAsync(string serialNumber, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetSphereCertific /// /// Serial number of the certificate. Use '.default' to get current active certificate. /// The cancellation token to use. - /// 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 GetSphereCertificate(string serialNumber, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetSphereCertificate(string s /// An object representing collection of SphereImageResources and their operations over a SphereImageResource. public virtual SphereImageCollection GetSphereImages() { - return GetCachedClient(Client => new SphereImageCollection(Client, Id)); + return GetCachedClient(client => new SphereImageCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual SphereImageCollection GetSphereImages() /// /// Image name. Use .default for image creation. /// The cancellation token to use. - /// 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> GetSphereImageAsync(string imageName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetSphereImageAsync(str /// /// Image name. Use .default for image creation. /// The cancellation token to use. - /// 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 GetSphereImage(string imageName, CancellationToken cancellationToken = default) { @@ -200,7 +200,7 @@ public virtual Response GetSphereImage(string imageName, Ca /// An object representing collection of SphereProductResources and their operations over a SphereProductResource. public virtual SphereProductCollection GetSphereProducts() { - return GetCachedClient(Client => new SphereProductCollection(Client, Id)); + return GetCachedClient(client => new SphereProductCollection(client, Id)); } /// @@ -218,8 +218,8 @@ public virtual SphereProductCollection GetSphereProducts() /// /// Name of product. /// The cancellation token to use. - /// 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> GetSphereProductAsync(string productName, CancellationToken cancellationToken = default) { @@ -241,8 +241,8 @@ public virtual async Task> GetSphereProductAsync /// /// Name of product. /// The cancellation token to use. - /// 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 GetSphereProduct(string productName, CancellationToken cancellationToken = default) { diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereDeviceGroupResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereDeviceGroupResource.cs index 703fd7b096b5..80f6a3880d8a 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereDeviceGroupResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereDeviceGroupResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SphereDeploymentResources and their operations over a SphereDeploymentResource. public virtual SphereDeploymentCollection GetSphereDeployments() { - return GetCachedClient(Client => new SphereDeploymentCollection(Client, Id)); + return GetCachedClient(client => new SphereDeploymentCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SphereDeploymentCollection GetSphereDeployments() /// /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group. /// The cancellation token to use. - /// 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> GetSphereDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetSphereDeploymen /// /// Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group. /// The cancellation token to use. - /// 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 GetSphereDeployment(string deploymentName, CancellationToken cancellationToken = default) { @@ -144,7 +144,7 @@ public virtual Response GetSphereDeployment(string dep /// An object representing collection of SphereDeviceResources and their operations over a SphereDeviceResource. public virtual SphereDeviceCollection GetSphereDevices() { - return GetCachedClient(Client => new SphereDeviceCollection(Client, Id)); + return GetCachedClient(client => new SphereDeviceCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual SphereDeviceCollection GetSphereDevices() /// /// Device name. /// The cancellation token to use. - /// 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> GetSphereDeviceAsync(string deviceName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetSphereDeviceAsync(s /// /// Device name. /// The cancellation token to use. - /// 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 GetSphereDevice(string deviceName, CancellationToken cancellationToken = default) { diff --git a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereProductResource.cs b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereProductResource.cs index b4debe9a2901..55e28557a0f0 100644 --- a/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereProductResource.cs +++ b/sdk/sphere/Azure.ResourceManager.Sphere/src/Generated/SphereProductResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SphereDeviceGroupResources and their operations over a SphereDeviceGroupResource. public virtual SphereDeviceGroupCollection GetSphereDeviceGroups() { - return GetCachedClient(Client => new SphereDeviceGroupCollection(Client, Id)); + return GetCachedClient(client => new SphereDeviceGroupCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SphereDeviceGroupCollection GetSphereDeviceGroups() /// /// Name of device group. /// The cancellation token to use. - /// 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> GetSphereDeviceGroupAsync(string deviceGroupName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSphereDeviceGr /// /// Name of device group. /// The cancellation token to use. - /// 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 GetSphereDeviceGroup(string deviceGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d8e89b3d63a5..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Sql.Models; - -namespace Azure.ResourceManager.Sql -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _longTermRetentionBackupsClientDiagnostics; - private LongTermRetentionBackupsRestOperations _longTermRetentionBackupsRestClient; - private ClientDiagnostics _longTermRetentionManagedInstanceBackupsClientDiagnostics; - private LongTermRetentionManagedInstanceBackupsRestOperations _longTermRetentionManagedInstanceBackupsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of InstancePoolResources in the ResourceGroupResource. - /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. - public virtual InstancePoolCollection GetInstancePools() - { - return GetCachedClient(Client => new InstancePoolCollection(Client, Id)); - } - - /// Gets a collection of SqlServerTrustGroupResources in the ResourceGroupResource. - /// The name of the region where the resource is located. - /// An object representing collection of SqlServerTrustGroupResources and their operations over a SqlServerTrustGroupResource. - public virtual SqlServerTrustGroupCollection GetSqlServerTrustGroups(AzureLocation locationName) - { - return new SqlServerTrustGroupCollection(Client, Id, locationName); - } - - /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. - /// The location of the database. - /// The name of the server. - /// The name of the database. - /// An object representing collection of ResourceGroupLongTermRetentionBackupResources and their operations over a ResourceGroupLongTermRetentionBackupResource. - public virtual ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLongTermRetentionBackups(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) - { - return new ResourceGroupLongTermRetentionBackupCollection(Client, Id, locationName, longTermRetentionServerName, longTermRetentionDatabaseName); - } - - /// Gets a collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources in the ResourceGroupResource. - /// The location of the database. - /// The name of the managed instance. - /// The name of the managed database. - /// An object representing collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources and their operations over a ResourceGroupLongTermRetentionManagedInstanceBackupResource. - public virtual ResourceGroupLongTermRetentionManagedInstanceBackupCollection GetResourceGroupLongTermRetentionManagedInstanceBackups(AzureLocation locationName, string managedInstanceName, string databaseName) - { - return new ResourceGroupLongTermRetentionManagedInstanceBackupCollection(Client, Id, locationName, managedInstanceName, databaseName); - } - - /// Gets a collection of VirtualClusterResources in the ResourceGroupResource. - /// An object representing collection of VirtualClusterResources and their operations over a VirtualClusterResource. - public virtual VirtualClusterCollection GetVirtualClusters() - { - return GetCachedClient(Client => new VirtualClusterCollection(Client, Id)); - } - - /// Gets a collection of InstanceFailoverGroupResources in the ResourceGroupResource. - /// The name of the region where the resource is located. - /// An object representing collection of InstanceFailoverGroupResources and their operations over a InstanceFailoverGroupResource. - public virtual InstanceFailoverGroupCollection GetInstanceFailoverGroups(AzureLocation locationName) - { - return new InstanceFailoverGroupCollection(Client, Id, locationName); - } - - /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. - /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. - public virtual ManagedInstanceCollection GetManagedInstances() - { - return GetCachedClient(Client => new ManagedInstanceCollection(Client, Id)); - } - - /// Gets a collection of SqlServerResources in the ResourceGroupResource. - /// An object representing collection of SqlServerResources and their operations over a SqlServerResource. - public virtual SqlServerCollection GetSqlServers() - { - return GetCachedClient(Client => new SqlServerCollection(Client, Id)); - } - - /// - /// Lists the long term retention backups for a given location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups - /// - /// - /// Operation Id - /// LongTermRetentionBackups_ListByResourceGroupLocation - /// - /// - /// - /// The location of the database. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetLongTermRetentionBackupsWithLocationAsync(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for a given location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups - /// - /// - /// Operation Id - /// LongTermRetentionBackups_ListByResourceGroupLocation - /// - /// - /// - /// The location of the database. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetLongTermRetentionBackupsWithLocation(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for a given server. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups - /// - /// - /// Operation Id - /// LongTermRetentionBackups_ListByResourceGroupServer - /// - /// - /// - /// The location of the database. - /// The name of the server. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetLongTermRetentionBackupsWithServerAsync(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for a given server. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups - /// - /// - /// Operation Id - /// LongTermRetentionBackups_ListByResourceGroupServer - /// - /// - /// - /// The location of the database. - /// The name of the server. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetLongTermRetentionBackupsWithServer(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for a given managed instance. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups - /// - /// - /// Operation Id - /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance - /// - /// - /// - /// The location of the database. - /// The name of the managed instance. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for a given managed instance. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups - /// - /// - /// Operation Id - /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance - /// - /// - /// - /// The location of the database. - /// The name of the managed instance. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetLongTermRetentionManagedInstanceBackupsWithInstance(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for managed databases in a given location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups - /// - /// - /// Operation Id - /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation - /// - /// - /// - /// The location of the database. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the long term retention backups for managed databases in a given location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups - /// - /// - /// Operation Id - /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation - /// - /// - /// - /// The location of the database. - /// Whether or not to only get the latest backup for each database. - /// Whether to query against just live databases, just deleted databases, or all databases. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetLongTermRetentionManagedInstanceBackupsWithLocation(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlArmClientMockingExtension.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlArmClientMockingExtension.cs new file mode 100644 index 000000000000..8ef29695cadb --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlArmClientMockingExtension.cs @@ -0,0 +1,1551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Sql; + +namespace Azure.ResourceManager.Sql.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class SqlArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected SqlArmClientMockingExtension() + { + } + + /// 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 SqlArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal SqlArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataMaskingPolicyResource GetDataMaskingPolicyResource(ResourceIdentifier id) + { + DataMaskingPolicyResource.ValidateResourceId(id); + return new DataMaskingPolicyResource(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 GeoBackupPolicyResource GetGeoBackupPolicyResource(ResourceIdentifier id) + { + GeoBackupPolicyResource.ValidateResourceId(id); + return new GeoBackupPolicyResource(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 SqlServerCommunicationLinkResource GetSqlServerCommunicationLinkResource(ResourceIdentifier id) + { + SqlServerCommunicationLinkResource.ValidateResourceId(id); + return new SqlServerCommunicationLinkResource(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 ServiceObjectiveResource GetServiceObjectiveResource(ResourceIdentifier id) + { + ServiceObjectiveResource.ValidateResourceId(id); + return new ServiceObjectiveResource(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 SqlDatabaseAdvisorResource GetSqlDatabaseAdvisorResource(ResourceIdentifier id) + { + SqlDatabaseAdvisorResource.ValidateResourceId(id); + return new SqlDatabaseAdvisorResource(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 SqlServerAdvisorResource GetSqlServerAdvisorResource(ResourceIdentifier id) + { + SqlServerAdvisorResource.ValidateResourceId(id); + return new SqlServerAdvisorResource(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 SqlDatabaseAutomaticTuningResource GetSqlDatabaseAutomaticTuningResource(ResourceIdentifier id) + { + SqlDatabaseAutomaticTuningResource.ValidateResourceId(id); + return new SqlDatabaseAutomaticTuningResource(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 SqlDatabaseColumnResource GetSqlDatabaseColumnResource(ResourceIdentifier id) + { + SqlDatabaseColumnResource.ValidateResourceId(id); + return new SqlDatabaseColumnResource(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 ManagedDatabaseColumnResource GetManagedDatabaseColumnResource(ResourceIdentifier id) + { + ManagedDatabaseColumnResource.ValidateResourceId(id); + return new ManagedDatabaseColumnResource(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 RecommendedActionResource GetRecommendedActionResource(ResourceIdentifier id) + { + RecommendedActionResource.ValidateResourceId(id); + return new RecommendedActionResource(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 SqlDatabaseSchemaResource GetSqlDatabaseSchemaResource(ResourceIdentifier id) + { + SqlDatabaseSchemaResource.ValidateResourceId(id); + return new SqlDatabaseSchemaResource(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 ManagedDatabaseSchemaResource GetManagedDatabaseSchemaResource(ResourceIdentifier id) + { + ManagedDatabaseSchemaResource.ValidateResourceId(id); + return new ManagedDatabaseSchemaResource(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 SqlDatabaseSecurityAlertPolicyResource GetSqlDatabaseSecurityAlertPolicyResource(ResourceIdentifier id) + { + SqlDatabaseSecurityAlertPolicyResource.ValidateResourceId(id); + return new SqlDatabaseSecurityAlertPolicyResource(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 SqlDatabaseTableResource GetSqlDatabaseTableResource(ResourceIdentifier id) + { + SqlDatabaseTableResource.ValidateResourceId(id); + return new SqlDatabaseTableResource(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 ManagedDatabaseTableResource GetManagedDatabaseTableResource(ResourceIdentifier id) + { + ManagedDatabaseTableResource.ValidateResourceId(id); + return new ManagedDatabaseTableResource(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 SqlDatabaseVulnerabilityAssessmentRuleBaselineResource GetSqlDatabaseVulnerabilityAssessmentRuleBaselineResource(ResourceIdentifier id) + { + SqlDatabaseVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); + return new SqlDatabaseVulnerabilityAssessmentRuleBaselineResource(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 ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource GetManagedDatabaseVulnerabilityAssessmentRuleBaselineResource(ResourceIdentifier id) + { + ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); + return new ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource(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 SqlDatabaseVulnerabilityAssessmentResource GetSqlDatabaseVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SqlDatabaseVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SqlDatabaseVulnerabilityAssessmentResource(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 ManagedDatabaseVulnerabilityAssessmentResource GetManagedDatabaseVulnerabilityAssessmentResource(ResourceIdentifier id) + { + ManagedDatabaseVulnerabilityAssessmentResource.ValidateResourceId(id); + return new ManagedDatabaseVulnerabilityAssessmentResource(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 SqlDatabaseVulnerabilityAssessmentScanResource GetSqlDatabaseVulnerabilityAssessmentScanResource(ResourceIdentifier id) + { + SqlDatabaseVulnerabilityAssessmentScanResource.ValidateResourceId(id); + return new SqlDatabaseVulnerabilityAssessmentScanResource(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 ManagedDatabaseVulnerabilityAssessmentScanResource GetManagedDatabaseVulnerabilityAssessmentScanResource(ResourceIdentifier id) + { + ManagedDatabaseVulnerabilityAssessmentScanResource.ValidateResourceId(id); + return new ManagedDatabaseVulnerabilityAssessmentScanResource(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 DataWarehouseUserActivityResource GetDataWarehouseUserActivityResource(ResourceIdentifier id) + { + DataWarehouseUserActivityResource.ValidateResourceId(id); + return new DataWarehouseUserActivityResource(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 DeletedServerResource GetDeletedServerResource(ResourceIdentifier id) + { + DeletedServerResource.ValidateResourceId(id); + return new DeletedServerResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EncryptionProtectorResource GetEncryptionProtectorResource(ResourceIdentifier id) + { + EncryptionProtectorResource.ValidateResourceId(id); + return new EncryptionProtectorResource(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 SqlFirewallRuleResource GetSqlFirewallRuleResource(ResourceIdentifier id) + { + SqlFirewallRuleResource.ValidateResourceId(id); + return new SqlFirewallRuleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InstancePoolResource GetInstancePoolResource(ResourceIdentifier id) + { + InstancePoolResource.ValidateResourceId(id); + return new InstancePoolResource(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 SqlServerJobAgentResource GetSqlServerJobAgentResource(ResourceIdentifier id) + { + SqlServerJobAgentResource.ValidateResourceId(id); + return new SqlServerJobAgentResource(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 SqlServerJobCredentialResource GetSqlServerJobCredentialResource(ResourceIdentifier id) + { + SqlServerJobCredentialResource.ValidateResourceId(id); + return new SqlServerJobCredentialResource(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 SqlServerJobExecutionResource GetSqlServerJobExecutionResource(ResourceIdentifier id) + { + SqlServerJobExecutionResource.ValidateResourceId(id); + return new SqlServerJobExecutionResource(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 SqlServerJobExecutionStepResource GetSqlServerJobExecutionStepResource(ResourceIdentifier id) + { + SqlServerJobExecutionStepResource.ValidateResourceId(id); + return new SqlServerJobExecutionStepResource(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 SqlServerJobExecutionStepTargetResource GetSqlServerJobExecutionStepTargetResource(ResourceIdentifier id) + { + SqlServerJobExecutionStepTargetResource.ValidateResourceId(id); + return new SqlServerJobExecutionStepTargetResource(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 SqlServerJobResource GetSqlServerJobResource(ResourceIdentifier id) + { + SqlServerJobResource.ValidateResourceId(id); + return new SqlServerJobResource(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 SqlServerJobVersionStepResource GetSqlServerJobVersionStepResource(ResourceIdentifier id) + { + SqlServerJobVersionStepResource.ValidateResourceId(id); + return new SqlServerJobVersionStepResource(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 SqlServerJobStepResource GetSqlServerJobStepResource(ResourceIdentifier id) + { + SqlServerJobStepResource.ValidateResourceId(id); + return new SqlServerJobStepResource(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 SqlServerJobTargetGroupResource GetSqlServerJobTargetGroupResource(ResourceIdentifier id) + { + SqlServerJobTargetGroupResource.ValidateResourceId(id); + return new SqlServerJobTargetGroupResource(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 SqlServerJobVersionResource GetSqlServerJobVersionResource(ResourceIdentifier id) + { + SqlServerJobVersionResource.ValidateResourceId(id); + return new SqlServerJobVersionResource(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 LongTermRetentionPolicyResource GetLongTermRetentionPolicyResource(ResourceIdentifier id) + { + LongTermRetentionPolicyResource.ValidateResourceId(id); + return new LongTermRetentionPolicyResource(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 MaintenanceWindowOptionResource GetMaintenanceWindowOptionResource(ResourceIdentifier id) + { + MaintenanceWindowOptionResource.ValidateResourceId(id); + return new MaintenanceWindowOptionResource(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 MaintenanceWindowsResource GetMaintenanceWindowsResource(ResourceIdentifier id) + { + MaintenanceWindowsResource.ValidateResourceId(id); + return new MaintenanceWindowsResource(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 ManagedBackupShortTermRetentionPolicyResource GetManagedBackupShortTermRetentionPolicyResource(ResourceIdentifier id) + { + ManagedBackupShortTermRetentionPolicyResource.ValidateResourceId(id); + return new ManagedBackupShortTermRetentionPolicyResource(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 ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource GetManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource(ResourceIdentifier id) + { + ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource.ValidateResourceId(id); + return new ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource(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 ManagedDatabaseSecurityAlertPolicyResource GetManagedDatabaseSecurityAlertPolicyResource(ResourceIdentifier id) + { + ManagedDatabaseSecurityAlertPolicyResource.ValidateResourceId(id); + return new ManagedDatabaseSecurityAlertPolicyResource(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 ManagedTransparentDataEncryptionResource GetManagedTransparentDataEncryptionResource(ResourceIdentifier id) + { + ManagedTransparentDataEncryptionResource.ValidateResourceId(id); + return new ManagedTransparentDataEncryptionResource(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 ManagedInstanceAdministratorResource GetManagedInstanceAdministratorResource(ResourceIdentifier id) + { + ManagedInstanceAdministratorResource.ValidateResourceId(id); + return new ManagedInstanceAdministratorResource(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 ManagedInstanceAzureADOnlyAuthenticationResource GetManagedInstanceAzureADOnlyAuthenticationResource(ResourceIdentifier id) + { + ManagedInstanceAzureADOnlyAuthenticationResource.ValidateResourceId(id); + return new ManagedInstanceAzureADOnlyAuthenticationResource(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 ManagedInstanceEncryptionProtectorResource GetManagedInstanceEncryptionProtectorResource(ResourceIdentifier id) + { + ManagedInstanceEncryptionProtectorResource.ValidateResourceId(id); + return new ManagedInstanceEncryptionProtectorResource(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 ManagedInstanceKeyResource GetManagedInstanceKeyResource(ResourceIdentifier id) + { + ManagedInstanceKeyResource.ValidateResourceId(id); + return new ManagedInstanceKeyResource(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 ManagedInstanceLongTermRetentionPolicyResource GetManagedInstanceLongTermRetentionPolicyResource(ResourceIdentifier id) + { + ManagedInstanceLongTermRetentionPolicyResource.ValidateResourceId(id); + return new ManagedInstanceLongTermRetentionPolicyResource(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 ManagedInstanceOperationResource GetManagedInstanceOperationResource(ResourceIdentifier id) + { + ManagedInstanceOperationResource.ValidateResourceId(id); + return new ManagedInstanceOperationResource(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 ManagedInstancePrivateEndpointConnectionResource GetManagedInstancePrivateEndpointConnectionResource(ResourceIdentifier id) + { + ManagedInstancePrivateEndpointConnectionResource.ValidateResourceId(id); + return new ManagedInstancePrivateEndpointConnectionResource(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 ManagedInstancePrivateLinkResource GetManagedInstancePrivateLinkResource(ResourceIdentifier id) + { + ManagedInstancePrivateLinkResource.ValidateResourceId(id); + return new ManagedInstancePrivateLinkResource(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 ManagedInstanceVulnerabilityAssessmentResource GetManagedInstanceVulnerabilityAssessmentResource(ResourceIdentifier id) + { + ManagedInstanceVulnerabilityAssessmentResource.ValidateResourceId(id); + return new ManagedInstanceVulnerabilityAssessmentResource(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 ManagedServerSecurityAlertPolicyResource GetManagedServerSecurityAlertPolicyResource(ResourceIdentifier id) + { + ManagedServerSecurityAlertPolicyResource.ValidateResourceId(id); + return new ManagedServerSecurityAlertPolicyResource(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 SqlPrivateEndpointConnectionResource GetSqlPrivateEndpointConnectionResource(ResourceIdentifier id) + { + SqlPrivateEndpointConnectionResource.ValidateResourceId(id); + return new SqlPrivateEndpointConnectionResource(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 SqlPrivateLinkResource GetSqlPrivateLinkResource(ResourceIdentifier id) + { + SqlPrivateLinkResource.ValidateResourceId(id); + return new SqlPrivateLinkResource(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 RecoverableManagedDatabaseResource GetRecoverableManagedDatabaseResource(ResourceIdentifier id) + { + RecoverableManagedDatabaseResource.ValidateResourceId(id); + return new RecoverableManagedDatabaseResource(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 SqlServerDatabaseRestorePointResource GetSqlServerDatabaseRestorePointResource(ResourceIdentifier id) + { + SqlServerDatabaseRestorePointResource.ValidateResourceId(id); + return new SqlServerDatabaseRestorePointResource(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 SqlServerAutomaticTuningResource GetSqlServerAutomaticTuningResource(ResourceIdentifier id) + { + SqlServerAutomaticTuningResource.ValidateResourceId(id); + return new SqlServerAutomaticTuningResource(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 SqlServerAzureADAdministratorResource GetSqlServerAzureADAdministratorResource(ResourceIdentifier id) + { + SqlServerAzureADAdministratorResource.ValidateResourceId(id); + return new SqlServerAzureADAdministratorResource(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 SqlServerAzureADOnlyAuthenticationResource GetSqlServerAzureADOnlyAuthenticationResource(ResourceIdentifier id) + { + SqlServerAzureADOnlyAuthenticationResource.ValidateResourceId(id); + return new SqlServerAzureADOnlyAuthenticationResource(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 SqlServerDevOpsAuditingSettingResource GetSqlServerDevOpsAuditingSettingResource(ResourceIdentifier id) + { + SqlServerDevOpsAuditingSettingResource.ValidateResourceId(id); + return new SqlServerDevOpsAuditingSettingResource(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 SqlServerDnsAliasResource GetSqlServerDnsAliasResource(ResourceIdentifier id) + { + SqlServerDnsAliasResource.ValidateResourceId(id); + return new SqlServerDnsAliasResource(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 SqlServerKeyResource GetSqlServerKeyResource(ResourceIdentifier id) + { + SqlServerKeyResource.ValidateResourceId(id); + return new SqlServerKeyResource(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 SqlServerSecurityAlertPolicyResource GetSqlServerSecurityAlertPolicyResource(ResourceIdentifier id) + { + SqlServerSecurityAlertPolicyResource.ValidateResourceId(id); + return new SqlServerSecurityAlertPolicyResource(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 SqlServerTrustGroupResource GetSqlServerTrustGroupResource(ResourceIdentifier id) + { + SqlServerTrustGroupResource.ValidateResourceId(id); + return new SqlServerTrustGroupResource(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 SqlServerVulnerabilityAssessmentResource GetSqlServerVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SqlServerVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SqlServerVulnerabilityAssessmentResource(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 SqlAgentConfigurationResource GetSqlAgentConfigurationResource(ResourceIdentifier id) + { + SqlAgentConfigurationResource.ValidateResourceId(id); + return new SqlAgentConfigurationResource(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 SubscriptionUsageResource GetSubscriptionUsageResource(ResourceIdentifier id) + { + SubscriptionUsageResource.ValidateResourceId(id); + return new SubscriptionUsageResource(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 SyncAgentResource GetSyncAgentResource(ResourceIdentifier id) + { + SyncAgentResource.ValidateResourceId(id); + return new SyncAgentResource(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 SyncGroupResource GetSyncGroupResource(ResourceIdentifier id) + { + SyncGroupResource.ValidateResourceId(id); + return new SyncGroupResource(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 SyncMemberResource GetSyncMemberResource(ResourceIdentifier id) + { + SyncMemberResource.ValidateResourceId(id); + return new SyncMemberResource(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 SqlTimeZoneResource GetSqlTimeZoneResource(ResourceIdentifier id) + { + SqlTimeZoneResource.ValidateResourceId(id); + return new SqlTimeZoneResource(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 SqlServerVirtualNetworkRuleResource GetSqlServerVirtualNetworkRuleResource(ResourceIdentifier id) + { + SqlServerVirtualNetworkRuleResource.ValidateResourceId(id); + return new SqlServerVirtualNetworkRuleResource(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 WorkloadClassifierResource GetWorkloadClassifierResource(ResourceIdentifier id) + { + WorkloadClassifierResource.ValidateResourceId(id); + return new WorkloadClassifierResource(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 WorkloadGroupResource GetWorkloadGroupResource(ResourceIdentifier id) + { + WorkloadGroupResource.ValidateResourceId(id); + return new WorkloadGroupResource(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 BackupShortTermRetentionPolicyResource GetBackupShortTermRetentionPolicyResource(ResourceIdentifier id) + { + BackupShortTermRetentionPolicyResource.ValidateResourceId(id); + return new BackupShortTermRetentionPolicyResource(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 LedgerDigestUploadResource GetLedgerDigestUploadResource(ResourceIdentifier id) + { + LedgerDigestUploadResource.ValidateResourceId(id); + return new LedgerDigestUploadResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OutboundFirewallRuleResource GetOutboundFirewallRuleResource(ResourceIdentifier id) + { + OutboundFirewallRuleResource.ValidateResourceId(id); + return new OutboundFirewallRuleResource(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 SubscriptionLongTermRetentionBackupResource GetSubscriptionLongTermRetentionBackupResource(ResourceIdentifier id) + { + SubscriptionLongTermRetentionBackupResource.ValidateResourceId(id); + return new SubscriptionLongTermRetentionBackupResource(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 ResourceGroupLongTermRetentionBackupResource GetResourceGroupLongTermRetentionBackupResource(ResourceIdentifier id) + { + ResourceGroupLongTermRetentionBackupResource.ValidateResourceId(id); + return new ResourceGroupLongTermRetentionBackupResource(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 SubscriptionLongTermRetentionManagedInstanceBackupResource GetSubscriptionLongTermRetentionManagedInstanceBackupResource(ResourceIdentifier id) + { + SubscriptionLongTermRetentionManagedInstanceBackupResource.ValidateResourceId(id); + return new SubscriptionLongTermRetentionManagedInstanceBackupResource(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 ResourceGroupLongTermRetentionManagedInstanceBackupResource GetResourceGroupLongTermRetentionManagedInstanceBackupResource(ResourceIdentifier id) + { + ResourceGroupLongTermRetentionManagedInstanceBackupResource.ValidateResourceId(id); + return new ResourceGroupLongTermRetentionManagedInstanceBackupResource(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 RestorableDroppedManagedDatabaseResource GetRestorableDroppedManagedDatabaseResource(ResourceIdentifier id) + { + RestorableDroppedManagedDatabaseResource.ValidateResourceId(id); + return new RestorableDroppedManagedDatabaseResource(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 SqlServerConnectionPolicyResource GetSqlServerConnectionPolicyResource(ResourceIdentifier id) + { + SqlServerConnectionPolicyResource.ValidateResourceId(id); + return new SqlServerConnectionPolicyResource(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 DistributedAvailabilityGroupResource GetDistributedAvailabilityGroupResource(ResourceIdentifier id) + { + DistributedAvailabilityGroupResource.ValidateResourceId(id); + return new DistributedAvailabilityGroupResource(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 ManagedInstanceServerTrustCertificateResource GetManagedInstanceServerTrustCertificateResource(ResourceIdentifier id) + { + ManagedInstanceServerTrustCertificateResource.ValidateResourceId(id); + return new ManagedInstanceServerTrustCertificateResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EndpointCertificateResource GetEndpointCertificateResource(ResourceIdentifier id) + { + EndpointCertificateResource.ValidateResourceId(id); + return new EndpointCertificateResource(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 ManagedDatabaseSensitivityLabelResource GetManagedDatabaseSensitivityLabelResource(ResourceIdentifier id) + { + ManagedDatabaseSensitivityLabelResource.ValidateResourceId(id); + return new ManagedDatabaseSensitivityLabelResource(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 SqlDatabaseSensitivityLabelResource GetSqlDatabaseSensitivityLabelResource(ResourceIdentifier id) + { + SqlDatabaseSensitivityLabelResource.ValidateResourceId(id); + return new SqlDatabaseSensitivityLabelResource(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 SqlServerBlobAuditingPolicyResource GetSqlServerBlobAuditingPolicyResource(ResourceIdentifier id) + { + SqlServerBlobAuditingPolicyResource.ValidateResourceId(id); + return new SqlServerBlobAuditingPolicyResource(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 SqlDatabaseBlobAuditingPolicyResource GetSqlDatabaseBlobAuditingPolicyResource(ResourceIdentifier id) + { + SqlDatabaseBlobAuditingPolicyResource.ValidateResourceId(id); + return new SqlDatabaseBlobAuditingPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExtendedDatabaseBlobAuditingPolicyResource GetExtendedDatabaseBlobAuditingPolicyResource(ResourceIdentifier id) + { + ExtendedDatabaseBlobAuditingPolicyResource.ValidateResourceId(id); + return new ExtendedDatabaseBlobAuditingPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExtendedServerBlobAuditingPolicyResource GetExtendedServerBlobAuditingPolicyResource(ResourceIdentifier id) + { + ExtendedServerBlobAuditingPolicyResource.ValidateResourceId(id); + return new ExtendedServerBlobAuditingPolicyResource(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 DatabaseAdvancedThreatProtectionResource GetDatabaseAdvancedThreatProtectionResource(ResourceIdentifier id) + { + DatabaseAdvancedThreatProtectionResource.ValidateResourceId(id); + return new DatabaseAdvancedThreatProtectionResource(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 ServerAdvancedThreatProtectionResource GetServerAdvancedThreatProtectionResource(ResourceIdentifier id) + { + ServerAdvancedThreatProtectionResource.ValidateResourceId(id); + return new ServerAdvancedThreatProtectionResource(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 ManagedServerDnsAliasResource GetManagedServerDnsAliasResource(ResourceIdentifier id) + { + ManagedServerDnsAliasResource.ValidateResourceId(id); + return new ManagedServerDnsAliasResource(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 ManagedDatabaseAdvancedThreatProtectionResource GetManagedDatabaseAdvancedThreatProtectionResource(ResourceIdentifier id) + { + ManagedDatabaseAdvancedThreatProtectionResource.ValidateResourceId(id); + return new ManagedDatabaseAdvancedThreatProtectionResource(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 ManagedInstanceAdvancedThreatProtectionResource GetManagedInstanceAdvancedThreatProtectionResource(ResourceIdentifier id) + { + ManagedInstanceAdvancedThreatProtectionResource.ValidateResourceId(id); + return new ManagedInstanceAdvancedThreatProtectionResource(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 SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(ResourceIdentifier id) + { + SqlServerDatabaseReplicationLinkResource.ValidateResourceId(id); + return new SqlServerDatabaseReplicationLinkResource(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 ManagedInstanceDtcResource GetManagedInstanceDtcResource(ResourceIdentifier id) + { + ManagedInstanceDtcResource.ValidateResourceId(id); + return new ManagedInstanceDtcResource(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 VirtualClusterResource GetVirtualClusterResource(ResourceIdentifier id) + { + VirtualClusterResource.ValidateResourceId(id); + return new VirtualClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InstanceFailoverGroupResource GetInstanceFailoverGroupResource(ResourceIdentifier id) + { + InstanceFailoverGroupResource.ValidateResourceId(id); + return new InstanceFailoverGroupResource(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 ManagedDatabaseRestoreDetailResource GetManagedDatabaseRestoreDetailResource(ResourceIdentifier id) + { + ManagedDatabaseRestoreDetailResource.ValidateResourceId(id); + return new ManagedDatabaseRestoreDetailResource(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 SqlDatabaseResource GetSqlDatabaseResource(ResourceIdentifier id) + { + SqlDatabaseResource.ValidateResourceId(id); + return new SqlDatabaseResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticPoolResource GetElasticPoolResource(ResourceIdentifier id) + { + ElasticPoolResource.ValidateResourceId(id); + return new ElasticPoolResource(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 ManagedDatabaseResource GetManagedDatabaseResource(ResourceIdentifier id) + { + ManagedDatabaseResource.ValidateResourceId(id); + return new ManagedDatabaseResource(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 ManagedInstanceResource GetManagedInstanceResource(ResourceIdentifier id) + { + ManagedInstanceResource.ValidateResourceId(id); + return new ManagedInstanceResource(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 ManagedLedgerDigestUploadResource GetManagedLedgerDigestUploadResource(ResourceIdentifier id) + { + ManagedLedgerDigestUploadResource.ValidateResourceId(id); + return new ManagedLedgerDigestUploadResource(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 RecoverableDatabaseResource GetRecoverableDatabaseResource(ResourceIdentifier id) + { + RecoverableDatabaseResource.ValidateResourceId(id); + return new RecoverableDatabaseResource(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 RestorableDroppedDatabaseResource GetRestorableDroppedDatabaseResource(ResourceIdentifier id) + { + RestorableDroppedDatabaseResource.ValidateResourceId(id); + return new RestorableDroppedDatabaseResource(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 ManagedInstanceServerConfigurationOptionResource GetManagedInstanceServerConfigurationOptionResource(ResourceIdentifier id) + { + ManagedInstanceServerConfigurationOptionResource.ValidateResourceId(id); + return new ManagedInstanceServerConfigurationOptionResource(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 ManagedInstanceStartStopScheduleResource GetManagedInstanceStartStopScheduleResource(ResourceIdentifier id) + { + ManagedInstanceStartStopScheduleResource.ValidateResourceId(id); + return new ManagedInstanceStartStopScheduleResource(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 LogicalDatabaseTransparentDataEncryptionResource GetLogicalDatabaseTransparentDataEncryptionResource(ResourceIdentifier id) + { + LogicalDatabaseTransparentDataEncryptionResource.ValidateResourceId(id); + return new LogicalDatabaseTransparentDataEncryptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual IPv6FirewallRuleResource GetIPv6FirewallRuleResource(ResourceIdentifier id) + { + IPv6FirewallRuleResource.ValidateResourceId(id); + return new IPv6FirewallRuleResource(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 SqlServerSqlVulnerabilityAssessmentBaselineResource GetSqlServerSqlVulnerabilityAssessmentBaselineResource(ResourceIdentifier id) + { + SqlServerSqlVulnerabilityAssessmentBaselineResource.ValidateResourceId(id); + return new SqlServerSqlVulnerabilityAssessmentBaselineResource(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 SqlDatabaseSqlVulnerabilityAssessmentBaselineResource GetSqlDatabaseSqlVulnerabilityAssessmentBaselineResource(ResourceIdentifier id) + { + SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.ValidateResourceId(id); + return new SqlDatabaseSqlVulnerabilityAssessmentBaselineResource(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 SqlServerSqlVulnerabilityAssessmentBaselineRuleResource GetSqlServerSqlVulnerabilityAssessmentBaselineRuleResource(ResourceIdentifier id) + { + SqlServerSqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); + return new SqlServerSqlVulnerabilityAssessmentBaselineRuleResource(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 SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource(ResourceIdentifier id) + { + SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); + return new SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource(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 SqlServerSqlVulnerabilityAssessmentScanResultResource GetSqlServerSqlVulnerabilityAssessmentScanResultResource(ResourceIdentifier id) + { + SqlServerSqlVulnerabilityAssessmentScanResultResource.ValidateResourceId(id); + return new SqlServerSqlVulnerabilityAssessmentScanResultResource(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 SqlDatabaseSqlVulnerabilityAssessmentScanResultResource GetSqlDatabaseSqlVulnerabilityAssessmentScanResultResource(ResourceIdentifier id) + { + SqlDatabaseSqlVulnerabilityAssessmentScanResultResource.ValidateResourceId(id); + return new SqlDatabaseSqlVulnerabilityAssessmentScanResultResource(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 SqlServerSqlVulnerabilityAssessmentScanResource GetSqlServerSqlVulnerabilityAssessmentScanResource(ResourceIdentifier id) + { + SqlServerSqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); + return new SqlServerSqlVulnerabilityAssessmentScanResource(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 SqlDatabaseSqlVulnerabilityAssessmentScanResource GetSqlDatabaseSqlVulnerabilityAssessmentScanResource(ResourceIdentifier id) + { + SqlDatabaseSqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); + return new SqlDatabaseSqlVulnerabilityAssessmentScanResource(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 SqlServerSqlVulnerabilityAssessmentResource GetSqlServerSqlVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SqlServerSqlVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SqlServerSqlVulnerabilityAssessmentResource(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 SqlDatabaseSqlVulnerabilityAssessmentResource GetSqlDatabaseSqlVulnerabilityAssessmentResource(ResourceIdentifier id) + { + SqlDatabaseSqlVulnerabilityAssessmentResource.ValidateResourceId(id); + return new SqlDatabaseSqlVulnerabilityAssessmentResource(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 SqlServerResource GetSqlServerResource(ResourceIdentifier id) + { + SqlServerResource.ValidateResourceId(id); + return new SqlServerResource(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 FailoverGroupResource GetFailoverGroupResource(ResourceIdentifier id) + { + FailoverGroupResource.ValidateResourceId(id); + return new FailoverGroupResource(Client, id); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs index fd3093d6ab12..ce4dd129d4cd 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs @@ -13,6 +13,7 @@ using Azure.ResourceManager; using Azure.ResourceManager.Resources; using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.Sql.Mocking; using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql @@ -20,2437 +21,2049 @@ namespace Azure.ResourceManager.Sql /// A class to add extension methods to Azure.ResourceManager.Sql. public static partial class SqlExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static SqlArmClientMockingExtension GetSqlArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new SqlArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static SqlResourceGroupMockingExtension GetSqlResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new SqlResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static SqlSubscriptionMockingExtension GetSqlSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new SqlSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataMaskingPolicyResource /// /// 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. /// Returns a object. public static DataMaskingPolicyResource GetDataMaskingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataMaskingPolicyResource.ValidateResourceId(id); - return new DataMaskingPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetDataMaskingPolicyResource(id); } - #endregion - #region GeoBackupPolicyResource /// /// 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. /// Returns a object. public static GeoBackupPolicyResource GetGeoBackupPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GeoBackupPolicyResource.ValidateResourceId(id); - return new GeoBackupPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetGeoBackupPolicyResource(id); } - #endregion - #region SqlServerCommunicationLinkResource /// /// 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. /// Returns a object. public static SqlServerCommunicationLinkResource GetSqlServerCommunicationLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerCommunicationLinkResource.ValidateResourceId(id); - return new SqlServerCommunicationLinkResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerCommunicationLinkResource(id); } - #endregion - #region ServiceObjectiveResource /// /// 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. /// Returns a object. public static ServiceObjectiveResource GetServiceObjectiveResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceObjectiveResource.ValidateResourceId(id); - return new ServiceObjectiveResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetServiceObjectiveResource(id); } - #endregion - #region SqlDatabaseAdvisorResource /// /// 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. /// Returns a object. public static SqlDatabaseAdvisorResource GetSqlDatabaseAdvisorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseAdvisorResource.ValidateResourceId(id); - return new SqlDatabaseAdvisorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseAdvisorResource(id); } - #endregion - #region SqlServerAdvisorResource /// /// 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. /// Returns a object. public static SqlServerAdvisorResource GetSqlServerAdvisorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerAdvisorResource.ValidateResourceId(id); - return new SqlServerAdvisorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerAdvisorResource(id); } - #endregion - #region SqlDatabaseAutomaticTuningResource /// /// 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. /// Returns a object. public static SqlDatabaseAutomaticTuningResource GetSqlDatabaseAutomaticTuningResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseAutomaticTuningResource.ValidateResourceId(id); - return new SqlDatabaseAutomaticTuningResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseAutomaticTuningResource(id); } - #endregion - #region SqlDatabaseColumnResource /// /// 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. /// Returns a object. public static SqlDatabaseColumnResource GetSqlDatabaseColumnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseColumnResource.ValidateResourceId(id); - return new SqlDatabaseColumnResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseColumnResource(id); } - #endregion - #region ManagedDatabaseColumnResource /// /// 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. /// Returns a object. public static ManagedDatabaseColumnResource GetManagedDatabaseColumnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseColumnResource.ValidateResourceId(id); - return new ManagedDatabaseColumnResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseColumnResource(id); } - #endregion - #region RecommendedActionResource /// /// 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. /// Returns a object. public static RecommendedActionResource GetRecommendedActionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecommendedActionResource.ValidateResourceId(id); - return new RecommendedActionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetRecommendedActionResource(id); } - #endregion - #region SqlDatabaseSchemaResource /// /// 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. /// Returns a object. public static SqlDatabaseSchemaResource GetSqlDatabaseSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSchemaResource.ValidateResourceId(id); - return new SqlDatabaseSchemaResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSchemaResource(id); } - #endregion - #region ManagedDatabaseSchemaResource /// /// 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. /// Returns a object. public static ManagedDatabaseSchemaResource GetManagedDatabaseSchemaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseSchemaResource.ValidateResourceId(id); - return new ManagedDatabaseSchemaResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseSchemaResource(id); } - #endregion - #region SqlDatabaseSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static SqlDatabaseSecurityAlertPolicyResource GetSqlDatabaseSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSecurityAlertPolicyResource.ValidateResourceId(id); - return new SqlDatabaseSecurityAlertPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSecurityAlertPolicyResource(id); } - #endregion - #region SqlDatabaseTableResource /// /// 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. /// Returns a object. public static SqlDatabaseTableResource GetSqlDatabaseTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseTableResource.ValidateResourceId(id); - return new SqlDatabaseTableResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseTableResource(id); } - #endregion - #region ManagedDatabaseTableResource /// /// 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. /// Returns a object. public static ManagedDatabaseTableResource GetManagedDatabaseTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseTableResource.ValidateResourceId(id); - return new ManagedDatabaseTableResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseTableResource(id); } - #endregion - #region SqlDatabaseVulnerabilityAssessmentRuleBaselineResource /// /// 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. /// Returns a object. public static SqlDatabaseVulnerabilityAssessmentRuleBaselineResource GetSqlDatabaseVulnerabilityAssessmentRuleBaselineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); - return new SqlDatabaseVulnerabilityAssessmentRuleBaselineResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseVulnerabilityAssessmentRuleBaselineResource(id); } - #endregion - #region ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource /// /// 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. /// Returns a object. public static ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource GetManagedDatabaseVulnerabilityAssessmentRuleBaselineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource.ValidateResourceId(id); - return new ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseVulnerabilityAssessmentRuleBaselineResource(id); } - #endregion - #region SqlDatabaseVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SqlDatabaseVulnerabilityAssessmentResource GetSqlDatabaseVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SqlDatabaseVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseVulnerabilityAssessmentResource(id); } - #endregion - #region ManagedDatabaseVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static ManagedDatabaseVulnerabilityAssessmentResource GetManagedDatabaseVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseVulnerabilityAssessmentResource.ValidateResourceId(id); - return new ManagedDatabaseVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseVulnerabilityAssessmentResource(id); } - #endregion - #region SqlDatabaseVulnerabilityAssessmentScanResource /// /// 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. /// Returns a object. public static SqlDatabaseVulnerabilityAssessmentScanResource GetSqlDatabaseVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new SqlDatabaseVulnerabilityAssessmentScanResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseVulnerabilityAssessmentScanResource(id); } - #endregion - #region ManagedDatabaseVulnerabilityAssessmentScanResource /// /// 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. /// Returns a object. public static ManagedDatabaseVulnerabilityAssessmentScanResource GetManagedDatabaseVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new ManagedDatabaseVulnerabilityAssessmentScanResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseVulnerabilityAssessmentScanResource(id); } - #endregion - #region DataWarehouseUserActivityResource /// /// 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. /// Returns a object. public static DataWarehouseUserActivityResource GetDataWarehouseUserActivityResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataWarehouseUserActivityResource.ValidateResourceId(id); - return new DataWarehouseUserActivityResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetDataWarehouseUserActivityResource(id); } - #endregion - #region DeletedServerResource /// /// 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. /// Returns a object. public static DeletedServerResource GetDeletedServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedServerResource.ValidateResourceId(id); - return new DeletedServerResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetDeletedServerResource(id); } - #endregion - #region EncryptionProtectorResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EncryptionProtectorResource GetEncryptionProtectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EncryptionProtectorResource.ValidateResourceId(id); - return new EncryptionProtectorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetEncryptionProtectorResource(id); } - #endregion - #region SqlFirewallRuleResource /// /// 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. /// Returns a object. public static SqlFirewallRuleResource GetSqlFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlFirewallRuleResource.ValidateResourceId(id); - return new SqlFirewallRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlFirewallRuleResource(id); } - #endregion - #region InstancePoolResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InstancePoolResource GetInstancePoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InstancePoolResource.ValidateResourceId(id); - return new InstancePoolResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetInstancePoolResource(id); } - #endregion - #region SqlServerJobAgentResource /// /// 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. /// Returns a object. public static SqlServerJobAgentResource GetSqlServerJobAgentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobAgentResource.ValidateResourceId(id); - return new SqlServerJobAgentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobAgentResource(id); } - #endregion - #region SqlServerJobCredentialResource /// /// 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. /// Returns a object. public static SqlServerJobCredentialResource GetSqlServerJobCredentialResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobCredentialResource.ValidateResourceId(id); - return new SqlServerJobCredentialResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobCredentialResource(id); } - #endregion - #region SqlServerJobExecutionResource /// /// 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. /// Returns a object. public static SqlServerJobExecutionResource GetSqlServerJobExecutionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobExecutionResource.ValidateResourceId(id); - return new SqlServerJobExecutionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobExecutionResource(id); } - #endregion - #region SqlServerJobExecutionStepResource /// /// 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. /// Returns a object. public static SqlServerJobExecutionStepResource GetSqlServerJobExecutionStepResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobExecutionStepResource.ValidateResourceId(id); - return new SqlServerJobExecutionStepResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobExecutionStepResource(id); } - #endregion - #region SqlServerJobExecutionStepTargetResource /// /// 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. /// Returns a object. public static SqlServerJobExecutionStepTargetResource GetSqlServerJobExecutionStepTargetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobExecutionStepTargetResource.ValidateResourceId(id); - return new SqlServerJobExecutionStepTargetResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobExecutionStepTargetResource(id); } - #endregion - #region SqlServerJobResource /// /// 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. /// Returns a object. public static SqlServerJobResource GetSqlServerJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobResource.ValidateResourceId(id); - return new SqlServerJobResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobResource(id); } - #endregion - #region SqlServerJobVersionStepResource /// /// 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. /// Returns a object. public static SqlServerJobVersionStepResource GetSqlServerJobVersionStepResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobVersionStepResource.ValidateResourceId(id); - return new SqlServerJobVersionStepResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobVersionStepResource(id); } - #endregion - #region SqlServerJobStepResource /// /// 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. /// Returns a object. public static SqlServerJobStepResource GetSqlServerJobStepResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobStepResource.ValidateResourceId(id); - return new SqlServerJobStepResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobStepResource(id); } - #endregion - #region SqlServerJobTargetGroupResource /// /// 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. /// Returns a object. public static SqlServerJobTargetGroupResource GetSqlServerJobTargetGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobTargetGroupResource.ValidateResourceId(id); - return new SqlServerJobTargetGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobTargetGroupResource(id); } - #endregion - #region SqlServerJobVersionResource /// /// 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. /// Returns a object. public static SqlServerJobVersionResource GetSqlServerJobVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerJobVersionResource.ValidateResourceId(id); - return new SqlServerJobVersionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerJobVersionResource(id); } - #endregion - #region LongTermRetentionPolicyResource /// /// 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. /// Returns a object. public static LongTermRetentionPolicyResource GetLongTermRetentionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LongTermRetentionPolicyResource.ValidateResourceId(id); - return new LongTermRetentionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetLongTermRetentionPolicyResource(id); } - #endregion - #region MaintenanceWindowOptionResource /// /// 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. /// Returns a object. public static MaintenanceWindowOptionResource GetMaintenanceWindowOptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MaintenanceWindowOptionResource.ValidateResourceId(id); - return new MaintenanceWindowOptionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetMaintenanceWindowOptionResource(id); } - #endregion - #region MaintenanceWindowsResource /// /// 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. /// Returns a object. public static MaintenanceWindowsResource GetMaintenanceWindowsResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MaintenanceWindowsResource.ValidateResourceId(id); - return new MaintenanceWindowsResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetMaintenanceWindowsResource(id); } - #endregion - #region ManagedBackupShortTermRetentionPolicyResource /// /// 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. /// Returns a object. public static ManagedBackupShortTermRetentionPolicyResource GetManagedBackupShortTermRetentionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedBackupShortTermRetentionPolicyResource.ValidateResourceId(id); - return new ManagedBackupShortTermRetentionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedBackupShortTermRetentionPolicyResource(id); } - #endregion - #region ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource /// /// 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. /// Returns a object. public static ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource GetManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource.ValidateResourceId(id); - return new ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource(id); } - #endregion - #region ManagedDatabaseSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static ManagedDatabaseSecurityAlertPolicyResource GetManagedDatabaseSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseSecurityAlertPolicyResource.ValidateResourceId(id); - return new ManagedDatabaseSecurityAlertPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseSecurityAlertPolicyResource(id); } - #endregion - #region ManagedTransparentDataEncryptionResource /// /// 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. /// Returns a object. public static ManagedTransparentDataEncryptionResource GetManagedTransparentDataEncryptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedTransparentDataEncryptionResource.ValidateResourceId(id); - return new ManagedTransparentDataEncryptionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedTransparentDataEncryptionResource(id); } - #endregion - #region ManagedInstanceAdministratorResource /// /// 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. /// Returns a object. public static ManagedInstanceAdministratorResource GetManagedInstanceAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceAdministratorResource.ValidateResourceId(id); - return new ManagedInstanceAdministratorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceAdministratorResource(id); } - #endregion - #region ManagedInstanceAzureADOnlyAuthenticationResource /// /// 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. /// Returns a object. public static ManagedInstanceAzureADOnlyAuthenticationResource GetManagedInstanceAzureADOnlyAuthenticationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceAzureADOnlyAuthenticationResource.ValidateResourceId(id); - return new ManagedInstanceAzureADOnlyAuthenticationResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceAzureADOnlyAuthenticationResource(id); } - #endregion - #region ManagedInstanceEncryptionProtectorResource /// /// 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. /// Returns a object. public static ManagedInstanceEncryptionProtectorResource GetManagedInstanceEncryptionProtectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceEncryptionProtectorResource.ValidateResourceId(id); - return new ManagedInstanceEncryptionProtectorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceEncryptionProtectorResource(id); } - #endregion - #region ManagedInstanceKeyResource /// /// 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. /// Returns a object. public static ManagedInstanceKeyResource GetManagedInstanceKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceKeyResource.ValidateResourceId(id); - return new ManagedInstanceKeyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceKeyResource(id); } - #endregion - #region ManagedInstanceLongTermRetentionPolicyResource /// /// 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. /// Returns a object. public static ManagedInstanceLongTermRetentionPolicyResource GetManagedInstanceLongTermRetentionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceLongTermRetentionPolicyResource.ValidateResourceId(id); - return new ManagedInstanceLongTermRetentionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceLongTermRetentionPolicyResource(id); } - #endregion - #region ManagedInstanceOperationResource /// /// 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. /// Returns a object. public static ManagedInstanceOperationResource GetManagedInstanceOperationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceOperationResource.ValidateResourceId(id); - return new ManagedInstanceOperationResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceOperationResource(id); } - #endregion - #region ManagedInstancePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ManagedInstancePrivateEndpointConnectionResource GetManagedInstancePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstancePrivateEndpointConnectionResource.ValidateResourceId(id); - return new ManagedInstancePrivateEndpointConnectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstancePrivateEndpointConnectionResource(id); } - #endregion - #region ManagedInstancePrivateLinkResource /// /// 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. /// Returns a object. public static ManagedInstancePrivateLinkResource GetManagedInstancePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstancePrivateLinkResource.ValidateResourceId(id); - return new ManagedInstancePrivateLinkResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstancePrivateLinkResource(id); } - #endregion - #region ManagedInstanceVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static ManagedInstanceVulnerabilityAssessmentResource GetManagedInstanceVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceVulnerabilityAssessmentResource.ValidateResourceId(id); - return new ManagedInstanceVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceVulnerabilityAssessmentResource(id); } - #endregion - #region ManagedServerSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static ManagedServerSecurityAlertPolicyResource GetManagedServerSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedServerSecurityAlertPolicyResource.ValidateResourceId(id); - return new ManagedServerSecurityAlertPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedServerSecurityAlertPolicyResource(id); } - #endregion - #region SqlPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static SqlPrivateEndpointConnectionResource GetSqlPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlPrivateEndpointConnectionResource.ValidateResourceId(id); - return new SqlPrivateEndpointConnectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlPrivateEndpointConnectionResource(id); } - #endregion - #region SqlPrivateLinkResource /// /// 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. /// Returns a object. public static SqlPrivateLinkResource GetSqlPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlPrivateLinkResource.ValidateResourceId(id); - return new SqlPrivateLinkResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlPrivateLinkResource(id); } - #endregion - #region RecoverableManagedDatabaseResource /// /// 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. /// Returns a object. public static RecoverableManagedDatabaseResource GetRecoverableManagedDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecoverableManagedDatabaseResource.ValidateResourceId(id); - return new RecoverableManagedDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetRecoverableManagedDatabaseResource(id); } - #endregion - #region SqlServerDatabaseRestorePointResource /// /// 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. /// Returns a object. public static SqlServerDatabaseRestorePointResource GetSqlServerDatabaseRestorePointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerDatabaseRestorePointResource.ValidateResourceId(id); - return new SqlServerDatabaseRestorePointResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerDatabaseRestorePointResource(id); } - #endregion - #region SqlServerAutomaticTuningResource /// /// 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. /// Returns a object. public static SqlServerAutomaticTuningResource GetSqlServerAutomaticTuningResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerAutomaticTuningResource.ValidateResourceId(id); - return new SqlServerAutomaticTuningResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerAutomaticTuningResource(id); } - #endregion - #region SqlServerAzureADAdministratorResource /// /// 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. /// Returns a object. public static SqlServerAzureADAdministratorResource GetSqlServerAzureADAdministratorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerAzureADAdministratorResource.ValidateResourceId(id); - return new SqlServerAzureADAdministratorResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerAzureADAdministratorResource(id); } - #endregion - #region SqlServerAzureADOnlyAuthenticationResource /// /// 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. /// Returns a object. public static SqlServerAzureADOnlyAuthenticationResource GetSqlServerAzureADOnlyAuthenticationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerAzureADOnlyAuthenticationResource.ValidateResourceId(id); - return new SqlServerAzureADOnlyAuthenticationResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerAzureADOnlyAuthenticationResource(id); } - #endregion - #region SqlServerDevOpsAuditingSettingResource /// /// 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. /// Returns a object. public static SqlServerDevOpsAuditingSettingResource GetSqlServerDevOpsAuditingSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerDevOpsAuditingSettingResource.ValidateResourceId(id); - return new SqlServerDevOpsAuditingSettingResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerDevOpsAuditingSettingResource(id); } - #endregion - #region SqlServerDnsAliasResource /// /// 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. /// Returns a object. public static SqlServerDnsAliasResource GetSqlServerDnsAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerDnsAliasResource.ValidateResourceId(id); - return new SqlServerDnsAliasResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerDnsAliasResource(id); } - #endregion - #region SqlServerKeyResource /// /// 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. /// Returns a object. public static SqlServerKeyResource GetSqlServerKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerKeyResource.ValidateResourceId(id); - return new SqlServerKeyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerKeyResource(id); } - #endregion - #region SqlServerSecurityAlertPolicyResource /// /// 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. /// Returns a object. public static SqlServerSecurityAlertPolicyResource GetSqlServerSecurityAlertPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSecurityAlertPolicyResource.ValidateResourceId(id); - return new SqlServerSecurityAlertPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSecurityAlertPolicyResource(id); } - #endregion - #region SqlServerTrustGroupResource /// /// 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. /// Returns a object. public static SqlServerTrustGroupResource GetSqlServerTrustGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerTrustGroupResource.ValidateResourceId(id); - return new SqlServerTrustGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerTrustGroupResource(id); } - #endregion - #region SqlServerVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SqlServerVulnerabilityAssessmentResource GetSqlServerVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SqlServerVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerVulnerabilityAssessmentResource(id); } - #endregion - #region SqlAgentConfigurationResource /// /// 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. /// Returns a object. public static SqlAgentConfigurationResource GetSqlAgentConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlAgentConfigurationResource.ValidateResourceId(id); - return new SqlAgentConfigurationResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlAgentConfigurationResource(id); } - #endregion - #region SubscriptionUsageResource /// /// 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. /// Returns a object. public static SubscriptionUsageResource GetSubscriptionUsageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionUsageResource.ValidateResourceId(id); - return new SubscriptionUsageResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSubscriptionUsageResource(id); } - #endregion - #region SyncAgentResource /// /// 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. /// Returns a object. public static SyncAgentResource GetSyncAgentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SyncAgentResource.ValidateResourceId(id); - return new SyncAgentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSyncAgentResource(id); } - #endregion - #region SyncGroupResource /// /// 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. /// Returns a object. public static SyncGroupResource GetSyncGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SyncGroupResource.ValidateResourceId(id); - return new SyncGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSyncGroupResource(id); } - #endregion - #region SyncMemberResource /// /// 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. /// Returns a object. public static SyncMemberResource GetSyncMemberResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SyncMemberResource.ValidateResourceId(id); - return new SyncMemberResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSyncMemberResource(id); } - #endregion - #region SqlTimeZoneResource /// /// 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. /// Returns a object. public static SqlTimeZoneResource GetSqlTimeZoneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlTimeZoneResource.ValidateResourceId(id); - return new SqlTimeZoneResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlTimeZoneResource(id); } - #endregion - #region SqlServerVirtualNetworkRuleResource /// /// 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. /// Returns a object. public static SqlServerVirtualNetworkRuleResource GetSqlServerVirtualNetworkRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerVirtualNetworkRuleResource.ValidateResourceId(id); - return new SqlServerVirtualNetworkRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerVirtualNetworkRuleResource(id); } - #endregion - #region WorkloadClassifierResource /// /// 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. /// Returns a object. public static WorkloadClassifierResource GetWorkloadClassifierResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadClassifierResource.ValidateResourceId(id); - return new WorkloadClassifierResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetWorkloadClassifierResource(id); } - #endregion - #region WorkloadGroupResource /// /// 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. /// Returns a object. public static WorkloadGroupResource GetWorkloadGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WorkloadGroupResource.ValidateResourceId(id); - return new WorkloadGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetWorkloadGroupResource(id); } - #endregion - #region BackupShortTermRetentionPolicyResource /// /// 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. /// Returns a object. public static BackupShortTermRetentionPolicyResource GetBackupShortTermRetentionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BackupShortTermRetentionPolicyResource.ValidateResourceId(id); - return new BackupShortTermRetentionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetBackupShortTermRetentionPolicyResource(id); } - #endregion - #region LedgerDigestUploadResource /// /// 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. /// Returns a object. public static LedgerDigestUploadResource GetLedgerDigestUploadResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LedgerDigestUploadResource.ValidateResourceId(id); - return new LedgerDigestUploadResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetLedgerDigestUploadResource(id); } - #endregion - #region OutboundFirewallRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OutboundFirewallRuleResource GetOutboundFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OutboundFirewallRuleResource.ValidateResourceId(id); - return new OutboundFirewallRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetOutboundFirewallRuleResource(id); } - #endregion - #region SubscriptionLongTermRetentionBackupResource /// /// 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. /// Returns a object. public static SubscriptionLongTermRetentionBackupResource GetSubscriptionLongTermRetentionBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionLongTermRetentionBackupResource.ValidateResourceId(id); - return new SubscriptionLongTermRetentionBackupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSubscriptionLongTermRetentionBackupResource(id); } - #endregion - #region ResourceGroupLongTermRetentionBackupResource /// /// 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. /// Returns a object. public static ResourceGroupLongTermRetentionBackupResource GetResourceGroupLongTermRetentionBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGroupLongTermRetentionBackupResource.ValidateResourceId(id); - return new ResourceGroupLongTermRetentionBackupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetResourceGroupLongTermRetentionBackupResource(id); } - #endregion - #region SubscriptionLongTermRetentionManagedInstanceBackupResource /// /// 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. /// Returns a object. public static SubscriptionLongTermRetentionManagedInstanceBackupResource GetSubscriptionLongTermRetentionManagedInstanceBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SubscriptionLongTermRetentionManagedInstanceBackupResource.ValidateResourceId(id); - return new SubscriptionLongTermRetentionManagedInstanceBackupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSubscriptionLongTermRetentionManagedInstanceBackupResource(id); } - #endregion - #region ResourceGroupLongTermRetentionManagedInstanceBackupResource /// /// 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. /// Returns a object. public static ResourceGroupLongTermRetentionManagedInstanceBackupResource GetResourceGroupLongTermRetentionManagedInstanceBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGroupLongTermRetentionManagedInstanceBackupResource.ValidateResourceId(id); - return new ResourceGroupLongTermRetentionManagedInstanceBackupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetResourceGroupLongTermRetentionManagedInstanceBackupResource(id); } - #endregion - #region RestorableDroppedManagedDatabaseResource /// /// 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. /// Returns a object. public static RestorableDroppedManagedDatabaseResource GetRestorableDroppedManagedDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RestorableDroppedManagedDatabaseResource.ValidateResourceId(id); - return new RestorableDroppedManagedDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetRestorableDroppedManagedDatabaseResource(id); } - #endregion - #region SqlServerConnectionPolicyResource /// /// 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. /// Returns a object. public static SqlServerConnectionPolicyResource GetSqlServerConnectionPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerConnectionPolicyResource.ValidateResourceId(id); - return new SqlServerConnectionPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerConnectionPolicyResource(id); } - #endregion - #region DistributedAvailabilityGroupResource /// /// 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. /// Returns a object. public static DistributedAvailabilityGroupResource GetDistributedAvailabilityGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DistributedAvailabilityGroupResource.ValidateResourceId(id); - return new DistributedAvailabilityGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetDistributedAvailabilityGroupResource(id); } - #endregion - #region ManagedInstanceServerTrustCertificateResource /// /// 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. /// Returns a object. public static ManagedInstanceServerTrustCertificateResource GetManagedInstanceServerTrustCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceServerTrustCertificateResource.ValidateResourceId(id); - return new ManagedInstanceServerTrustCertificateResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceServerTrustCertificateResource(id); } - #endregion - #region EndpointCertificateResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EndpointCertificateResource GetEndpointCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EndpointCertificateResource.ValidateResourceId(id); - return new EndpointCertificateResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetEndpointCertificateResource(id); } - #endregion - #region ManagedDatabaseSensitivityLabelResource /// /// 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. /// Returns a object. public static ManagedDatabaseSensitivityLabelResource GetManagedDatabaseSensitivityLabelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseSensitivityLabelResource.ValidateResourceId(id); - return new ManagedDatabaseSensitivityLabelResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseSensitivityLabelResource(id); } - #endregion - #region SqlDatabaseSensitivityLabelResource /// /// 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. /// Returns a object. public static SqlDatabaseSensitivityLabelResource GetSqlDatabaseSensitivityLabelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSensitivityLabelResource.ValidateResourceId(id); - return new SqlDatabaseSensitivityLabelResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSensitivityLabelResource(id); } - #endregion - #region SqlServerBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SqlServerBlobAuditingPolicyResource GetSqlServerBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerBlobAuditingPolicyResource.ValidateResourceId(id); - return new SqlServerBlobAuditingPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerBlobAuditingPolicyResource(id); } - #endregion - #region SqlDatabaseBlobAuditingPolicyResource /// /// 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. /// Returns a object. public static SqlDatabaseBlobAuditingPolicyResource GetSqlDatabaseBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseBlobAuditingPolicyResource.ValidateResourceId(id); - return new SqlDatabaseBlobAuditingPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseBlobAuditingPolicyResource(id); } - #endregion - #region ExtendedDatabaseBlobAuditingPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExtendedDatabaseBlobAuditingPolicyResource GetExtendedDatabaseBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExtendedDatabaseBlobAuditingPolicyResource.ValidateResourceId(id); - return new ExtendedDatabaseBlobAuditingPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetExtendedDatabaseBlobAuditingPolicyResource(id); } - #endregion - #region ExtendedServerBlobAuditingPolicyResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExtendedServerBlobAuditingPolicyResource GetExtendedServerBlobAuditingPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExtendedServerBlobAuditingPolicyResource.ValidateResourceId(id); - return new ExtendedServerBlobAuditingPolicyResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetExtendedServerBlobAuditingPolicyResource(id); } - #endregion - #region DatabaseAdvancedThreatProtectionResource /// /// 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. /// Returns a object. public static DatabaseAdvancedThreatProtectionResource GetDatabaseAdvancedThreatProtectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatabaseAdvancedThreatProtectionResource.ValidateResourceId(id); - return new DatabaseAdvancedThreatProtectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetDatabaseAdvancedThreatProtectionResource(id); } - #endregion - #region ServerAdvancedThreatProtectionResource /// /// 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. /// Returns a object. public static ServerAdvancedThreatProtectionResource GetServerAdvancedThreatProtectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServerAdvancedThreatProtectionResource.ValidateResourceId(id); - return new ServerAdvancedThreatProtectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetServerAdvancedThreatProtectionResource(id); } - #endregion - #region ManagedServerDnsAliasResource /// /// 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. /// Returns a object. public static ManagedServerDnsAliasResource GetManagedServerDnsAliasResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedServerDnsAliasResource.ValidateResourceId(id); - return new ManagedServerDnsAliasResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedServerDnsAliasResource(id); } - #endregion - #region ManagedDatabaseAdvancedThreatProtectionResource /// /// 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. /// Returns a object. public static ManagedDatabaseAdvancedThreatProtectionResource GetManagedDatabaseAdvancedThreatProtectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseAdvancedThreatProtectionResource.ValidateResourceId(id); - return new ManagedDatabaseAdvancedThreatProtectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseAdvancedThreatProtectionResource(id); } - #endregion - #region ManagedInstanceAdvancedThreatProtectionResource /// /// 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. /// Returns a object. public static ManagedInstanceAdvancedThreatProtectionResource GetManagedInstanceAdvancedThreatProtectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceAdvancedThreatProtectionResource.ValidateResourceId(id); - return new ManagedInstanceAdvancedThreatProtectionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceAdvancedThreatProtectionResource(id); } - #endregion - #region SqlServerDatabaseReplicationLinkResource /// /// 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. /// Returns a object. public static SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerDatabaseReplicationLinkResource.ValidateResourceId(id); - return new SqlServerDatabaseReplicationLinkResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerDatabaseReplicationLinkResource(id); } - #endregion - #region ManagedInstanceDtcResource /// /// 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. /// Returns a object. public static ManagedInstanceDtcResource GetManagedInstanceDtcResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceDtcResource.ValidateResourceId(id); - return new ManagedInstanceDtcResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceDtcResource(id); } - #endregion - #region VirtualClusterResource /// /// 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. /// Returns a object. public static VirtualClusterResource GetVirtualClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualClusterResource.ValidateResourceId(id); - return new VirtualClusterResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetVirtualClusterResource(id); } - #endregion - #region InstanceFailoverGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InstanceFailoverGroupResource GetInstanceFailoverGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InstanceFailoverGroupResource.ValidateResourceId(id); - return new InstanceFailoverGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetInstanceFailoverGroupResource(id); } - #endregion - #region ManagedDatabaseRestoreDetailResource /// /// 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. /// Returns a object. public static ManagedDatabaseRestoreDetailResource GetManagedDatabaseRestoreDetailResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseRestoreDetailResource.ValidateResourceId(id); - return new ManagedDatabaseRestoreDetailResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseRestoreDetailResource(id); } - #endregion - #region SqlDatabaseResource /// /// 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. /// Returns a object. public static SqlDatabaseResource GetSqlDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseResource.ValidateResourceId(id); - return new SqlDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseResource(id); } - #endregion - #region ElasticPoolResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticPoolResource GetElasticPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticPoolResource.ValidateResourceId(id); - return new ElasticPoolResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetElasticPoolResource(id); } - #endregion - #region ManagedDatabaseResource /// /// 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. /// Returns a object. public static ManagedDatabaseResource GetManagedDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDatabaseResource.ValidateResourceId(id); - return new ManagedDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedDatabaseResource(id); } - #endregion - #region ManagedInstanceResource /// /// 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. /// Returns a object. public static ManagedInstanceResource GetManagedInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceResource.ValidateResourceId(id); - return new ManagedInstanceResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceResource(id); } - #endregion - #region ManagedLedgerDigestUploadResource /// /// 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. /// Returns a object. public static ManagedLedgerDigestUploadResource GetManagedLedgerDigestUploadResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedLedgerDigestUploadResource.ValidateResourceId(id); - return new ManagedLedgerDigestUploadResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedLedgerDigestUploadResource(id); } - #endregion - #region RecoverableDatabaseResource /// /// 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. /// Returns a object. public static RecoverableDatabaseResource GetRecoverableDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RecoverableDatabaseResource.ValidateResourceId(id); - return new RecoverableDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetRecoverableDatabaseResource(id); } - #endregion - #region RestorableDroppedDatabaseResource /// /// 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. /// Returns a object. public static RestorableDroppedDatabaseResource GetRestorableDroppedDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RestorableDroppedDatabaseResource.ValidateResourceId(id); - return new RestorableDroppedDatabaseResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetRestorableDroppedDatabaseResource(id); } - #endregion - #region ManagedInstanceServerConfigurationOptionResource /// /// 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. /// Returns a object. public static ManagedInstanceServerConfigurationOptionResource GetManagedInstanceServerConfigurationOptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceServerConfigurationOptionResource.ValidateResourceId(id); - return new ManagedInstanceServerConfigurationOptionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceServerConfigurationOptionResource(id); } - #endregion - #region ManagedInstanceStartStopScheduleResource /// /// 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. /// Returns a object. public static ManagedInstanceStartStopScheduleResource GetManagedInstanceStartStopScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedInstanceStartStopScheduleResource.ValidateResourceId(id); - return new ManagedInstanceStartStopScheduleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetManagedInstanceStartStopScheduleResource(id); } - #endregion - #region LogicalDatabaseTransparentDataEncryptionResource /// /// 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. /// Returns a object. public static LogicalDatabaseTransparentDataEncryptionResource GetLogicalDatabaseTransparentDataEncryptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LogicalDatabaseTransparentDataEncryptionResource.ValidateResourceId(id); - return new LogicalDatabaseTransparentDataEncryptionResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetLogicalDatabaseTransparentDataEncryptionResource(id); } - #endregion - #region IPv6FirewallRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static IPv6FirewallRuleResource GetIPv6FirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - IPv6FirewallRuleResource.ValidateResourceId(id); - return new IPv6FirewallRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetIPv6FirewallRuleResource(id); } - #endregion - #region SqlServerSqlVulnerabilityAssessmentBaselineResource /// /// 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. /// Returns a object. public static SqlServerSqlVulnerabilityAssessmentBaselineResource GetSqlServerSqlVulnerabilityAssessmentBaselineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSqlVulnerabilityAssessmentBaselineResource.ValidateResourceId(id); - return new SqlServerSqlVulnerabilityAssessmentBaselineResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSqlVulnerabilityAssessmentBaselineResource(id); } - #endregion - #region SqlDatabaseSqlVulnerabilityAssessmentBaselineResource /// /// 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. /// Returns a object. public static SqlDatabaseSqlVulnerabilityAssessmentBaselineResource GetSqlDatabaseSqlVulnerabilityAssessmentBaselineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.ValidateResourceId(id); - return new SqlDatabaseSqlVulnerabilityAssessmentBaselineResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSqlVulnerabilityAssessmentBaselineResource(id); } - #endregion - #region SqlServerSqlVulnerabilityAssessmentBaselineRuleResource /// /// 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. /// Returns a object. public static SqlServerSqlVulnerabilityAssessmentBaselineRuleResource GetSqlServerSqlVulnerabilityAssessmentBaselineRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); - return new SqlServerSqlVulnerabilityAssessmentBaselineRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSqlVulnerabilityAssessmentBaselineRuleResource(id); } - #endregion - #region SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource /// /// 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. /// Returns a object. public static SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); - return new SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource(id); } - #endregion - #region SqlServerSqlVulnerabilityAssessmentScanResultResource /// /// 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. /// Returns a object. public static SqlServerSqlVulnerabilityAssessmentScanResultResource GetSqlServerSqlVulnerabilityAssessmentScanResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSqlVulnerabilityAssessmentScanResultResource.ValidateResourceId(id); - return new SqlServerSqlVulnerabilityAssessmentScanResultResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSqlVulnerabilityAssessmentScanResultResource(id); } - #endregion - #region SqlDatabaseSqlVulnerabilityAssessmentScanResultResource /// /// 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. /// Returns a object. public static SqlDatabaseSqlVulnerabilityAssessmentScanResultResource GetSqlDatabaseSqlVulnerabilityAssessmentScanResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSqlVulnerabilityAssessmentScanResultResource.ValidateResourceId(id); - return new SqlDatabaseSqlVulnerabilityAssessmentScanResultResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSqlVulnerabilityAssessmentScanResultResource(id); } - #endregion - #region SqlServerSqlVulnerabilityAssessmentScanResource /// /// 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. /// Returns a object. public static SqlServerSqlVulnerabilityAssessmentScanResource GetSqlServerSqlVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new SqlServerSqlVulnerabilityAssessmentScanResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSqlVulnerabilityAssessmentScanResource(id); } - #endregion - #region SqlDatabaseSqlVulnerabilityAssessmentScanResource /// /// 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. /// Returns a object. public static SqlDatabaseSqlVulnerabilityAssessmentScanResource GetSqlDatabaseSqlVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new SqlDatabaseSqlVulnerabilityAssessmentScanResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSqlVulnerabilityAssessmentScanResource(id); } - #endregion - #region SqlServerSqlVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SqlServerSqlVulnerabilityAssessmentResource GetSqlServerSqlVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerSqlVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SqlServerSqlVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerSqlVulnerabilityAssessmentResource(id); } - #endregion - #region SqlDatabaseSqlVulnerabilityAssessmentResource /// /// 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. /// Returns a object. public static SqlDatabaseSqlVulnerabilityAssessmentResource GetSqlDatabaseSqlVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlDatabaseSqlVulnerabilityAssessmentResource.ValidateResourceId(id); - return new SqlDatabaseSqlVulnerabilityAssessmentResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlDatabaseSqlVulnerabilityAssessmentResource(id); } - #endregion - #region SqlServerResource /// /// 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. /// Returns a object. public static SqlServerResource GetSqlServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlServerResource.ValidateResourceId(id); - return new SqlServerResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetSqlServerResource(id); } - #endregion - #region FailoverGroupResource /// /// 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. /// Returns a object. public static FailoverGroupResource GetFailoverGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FailoverGroupResource.ValidateResourceId(id); - return new FailoverGroupResource(client, id); - } - ); + return GetSqlArmClientMockingExtension(client).GetFailoverGroupResource(id); } - #endregion - /// Gets a collection of InstancePoolResources in the ResourceGroupResource. + /// + /// Gets a collection of InstancePoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. public static InstancePoolCollection GetInstancePools(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetInstancePools(); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstancePools(); } /// @@ -2465,16 +2078,20 @@ public static InstancePoolCollection GetInstancePools(this ResourceGroupResource /// InstancePools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the instance pool to be retrieved. /// The cancellation token to use. - /// 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 static async Task> GetInstancePoolAsync(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetInstancePools().GetAsync(instancePoolName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstancePoolAsync(instancePoolName, cancellationToken).ConfigureAwait(false); } /// @@ -2489,25 +2106,35 @@ public static async Task> GetInstancePoolAsync(th /// InstancePools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the instance pool to be retrieved. /// The cancellation token to use. - /// 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 static Response GetInstancePool(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetInstancePools().Get(instancePoolName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstancePool(instancePoolName, cancellationToken); } - /// Gets a collection of SqlServerTrustGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of SqlServerTrustGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// An object representing collection of SqlServerTrustGroupResources and their operations over a SqlServerTrustGroupResource. public static SqlServerTrustGroupCollection GetSqlServerTrustGroups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSqlServerTrustGroups(locationName); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServerTrustGroups(locationName); } /// @@ -2522,17 +2149,21 @@ public static SqlServerTrustGroupCollection GetSqlServerTrustGroups(this Resourc /// ServerTrustGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the server trust group. /// The cancellation token to use. - /// 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 static async Task> GetSqlServerTrustGroupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string serverTrustGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSqlServerTrustGroups(locationName).GetAsync(serverTrustGroupName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServerTrustGroupAsync(locationName, serverTrustGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -2547,33 +2178,40 @@ public static async Task> GetSqlServerTrus /// ServerTrustGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the server trust group. /// The cancellation token to use. - /// 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 static Response GetSqlServerTrustGroup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string serverTrustGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSqlServerTrustGroups(locationName).Get(serverTrustGroupName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServerTrustGroup(locationName, serverTrustGroupName, cancellationToken); } - /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location of the database. /// The name of the server. /// The name of the database. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of ResourceGroupLongTermRetentionBackupResources and their operations over a ResourceGroupLongTermRetentionBackupResource. public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLongTermRetentionBackups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - Argument.AssertNotNullOrEmpty(longTermRetentionDatabaseName, nameof(longTermRetentionDatabaseName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); } /// @@ -2588,6 +2226,10 @@ public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLon /// LongTermRetentionBackups_GetByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2595,12 +2237,12 @@ public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLon /// The name of the database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetResourceGroupLongTermRetentionBackupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionBackupAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken).ConfigureAwait(false); } /// @@ -2615,6 +2257,10 @@ public static async Task> /// LongTermRetentionBackups_GetByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2622,28 +2268,31 @@ public static async Task> /// The name of the database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetResourceGroupLongTermRetentionBackup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).Get(backupName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionBackup(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken); } - /// Gets a collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location of the database. /// The name of the managed instance. /// The name of the managed database. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources and their operations over a ResourceGroupLongTermRetentionManagedInstanceBackupResource. public static ResourceGroupLongTermRetentionManagedInstanceBackupCollection GetResourceGroupLongTermRetentionManagedInstanceBackups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string managedInstanceName, string databaseName) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName); } /// @@ -2658,6 +2307,10 @@ public static ResourceGroupLongTermRetentionManagedInstanceBackupCollection GetR /// LongTermRetentionManagedInstanceBackups_GetByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2665,12 +2318,12 @@ public static ResourceGroupLongTermRetentionManagedInstanceBackupCollection GetR /// The name of the managed database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetResourceGroupLongTermRetentionManagedInstanceBackupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionManagedInstanceBackupAsync(locationName, managedInstanceName, databaseName, backupName, cancellationToken).ConfigureAwait(false); } /// @@ -2685,6 +2338,10 @@ public static async TaskLongTermRetentionManagedInstanceBackups_GetByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2692,20 +2349,26 @@ public static async Task The name of the managed database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetResourceGroupLongTermRetentionManagedInstanceBackup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).Get(backupName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetResourceGroupLongTermRetentionManagedInstanceBackup(locationName, managedInstanceName, databaseName, backupName, cancellationToken); } - /// Gets a collection of VirtualClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualClusterResources and their operations over a VirtualClusterResource. public static VirtualClusterCollection GetVirtualClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualClusters(); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetVirtualClusters(); } /// @@ -2720,16 +2383,20 @@ public static VirtualClusterCollection GetVirtualClusters(this ResourceGroupReso /// VirtualClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual cluster. /// The cancellation token to use. - /// 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 static async Task> GetVirtualClusterAsync(this ResourceGroupResource resourceGroupResource, string virtualClusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualClusters().GetAsync(virtualClusterName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetVirtualClusterAsync(virtualClusterName, cancellationToken).ConfigureAwait(false); } /// @@ -2744,25 +2411,35 @@ public static async Task> GetVirtualClusterAsyn /// VirtualClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual cluster. /// The cancellation token to use. - /// 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 static Response GetVirtualCluster(this ResourceGroupResource resourceGroupResource, string virtualClusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualClusters().Get(virtualClusterName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetVirtualCluster(virtualClusterName, cancellationToken); } - /// Gets a collection of InstanceFailoverGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of InstanceFailoverGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// An object representing collection of InstanceFailoverGroupResources and their operations over a InstanceFailoverGroupResource. public static InstanceFailoverGroupCollection GetInstanceFailoverGroups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetInstanceFailoverGroups(locationName); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstanceFailoverGroups(locationName); } /// @@ -2777,17 +2454,21 @@ public static InstanceFailoverGroupCollection GetInstanceFailoverGroups(this Res /// InstanceFailoverGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the failover group. /// The cancellation token to use. - /// 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 static async Task> GetInstanceFailoverGroupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string failoverGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetInstanceFailoverGroups(locationName).GetAsync(failoverGroupName, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstanceFailoverGroupAsync(locationName, failoverGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -2802,25 +2483,35 @@ public static async Task> GetInstanceFai /// InstanceFailoverGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the failover group. /// The cancellation token to use. - /// 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 static Response GetInstanceFailoverGroup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string failoverGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetInstanceFailoverGroups(locationName).Get(failoverGroupName, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetInstanceFailoverGroup(locationName, failoverGroupName, cancellationToken); } - /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. public static ManagedInstanceCollection GetManagedInstances(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedInstances(); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetManagedInstances(); } /// @@ -2835,17 +2526,21 @@ public static ManagedInstanceCollection GetManagedInstances(this ResourceGroupRe /// ManagedInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed instance. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static async Task> GetManagedInstanceAsync(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedInstances().GetAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetManagedInstanceAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -2860,25 +2555,35 @@ public static async Task> GetManagedInstanceAs /// ManagedInstances_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed instance. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static Response GetManagedInstance(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedInstances().Get(managedInstanceName, expand, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetManagedInstance(managedInstanceName, expand, cancellationToken); } - /// Gets a collection of SqlServerResources in the ResourceGroupResource. + /// + /// Gets a collection of SqlServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SqlServerResources and their operations over a SqlServerResource. public static SqlServerCollection GetSqlServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSqlServers(); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServers(); } /// @@ -2893,17 +2598,21 @@ public static SqlServerCollection GetSqlServers(this ResourceGroupResource resou /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static async Task> GetSqlServerAsync(this ResourceGroupResource resourceGroupResource, string serverName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSqlServers().GetAsync(serverName, expand, cancellationToken).ConfigureAwait(false); + return await GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServerAsync(serverName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -2918,17 +2627,21 @@ public static async Task> GetSqlServerAsync(this Res /// Servers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the server. /// The child resources to include in the response. /// The cancellation token to use. - /// 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 static Response GetSqlServer(this ResourceGroupResource resourceGroupResource, string serverName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSqlServers().Get(serverName, expand, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetSqlServer(serverName, expand, cancellationToken); } /// @@ -2943,6 +2656,10 @@ public static Response GetSqlServer(this ResourceGroupResourc /// LongTermRetentionBackups_ListByResourceGroupLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2952,7 +2669,7 @@ public static Response GetSqlServer(this ResourceGroupResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionBackupsWithLocationAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -2967,6 +2684,10 @@ public static AsyncPageable GetLongTermRetentionBac /// LongTermRetentionBackups_ListByResourceGroupLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -2976,7 +2697,7 @@ public static AsyncPageable GetLongTermRetentionBac /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionBackupsWithLocation(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -2991,6 +2712,10 @@ public static Pageable GetLongTermRetentionBackupsW /// LongTermRetentionBackups_ListByResourceGroupServer /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3003,9 +2728,7 @@ public static Pageable GetLongTermRetentionBackupsW /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionBackupsWithServerAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionBackupsWithServerAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionBackupsWithServerAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3020,6 +2743,10 @@ public static AsyncPageable GetLongTermRetentionBac /// LongTermRetentionBackups_ListByResourceGroupServer /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3032,9 +2759,7 @@ public static AsyncPageable GetLongTermRetentionBac /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionBackupsWithServer(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionBackupsWithServer(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionBackupsWithServer(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3049,6 +2774,10 @@ public static Pageable GetLongTermRetentionBackupsW /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3061,9 +2790,7 @@ public static Pageable GetLongTermRetentionBackupsW /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3078,6 +2805,10 @@ public static AsyncPageable GetLongT /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3090,9 +2821,7 @@ public static AsyncPageable GetLongT /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionManagedInstanceBackupsWithInstance(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithInstance(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithInstance(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3107,6 +2836,10 @@ public static Pageable GetLongTermRe /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3116,7 +2849,7 @@ public static Pageable GetLongTermRe /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3131,6 +2864,10 @@ public static AsyncPageable GetLongT /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3140,16 +2877,22 @@ public static AsyncPageable GetLongT /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionManagedInstanceBackupsWithLocation(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlResourceGroupMockingExtension(resourceGroupResource).GetLongTermRetentionManagedInstanceBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } - /// Gets a collection of DeletedServerResources in the SubscriptionResource. + /// + /// Gets a collection of DeletedServerResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// An object representing collection of DeletedServerResources and their operations over a DeletedServerResource. public static DeletedServerCollection GetDeletedServers(this SubscriptionResource subscriptionResource, AzureLocation locationName) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedServers(locationName); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetDeletedServers(locationName); } /// @@ -3164,17 +2907,21 @@ public static DeletedServerCollection GetDeletedServers(this SubscriptionResourc /// DeletedServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the deleted server. /// The cancellation token to use. - /// 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 static async Task> GetDeletedServerAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string deletedServerName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetDeletedServers(locationName).GetAsync(deletedServerName, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetDeletedServerAsync(locationName, deletedServerName, cancellationToken).ConfigureAwait(false); } /// @@ -3189,26 +2936,36 @@ public static async Task> GetDeletedServerAsync( /// DeletedServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// The name of the deleted server. /// The cancellation token to use. - /// 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 static Response GetDeletedServer(this SubscriptionResource subscriptionResource, AzureLocation locationName, string deletedServerName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetDeletedServers(locationName).Get(deletedServerName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetDeletedServer(locationName, deletedServerName, cancellationToken); } - /// Gets a collection of SubscriptionUsageResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionUsageResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// An object representing collection of SubscriptionUsageResources and their operations over a SubscriptionUsageResource. public static SubscriptionUsageCollection GetSubscriptionUsages(this SubscriptionResource subscriptionResource, AzureLocation locationName) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionUsages(locationName); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionUsages(locationName); } /// @@ -3223,17 +2980,21 @@ public static SubscriptionUsageCollection GetSubscriptionUsages(this Subscriptio /// SubscriptionUsages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// Name of usage metric to return. /// The cancellation token to use. - /// 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 static async Task> GetSubscriptionUsageAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string usageName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionUsages(locationName).GetAsync(usageName, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionUsageAsync(locationName, usageName, cancellationToken).ConfigureAwait(false); } /// @@ -3248,26 +3009,36 @@ public static async Task> GetSubscriptionUsa /// SubscriptionUsages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. /// Name of usage metric to return. /// The cancellation token to use. - /// 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 static Response GetSubscriptionUsage(this SubscriptionResource subscriptionResource, AzureLocation locationName, string usageName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionUsages(locationName).Get(usageName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionUsage(locationName, usageName, cancellationToken); } - /// Gets a collection of SqlTimeZoneResources in the SubscriptionResource. + /// + /// Gets a collection of SqlTimeZoneResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The String to use. /// An object representing collection of SqlTimeZoneResources and their operations over a SqlTimeZoneResource. public static SqlTimeZoneCollection GetSqlTimeZones(this SubscriptionResource subscriptionResource, AzureLocation locationName) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlTimeZones(locationName); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSqlTimeZones(locationName); } /// @@ -3282,17 +3053,21 @@ public static SqlTimeZoneCollection GetSqlTimeZones(this SubscriptionResource su /// TimeZones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. /// The String to use. /// The cancellation token to use. - /// 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 static async Task> GetSqlTimeZoneAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string timeZoneId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSqlTimeZones(locationName).GetAsync(timeZoneId, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetSqlTimeZoneAsync(locationName, timeZoneId, cancellationToken).ConfigureAwait(false); } /// @@ -3307,33 +3082,40 @@ public static async Task> GetSqlTimeZoneAsync(this /// TimeZones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. /// The String to use. /// The cancellation token to use. - /// 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 static Response GetSqlTimeZone(this SubscriptionResource subscriptionResource, AzureLocation locationName, string timeZoneId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSqlTimeZones(locationName).Get(timeZoneId, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSqlTimeZone(locationName, timeZoneId, cancellationToken); } - /// Gets a collection of SubscriptionLongTermRetentionBackupResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionLongTermRetentionBackupResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location of the database. /// The name of the server. /// The name of the database. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of SubscriptionLongTermRetentionBackupResources and their operations over a SubscriptionLongTermRetentionBackupResource. public static SubscriptionLongTermRetentionBackupCollection GetSubscriptionLongTermRetentionBackups(this SubscriptionResource subscriptionResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - Argument.AssertNotNullOrEmpty(longTermRetentionDatabaseName, nameof(longTermRetentionDatabaseName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); } /// @@ -3348,6 +3130,10 @@ public static SubscriptionLongTermRetentionBackupCollection GetSubscriptionLongT /// LongTermRetentionBackups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3355,12 +3141,12 @@ public static SubscriptionLongTermRetentionBackupCollection GetSubscriptionLongT /// The name of the database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSubscriptionLongTermRetentionBackupAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionBackupAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken).ConfigureAwait(false); } /// @@ -3375,6 +3161,10 @@ public static async Task> /// LongTermRetentionBackups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3382,28 +3172,31 @@ public static async Task> /// The name of the database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSubscriptionLongTermRetentionBackup(this SubscriptionResource subscriptionResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).Get(backupName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionBackup(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken); } - /// Gets a collection of SubscriptionLongTermRetentionManagedInstanceBackupResources in the SubscriptionResource. + /// + /// Gets a collection of SubscriptionLongTermRetentionManagedInstanceBackupResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The location of the database. /// The name of the managed instance. /// The name of the managed database. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of SubscriptionLongTermRetentionManagedInstanceBackupResources and their operations over a SubscriptionLongTermRetentionManagedInstanceBackupResource. public static SubscriptionLongTermRetentionManagedInstanceBackupCollection GetSubscriptionLongTermRetentionManagedInstanceBackups(this SubscriptionResource subscriptionResource, AzureLocation locationName, string managedInstanceName, string databaseName) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName); } /// @@ -3418,6 +3211,10 @@ public static SubscriptionLongTermRetentionManagedInstanceBackupCollection GetSu /// LongTermRetentionManagedInstanceBackups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3425,12 +3222,12 @@ public static SubscriptionLongTermRetentionManagedInstanceBackupCollection GetSu /// The name of the managed database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetSubscriptionLongTermRetentionManagedInstanceBackupAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionManagedInstanceBackupAsync(locationName, managedInstanceName, databaseName, backupName, cancellationToken).ConfigureAwait(false); } /// @@ -3445,6 +3242,10 @@ public static async TaskLongTermRetentionManagedInstanceBackups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3452,12 +3253,12 @@ public static async Task The name of the managed database. /// The backup name. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetSubscriptionLongTermRetentionManagedInstanceBackup(this SubscriptionResource subscriptionResource, AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).Get(backupName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSubscriptionLongTermRetentionManagedInstanceBackup(locationName, managedInstanceName, databaseName, backupName, cancellationToken); } /// @@ -3472,13 +3273,17 @@ public static ResponseDeletedServers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeletedServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedServersAsync(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetDeletedServersAsync(cancellationToken); } /// @@ -3493,13 +3298,17 @@ public static AsyncPageable GetDeletedServersAsync(this S /// DeletedServers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeletedServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeletedServers(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetDeletedServers(cancellationToken); } /// @@ -3514,13 +3323,17 @@ public static Pageable GetDeletedServers(this Subscriptio /// InstancePools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetInstancePoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetInstancePoolsAsync(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetInstancePoolsAsync(cancellationToken); } /// @@ -3535,13 +3348,17 @@ public static AsyncPageable GetInstancePoolsAsync(this Sub /// InstancePools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetInstancePools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetInstancePools(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetInstancePools(cancellationToken); } /// @@ -3556,6 +3373,10 @@ public static Pageable GetInstancePools(this SubscriptionR /// Capabilities_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location name whose capabilities are retrieved. @@ -3563,7 +3384,7 @@ public static Pageable GetInstancePools(this SubscriptionR /// The cancellation token to use. public static async Task> GetCapabilitiesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, SqlCapabilityGroup? include = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilitiesByLocationAsync(locationName, include, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).GetCapabilitiesByLocationAsync(locationName, include, cancellationToken).ConfigureAwait(false); } /// @@ -3578,6 +3399,10 @@ public static async Task> GetCapabilitiesByLoc /// Capabilities_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location name whose capabilities are retrieved. @@ -3585,7 +3410,7 @@ public static async Task> GetCapabilitiesByLoc /// The cancellation token to use. public static Response GetCapabilitiesByLocation(this SubscriptionResource subscriptionResource, AzureLocation locationName, SqlCapabilityGroup? include = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilitiesByLocation(locationName, include, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetCapabilitiesByLocation(locationName, include, cancellationToken); } /// @@ -3600,6 +3425,10 @@ public static Response GetCapabilitiesByLocation(this S /// SyncGroups_ListSyncDatabaseIds /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. @@ -3607,7 +3436,7 @@ public static Response GetCapabilitiesByLocation(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSyncDatabaseIdsSyncGroupsAsync(locationName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSyncDatabaseIdsSyncGroupsAsync(locationName, cancellationToken); } /// @@ -3622,6 +3451,10 @@ public static AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(this /// SyncGroups_ListSyncDatabaseIds /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the region where the resource is located. @@ -3629,7 +3462,7 @@ public static AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSyncDatabaseIdsSyncGroups(this SubscriptionResource subscriptionResource, AzureLocation locationName, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSyncDatabaseIdsSyncGroups(locationName, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSyncDatabaseIdsSyncGroups(locationName, cancellationToken); } /// @@ -3644,6 +3477,10 @@ public static Pageable GetSyncDatabaseIdsSyncGroups(this Subscripti /// LongTermRetentionBackups_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3653,7 +3490,7 @@ public static Pageable GetSyncDatabaseIdsSyncGroups(this Subscripti /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionBackupsWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3668,6 +3505,10 @@ public static AsyncPageable GetLongTermRetentionBac /// LongTermRetentionBackups_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3677,7 +3518,7 @@ public static AsyncPageable GetLongTermRetentionBac /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionBackupsWithLocation(this SubscriptionResource subscriptionResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3692,6 +3533,10 @@ public static Pageable GetLongTermRetentionBackupsW /// LongTermRetentionBackups_ListByServer /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3704,9 +3549,7 @@ public static Pageable GetLongTermRetentionBackupsW /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionBackupsWithServerAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionBackupsWithServerAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionBackupsWithServerAsync(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3721,6 +3564,10 @@ public static AsyncPageable GetLongTermRetentionBac /// LongTermRetentionBackups_ListByServer /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3733,9 +3580,7 @@ public static AsyncPageable GetLongTermRetentionBac /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionBackupsWithServer(this SubscriptionResource subscriptionResource, AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionBackupsWithServer(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionBackupsWithServer(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3750,6 +3595,10 @@ public static Pageable GetLongTermRetentionBackupsW /// LongTermRetentionManagedInstanceBackups_ListByInstance /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3762,9 +3611,7 @@ public static Pageable GetLongTermRetentionBackupsW /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3779,6 +3626,10 @@ public static AsyncPageable GetLongT /// LongTermRetentionManagedInstanceBackups_ListByInstance /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3791,9 +3642,7 @@ public static AsyncPageable GetLongT /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionManagedInstanceBackupsWithInstance(this SubscriptionResource subscriptionResource, AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithInstance(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithInstance(locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3808,6 +3657,10 @@ public static Pageable GetLongTermRe /// LongTermRetentionManagedInstanceBackups_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3817,7 +3670,7 @@ public static Pageable GetLongTermRe /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3832,6 +3685,10 @@ public static AsyncPageable GetLongT /// LongTermRetentionManagedInstanceBackups_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the database. @@ -3841,7 +3698,7 @@ public static AsyncPageable GetLongT /// A collection of that may take multiple service requests to iterate over. public static Pageable GetLongTermRetentionManagedInstanceBackupsWithLocation(this SubscriptionResource subscriptionResource, AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetLongTermRetentionManagedInstanceBackupsWithLocation(locationName, onlyLatestPerDatabase, databaseState, cancellationToken); } /// @@ -3856,13 +3713,17 @@ public static Pageable GetLongTermRe /// VirtualClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualClustersAsync(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetVirtualClustersAsync(cancellationToken); } /// @@ -3877,13 +3738,17 @@ public static AsyncPageable GetVirtualClustersAsync(this /// VirtualClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualClusters(cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetVirtualClusters(cancellationToken); } /// @@ -3898,6 +3763,10 @@ public static Pageable GetVirtualClusters(this Subscript /// ManagedInstances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The child resources to include in the response. @@ -3905,7 +3774,7 @@ public static Pageable GetVirtualClusters(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedInstancesAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedInstancesAsync(expand, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetManagedInstancesAsync(expand, cancellationToken); } /// @@ -3920,6 +3789,10 @@ public static AsyncPageable GetManagedInstancesAsync(th /// ManagedInstances_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The child resources to include in the response. @@ -3927,7 +3800,7 @@ public static AsyncPageable GetManagedInstancesAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedInstances(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedInstances(expand, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetManagedInstances(expand, cancellationToken); } /// @@ -3942,6 +3815,10 @@ public static Pageable GetManagedInstances(this Subscri /// Servers_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name availability request parameters. @@ -3949,9 +3826,7 @@ public static Pageable GetManagedInstances(this Subscri /// is null. public static async Task> CheckSqlServerNameAvailabilityAsync(this SubscriptionResource subscriptionResource, SqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSqlServerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetSqlSubscriptionMockingExtension(subscriptionResource).CheckSqlServerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -3966,6 +3841,10 @@ public static async Task> CheckSqlServerNa /// Servers_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name availability request parameters. @@ -3973,9 +3852,7 @@ public static async Task> CheckSqlServerNa /// is null. public static Response CheckSqlServerNameAvailability(this SubscriptionResource subscriptionResource, SqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckSqlServerNameAvailability(content, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).CheckSqlServerNameAvailability(content, cancellationToken); } /// @@ -3990,6 +3867,10 @@ public static Response CheckSqlServerNameAvailabili /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The child resources to include in the response. @@ -3997,7 +3878,7 @@ public static Response CheckSqlServerNameAvailabili /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSqlServersAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlServersAsync(expand, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSqlServersAsync(expand, cancellationToken); } /// @@ -4012,6 +3893,10 @@ public static AsyncPageable GetSqlServersAsync(this Subscript /// Servers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The child resources to include in the response. @@ -4019,7 +3904,7 @@ public static AsyncPageable GetSqlServersAsync(this Subscript /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSqlServers(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlServers(expand, cancellationToken); + return GetSqlSubscriptionMockingExtension(subscriptionResource).GetSqlServers(expand, cancellationToken); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlResourceGroupMockingExtension.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..bba5fb06d4e5 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlResourceGroupMockingExtension.cs @@ -0,0 +1,728 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Sql; +using Azure.ResourceManager.Sql.Models; + +namespace Azure.ResourceManager.Sql.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class SqlResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _longTermRetentionBackupsClientDiagnostics; + private LongTermRetentionBackupsRestOperations _longTermRetentionBackupsRestClient; + private ClientDiagnostics _longTermRetentionManagedInstanceBackupsClientDiagnostics; + private LongTermRetentionManagedInstanceBackupsRestOperations _longTermRetentionManagedInstanceBackupsRestClient; + + /// Initializes a new instance of the class for mocking. + protected SqlResourceGroupMockingExtension() + { + } + + /// 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 SqlResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of InstancePoolResources in the ResourceGroupResource. + /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. + public virtual InstancePoolCollection GetInstancePools() + { + return GetCachedClient(client => new InstancePoolCollection(client, Id)); + } + + /// + /// Gets an instance pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} + /// + /// + /// Operation Id + /// InstancePools_Get + /// + /// + /// + /// The name of the instance pool to be retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetInstancePoolAsync(string instancePoolName, CancellationToken cancellationToken = default) + { + return await GetInstancePools().GetAsync(instancePoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an instance pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} + /// + /// + /// Operation Id + /// InstancePools_Get + /// + /// + /// + /// The name of the instance pool to be retrieved. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetInstancePool(string instancePoolName, CancellationToken cancellationToken = default) + { + return GetInstancePools().Get(instancePoolName, cancellationToken); + } + + /// Gets a collection of SqlServerTrustGroupResources in the ResourceGroupResource. + /// The name of the region where the resource is located. + /// An object representing collection of SqlServerTrustGroupResources and their operations over a SqlServerTrustGroupResource. + public virtual SqlServerTrustGroupCollection GetSqlServerTrustGroups(AzureLocation locationName) + { + return new SqlServerTrustGroupCollection(Client, Id, locationName); + } + + /// + /// Gets a server trust group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName} + /// + /// + /// Operation Id + /// ServerTrustGroups_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the server trust group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlServerTrustGroupAsync(AzureLocation locationName, string serverTrustGroupName, CancellationToken cancellationToken = default) + { + return await GetSqlServerTrustGroups(locationName).GetAsync(serverTrustGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a server trust group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName} + /// + /// + /// Operation Id + /// ServerTrustGroups_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the server trust group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlServerTrustGroup(AzureLocation locationName, string serverTrustGroupName, CancellationToken cancellationToken = default) + { + return GetSqlServerTrustGroups(locationName).Get(serverTrustGroupName, cancellationToken); + } + + /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// An object representing collection of ResourceGroupLongTermRetentionBackupResources and their operations over a ResourceGroupLongTermRetentionBackupResource. + public virtual ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLongTermRetentionBackups(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) + { + return new ResourceGroupLongTermRetentionBackupCollection(Client, Id, locationName, longTermRetentionServerName, longTermRetentionDatabaseName); + } + + /// + /// Gets a long term retention backup. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionBackups_GetByResourceGroup + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGroupLongTermRetentionBackupAsync(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + { + return await GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a long term retention backup. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionBackups_GetByResourceGroup + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGroupLongTermRetentionBackup(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + { + return GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).Get(backupName, cancellationToken); + } + + /// Gets a collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources in the ResourceGroupResource. + /// The location of the database. + /// The name of the managed instance. + /// The name of the managed database. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// An object representing collection of ResourceGroupLongTermRetentionManagedInstanceBackupResources and their operations over a ResourceGroupLongTermRetentionManagedInstanceBackupResource. + public virtual ResourceGroupLongTermRetentionManagedInstanceBackupCollection GetResourceGroupLongTermRetentionManagedInstanceBackups(AzureLocation locationName, string managedInstanceName, string databaseName) + { + return new ResourceGroupLongTermRetentionManagedInstanceBackupCollection(Client, Id, locationName, managedInstanceName, databaseName); + } + + /// + /// Gets a long term retention backup for a managed database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_GetByResourceGroup + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// The name of the managed database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGroupLongTermRetentionManagedInstanceBackupAsync(AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) + { + return await GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a long term retention backup for a managed database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_GetByResourceGroup + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// The name of the managed database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGroupLongTermRetentionManagedInstanceBackup(AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) + { + return GetResourceGroupLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).Get(backupName, cancellationToken); + } + + /// Gets a collection of VirtualClusterResources in the ResourceGroupResource. + /// An object representing collection of VirtualClusterResources and their operations over a VirtualClusterResource. + public virtual VirtualClusterCollection GetVirtualClusters() + { + return GetCachedClient(client => new VirtualClusterCollection(client, Id)); + } + + /// + /// Gets a virtual cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName} + /// + /// + /// Operation Id + /// VirtualClusters_Get + /// + /// + /// + /// The name of the virtual cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualClusterAsync(string virtualClusterName, CancellationToken cancellationToken = default) + { + return await GetVirtualClusters().GetAsync(virtualClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a virtual cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName} + /// + /// + /// Operation Id + /// VirtualClusters_Get + /// + /// + /// + /// The name of the virtual cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualCluster(string virtualClusterName, CancellationToken cancellationToken = default) + { + return GetVirtualClusters().Get(virtualClusterName, cancellationToken); + } + + /// Gets a collection of InstanceFailoverGroupResources in the ResourceGroupResource. + /// The name of the region where the resource is located. + /// An object representing collection of InstanceFailoverGroupResources and their operations over a InstanceFailoverGroupResource. + public virtual InstanceFailoverGroupCollection GetInstanceFailoverGroups(AzureLocation locationName) + { + return new InstanceFailoverGroupCollection(Client, Id, locationName); + } + + /// + /// Gets a failover group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName} + /// + /// + /// Operation Id + /// InstanceFailoverGroups_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the failover group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetInstanceFailoverGroupAsync(AzureLocation locationName, string failoverGroupName, CancellationToken cancellationToken = default) + { + return await GetInstanceFailoverGroups(locationName).GetAsync(failoverGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a failover group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName} + /// + /// + /// Operation Id + /// InstanceFailoverGroups_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the failover group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetInstanceFailoverGroup(AzureLocation locationName, string failoverGroupName, CancellationToken cancellationToken = default) + { + return GetInstanceFailoverGroups(locationName).Get(failoverGroupName, cancellationToken); + } + + /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. + /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. + public virtual ManagedInstanceCollection GetManagedInstances() + { + return GetCachedClient(client => new ManagedInstanceCollection(client, Id)); + } + + /// + /// Gets a managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// + /// + /// Operation Id + /// ManagedInstances_Get + /// + /// + /// + /// The name of the managed instance. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedInstanceAsync(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetManagedInstances().GetAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// + /// + /// Operation Id + /// ManagedInstances_Get + /// + /// + /// + /// The name of the managed instance. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedInstance(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + { + return GetManagedInstances().Get(managedInstanceName, expand, cancellationToken); + } + + /// Gets a collection of SqlServerResources in the ResourceGroupResource. + /// An object representing collection of SqlServerResources and their operations over a SqlServerResource. + public virtual SqlServerCollection GetSqlServers() + { + return GetCachedClient(client => new SqlServerCollection(client, Id)); + } + + /// + /// Gets a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlServerAsync(string serverName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetSqlServers().GetAsync(serverName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName} + /// + /// + /// Operation Id + /// Servers_Get + /// + /// + /// + /// The name of the server. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlServer(string serverName, string expand = null, CancellationToken cancellationToken = default) + { + return GetSqlServers().Get(serverName, expand, cancellationToken); + } + + /// + /// Lists the long term retention backups for a given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups + /// + /// + /// Operation Id + /// LongTermRetentionBackups_ListByResourceGroupLocation + /// + /// + /// + /// The location of the database. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLongTermRetentionBackupsWithLocationAsync(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for a given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups + /// + /// + /// Operation Id + /// LongTermRetentionBackups_ListByResourceGroupLocation + /// + /// + /// + /// The location of the database. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLongTermRetentionBackupsWithLocation(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for a given server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups + /// + /// + /// Operation Id + /// LongTermRetentionBackups_ListByResourceGroupServer + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLongTermRetentionBackupsWithServerAsync(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for a given server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups + /// + /// + /// Operation Id + /// LongTermRetentionBackups_ListByResourceGroupServer + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLongTermRetentionBackupsWithServer(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByResourceGroupServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for a given managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for a given managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupInstance + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLongTermRetentionManagedInstanceBackupsWithInstance(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupInstanceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for managed databases in a given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation + /// + /// + /// + /// The location of the database. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithLocationAsync(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the long term retention backups for managed databases in a given location. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_ListByResourceGroupLocation + /// + /// + /// + /// The location of the database. + /// Whether or not to only get the latest backup for each database. + /// Whether to query against just live databases, just deleted databases, or all databases. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetLongTermRetentionManagedInstanceBackupsWithLocation(AzureLocation locationName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationRequest(Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByResourceGroupLocationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, locationName, onlyLatestPerDatabase, databaseState); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlResourceGroupMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlSubscriptionMockingExtension.cs similarity index 69% rename from sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlSubscriptionMockingExtension.cs index aefd96deaf4b..78a9c1d863a2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlSubscriptionMockingExtension.cs @@ -15,12 +15,13 @@ using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.Sql; using Azure.ResourceManager.Sql.Models; -namespace Azure.ResourceManager.Sql +namespace Azure.ResourceManager.Sql.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class SqlSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _deletedServerClientDiagnostics; private DeletedServersRestOperations _deletedServerRestClient; @@ -41,15 +42,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _sqlServerServersClientDiagnostics; private ServersRestOperations _sqlServerServersRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected SqlSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal SqlSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -86,6 +87,54 @@ public virtual DeletedServerCollection GetDeletedServers(AzureLocation locationN return new DeletedServerCollection(Client, Id, locationName); } + /// + /// Gets a deleted server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName} + /// + /// + /// Operation Id + /// DeletedServers_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the deleted server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeletedServerAsync(AzureLocation locationName, string deletedServerName, CancellationToken cancellationToken = default) + { + return await GetDeletedServers(locationName).GetAsync(deletedServerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a deleted server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName} + /// + /// + /// Operation Id + /// DeletedServers_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// The name of the deleted server. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeletedServer(AzureLocation locationName, string deletedServerName, CancellationToken cancellationToken = default) + { + return GetDeletedServers(locationName).Get(deletedServerName, cancellationToken); + } + /// Gets a collection of SubscriptionUsageResources in the SubscriptionResource. /// The name of the region where the resource is located. /// An object representing collection of SubscriptionUsageResources and their operations over a SubscriptionUsageResource. @@ -94,6 +143,54 @@ public virtual SubscriptionUsageCollection GetSubscriptionUsages(AzureLocation l return new SubscriptionUsageCollection(Client, Id, locationName); } + /// + /// Gets a subscription usage metric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName} + /// + /// + /// Operation Id + /// SubscriptionUsages_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// Name of usage metric to return. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionUsageAsync(AzureLocation locationName, string usageName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionUsages(locationName).GetAsync(usageName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a subscription usage metric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName} + /// + /// + /// Operation Id + /// SubscriptionUsages_Get + /// + /// + /// + /// The name of the region where the resource is located. + /// Name of usage metric to return. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionUsage(AzureLocation locationName, string usageName, CancellationToken cancellationToken = default) + { + return GetSubscriptionUsages(locationName).Get(usageName, cancellationToken); + } + /// Gets a collection of SqlTimeZoneResources in the SubscriptionResource. /// The String to use. /// An object representing collection of SqlTimeZoneResources and their operations over a SqlTimeZoneResource. @@ -102,26 +199,182 @@ public virtual SqlTimeZoneCollection GetSqlTimeZones(AzureLocation locationName) return new SqlTimeZoneCollection(Client, Id, locationName); } + /// + /// Gets a managed instance time zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId} + /// + /// + /// Operation Id + /// TimeZones_Get + /// + /// + /// + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlTimeZoneAsync(AzureLocation locationName, string timeZoneId, CancellationToken cancellationToken = default) + { + return await GetSqlTimeZones(locationName).GetAsync(timeZoneId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a managed instance time zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId} + /// + /// + /// Operation Id + /// TimeZones_Get + /// + /// + /// + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlTimeZone(AzureLocation locationName, string timeZoneId, CancellationToken cancellationToken = default) + { + return GetSqlTimeZones(locationName).Get(timeZoneId, cancellationToken); + } + /// Gets a collection of SubscriptionLongTermRetentionBackupResources in the SubscriptionResource. /// The location of the database. /// The name of the server. /// The name of the database. + /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of SubscriptionLongTermRetentionBackupResources and their operations over a SubscriptionLongTermRetentionBackupResource. public virtual SubscriptionLongTermRetentionBackupCollection GetSubscriptionLongTermRetentionBackups(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) { return new SubscriptionLongTermRetentionBackupCollection(Client, Id, locationName, longTermRetentionServerName, longTermRetentionDatabaseName); } + /// + /// Gets a long term retention backup. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionBackups_Get + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionLongTermRetentionBackupAsync(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a long term retention backup. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionBackups_Get + /// + /// + /// + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionLongTermRetentionBackup(AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + { + return GetSubscriptionLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).Get(backupName, cancellationToken); + } + /// Gets a collection of SubscriptionLongTermRetentionManagedInstanceBackupResources in the SubscriptionResource. /// The location of the database. /// The name of the managed instance. /// The name of the managed database. + /// or is null. + /// or is an empty string, and was expected to be non-empty. /// An object representing collection of SubscriptionLongTermRetentionManagedInstanceBackupResources and their operations over a SubscriptionLongTermRetentionManagedInstanceBackupResource. public virtual SubscriptionLongTermRetentionManagedInstanceBackupCollection GetSubscriptionLongTermRetentionManagedInstanceBackups(AzureLocation locationName, string managedInstanceName, string databaseName) { return new SubscriptionLongTermRetentionManagedInstanceBackupCollection(Client, Id, locationName, managedInstanceName, databaseName); } + /// + /// Gets a long term retention backup for a managed database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_Get + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// The name of the managed database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSubscriptionLongTermRetentionManagedInstanceBackupAsync(AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) + { + return await GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).GetAsync(backupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a long term retention backup for a managed database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName} + /// + /// + /// Operation Id + /// LongTermRetentionManagedInstanceBackups_Get + /// + /// + /// + /// The location of the database. + /// The name of the managed instance. + /// The name of the managed database. + /// The backup name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSubscriptionLongTermRetentionManagedInstanceBackup(AzureLocation locationName, string managedInstanceName, string databaseName, string backupName, CancellationToken cancellationToken = default) + { + return GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).Get(backupName, cancellationToken); + } + /// /// Gets a list of all deleted servers in a subscription. /// @@ -141,7 +394,7 @@ public virtual AsyncPageable GetDeletedServersAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedServerRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedServerRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedServerResource(Client, DeletedServerData.DeserializeDeletedServerData(e)), DeletedServerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedServerResource(Client, DeletedServerData.DeserializeDeletedServerData(e)), DeletedServerClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetDeletedServers", "value", "nextLink", cancellationToken); } /// @@ -163,7 +416,7 @@ public virtual Pageable GetDeletedServers(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => DeletedServerRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeletedServerRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedServerResource(Client, DeletedServerData.DeserializeDeletedServerData(e)), DeletedServerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeletedServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedServerResource(Client, DeletedServerData.DeserializeDeletedServerData(e)), DeletedServerClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetDeletedServers", "value", "nextLink", cancellationToken); } /// @@ -185,7 +438,7 @@ public virtual AsyncPageable GetInstancePoolsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => InstancePoolRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InstancePoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new InstancePoolResource(Client, InstancePoolData.DeserializeInstancePoolData(e)), InstancePoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetInstancePools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new InstancePoolResource(Client, InstancePoolData.DeserializeInstancePoolData(e)), InstancePoolClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetInstancePools", "value", "nextLink", cancellationToken); } /// @@ -207,7 +460,7 @@ public virtual Pageable GetInstancePools(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => InstancePoolRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => InstancePoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new InstancePoolResource(Client, InstancePoolData.DeserializeInstancePoolData(e)), InstancePoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetInstancePools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new InstancePoolResource(Client, InstancePoolData.DeserializeInstancePoolData(e)), InstancePoolClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetInstancePools", "value", "nextLink", cancellationToken); } /// @@ -228,7 +481,7 @@ public virtual Pageable GetInstancePools(CancellationToken /// The cancellation token to use. public virtual async Task> GetCapabilitiesByLocationAsync(AzureLocation locationName, SqlCapabilityGroup? include = null, CancellationToken cancellationToken = default) { - using var scope = CapabilitiesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilitiesByLocation"); + using var scope = CapabilitiesClientDiagnostics.CreateScope("SqlSubscriptionMockingExtension.GetCapabilitiesByLocation"); scope.Start(); try { @@ -260,7 +513,7 @@ public virtual async Task> GetCapabilitiesByLo /// The cancellation token to use. public virtual Response GetCapabilitiesByLocation(AzureLocation locationName, SqlCapabilityGroup? include = null, CancellationToken cancellationToken = default) { - using var scope = CapabilitiesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilitiesByLocation"); + using var scope = CapabilitiesClientDiagnostics.CreateScope("SqlSubscriptionMockingExtension.GetCapabilitiesByLocation"); scope.Start(); try { @@ -294,7 +547,7 @@ public virtual AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(Azur { HttpMessage FirstPageRequest(int? pageSizeHint) => SyncGroupRestClient.CreateListSyncDatabaseIdsRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SyncGroupRestClient.CreateListSyncDatabaseIdsNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), SyncGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSyncDatabaseIdsSyncGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), SyncGroupClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetSyncDatabaseIdsSyncGroups", "value", "nextLink", cancellationToken); } /// @@ -317,7 +570,7 @@ public virtual Pageable GetSyncDatabaseIdsSyncGroups(AzureLocation { HttpMessage FirstPageRequest(int? pageSizeHint) => SyncGroupRestClient.CreateListSyncDatabaseIdsRequest(Id.SubscriptionId, locationName); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SyncGroupRestClient.CreateListSyncDatabaseIdsNextPageRequest(nextLink, Id.SubscriptionId, locationName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), SyncGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSyncDatabaseIdsSyncGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), SyncGroupClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetSyncDatabaseIdsSyncGroups", "value", "nextLink", cancellationToken); } /// @@ -342,7 +595,7 @@ public virtual AsyncPageable GetLongTermRetentionBa { HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByLocationRequest(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); } /// @@ -367,7 +620,7 @@ public virtual Pageable GetLongTermRetentionBackups { HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByLocationRequest(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionBackupsWithLocation", "value", "nextLink", cancellationToken); } /// @@ -388,12 +641,16 @@ public virtual Pageable GetLongTermRetentionBackups /// Whether or not to only get the latest backup for each database. /// Whether to query against just live databases, just deleted databases, or all databases. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetLongTermRetentionBackupsWithServerAsync(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByServerRequest(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); } /// @@ -414,12 +671,16 @@ public virtual AsyncPageable GetLongTermRetentionBa /// Whether or not to only get the latest backup for each database. /// Whether to query against just live databases, just deleted databases, or all databases. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetLongTermRetentionBackupsWithServer(AzureLocation locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(longTermRetentionServerName, nameof(longTermRetentionServerName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionBackupsRestClient.CreateListByServerRequest(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionBackupsRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData, LongTermRetentionBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); } /// @@ -440,12 +701,16 @@ public virtual Pageable GetLongTermRetentionBackups /// Whether or not to only get the latest backup for each database. /// Whether to query against just live databases, just deleted databases, or all databases. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsWithInstanceAsync(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByInstanceRequest(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByInstanceNextPageRequest(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); } /// @@ -466,12 +731,16 @@ public virtual AsyncPageable GetLong /// Whether or not to only get the latest backup for each database. /// Whether to query against just live databases, just deleted databases, or all databases. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetLongTermRetentionManagedInstanceBackupsWithInstance(AzureLocation locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, SqlDatabaseState? databaseState = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByInstanceRequest(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByInstanceNextPageRequest(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithInstance", "value", "nextLink", cancellationToken); } /// @@ -496,7 +765,7 @@ public virtual AsyncPageable GetLong { HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByLocationRequest(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); } /// @@ -521,7 +790,7 @@ public virtual Pageable GetLongTermR { HttpMessage FirstPageRequest(int? pageSizeHint) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByLocationRequest(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LongTermRetentionManagedInstanceBackupsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedInstanceLongTermRetentionBackupData.DeserializeManagedInstanceLongTermRetentionBackupData, LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetLongTermRetentionManagedInstanceBackupsWithLocation", "value", "nextLink", cancellationToken); } /// @@ -543,7 +812,7 @@ public virtual AsyncPageable GetVirtualClustersAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualClusterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualClusterResource(Client, VirtualClusterData.DeserializeVirtualClusterData(e)), VirtualClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualClusterResource(Client, VirtualClusterData.DeserializeVirtualClusterData(e)), VirtualClusterClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetVirtualClusters", "value", "nextLink", cancellationToken); } /// @@ -565,7 +834,7 @@ public virtual Pageable GetVirtualClusters(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualClusterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualClusterResource(Client, VirtualClusterData.DeserializeVirtualClusterData(e)), VirtualClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualClusterResource(Client, VirtualClusterData.DeserializeVirtualClusterData(e)), VirtualClusterClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetVirtualClusters", "value", "nextLink", cancellationToken); } /// @@ -588,7 +857,7 @@ public virtual AsyncPageable GetManagedInstancesAsync(s { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedInstances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetManagedInstances", "value", "nextLink", cancellationToken); } /// @@ -611,7 +880,7 @@ public virtual Pageable GetManagedInstances(string expa { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedInstances", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetManagedInstances", "value", "nextLink", cancellationToken); } /// @@ -629,9 +898,12 @@ public virtual Pageable GetManagedInstances(string expa /// /// The name availability request parameters. /// The cancellation token to use. + /// is null. public virtual async Task> CheckSqlServerNameAvailabilityAsync(SqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSqlServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SqlServerServersClientDiagnostics.CreateScope("SqlSubscriptionMockingExtension.CheckSqlServerNameAvailability"); scope.Start(); try { @@ -660,9 +932,12 @@ public virtual async Task> CheckSqlServerN /// /// The name availability request parameters. /// The cancellation token to use. + /// is null. public virtual Response CheckSqlServerNameAvailability(SqlNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckSqlServerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SqlServerServersClientDiagnostics.CreateScope("SqlSubscriptionMockingExtension.CheckSqlServerNameAvailability"); scope.Start(); try { @@ -696,7 +971,7 @@ public virtual AsyncPageable GetSqlServersAsync(string expand { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlServerServersRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlServerResource(Client, SqlServerData.DeserializeSqlServerData(e)), SqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlServerResource(Client, SqlServerData.DeserializeSqlServerData(e)), SqlServerServersClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetSqlServers", "value", "nextLink", cancellationToken); } /// @@ -719,7 +994,7 @@ public virtual Pageable GetSqlServers(string expand = null, C { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlServerServersRestClient.CreateListRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlServerServersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlServerResource(Client, SqlServerData.DeserializeSqlServerData(e)), SqlServerServersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlServerResource(Client, SqlServerData.DeserializeSqlServerData(e)), SqlServerServersClientDiagnostics, Pipeline, "SqlSubscriptionMockingExtension.GetSqlServers", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseColumnResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseColumnResource.cs index 7e08437db91c..3a3d4c715fc2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseColumnResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseColumnResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedDatabaseSensitivityLabelResources and their operations over a ManagedDatabaseSensitivityLabelResource. public virtual ManagedDatabaseSensitivityLabelCollection GetManagedDatabaseSensitivityLabels() { - return GetCachedClient(Client => new ManagedDatabaseSensitivityLabelCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseSensitivityLabelCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseResource.cs index c2526226ab99..079fbf669fa0 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseResource.cs @@ -111,7 +111,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedDatabaseSchemaResources and their operations over a ManagedDatabaseSchemaResource. public virtual ManagedDatabaseSchemaCollection GetManagedDatabaseSchemas() { - return GetCachedClient(Client => new ManagedDatabaseSchemaCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseSchemaCollection(client, Id)); } /// @@ -129,8 +129,8 @@ public virtual ManagedDatabaseSchemaCollection GetManagedDatabaseSchemas() /// /// The name of the schema. /// The cancellation token to use. - /// 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> GetManagedDatabaseSchemaAsync(string schemaName, CancellationToken cancellationToken = default) { @@ -152,8 +152,8 @@ public virtual async Task> GetManagedDat /// /// The name of the schema. /// The cancellation token to use. - /// 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 GetManagedDatabaseSchema(string schemaName, CancellationToken cancellationToken = default) { @@ -164,7 +164,7 @@ public virtual Response GetManagedDatabaseSchema( /// An object representing collection of ManagedDatabaseVulnerabilityAssessmentResources and their operations over a ManagedDatabaseVulnerabilityAssessmentResource. public virtual ManagedDatabaseVulnerabilityAssessmentCollection GetManagedDatabaseVulnerabilityAssessments() { - return GetCachedClient(Client => new ManagedDatabaseVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseVulnerabilityAssessmentCollection(client, Id)); } /// @@ -213,7 +213,7 @@ public virtual Response GetManag /// An object representing collection of ManagedBackupShortTermRetentionPolicyResources and their operations over a ManagedBackupShortTermRetentionPolicyResource. public virtual ManagedBackupShortTermRetentionPolicyCollection GetManagedBackupShortTermRetentionPolicies() { - return GetCachedClient(Client => new ManagedBackupShortTermRetentionPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedBackupShortTermRetentionPolicyCollection(client, Id)); } /// @@ -262,7 +262,7 @@ public virtual Response GetManage /// An object representing collection of ManagedDatabaseSecurityAlertPolicyResources and their operations over a ManagedDatabaseSecurityAlertPolicyResource. public virtual ManagedDatabaseSecurityAlertPolicyCollection GetManagedDatabaseSecurityAlertPolicies() { - return GetCachedClient(Client => new ManagedDatabaseSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseSecurityAlertPolicyCollection(client, Id)); } /// @@ -311,7 +311,7 @@ public virtual Response GetManagedDa /// An object representing collection of ManagedTransparentDataEncryptionResources and their operations over a ManagedTransparentDataEncryptionResource. public virtual ManagedTransparentDataEncryptionCollection GetManagedTransparentDataEncryptions() { - return GetCachedClient(Client => new ManagedTransparentDataEncryptionCollection(Client, Id)); + return GetCachedClient(client => new ManagedTransparentDataEncryptionCollection(client, Id)); } /// @@ -360,7 +360,7 @@ public virtual Response GetManagedTran /// An object representing collection of ManagedInstanceLongTermRetentionPolicyResources and their operations over a ManagedInstanceLongTermRetentionPolicyResource. public virtual ManagedInstanceLongTermRetentionPolicyCollection GetManagedInstanceLongTermRetentionPolicies() { - return GetCachedClient(Client => new ManagedInstanceLongTermRetentionPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceLongTermRetentionPolicyCollection(client, Id)); } /// @@ -409,7 +409,7 @@ public virtual Response GetManag /// An object representing collection of ManagedDatabaseAdvancedThreatProtectionResources and their operations over a ManagedDatabaseAdvancedThreatProtectionResource. public virtual ManagedDatabaseAdvancedThreatProtectionCollection GetManagedDatabaseAdvancedThreatProtections() { - return GetCachedClient(Client => new ManagedDatabaseAdvancedThreatProtectionCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseAdvancedThreatProtectionCollection(client, Id)); } /// @@ -458,7 +458,7 @@ public virtual Response GetMana /// An object representing collection of ManagedDatabaseRestoreDetailResources and their operations over a ManagedDatabaseRestoreDetailResource. public virtual ManagedDatabaseRestoreDetailCollection GetManagedDatabaseRestoreDetails() { - return GetCachedClient(Client => new ManagedDatabaseRestoreDetailCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseRestoreDetailCollection(client, Id)); } /// @@ -507,7 +507,7 @@ public virtual Response GetManagedDatabase /// An object representing collection of ManagedLedgerDigestUploadResources and their operations over a ManagedLedgerDigestUploadResource. public virtual ManagedLedgerDigestUploadCollection GetManagedLedgerDigestUploads() { - return GetCachedClient(Client => new ManagedLedgerDigestUploadCollection(Client, Id)); + return GetCachedClient(client => new ManagedLedgerDigestUploadCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseSchemaResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseSchemaResource.cs index 1e2e8f0180a2..b2ac89aed278 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseSchemaResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseSchemaResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedDatabaseTableResources and their operations over a ManagedDatabaseTableResource. public virtual ManagedDatabaseTableCollection GetManagedDatabaseTables() { - return GetCachedClient(Client => new ManagedDatabaseTableCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseTableCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ManagedDatabaseTableCollection GetManagedDatabaseTables() /// /// The name of the table. /// The cancellation token to use. - /// 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> GetManagedDatabaseTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetManagedData /// /// The name of the table. /// The cancellation token to use. - /// 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 GetManagedDatabaseTable(string tableName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseTableResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseTableResource.cs index 31d4ec4eac93..9c4c771308a8 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseTableResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseTableResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedDatabaseColumnResources and their operations over a ManagedDatabaseColumnResource. public virtual ManagedDatabaseColumnCollection GetManagedDatabaseColumns() { - return GetCachedClient(Client => new ManagedDatabaseColumnCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseColumnCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ManagedDatabaseColumnCollection GetManagedDatabaseColumns() /// /// The name of the column. /// The cancellation token to use. - /// 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> GetManagedDatabaseColumnAsync(string columnName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetManagedDat /// /// The name of the column. /// The cancellation token to use. - /// 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 GetManagedDatabaseColumn(string columnName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentResource.cs index 4eac801917f3..8474036bedbd 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedDatabaseVulnerabilityAssessmentResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedDatabaseVulnerabilityAssessmentRuleBaselineResources and their operations over a ManagedDatabaseVulnerabilityAssessmentRuleBaselineResource. public virtual ManagedDatabaseVulnerabilityAssessmentRuleBaselineCollection GetManagedDatabaseVulnerabilityAssessmentRuleBaselines() { - return GetCachedClient(Client => new ManagedDatabaseVulnerabilityAssessmentRuleBaselineCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseVulnerabilityAssessmentRuleBaselineCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ManagedDatabaseVulnerabilityAssessmentRuleBaselineCollection GetM /// The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). /// The cancellation token to use. - /// 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> GetManagedDatabaseVulnerabilityAssessmentRuleBaselineAsync(string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). /// The cancellation token to use. - /// 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 GetManagedDatabaseVulnerabilityAssessmentRuleBaseline(string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response An object representing collection of ManagedDatabaseVulnerabilityAssessmentScanResources and their operations over a ManagedDatabaseVulnerabilityAssessmentScanResource. public virtual ManagedDatabaseVulnerabilityAssessmentScanCollection GetManagedDatabaseVulnerabilityAssessmentScans() { - return GetCachedClient(Client => new ManagedDatabaseVulnerabilityAssessmentScanCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseVulnerabilityAssessmentScanCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ManagedDatabaseVulnerabilityAssessmentScanCollection GetManagedDa /// /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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> GetManagedDatabaseVulnerabilityAssessmentScanAsync(string scanId, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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 GetManagedDatabaseVulnerabilityAssessmentScan(string scanId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs index c258a8241a2e..bf5e1a569299 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs @@ -108,7 +108,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedInstanceAdministratorResources and their operations over a ManagedInstanceAdministratorResource. public virtual ManagedInstanceAdministratorCollection GetManagedInstanceAdministrators() { - return GetCachedClient(Client => new ManagedInstanceAdministratorCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceAdministratorCollection(client, Id)); } /// @@ -157,7 +157,7 @@ public virtual Response GetManagedInstance /// An object representing collection of ManagedInstanceAzureADOnlyAuthenticationResources and their operations over a ManagedInstanceAzureADOnlyAuthenticationResource. public virtual ManagedInstanceAzureADOnlyAuthenticationCollection GetManagedInstanceAzureADOnlyAuthentications() { - return GetCachedClient(Client => new ManagedInstanceAzureADOnlyAuthenticationCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceAzureADOnlyAuthenticationCollection(client, Id)); } /// @@ -206,7 +206,7 @@ public virtual Response GetMan /// An object representing collection of ManagedInstanceEncryptionProtectorResources and their operations over a ManagedInstanceEncryptionProtectorResource. public virtual ManagedInstanceEncryptionProtectorCollection GetManagedInstanceEncryptionProtectors() { - return GetCachedClient(Client => new ManagedInstanceEncryptionProtectorCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceEncryptionProtectorCollection(client, Id)); } /// @@ -255,7 +255,7 @@ public virtual Response GetManagedIn /// An object representing collection of ManagedInstanceKeyResources and their operations over a ManagedInstanceKeyResource. public virtual ManagedInstanceKeyCollection GetManagedInstanceKeys() { - return GetCachedClient(Client => new ManagedInstanceKeyCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceKeyCollection(client, Id)); } /// @@ -273,8 +273,8 @@ public virtual ManagedInstanceKeyCollection GetManagedInstanceKeys() /// /// The name of the managed instance key to be retrieved. /// The cancellation token to use. - /// 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> GetManagedInstanceKeyAsync(string keyName, CancellationToken cancellationToken = default) { @@ -296,8 +296,8 @@ public virtual async Task> GetManagedInstan /// /// The name of the managed instance key to be retrieved. /// The cancellation token to use. - /// 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 GetManagedInstanceKey(string keyName, CancellationToken cancellationToken = default) { @@ -308,7 +308,7 @@ public virtual Response GetManagedInstanceKey(string /// An object representing collection of ManagedInstanceOperationResources and their operations over a ManagedInstanceOperationResource. public virtual ManagedInstanceOperationCollection GetManagedInstanceOperations() { - return GetCachedClient(Client => new ManagedInstanceOperationCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceOperationCollection(client, Id)); } /// @@ -357,7 +357,7 @@ public virtual Response GetManagedInstanceOper /// An object representing collection of ManagedInstancePrivateEndpointConnectionResources and their operations over a ManagedInstancePrivateEndpointConnectionResource. public virtual ManagedInstancePrivateEndpointConnectionCollection GetManagedInstancePrivateEndpointConnections() { - return GetCachedClient(Client => new ManagedInstancePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstancePrivateEndpointConnectionCollection(client, Id)); } /// @@ -375,8 +375,8 @@ public virtual ManagedInstancePrivateEndpointConnectionCollection GetManagedInst /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetManagedInstancePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -398,8 +398,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetManagedInstancePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -410,7 +410,7 @@ public virtual Response GetMan /// An object representing collection of ManagedInstancePrivateLinkResources and their operations over a ManagedInstancePrivateLinkResource. public virtual ManagedInstancePrivateLinkCollection GetManagedInstancePrivateLinks() { - return GetCachedClient(Client => new ManagedInstancePrivateLinkCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstancePrivateLinkCollection(client, Id)); } /// @@ -428,8 +428,8 @@ public virtual ManagedInstancePrivateLinkCollection GetManagedInstancePrivateLin /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetManagedInstancePrivateLinkAsync(string groupName, CancellationToken cancellationToken = default) { @@ -451,8 +451,8 @@ public virtual async Task> GetManag /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetManagedInstancePrivateLink(string groupName, CancellationToken cancellationToken = default) { @@ -463,7 +463,7 @@ public virtual Response GetManagedInstancePr /// An object representing collection of ManagedInstanceVulnerabilityAssessmentResources and their operations over a ManagedInstanceVulnerabilityAssessmentResource. public virtual ManagedInstanceVulnerabilityAssessmentCollection GetManagedInstanceVulnerabilityAssessments() { - return GetCachedClient(Client => new ManagedInstanceVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceVulnerabilityAssessmentCollection(client, Id)); } /// @@ -512,7 +512,7 @@ public virtual Response GetManag /// An object representing collection of ManagedServerSecurityAlertPolicyResources and their operations over a ManagedServerSecurityAlertPolicyResource. public virtual ManagedServerSecurityAlertPolicyCollection GetManagedServerSecurityAlertPolicies() { - return GetCachedClient(Client => new ManagedServerSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedServerSecurityAlertPolicyCollection(client, Id)); } /// @@ -561,7 +561,7 @@ public virtual Response GetManagedServ /// An object representing collection of RecoverableManagedDatabaseResources and their operations over a RecoverableManagedDatabaseResource. public virtual RecoverableManagedDatabaseCollection GetRecoverableManagedDatabases() { - return GetCachedClient(Client => new RecoverableManagedDatabaseCollection(Client, Id)); + return GetCachedClient(client => new RecoverableManagedDatabaseCollection(client, Id)); } /// @@ -579,8 +579,8 @@ public virtual RecoverableManagedDatabaseCollection GetRecoverableManagedDatabas /// /// The String to use. /// The cancellation token to use. - /// 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> GetRecoverableManagedDatabaseAsync(string recoverableDatabaseName, CancellationToken cancellationToken = default) { @@ -602,8 +602,8 @@ public virtual async Task> GetRecov /// /// The String to use. /// The cancellation token to use. - /// 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 GetRecoverableManagedDatabase(string recoverableDatabaseName, CancellationToken cancellationToken = default) { @@ -621,7 +621,7 @@ public virtual SqlAgentConfigurationResource GetSqlAgentConfiguration() /// An object representing collection of RestorableDroppedManagedDatabaseResources and their operations over a RestorableDroppedManagedDatabaseResource. public virtual RestorableDroppedManagedDatabaseCollection GetRestorableDroppedManagedDatabases() { - return GetCachedClient(Client => new RestorableDroppedManagedDatabaseCollection(Client, Id)); + return GetCachedClient(client => new RestorableDroppedManagedDatabaseCollection(client, Id)); } /// @@ -639,8 +639,8 @@ public virtual RestorableDroppedManagedDatabaseCollection GetRestorableDroppedMa /// /// The String to use. /// The cancellation token to use. - /// 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> GetRestorableDroppedManagedDatabaseAsync(string restorableDroppedDatabaseId, CancellationToken cancellationToken = default) { @@ -662,8 +662,8 @@ public virtual async Task> Ge /// /// The String to use. /// The cancellation token to use. - /// 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 GetRestorableDroppedManagedDatabase(string restorableDroppedDatabaseId, CancellationToken cancellationToken = default) { @@ -674,7 +674,7 @@ public virtual Response GetRestorableD /// An object representing collection of DistributedAvailabilityGroupResources and their operations over a DistributedAvailabilityGroupResource. public virtual DistributedAvailabilityGroupCollection GetDistributedAvailabilityGroups() { - return GetCachedClient(Client => new DistributedAvailabilityGroupCollection(Client, Id)); + return GetCachedClient(client => new DistributedAvailabilityGroupCollection(client, Id)); } /// @@ -692,8 +692,8 @@ public virtual DistributedAvailabilityGroupCollection GetDistributedAvailability /// /// The distributed availability group name. /// The cancellation token to use. - /// 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> GetDistributedAvailabilityGroupAsync(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default) { @@ -715,8 +715,8 @@ public virtual async Task> GetDis /// /// The distributed availability group name. /// The cancellation token to use. - /// 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 GetDistributedAvailabilityGroup(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default) { @@ -727,7 +727,7 @@ public virtual Response GetDistributedAvai /// An object representing collection of ManagedInstanceServerTrustCertificateResources and their operations over a ManagedInstanceServerTrustCertificateResource. public virtual ManagedInstanceServerTrustCertificateCollection GetManagedInstanceServerTrustCertificates() { - return GetCachedClient(Client => new ManagedInstanceServerTrustCertificateCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceServerTrustCertificateCollection(client, Id)); } /// @@ -745,8 +745,8 @@ public virtual ManagedInstanceServerTrustCertificateCollection GetManagedInstanc /// /// Name of of the certificate to get. /// The cancellation token to use. - /// 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> GetManagedInstanceServerTrustCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -768,8 +768,8 @@ public virtual async Task /// Name of of the certificate to get. /// The cancellation token to use. - /// 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 GetManagedInstanceServerTrustCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -780,7 +780,7 @@ public virtual Response GetManage /// An object representing collection of EndpointCertificateResources and their operations over a EndpointCertificateResource. public virtual EndpointCertificateCollection GetEndpointCertificates() { - return GetCachedClient(Client => new EndpointCertificateCollection(Client, Id)); + return GetCachedClient(client => new EndpointCertificateCollection(client, Id)); } /// @@ -798,8 +798,8 @@ public virtual EndpointCertificateCollection GetEndpointCertificates() /// /// Type of the endpoint whose certificate the customer is looking for. /// The cancellation token to use. - /// 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> GetEndpointCertificateAsync(string endpointType, CancellationToken cancellationToken = default) { @@ -821,8 +821,8 @@ public virtual async Task> GetEndpointCert /// /// Type of the endpoint whose certificate the customer is looking for. /// The cancellation token to use. - /// 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 GetEndpointCertificate(string endpointType, CancellationToken cancellationToken = default) { @@ -833,7 +833,7 @@ public virtual Response GetEndpointCertificate(stri /// An object representing collection of ManagedServerDnsAliasResources and their operations over a ManagedServerDnsAliasResource. public virtual ManagedServerDnsAliasCollection GetManagedServerDnsAliases() { - return GetCachedClient(Client => new ManagedServerDnsAliasCollection(Client, Id)); + return GetCachedClient(client => new ManagedServerDnsAliasCollection(client, Id)); } /// @@ -851,8 +851,8 @@ public virtual ManagedServerDnsAliasCollection GetManagedServerDnsAliases() /// /// The String to use. /// The cancellation token to use. - /// 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> GetManagedServerDnsAliasAsync(string dnsAliasName, CancellationToken cancellationToken = default) { @@ -874,8 +874,8 @@ public virtual async Task> GetManagedSer /// /// The String to use. /// The cancellation token to use. - /// 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 GetManagedServerDnsAlias(string dnsAliasName, CancellationToken cancellationToken = default) { @@ -886,7 +886,7 @@ public virtual Response GetManagedServerDnsAlias( /// An object representing collection of ManagedInstanceAdvancedThreatProtectionResources and their operations over a ManagedInstanceAdvancedThreatProtectionResource. public virtual ManagedInstanceAdvancedThreatProtectionCollection GetManagedInstanceAdvancedThreatProtections() { - return GetCachedClient(Client => new ManagedInstanceAdvancedThreatProtectionCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceAdvancedThreatProtectionCollection(client, Id)); } /// @@ -935,7 +935,7 @@ public virtual Response GetMana /// An object representing collection of ManagedInstanceDtcResources and their operations over a ManagedInstanceDtcResource. public virtual ManagedInstanceDtcCollection GetManagedInstanceDtcs() { - return GetCachedClient(Client => new ManagedInstanceDtcCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceDtcCollection(client, Id)); } /// @@ -984,7 +984,7 @@ public virtual Response GetManagedInstanceDtc(DtcNam /// An object representing collection of ManagedDatabaseResources and their operations over a ManagedDatabaseResource. public virtual ManagedDatabaseCollection GetManagedDatabases() { - return GetCachedClient(Client => new ManagedDatabaseCollection(Client, Id)); + return GetCachedClient(client => new ManagedDatabaseCollection(client, Id)); } /// @@ -1002,8 +1002,8 @@ public virtual ManagedDatabaseCollection GetManagedDatabases() /// /// The name of the database. /// The cancellation token to use. - /// 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> GetManagedDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -1025,8 +1025,8 @@ public virtual async Task> GetManagedDatabaseA /// /// The name of the database. /// The cancellation token to use. - /// 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 GetManagedDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -1037,7 +1037,7 @@ public virtual Response GetManagedDatabase(string datab /// An object representing collection of ManagedInstanceServerConfigurationOptionResources and their operations over a ManagedInstanceServerConfigurationOptionResource. public virtual ManagedInstanceServerConfigurationOptionCollection GetManagedInstanceServerConfigurationOptions() { - return GetCachedClient(Client => new ManagedInstanceServerConfigurationOptionCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceServerConfigurationOptionCollection(client, Id)); } /// @@ -1086,7 +1086,7 @@ public virtual Response GetMan /// An object representing collection of ManagedInstanceStartStopScheduleResources and their operations over a ManagedInstanceStartStopScheduleResource. public virtual ManagedInstanceStartStopScheduleCollection GetManagedInstanceStartStopSchedules() { - return GetCachedClient(Client => new ManagedInstanceStartStopScheduleCollection(Client, Id)); + return GetCachedClient(client => new ManagedInstanceStartStopScheduleCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedManagedDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedManagedDatabaseResource.cs index cabaca176a2c..275ad6317afb 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedManagedDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedManagedDatabaseResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResources and their operations over a ManagedRestorableDroppedDbBackupShortTermRetentionPolicyResource. public virtual ManagedRestorableDroppedDbBackupShortTermRetentionPolicyCollection GetManagedRestorableDroppedDbBackupShortTermRetentionPolicies() { - return GetCachedClient(Client => new ManagedRestorableDroppedDbBackupShortTermRetentionPolicyCollection(Client, Id)); + return GetCachedClient(client => new ManagedRestorableDroppedDbBackupShortTermRetentionPolicyCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseAdvisorResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseAdvisorResource.cs index 5244b3a9438a..278881d9f161 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseAdvisorResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseAdvisorResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RecommendedActionResources and their operations over a RecommendedActionResource. public virtual RecommendedActionCollection GetRecommendedActions() { - return GetCachedClient(Client => new RecommendedActionCollection(Client, Id)); + return GetCachedClient(client => new RecommendedActionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual RecommendedActionCollection GetRecommendedActions() /// /// The name of Database Recommended Action. /// The cancellation token to use. - /// 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> GetRecommendedActionAsync(string recommendedActionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetRecommendedAct /// /// The name of Database Recommended Action. /// The cancellation token to use. - /// 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 GetRecommendedAction(string recommendedActionName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseColumnResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseColumnResource.cs index 45d445d1d8b4..f46e0dab520d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseColumnResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseColumnResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseSensitivityLabelResources and their operations over a SqlDatabaseSensitivityLabelResource. public virtual SqlDatabaseSensitivityLabelCollection GetSqlDatabaseSensitivityLabels() { - return GetCachedClient(Client => new SqlDatabaseSensitivityLabelCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSensitivityLabelCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs index 10983732e0e4..22623c40a72a 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs @@ -143,7 +143,7 @@ public virtual DataMaskingPolicyResource GetDataMaskingPolicy() /// An object representing collection of GeoBackupPolicyResources and their operations over a GeoBackupPolicyResource. public virtual GeoBackupPolicyCollection GetGeoBackupPolicies() { - return GetCachedClient(Client => new GeoBackupPolicyCollection(Client, Id)); + return GetCachedClient(client => new GeoBackupPolicyCollection(client, Id)); } /// @@ -192,7 +192,7 @@ public virtual Response GetGeoBackupPolicy(GeoBackupPol /// An object representing collection of SqlDatabaseAdvisorResources and their operations over a SqlDatabaseAdvisorResource. public virtual SqlDatabaseAdvisorCollection GetSqlDatabaseAdvisors() { - return GetCachedClient(Client => new SqlDatabaseAdvisorCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseAdvisorCollection(client, Id)); } /// @@ -210,8 +210,8 @@ public virtual SqlDatabaseAdvisorCollection GetSqlDatabaseAdvisors() /// /// The name of the Database Advisor. /// The cancellation token to use. - /// 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> GetSqlDatabaseAdvisorAsync(string advisorName, CancellationToken cancellationToken = default) { @@ -233,8 +233,8 @@ public virtual async Task> GetSqlDatabaseAd /// /// The name of the Database Advisor. /// The cancellation token to use. - /// 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 GetSqlDatabaseAdvisor(string advisorName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual SqlDatabaseAutomaticTuningResource GetSqlDatabaseAutomaticTuning( /// An object representing collection of SqlDatabaseSchemaResources and their operations over a SqlDatabaseSchemaResource. public virtual SqlDatabaseSchemaCollection GetSqlDatabaseSchemas() { - return GetCachedClient(Client => new SqlDatabaseSchemaCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSchemaCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual SqlDatabaseSchemaCollection GetSqlDatabaseSchemas() /// /// The name of the schema. /// The cancellation token to use. - /// 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> GetSqlDatabaseSchemaAsync(string schemaName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetSqlDatabaseSch /// /// The name of the schema. /// The cancellation token to use. - /// 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 GetSqlDatabaseSchema(string schemaName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetSqlDatabaseSchema(string s /// An object representing collection of SqlDatabaseSecurityAlertPolicyResources and their operations over a SqlDatabaseSecurityAlertPolicyResource. public virtual SqlDatabaseSecurityAlertPolicyCollection GetSqlDatabaseSecurityAlertPolicies() { - return GetCachedClient(Client => new SqlDatabaseSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSecurityAlertPolicyCollection(client, Id)); } /// @@ -354,7 +354,7 @@ public virtual Response GetSqlDatabaseSe /// An object representing collection of SqlDatabaseVulnerabilityAssessmentResources and their operations over a SqlDatabaseVulnerabilityAssessmentResource. public virtual SqlDatabaseVulnerabilityAssessmentCollection GetSqlDatabaseVulnerabilityAssessments() { - return GetCachedClient(Client => new SqlDatabaseVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseVulnerabilityAssessmentCollection(client, Id)); } /// @@ -403,7 +403,7 @@ public virtual Response GetSqlDataba /// An object representing collection of DataWarehouseUserActivityResources and their operations over a DataWarehouseUserActivityResource. public virtual DataWarehouseUserActivityCollection GetDataWarehouseUserActivities() { - return GetCachedClient(Client => new DataWarehouseUserActivityCollection(Client, Id)); + return GetCachedClient(client => new DataWarehouseUserActivityCollection(client, Id)); } /// @@ -452,7 +452,7 @@ public virtual Response GetDataWarehouseUserA /// An object representing collection of LongTermRetentionPolicyResources and their operations over a LongTermRetentionPolicyResource. public virtual LongTermRetentionPolicyCollection GetLongTermRetentionPolicies() { - return GetCachedClient(Client => new LongTermRetentionPolicyCollection(Client, Id)); + return GetCachedClient(client => new LongTermRetentionPolicyCollection(client, Id)); } /// @@ -515,7 +515,7 @@ public virtual MaintenanceWindowsResource GetMaintenanceWindows() /// An object representing collection of SqlServerDatabaseRestorePointResources and their operations over a SqlServerDatabaseRestorePointResource. public virtual SqlServerDatabaseRestorePointCollection GetSqlServerDatabaseRestorePoints() { - return GetCachedClient(Client => new SqlServerDatabaseRestorePointCollection(Client, Id)); + return GetCachedClient(client => new SqlServerDatabaseRestorePointCollection(client, Id)); } /// @@ -533,8 +533,8 @@ public virtual SqlServerDatabaseRestorePointCollection GetSqlServerDatabaseResto /// /// The name of the restore point. /// The cancellation token to use. - /// 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> GetSqlServerDatabaseRestorePointAsync(string restorePointName, CancellationToken cancellationToken = default) { @@ -556,8 +556,8 @@ public virtual async Task> GetSq /// /// The name of the restore point. /// The cancellation token to use. - /// 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 GetSqlServerDatabaseRestorePoint(string restorePointName, CancellationToken cancellationToken = default) { @@ -568,7 +568,7 @@ public virtual Response GetSqlServerDatab /// An object representing collection of SyncGroupResources and their operations over a SyncGroupResource. public virtual SyncGroupCollection GetSyncGroups() { - return GetCachedClient(Client => new SyncGroupCollection(Client, Id)); + return GetCachedClient(client => new SyncGroupCollection(client, Id)); } /// @@ -586,8 +586,8 @@ public virtual SyncGroupCollection GetSyncGroups() /// /// The name of the sync group. /// The cancellation token to use. - /// 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> GetSyncGroupAsync(string syncGroupName, CancellationToken cancellationToken = default) { @@ -609,8 +609,8 @@ public virtual async Task> GetSyncGroupAsync(string /// /// The name of the sync group. /// The cancellation token to use. - /// 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 GetSyncGroup(string syncGroupName, CancellationToken cancellationToken = default) { @@ -621,7 +621,7 @@ public virtual Response GetSyncGroup(string syncGroupName, Ca /// An object representing collection of WorkloadGroupResources and their operations over a WorkloadGroupResource. public virtual WorkloadGroupCollection GetWorkloadGroups() { - return GetCachedClient(Client => new WorkloadGroupCollection(Client, Id)); + return GetCachedClient(client => new WorkloadGroupCollection(client, Id)); } /// @@ -639,8 +639,8 @@ public virtual WorkloadGroupCollection GetWorkloadGroups() /// /// The name of the workload group. /// The cancellation token to use. - /// 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> GetWorkloadGroupAsync(string workloadGroupName, CancellationToken cancellationToken = default) { @@ -662,8 +662,8 @@ public virtual async Task> GetWorkloadGroupAsync /// /// The name of the workload group. /// The cancellation token to use. - /// 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 GetWorkloadGroup(string workloadGroupName, CancellationToken cancellationToken = default) { @@ -674,7 +674,7 @@ public virtual Response GetWorkloadGroup(string workloadG /// An object representing collection of BackupShortTermRetentionPolicyResources and their operations over a BackupShortTermRetentionPolicyResource. public virtual BackupShortTermRetentionPolicyCollection GetBackupShortTermRetentionPolicies() { - return GetCachedClient(Client => new BackupShortTermRetentionPolicyCollection(Client, Id)); + return GetCachedClient(client => new BackupShortTermRetentionPolicyCollection(client, Id)); } /// @@ -723,7 +723,7 @@ public virtual Response GetBackupShortTe /// An object representing collection of LedgerDigestUploadResources and their operations over a LedgerDigestUploadResource. public virtual LedgerDigestUploadCollection GetLedgerDigestUploads() { - return GetCachedClient(Client => new LedgerDigestUploadCollection(Client, Id)); + return GetCachedClient(client => new LedgerDigestUploadCollection(client, Id)); } /// @@ -772,7 +772,7 @@ public virtual Response GetLedgerDigestUpload(Ledger /// An object representing collection of SqlDatabaseBlobAuditingPolicyResources and their operations over a SqlDatabaseBlobAuditingPolicyResource. public virtual SqlDatabaseBlobAuditingPolicyCollection GetSqlDatabaseBlobAuditingPolicies() { - return GetCachedClient(Client => new SqlDatabaseBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseBlobAuditingPolicyCollection(client, Id)); } /// @@ -821,7 +821,7 @@ public virtual Response GetSqlDatabaseBlo /// An object representing collection of ExtendedDatabaseBlobAuditingPolicyResources and their operations over a ExtendedDatabaseBlobAuditingPolicyResource. public virtual ExtendedDatabaseBlobAuditingPolicyCollection GetExtendedDatabaseBlobAuditingPolicies() { - return GetCachedClient(Client => new ExtendedDatabaseBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new ExtendedDatabaseBlobAuditingPolicyCollection(client, Id)); } /// @@ -870,7 +870,7 @@ public virtual Response GetExtendedD /// An object representing collection of DatabaseAdvancedThreatProtectionResources and their operations over a DatabaseAdvancedThreatProtectionResource. public virtual DatabaseAdvancedThreatProtectionCollection GetDatabaseAdvancedThreatProtections() { - return GetCachedClient(Client => new DatabaseAdvancedThreatProtectionCollection(Client, Id)); + return GetCachedClient(client => new DatabaseAdvancedThreatProtectionCollection(client, Id)); } /// @@ -919,7 +919,7 @@ public virtual Response GetDatabaseAdv /// An object representing collection of SqlServerDatabaseReplicationLinkResources and their operations over a SqlServerDatabaseReplicationLinkResource. public virtual SqlServerDatabaseReplicationLinkCollection GetSqlServerDatabaseReplicationLinks() { - return GetCachedClient(Client => new SqlServerDatabaseReplicationLinkCollection(Client, Id)); + return GetCachedClient(client => new SqlServerDatabaseReplicationLinkCollection(client, Id)); } /// @@ -937,8 +937,8 @@ public virtual SqlServerDatabaseReplicationLinkCollection GetSqlServerDatabaseRe /// /// The name of the replication link. /// The cancellation token to use. - /// 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> GetSqlServerDatabaseReplicationLinkAsync(string linkId, CancellationToken cancellationToken = default) { @@ -960,8 +960,8 @@ public virtual async Task> Ge /// /// The name of the replication link. /// The cancellation token to use. - /// 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 GetSqlServerDatabaseReplicationLink(string linkId, CancellationToken cancellationToken = default) { @@ -972,7 +972,7 @@ public virtual Response GetSqlServerDa /// An object representing collection of LogicalDatabaseTransparentDataEncryptionResources and their operations over a LogicalDatabaseTransparentDataEncryptionResource. public virtual LogicalDatabaseTransparentDataEncryptionCollection GetLogicalDatabaseTransparentDataEncryptions() { - return GetCachedClient(Client => new LogicalDatabaseTransparentDataEncryptionCollection(Client, Id)); + return GetCachedClient(client => new LogicalDatabaseTransparentDataEncryptionCollection(client, Id)); } /// @@ -1021,7 +1021,7 @@ public virtual Response GetLog /// An object representing collection of SqlDatabaseSqlVulnerabilityAssessmentResources and their operations over a SqlDatabaseSqlVulnerabilityAssessmentResource. public virtual SqlDatabaseSqlVulnerabilityAssessmentCollection GetSqlDatabaseSqlVulnerabilityAssessments() { - return GetCachedClient(Client => new SqlDatabaseSqlVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSqlVulnerabilityAssessmentCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSchemaResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSchemaResource.cs index 7a3dd71b4bfa..e27b27a05584 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSchemaResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSchemaResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseTableResources and their operations over a SqlDatabaseTableResource. public virtual SqlDatabaseTableCollection GetSqlDatabaseTables() { - return GetCachedClient(Client => new SqlDatabaseTableCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseTableCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SqlDatabaseTableCollection GetSqlDatabaseTables() /// /// The name of the table. /// The cancellation token to use. - /// 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> GetSqlDatabaseTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSqlDatabaseTabl /// /// The name of the table. /// The cancellation token to use. - /// 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 GetSqlDatabaseTable(string tableName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.cs index 4599cf5f7ffe..212d721f46c3 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentBaselineResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleResource. public virtual SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleCollection GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRules() { - return GetCachedClient(Client => new SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SqlDatabaseSqlVulnerabilityAssessmentBaselineRuleCollection GetSq /// /// The vulnerability assessment rule ID. /// The cancellation token to use. - /// 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> GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRuleAsync(string ruleId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task /// The vulnerability assessment rule ID. /// The cancellation token to use. - /// 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 GetSqlDatabaseSqlVulnerabilityAssessmentBaselineRule(string ruleId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentResource.cs index 96382bf2f6f6..fe00a67c8aa3 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentResource.cs @@ -95,7 +95,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseSqlVulnerabilityAssessmentBaselineResources and their operations over a SqlDatabaseSqlVulnerabilityAssessmentBaselineResource. public virtual SqlDatabaseSqlVulnerabilityAssessmentBaselineCollection GetSqlDatabaseSqlVulnerabilityAssessmentBaselines() { - return GetCachedClient(Client => new SqlDatabaseSqlVulnerabilityAssessmentBaselineCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSqlVulnerabilityAssessmentBaselineCollection(client, Id)); } /// @@ -144,7 +144,7 @@ public virtual Response G /// An object representing collection of SqlDatabaseSqlVulnerabilityAssessmentScanResources and their operations over a SqlDatabaseSqlVulnerabilityAssessmentScanResource. public virtual SqlDatabaseSqlVulnerabilityAssessmentScanCollection GetSqlDatabaseSqlVulnerabilityAssessmentScans() { - return GetCachedClient(Client => new SqlDatabaseSqlVulnerabilityAssessmentScanCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSqlVulnerabilityAssessmentScanCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual SqlDatabaseSqlVulnerabilityAssessmentScanCollection GetSqlDatabas /// /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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> GetSqlDatabaseSqlVulnerabilityAssessmentScanAsync(string scanId, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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 GetSqlDatabaseSqlVulnerabilityAssessmentScan(string scanId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentScanResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentScanResource.cs index bfeb096da31b..1d91accab9d7 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentScanResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseSqlVulnerabilityAssessmentScanResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseSqlVulnerabilityAssessmentScanResultResources and their operations over a SqlDatabaseSqlVulnerabilityAssessmentScanResultResource. public virtual SqlDatabaseSqlVulnerabilityAssessmentScanResultCollection GetSqlDatabaseSqlVulnerabilityAssessmentScanResults() { - return GetCachedClient(Client => new SqlDatabaseSqlVulnerabilityAssessmentScanResultCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseSqlVulnerabilityAssessmentScanResultCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SqlDatabaseSqlVulnerabilityAssessmentScanResultCollection GetSqlD /// /// The scan result id of the specific result to retrieve. /// The cancellation token to use. - /// 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> GetSqlDatabaseSqlVulnerabilityAssessmentScanResultAsync(string scanResultId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task /// The scan result id of the specific result to retrieve. /// The cancellation token to use. - /// 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 GetSqlDatabaseSqlVulnerabilityAssessmentScanResult(string scanResultId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseTableResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseTableResource.cs index 9c32dd2a52be..74e5b9702326 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseTableResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseTableResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseColumnResources and their operations over a SqlDatabaseColumnResource. public virtual SqlDatabaseColumnCollection GetSqlDatabaseColumns() { - return GetCachedClient(Client => new SqlDatabaseColumnCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseColumnCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SqlDatabaseColumnCollection GetSqlDatabaseColumns() /// /// The name of the column. /// The cancellation token to use. - /// 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> GetSqlDatabaseColumnAsync(string columnName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSqlDatabaseCol /// /// The name of the column. /// The cancellation token to use. - /// 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 GetSqlDatabaseColumn(string columnName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentResource.cs index a892a39868b9..cda7c3ed0b39 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseVulnerabilityAssessmentResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlDatabaseVulnerabilityAssessmentRuleBaselineResources and their operations over a SqlDatabaseVulnerabilityAssessmentRuleBaselineResource. public virtual SqlDatabaseVulnerabilityAssessmentRuleBaselineCollection GetSqlDatabaseVulnerabilityAssessmentRuleBaselines() { - return GetCachedClient(Client => new SqlDatabaseVulnerabilityAssessmentRuleBaselineCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseVulnerabilityAssessmentRuleBaselineCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SqlDatabaseVulnerabilityAssessmentRuleBaselineCollection GetSqlDa /// The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). /// The cancellation token to use. - /// 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> GetSqlDatabaseVulnerabilityAssessmentRuleBaselineAsync(string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task The vulnerability assessment rule ID. /// The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule and master for server level rule). /// The cancellation token to use. - /// 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 GetSqlDatabaseVulnerabilityAssessmentRuleBaseline(string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response /// An object representing collection of SqlDatabaseVulnerabilityAssessmentScanResources and their operations over a SqlDatabaseVulnerabilityAssessmentScanResource. public virtual SqlDatabaseVulnerabilityAssessmentScanCollection GetSqlDatabaseVulnerabilityAssessmentScans() { - return GetCachedClient(Client => new SqlDatabaseVulnerabilityAssessmentScanCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseVulnerabilityAssessmentScanCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual SqlDatabaseVulnerabilityAssessmentScanCollection GetSqlDatabaseVu /// /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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> GetSqlDatabaseVulnerabilityAssessmentScanAsync(string scanId, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The vulnerability assessment scan Id of the scan to retrieve. /// The cancellation token to use. - /// 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 GetSqlDatabaseVulnerabilityAssessmentScan(string scanId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs index 27dd2c6d7d81..6b1ad31eae53 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerJobCredentialResources and their operations over a SqlServerJobCredentialResource. public virtual SqlServerJobCredentialCollection GetSqlServerJobCredentials() { - return GetCachedClient(Client => new SqlServerJobCredentialCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobCredentialCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual SqlServerJobCredentialCollection GetSqlServerJobCredentials() /// /// The name of the credential. /// The cancellation token to use. - /// 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> GetSqlServerJobCredentialAsync(string credentialName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetSqlServer /// /// The name of the credential. /// The cancellation token to use. - /// 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 GetSqlServerJobCredential(string credentialName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetSqlServerJobCredentia /// An object representing collection of SqlServerJobResources and their operations over a SqlServerJobResource. public virtual SqlServerJobCollection GetSqlServerJobs() { - return GetCachedClient(Client => new SqlServerJobCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual SqlServerJobCollection GetSqlServerJobs() /// /// The name of the job to get. /// The cancellation token to use. - /// 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> GetSqlServerJobAsync(string jobName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetSqlServerJobAsync(s /// /// The name of the job to get. /// The cancellation token to use. - /// 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 GetSqlServerJob(string jobName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response GetSqlServerJob(string jobName, Ca /// An object representing collection of SqlServerJobTargetGroupResources and their operations over a SqlServerJobTargetGroupResource. public virtual SqlServerJobTargetGroupCollection GetSqlServerJobTargetGroups() { - return GetCachedClient(Client => new SqlServerJobTargetGroupCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobTargetGroupCollection(client, Id)); } /// @@ -222,8 +222,8 @@ public virtual SqlServerJobTargetGroupCollection GetSqlServerJobTargetGroups() /// /// The name of the target group. /// The cancellation token to use. - /// 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> GetSqlServerJobTargetGroupAsync(string targetGroupName, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task> GetSqlServe /// /// The name of the target group. /// The cancellation token to use. - /// 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 GetSqlServerJobTargetGroup(string targetGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionResource.cs index a6b80d17a5e9..a6c4ca9ce805 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerJobExecutionStepResources and their operations over a SqlServerJobExecutionStepResource. public virtual SqlServerJobExecutionStepCollection GetSqlServerJobExecutionSteps() { - return GetCachedClient(Client => new SqlServerJobExecutionStepCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobExecutionStepCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SqlServerJobExecutionStepCollection GetSqlServerJobExecutionSteps /// /// The name of the step. /// The cancellation token to use. - /// 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> GetSqlServerJobExecutionStepAsync(string stepName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSqlSer /// /// The name of the step. /// The cancellation token to use. - /// 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 GetSqlServerJobExecutionStep(string stepName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionStepResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionStepResource.cs index 6c2e4e6ac1b9..c8e26f1278d0 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionStepResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobExecutionStepResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerJobExecutionStepTargetResources and their operations over a SqlServerJobExecutionStepTargetResource. public virtual SqlServerJobExecutionStepTargetCollection GetSqlServerJobExecutionStepTargets() { - return GetCachedClient(Client => new SqlServerJobExecutionStepTargetCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobExecutionStepTargetCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobResource.cs index 0713e3061705..ad2700c8b975 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobResource.cs @@ -95,7 +95,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerJobExecutionResources and their operations over a SqlServerJobExecutionResource. public virtual SqlServerJobExecutionCollection GetSqlServerJobExecutions() { - return GetCachedClient(Client => new SqlServerJobExecutionCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobExecutionCollection(client, Id)); } /// @@ -144,7 +144,7 @@ public virtual Response GetSqlServerJobExecution( /// An object representing collection of SqlServerJobStepResources and their operations over a SqlServerJobStepResource. public virtual SqlServerJobStepCollection GetSqlServerJobSteps() { - return GetCachedClient(Client => new SqlServerJobStepCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobStepCollection(client, Id)); } /// @@ -162,8 +162,8 @@ public virtual SqlServerJobStepCollection GetSqlServerJobSteps() /// /// The name of the job step. /// The cancellation token to use. - /// 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> GetSqlServerJobStepAsync(string stepName, CancellationToken cancellationToken = default) { @@ -185,8 +185,8 @@ public virtual async Task> GetSqlServerJobSte /// /// The name of the job step. /// The cancellation token to use. - /// 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 GetSqlServerJobStep(string stepName, CancellationToken cancellationToken = default) { @@ -197,7 +197,7 @@ public virtual Response GetSqlServerJobStep(string ste /// An object representing collection of SqlServerJobVersionResources and their operations over a SqlServerJobVersionResource. public virtual SqlServerJobVersionCollection GetSqlServerJobVersions() { - return GetCachedClient(Client => new SqlServerJobVersionCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobVersionCollection(client, Id)); } /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobVersionResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobVersionResource.cs index 001b8264d6d7..512aff55cec3 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobVersionResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobVersionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerJobVersionStepResources and their operations over a SqlServerJobVersionStepResource. public virtual SqlServerJobVersionStepCollection GetSqlServerJobVersionSteps() { - return GetCachedClient(Client => new SqlServerJobVersionStepCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobVersionStepCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SqlServerJobVersionStepCollection GetSqlServerJobVersionSteps() /// /// The name of the job step. /// The cancellation token to use. - /// 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> GetSqlServerJobVersionStepAsync(string stepName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetSqlServe /// /// The name of the job step. /// The cancellation token to use. - /// 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 GetSqlServerJobVersionStep(string stepName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs index 6cc822786c4a..36dc1a506158 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs @@ -116,7 +116,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerCommunicationLinkResources and their operations over a SqlServerCommunicationLinkResource. public virtual SqlServerCommunicationLinkCollection GetSqlServerCommunicationLinks() { - return GetCachedClient(Client => new SqlServerCommunicationLinkCollection(Client, Id)); + return GetCachedClient(client => new SqlServerCommunicationLinkCollection(client, Id)); } /// @@ -134,8 +134,8 @@ public virtual SqlServerCommunicationLinkCollection GetSqlServerCommunicationLin /// /// The name of the server communication link. /// The cancellation token to use. - /// 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> GetSqlServerCommunicationLinkAsync(string communicationLinkName, CancellationToken cancellationToken = default) { @@ -157,8 +157,8 @@ public virtual async Task> GetSqlSe /// /// The name of the server communication link. /// The cancellation token to use. - /// 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 GetSqlServerCommunicationLink(string communicationLinkName, CancellationToken cancellationToken = default) { @@ -169,7 +169,7 @@ public virtual Response GetSqlServerCommunic /// An object representing collection of ServiceObjectiveResources and their operations over a ServiceObjectiveResource. public virtual ServiceObjectiveCollection GetServiceObjectives() { - return GetCachedClient(Client => new ServiceObjectiveCollection(Client, Id)); + return GetCachedClient(client => new ServiceObjectiveCollection(client, Id)); } /// @@ -187,8 +187,8 @@ public virtual ServiceObjectiveCollection GetServiceObjectives() /// /// The name of the service objective to retrieve. /// The cancellation token to use. - /// 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> GetServiceObjectiveAsync(string serviceObjectiveName, CancellationToken cancellationToken = default) { @@ -210,8 +210,8 @@ public virtual async Task> GetServiceObjectiv /// /// The name of the service objective to retrieve. /// The cancellation token to use. - /// 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 GetServiceObjective(string serviceObjectiveName, CancellationToken cancellationToken = default) { @@ -222,7 +222,7 @@ public virtual Response GetServiceObjective(string ser /// An object representing collection of SqlServerAdvisorResources and their operations over a SqlServerAdvisorResource. public virtual SqlServerAdvisorCollection GetSqlServerAdvisors() { - return GetCachedClient(Client => new SqlServerAdvisorCollection(Client, Id)); + return GetCachedClient(client => new SqlServerAdvisorCollection(client, Id)); } /// @@ -240,8 +240,8 @@ public virtual SqlServerAdvisorCollection GetSqlServerAdvisors() /// /// The name of the Server Advisor. /// The cancellation token to use. - /// 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> GetSqlServerAdvisorAsync(string advisorName, CancellationToken cancellationToken = default) { @@ -263,8 +263,8 @@ public virtual async Task> GetSqlServerAdviso /// /// The name of the Server Advisor. /// The cancellation token to use. - /// 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 GetSqlServerAdvisor(string advisorName, CancellationToken cancellationToken = default) { @@ -275,7 +275,7 @@ public virtual Response GetSqlServerAdvisor(string adv /// An object representing collection of EncryptionProtectorResources and their operations over a EncryptionProtectorResource. public virtual EncryptionProtectorCollection GetEncryptionProtectors() { - return GetCachedClient(Client => new EncryptionProtectorCollection(Client, Id)); + return GetCachedClient(client => new EncryptionProtectorCollection(client, Id)); } /// @@ -324,7 +324,7 @@ public virtual Response GetEncryptionProtector(Encr /// An object representing collection of SqlFirewallRuleResources and their operations over a SqlFirewallRuleResource. public virtual SqlFirewallRuleCollection GetSqlFirewallRules() { - return GetCachedClient(Client => new SqlFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new SqlFirewallRuleCollection(client, Id)); } /// @@ -342,8 +342,8 @@ public virtual SqlFirewallRuleCollection GetSqlFirewallRules() /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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> GetSqlFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -365,8 +365,8 @@ public virtual async Task> GetSqlFirewallRuleA /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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 GetSqlFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -377,7 +377,7 @@ public virtual Response GetSqlFirewallRule(string firew /// An object representing collection of SqlServerJobAgentResources and their operations over a SqlServerJobAgentResource. public virtual SqlServerJobAgentCollection GetSqlServerJobAgents() { - return GetCachedClient(Client => new SqlServerJobAgentCollection(Client, Id)); + return GetCachedClient(client => new SqlServerJobAgentCollection(client, Id)); } /// @@ -395,8 +395,8 @@ public virtual SqlServerJobAgentCollection GetSqlServerJobAgents() /// /// The name of the job agent to be retrieved. /// The cancellation token to use. - /// 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> GetSqlServerJobAgentAsync(string jobAgentName, CancellationToken cancellationToken = default) { @@ -418,8 +418,8 @@ public virtual async Task> GetSqlServerJobAg /// /// The name of the job agent to be retrieved. /// The cancellation token to use. - /// 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 GetSqlServerJobAgent(string jobAgentName, CancellationToken cancellationToken = default) { @@ -430,7 +430,7 @@ public virtual Response GetSqlServerJobAgent(string j /// An object representing collection of SqlPrivateEndpointConnectionResources and their operations over a SqlPrivateEndpointConnectionResource. public virtual SqlPrivateEndpointConnectionCollection GetSqlPrivateEndpointConnections() { - return GetCachedClient(Client => new SqlPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new SqlPrivateEndpointConnectionCollection(client, Id)); } /// @@ -448,8 +448,8 @@ public virtual SqlPrivateEndpointConnectionCollection GetSqlPrivateEndpointConne /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetSqlPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -471,8 +471,8 @@ public virtual async Task> GetSql /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetSqlPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -483,7 +483,7 @@ public virtual Response GetSqlPrivateEndpo /// An object representing collection of SqlPrivateLinkResources and their operations over a SqlPrivateLinkResource. public virtual SqlPrivateLinkResourceCollection GetSqlPrivateLinkResources() { - return GetCachedClient(Client => new SqlPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new SqlPrivateLinkResourceCollection(client, Id)); } /// @@ -501,8 +501,8 @@ public virtual SqlPrivateLinkResourceCollection GetSqlPrivateLinkResources() /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetSqlPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -524,8 +524,8 @@ public virtual async Task> GetSqlPrivateLinkRes /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetSqlPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -543,7 +543,7 @@ public virtual SqlServerAutomaticTuningResource GetSqlServerAutomaticTuning() /// An object representing collection of SqlServerAzureADAdministratorResources and their operations over a SqlServerAzureADAdministratorResource. public virtual SqlServerAzureADAdministratorCollection GetSqlServerAzureADAdministrators() { - return GetCachedClient(Client => new SqlServerAzureADAdministratorCollection(Client, Id)); + return GetCachedClient(client => new SqlServerAzureADAdministratorCollection(client, Id)); } /// @@ -592,7 +592,7 @@ public virtual Response GetSqlServerAzure /// An object representing collection of SqlServerAzureADOnlyAuthenticationResources and their operations over a SqlServerAzureADOnlyAuthenticationResource. public virtual SqlServerAzureADOnlyAuthenticationCollection GetSqlServerAzureADOnlyAuthentications() { - return GetCachedClient(Client => new SqlServerAzureADOnlyAuthenticationCollection(Client, Id)); + return GetCachedClient(client => new SqlServerAzureADOnlyAuthenticationCollection(client, Id)); } /// @@ -641,7 +641,7 @@ public virtual Response GetSqlServer /// An object representing collection of SqlServerDevOpsAuditingSettingResources and their operations over a SqlServerDevOpsAuditingSettingResource. public virtual SqlServerDevOpsAuditingSettingCollection GetSqlServerDevOpsAuditingSettings() { - return GetCachedClient(Client => new SqlServerDevOpsAuditingSettingCollection(Client, Id)); + return GetCachedClient(client => new SqlServerDevOpsAuditingSettingCollection(client, Id)); } /// @@ -659,8 +659,8 @@ public virtual SqlServerDevOpsAuditingSettingCollection GetSqlServerDevOpsAuditi /// /// The name of the devops audit settings. This should always be Default. /// The cancellation token to use. - /// 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> GetSqlServerDevOpsAuditingSettingAsync(string devOpsAuditingSettingsName, CancellationToken cancellationToken = default) { @@ -682,8 +682,8 @@ public virtual async Task> GetS /// /// The name of the devops audit settings. This should always be Default. /// The cancellation token to use. - /// 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 GetSqlServerDevOpsAuditingSetting(string devOpsAuditingSettingsName, CancellationToken cancellationToken = default) { @@ -694,7 +694,7 @@ public virtual Response GetSqlServerDevO /// An object representing collection of SqlServerDnsAliasResources and their operations over a SqlServerDnsAliasResource. public virtual SqlServerDnsAliasCollection GetSqlServerDnsAliases() { - return GetCachedClient(Client => new SqlServerDnsAliasCollection(Client, Id)); + return GetCachedClient(client => new SqlServerDnsAliasCollection(client, Id)); } /// @@ -712,8 +712,8 @@ public virtual SqlServerDnsAliasCollection GetSqlServerDnsAliases() /// /// The name of the server dns alias. /// The cancellation token to use. - /// 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> GetSqlServerDnsAliasAsync(string dnsAliasName, CancellationToken cancellationToken = default) { @@ -735,8 +735,8 @@ public virtual async Task> GetSqlServerDnsAl /// /// The name of the server dns alias. /// The cancellation token to use. - /// 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 GetSqlServerDnsAlias(string dnsAliasName, CancellationToken cancellationToken = default) { @@ -747,7 +747,7 @@ public virtual Response GetSqlServerDnsAlias(string d /// An object representing collection of SqlServerKeyResources and their operations over a SqlServerKeyResource. public virtual SqlServerKeyCollection GetSqlServerKeys() { - return GetCachedClient(Client => new SqlServerKeyCollection(Client, Id)); + return GetCachedClient(client => new SqlServerKeyCollection(client, Id)); } /// @@ -765,8 +765,8 @@ public virtual SqlServerKeyCollection GetSqlServerKeys() /// /// The name of the server key to be retrieved. /// The cancellation token to use. - /// 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> GetSqlServerKeyAsync(string keyName, CancellationToken cancellationToken = default) { @@ -788,8 +788,8 @@ public virtual async Task> GetSqlServerKeyAsync(s /// /// The name of the server key to be retrieved. /// The cancellation token to use. - /// 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 GetSqlServerKey(string keyName, CancellationToken cancellationToken = default) { @@ -800,7 +800,7 @@ public virtual Response GetSqlServerKey(string keyName, Ca /// An object representing collection of SqlServerSecurityAlertPolicyResources and their operations over a SqlServerSecurityAlertPolicyResource. public virtual SqlServerSecurityAlertPolicyCollection GetSqlServerSecurityAlertPolicies() { - return GetCachedClient(Client => new SqlServerSecurityAlertPolicyCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSecurityAlertPolicyCollection(client, Id)); } /// @@ -849,7 +849,7 @@ public virtual Response GetSqlServerSecuri /// An object representing collection of SqlServerVulnerabilityAssessmentResources and their operations over a SqlServerVulnerabilityAssessmentResource. public virtual SqlServerVulnerabilityAssessmentCollection GetSqlServerVulnerabilityAssessments() { - return GetCachedClient(Client => new SqlServerVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SqlServerVulnerabilityAssessmentCollection(client, Id)); } /// @@ -898,7 +898,7 @@ public virtual Response GetSqlServerVu /// An object representing collection of SyncAgentResources and their operations over a SyncAgentResource. public virtual SyncAgentCollection GetSyncAgents() { - return GetCachedClient(Client => new SyncAgentCollection(Client, Id)); + return GetCachedClient(client => new SyncAgentCollection(client, Id)); } /// @@ -916,8 +916,8 @@ public virtual SyncAgentCollection GetSyncAgents() /// /// The name of the sync agent. /// The cancellation token to use. - /// 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> GetSyncAgentAsync(string syncAgentName, CancellationToken cancellationToken = default) { @@ -939,8 +939,8 @@ public virtual async Task> GetSyncAgentAsync(string /// /// The name of the sync agent. /// The cancellation token to use. - /// 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 GetSyncAgent(string syncAgentName, CancellationToken cancellationToken = default) { @@ -951,7 +951,7 @@ public virtual Response GetSyncAgent(string syncAgentName, Ca /// An object representing collection of SqlServerVirtualNetworkRuleResources and their operations over a SqlServerVirtualNetworkRuleResource. public virtual SqlServerVirtualNetworkRuleCollection GetSqlServerVirtualNetworkRules() { - return GetCachedClient(Client => new SqlServerVirtualNetworkRuleCollection(Client, Id)); + return GetCachedClient(client => new SqlServerVirtualNetworkRuleCollection(client, Id)); } /// @@ -969,8 +969,8 @@ public virtual SqlServerVirtualNetworkRuleCollection GetSqlServerVirtualNetworkR /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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> GetSqlServerVirtualNetworkRuleAsync(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -992,8 +992,8 @@ public virtual async Task> GetSqlS /// /// The name of the virtual network rule. /// The cancellation token to use. - /// 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 GetSqlServerVirtualNetworkRule(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -1004,7 +1004,7 @@ public virtual Response GetSqlServerVirtual /// An object representing collection of OutboundFirewallRuleResources and their operations over a OutboundFirewallRuleResource. public virtual OutboundFirewallRuleCollection GetOutboundFirewallRules() { - return GetCachedClient(Client => new OutboundFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new OutboundFirewallRuleCollection(client, Id)); } /// @@ -1022,8 +1022,8 @@ public virtual OutboundFirewallRuleCollection GetOutboundFirewallRules() /// /// The String to use. /// The cancellation token to use. - /// 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> GetOutboundFirewallRuleAsync(string outboundRuleFqdn, CancellationToken cancellationToken = default) { @@ -1045,8 +1045,8 @@ public virtual async Task> GetOutboundFir /// /// The String to use. /// The cancellation token to use. - /// 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 GetOutboundFirewallRule(string outboundRuleFqdn, CancellationToken cancellationToken = default) { @@ -1057,7 +1057,7 @@ public virtual Response GetOutboundFirewallRule(st /// An object representing collection of SqlServerConnectionPolicyResources and their operations over a SqlServerConnectionPolicyResource. public virtual SqlServerConnectionPolicyCollection GetSqlServerConnectionPolicies() { - return GetCachedClient(Client => new SqlServerConnectionPolicyCollection(Client, Id)); + return GetCachedClient(client => new SqlServerConnectionPolicyCollection(client, Id)); } /// @@ -1106,7 +1106,7 @@ public virtual Response GetSqlServerConnectio /// An object representing collection of SqlServerBlobAuditingPolicyResources and their operations over a SqlServerBlobAuditingPolicyResource. public virtual SqlServerBlobAuditingPolicyCollection GetSqlServerBlobAuditingPolicies() { - return GetCachedClient(Client => new SqlServerBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new SqlServerBlobAuditingPolicyCollection(client, Id)); } /// @@ -1155,7 +1155,7 @@ public virtual Response GetSqlServerBlobAud /// An object representing collection of ExtendedServerBlobAuditingPolicyResources and their operations over a ExtendedServerBlobAuditingPolicyResource. public virtual ExtendedServerBlobAuditingPolicyCollection GetExtendedServerBlobAuditingPolicies() { - return GetCachedClient(Client => new ExtendedServerBlobAuditingPolicyCollection(Client, Id)); + return GetCachedClient(client => new ExtendedServerBlobAuditingPolicyCollection(client, Id)); } /// @@ -1204,7 +1204,7 @@ public virtual Response GetExtendedSer /// An object representing collection of ServerAdvancedThreatProtectionResources and their operations over a ServerAdvancedThreatProtectionResource. public virtual ServerAdvancedThreatProtectionCollection GetServerAdvancedThreatProtections() { - return GetCachedClient(Client => new ServerAdvancedThreatProtectionCollection(Client, Id)); + return GetCachedClient(client => new ServerAdvancedThreatProtectionCollection(client, Id)); } /// @@ -1253,7 +1253,7 @@ public virtual Response GetServerAdvance /// An object representing collection of SqlDatabaseResources and their operations over a SqlDatabaseResource. public virtual SqlDatabaseCollection GetSqlDatabases() { - return GetCachedClient(Client => new SqlDatabaseCollection(Client, Id)); + return GetCachedClient(client => new SqlDatabaseCollection(client, Id)); } /// @@ -1273,8 +1273,8 @@ public virtual SqlDatabaseCollection GetSqlDatabases() /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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> GetSqlDatabaseAsync(string databaseName, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1298,8 +1298,8 @@ public virtual async Task> GetSqlDatabaseAsync(str /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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 GetSqlDatabase(string databaseName, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1310,7 +1310,7 @@ public virtual Response GetSqlDatabase(string databaseName, /// An object representing collection of ElasticPoolResources and their operations over a ElasticPoolResource. public virtual ElasticPoolCollection GetElasticPools() { - return GetCachedClient(Client => new ElasticPoolCollection(Client, Id)); + return GetCachedClient(client => new ElasticPoolCollection(client, Id)); } /// @@ -1328,8 +1328,8 @@ public virtual ElasticPoolCollection GetElasticPools() /// /// The name of the elastic pool. /// The cancellation token to use. - /// 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> GetElasticPoolAsync(string elasticPoolName, CancellationToken cancellationToken = default) { @@ -1351,8 +1351,8 @@ public virtual async Task> GetElasticPoolAsync(str /// /// The name of the elastic pool. /// The cancellation token to use. - /// 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 GetElasticPool(string elasticPoolName, CancellationToken cancellationToken = default) { @@ -1363,7 +1363,7 @@ public virtual Response GetElasticPool(string elasticPoolNa /// An object representing collection of RecoverableDatabaseResources and their operations over a RecoverableDatabaseResource. public virtual RecoverableDatabaseCollection GetRecoverableDatabases() { - return GetCachedClient(Client => new RecoverableDatabaseCollection(Client, Id)); + return GetCachedClient(client => new RecoverableDatabaseCollection(client, Id)); } /// @@ -1383,8 +1383,8 @@ public virtual RecoverableDatabaseCollection GetRecoverableDatabases() /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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> GetRecoverableDatabaseAsync(string databaseName, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1408,8 +1408,8 @@ public virtual async Task> GetRecoverableD /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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 GetRecoverableDatabase(string databaseName, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1420,7 +1420,7 @@ public virtual Response GetRecoverableDatabase(stri /// An object representing collection of RestorableDroppedDatabaseResources and their operations over a RestorableDroppedDatabaseResource. public virtual RestorableDroppedDatabaseCollection GetRestorableDroppedDatabases() { - return GetCachedClient(Client => new RestorableDroppedDatabaseCollection(Client, Id)); + return GetCachedClient(client => new RestorableDroppedDatabaseCollection(client, Id)); } /// @@ -1440,8 +1440,8 @@ public virtual RestorableDroppedDatabaseCollection GetRestorableDroppedDatabases /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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> GetRestorableDroppedDatabaseAsync(string restorableDroppedDatabaseId, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1465,8 +1465,8 @@ public virtual async Task> GetRestor /// The child resources to include in the response. /// An OData filter expression that filters elements in the collection. /// The cancellation token to use. - /// 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 GetRestorableDroppedDatabase(string restorableDroppedDatabaseId, string expand = null, string filter = null, CancellationToken cancellationToken = default) { @@ -1477,7 +1477,7 @@ public virtual Response GetRestorableDroppedD /// An object representing collection of IPv6FirewallRuleResources and their operations over a IPv6FirewallRuleResource. public virtual IPv6FirewallRuleCollection GetIPv6FirewallRules() { - return GetCachedClient(Client => new IPv6FirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new IPv6FirewallRuleCollection(client, Id)); } /// @@ -1495,8 +1495,8 @@ public virtual IPv6FirewallRuleCollection GetIPv6FirewallRules() /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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> GetIPv6FirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -1518,8 +1518,8 @@ public virtual async Task> GetIPv6FirewallRul /// /// The name of the firewall rule. /// The cancellation token to use. - /// 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 GetIPv6FirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -1530,7 +1530,7 @@ public virtual Response GetIPv6FirewallRule(string fir /// An object representing collection of SqlServerSqlVulnerabilityAssessmentResources and their operations over a SqlServerSqlVulnerabilityAssessmentResource. public virtual SqlServerSqlVulnerabilityAssessmentCollection GetSqlServerSqlVulnerabilityAssessments() { - return GetCachedClient(Client => new SqlServerSqlVulnerabilityAssessmentCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSqlVulnerabilityAssessmentCollection(client, Id)); } /// @@ -1579,7 +1579,7 @@ public virtual Response GetSqlServe /// An object representing collection of FailoverGroupResources and their operations over a FailoverGroupResource. public virtual FailoverGroupCollection GetFailoverGroups() { - return GetCachedClient(Client => new FailoverGroupCollection(Client, Id)); + return GetCachedClient(client => new FailoverGroupCollection(client, Id)); } /// @@ -1597,8 +1597,8 @@ public virtual FailoverGroupCollection GetFailoverGroups() /// /// The name of the failover group. /// The cancellation token to use. - /// 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> GetFailoverGroupAsync(string failoverGroupName, CancellationToken cancellationToken = default) { @@ -1620,8 +1620,8 @@ public virtual async Task> GetFailoverGroupAsync /// /// The name of the failover group. /// The cancellation token to use. - /// 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 GetFailoverGroup(string failoverGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineResource.cs index 819e0e71b282..b785e2642f58 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentBaselineResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerSqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlServerSqlVulnerabilityAssessmentBaselineRuleResource. public virtual SqlServerSqlVulnerabilityAssessmentBaselineRuleCollection GetSqlServerSqlVulnerabilityAssessmentBaselineRules() { - return GetCachedClient(Client => new SqlServerSqlVulnerabilityAssessmentBaselineRuleCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSqlVulnerabilityAssessmentBaselineRuleCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual SqlServerSqlVulnerabilityAssessmentBaselineRuleCollection GetSqlS /// /// The vulnerability assessment rule ID. /// The cancellation token to use. - /// 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> GetSqlServerSqlVulnerabilityAssessmentBaselineRuleAsync(string ruleId, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task /// The vulnerability assessment rule ID. /// The cancellation token to use. - /// 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 GetSqlServerSqlVulnerabilityAssessmentBaselineRule(string ruleId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentResource.cs index 0cf6d6c87641..b3c0923f0402 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerSqlVulnerabilityAssessmentBaselineResources and their operations over a SqlServerSqlVulnerabilityAssessmentBaselineResource. public virtual SqlServerSqlVulnerabilityAssessmentBaselineCollection GetSqlServerSqlVulnerabilityAssessmentBaselines() { - return GetCachedClient(Client => new SqlServerSqlVulnerabilityAssessmentBaselineCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSqlVulnerabilityAssessmentBaselineCollection(client, Id)); } /// @@ -149,7 +149,7 @@ public virtual Response Get /// An object representing collection of SqlServerSqlVulnerabilityAssessmentScanResources and their operations over a SqlServerSqlVulnerabilityAssessmentScanResource. public virtual SqlServerSqlVulnerabilityAssessmentScanCollection GetSqlServerSqlVulnerabilityAssessmentScans() { - return GetCachedClient(Client => new SqlServerSqlVulnerabilityAssessmentScanCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSqlVulnerabilityAssessmentScanCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual SqlServerSqlVulnerabilityAssessmentScanCollection GetSqlServerSql /// /// The String to use. /// The cancellation token to use. - /// 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> GetSqlServerSqlVulnerabilityAssessmentScanAsync(string scanId, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task /// The String to use. /// The cancellation token to use. - /// 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 GetSqlServerSqlVulnerabilityAssessmentScan(string scanId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentScanResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentScanResource.cs index 7888ef6d998d..d7056425847b 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentScanResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerSqlVulnerabilityAssessmentScanResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SqlServerSqlVulnerabilityAssessmentScanResultResources and their operations over a SqlServerSqlVulnerabilityAssessmentScanResultResource. public virtual SqlServerSqlVulnerabilityAssessmentScanResultCollection GetSqlServerSqlVulnerabilityAssessmentScanResults() { - return GetCachedClient(Client => new SqlServerSqlVulnerabilityAssessmentScanResultCollection(Client, Id)); + return GetCachedClient(client => new SqlServerSqlVulnerabilityAssessmentScanResultCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SqlServerSqlVulnerabilityAssessmentScanResultCollection GetSqlSer /// /// The scan result id of the specific result to retrieve. /// The cancellation token to use. - /// 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> GetSqlServerSqlVulnerabilityAssessmentScanResultAsync(string scanResultId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task /// The scan result id of the specific result to retrieve. /// The cancellation token to use. - /// 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 GetSqlServerSqlVulnerabilityAssessmentScanResult(string scanResultId, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SyncGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SyncGroupResource.cs index 3612a51205af..df7dad0ec2eb 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SyncGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SyncGroupResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SyncMemberResources and their operations over a SyncMemberResource. public virtual SyncMemberCollection GetSyncMembers() { - return GetCachedClient(Client => new SyncMemberCollection(Client, Id)); + return GetCachedClient(client => new SyncMemberCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SyncMemberCollection GetSyncMembers() /// /// The name of the sync member. /// The cancellation token to use. - /// 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> GetSyncMemberAsync(string syncMemberName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSyncMemberAsync(strin /// /// The name of the sync member. /// The cancellation token to use. - /// 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 GetSyncMember(string syncMemberName, CancellationToken cancellationToken = default) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/WorkloadGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/WorkloadGroupResource.cs index 3a4f26172005..e05ce62cda12 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/WorkloadGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/WorkloadGroupResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of WorkloadClassifierResources and their operations over a WorkloadClassifierResource. public virtual WorkloadClassifierCollection GetWorkloadClassifiers() { - return GetCachedClient(Client => new WorkloadClassifierCollection(Client, Id)); + return GetCachedClient(client => new WorkloadClassifierCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual WorkloadClassifierCollection GetWorkloadClassifiers() /// /// The name of the workload classifier. /// The cancellation token to use. - /// 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> GetWorkloadClassifierAsync(string workloadClassifierName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetWorkloadClass /// /// The name of the workload classifier. /// The cancellation token to use. - /// 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 GetWorkloadClassifier(string workloadClassifierName, CancellationToken cancellationToken = default) { From 6890db105124afd64e7bcd32c922e983ed70840e Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:29:36 +0000 Subject: [PATCH 7/8] Update SDK codes da_he_2 --- .../Generated/DataMigrationServiceResource.cs | 12 +- .../DataMigrationArmClientMockingExtension.cs | 147 +++ .../Extensions/DataMigrationExtensions.cs | 340 +++--- ...aMigrationResourceGroupMockingExtension.cs | 322 ++++++ ...aMigrationSubscriptionMockingExtension.cs} | 39 +- .../ResourceGroupResourceExtensionClient.cs | 69 -- .../src/Generated/ProjectResource.cs | 12 +- .../DataProtectionBackupInstanceResource.cs | 6 +- .../DataProtectionBackupVaultResource.cs | 30 +- ...otectionBackupArmClientMockingExtension.cs | 135 +++ .../DataProtectionBackupExtensions.cs | 241 +++-- ...tionBackupResourceGroupMockingExtension.cs | 223 ++++ ...tionBackupSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 124 --- .../src/Generated/DataShareAccountResource.cs | 12 +- .../src/Generated/DataShareResource.cs | 24 +- .../DataShareArmClientMockingExtension.cs | 159 +++ .../Extensions/DataShareExtensions.cs | 278 +++-- .../DataShareResourceGroupMockingExtension.cs | 92 ++ ... DataShareSubscriptionMockingExtension.cs} | 17 +- ....cs => DataShareTenantMockingExtension.cs} | 83 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/ShareSubscriptionResource.cs | 12 +- .../src/Generated/EasmWorkspaceResource.cs | 6 +- .../DefenderEasmArmClientMockingExtension.cs | 63 ++ .../Extensions/DefenderEasmExtensions.cs | 93 +- ...fenderEasmResourceGroupMockingExtension.cs | 92 ++ ...fenderEasmSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...VirtualizationArmClientMockingExtension.cs | 159 +++ .../DesktopVirtualizationExtensions.cs | 311 +++--- ...ualizationResourceGroupMockingExtension.cs | 251 +++++ ...ualizationSubscriptionMockingExtension.cs} | 29 +- .../ResourceGroupResourceExtensionClient.cs | 62 -- .../src/Generated/HostPoolResource.cs | 12 +- .../src/Generated/ScalingPlanResource.cs | 6 +- .../src/Generated/SessionHostResource.cs | 6 +- .../VirtualApplicationGroupResource.cs | 12 +- .../src/Generated/DevCenterGalleryResource.cs | 6 +- .../src/Generated/DevCenterImageResource.cs | 6 +- .../src/Generated/DevCenterPoolResource.cs | 6 +- .../src/Generated/DevCenterProjectResource.cs | 30 +- .../src/Generated/DevCenterResource.cs | 30 +- .../DevCenterArmClientMockingExtension.cs | 243 +++++ .../Extensions/DevCenterExtensions.cs | 420 ++++---- .../DevCenterResourceGroupMockingExtension.cs | 198 ++++ ... DevCenterSubscriptionMockingExtension.cs} | 55 +- .../ResourceGroupResourceExtensionClient.cs | 55 - .../DeviceProvisioningServiceResource.cs | 18 +- ...ioningServicesArmClientMockingExtension.cs | 87 ++ .../DeviceProvisioningServicesExtensions.cs | 135 ++- ...ngServicesResourceGroupMockingExtension.cs | 92 ++ ...ngServicesSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/DeviceUpdateAccountResource.cs | 24 +- .../DeviceUpdateArmClientMockingExtension.cs | 99 ++ .../Extensions/DeviceUpdateExtensions.cs | 148 ++- ...viceUpdateResourceGroupMockingExtension.cs | 92 ++ ...viceUpdateSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../DevSpacesArmClientMockingExtension.cs | 51 + .../Extensions/DevSpacesExtensions.cs | 96 +- ...DevSpacesResourceGroupMockingExtension.cs} | 71 +- ... DevSpacesSubscriptionMockingExtension.cs} | 17 +- .../DevTestLabArtifactSourceResource.cs | 12 +- .../src/Generated/DevTestLabResource.cs | 68 +- .../DevTestLabServiceFabricResource.cs | 6 +- .../src/Generated/DevTestLabUserResource.cs | 24 +- .../src/Generated/DevTestLabVmResource.cs | 6 +- .../DevTestLabsArmClientMockingExtension.cs | 291 +++++ .../Extensions/DevTestLabsExtensions.cs | 378 +++---- ...evTestLabsResourceGroupMockingExtension.cs | 149 +++ ...evTestLabsSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../DigitalTwinsDescriptionResource.cs | 24 +- .../DigitalTwinsArmClientMockingExtension.cs | 99 ++ .../Extensions/DigitalTwinsExtensions.cs | 148 ++- ...gitalTwinsResourceGroupMockingExtension.cs | 92 ++ ...gitalTwinsSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../DnsArmClientMockingExtension.cs | 171 +++ .../src/Generated/Extensions/DnsExtensions.cs | 226 ++-- .../DnsResourceGroupMockingExtension.cs | 92 ++ ....cs => DnsSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/DnsForwardingRulesetResource.cs | 12 +- .../src/Generated/DnsResolverResource.cs | 12 +- .../DnsResolverArmClientMockingExtension.cs | 123 +++ .../Extensions/DnsResolverExtensions.cs | 196 ++-- ...nsResolverResourceGroupMockingExtension.cs | 145 +++ ...nsResolverSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../src/Generated/DynatraceMonitorResource.cs | 12 +- .../DynatraceArmClientMockingExtension.cs | 75 ++ .../Extensions/DynatraceExtensions.cs | 106 +- .../DynatraceResourceGroupMockingExtension.cs | 92 ++ ... DynatraceSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../EdgeOrderArmClientMockingExtension.cs | 75 ++ .../Extensions/EdgeOrderExtensions.cs | 238 +++-- .../EdgeOrderResourceGroupMockingExtension.cs | 256 +++++ ... EdgeOrderSubscriptionMockingExtension.cs} | 50 +- .../ResourceGroupResourceExtensionClient.cs | 111 -- .../src/Generated/ElasticMonitorResource.cs | 6 +- .../ElasticArmClientMockingExtension.cs | 63 ++ .../Generated/Extensions/ElasticExtensions.cs | 93 +- .../ElasticResourceGroupMockingExtension.cs | 92 ++ ...=> ElasticSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/ElasticSanResource.cs | 12 +- .../ElasticSanVolumeGroupResource.cs | 6 +- .../ElasticSanArmClientMockingExtension.cs | 87 ++ .../Extensions/ElasticSanExtensions.cs | 131 +-- ...ElasticSanResourceGroupMockingExtension.cs | 92 ++ ...ElasticSanSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/DomainTopicResource.cs | 6 +- .../src/Generated/EventGridDomainResource.cs | 24 +- .../Generated/EventGridNamespaceResource.cs | 36 +- .../src/Generated/EventGridTopicResource.cs | 18 +- .../Extensions/ArmResourceExtensionClient.cs | 48 - .../EventGridArmClientMockingExtension.cs | 503 +++++++++ .../Extensions/EventGridExtensions.cs | 993 ++++++++++-------- .../EventGridResourceGroupMockingExtension.cs | 711 +++++++++++++ ... EventGridSubscriptionMockingExtension.cs} | 218 +++- .../EventGridTenantMockingExtension.cs | 145 +++ .../ResourceGroupResourceExtensionClient.cs | 160 --- .../TenantResourceExtensionClient.cs | 48 - .../src/Generated/NamespaceTopicResource.cs | 6 +- .../src/Generated/PartnerNamespaceResource.cs | 18 +- .../src/Generated/PartnerTopicResource.cs | 6 +- .../src/Generated/SystemTopicResource.cs | 6 +- .../src/Generated/EventHubResource.cs | 12 +- .../EventHubsDisasterRecoveryResource.cs | 6 +- .../Generated/EventHubsNamespaceResource.cs | 40 +- .../EventHubsArmClientMockingExtension.cs | 183 ++++ .../Extensions/EventHubsExtensions.cs | 289 ++--- .../EventHubsResourceGroupMockingExtension.cs | 145 +++ ... EventHubsSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 48 - ...endedLocationsArmClientMockingExtension.cs | 51 + .../Extensions/ExtendedLocationsExtensions.cs | 80 +- ...dLocationsResourceGroupMockingExtension.cs | 92 ++ ...dLocationsSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ContainerServiceFleetResource.cs | 18 +- ...erServiceFleetArmClientMockingExtension.cs | 87 ++ .../ContainerServiceFleetExtensions.cs | 119 +-- ...rviceFleetResourceGroupMockingExtension.cs | 92 ++ ...rviceFleetSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../FluidRelayArmClientMockingExtension.cs | 63 ++ .../Extensions/FluidRelayExtensions.cs | 93 +- ...FluidRelayResourceGroupMockingExtension.cs | 92 ++ ...FluidRelaySubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/FluidRelayServerResource.cs | 6 +- .../FrontDoorArmClientMockingExtension.cs | 111 ++ .../Extensions/FrontDoorExtensions.cs | 268 ++--- .../FrontDoorResourceGroupMockingExtension.cs | 198 ++++ ... FrontDoorSubscriptionMockingExtension.cs} | 35 +- ....cs => FrontDoorTenantMockingExtension.cs} | 23 +- .../ResourceGroupResourceExtensionClient.cs | 55 - ...ontDoorNetworkExperimentProfileResource.cs | 6 +- .../src/Generated/FrontDoorResource.cs | 12 +- .../GrafanaArmClientMockingExtension.cs | 75 ++ .../Generated/Extensions/GrafanaExtensions.cs | 106 +- .../GrafanaResourceGroupMockingExtension.cs | 92 ++ ...=> GrafanaSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/ManagedGrafanaResource.cs | 12 +- .../GraphServicesArmClientMockingExtension.cs | 51 + .../Extensions/GraphServicesExtensions.cs | 80 +- ...phServicesResourceGroupMockingExtension.cs | 92 ++ ...phServicesSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Extensions/ArmResourceExtensionClient.cs | 55 - ...tConfigurationArmClientMockingExtension.cs | 259 +++++ .../GuestConfigurationExtensions.cs | 260 ++--- ...figurationResourceGroupMockingExtension.cs | 87 ++ ...nfigurationSubscriptionMockingExtension.cs | 87 ++ .../ResourceGroupResourceExtensionClient.cs | 44 - .../SubscriptionResourceExtensionClient.cs | 44 - .../src/Generated/CloudHsmClusterResource.cs | 6 +- ...ecurityModulesArmClientMockingExtension.cs | 75 ++ .../HardwareSecurityModulesExtensions.cs | 144 +-- ...ityModulesResourceGroupMockingExtension.cs | 145 +++ ...ityModulesSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 48 - ...ightContainersArmClientMockingExtension.cs | 63 ++ .../HDInsightContainersExtensions.cs | 133 ++- ...ContainersResourceGroupMockingExtension.cs | 92 ++ ...ContainersSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/HDInsightClusterPoolResource.cs | 6 +- .../HDInsightArmClientMockingExtension.cs | 87 ++ .../Extensions/HDInsightExtensions.cs | 187 ++-- .../HDInsightResourceGroupMockingExtension.cs | 92 ++ ... HDInsightSubscriptionMockingExtension.cs} | 49 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/HDInsightClusterResource.cs | 18 +- .../HealthBotArmClientMockingExtension.cs | 51 + .../Extensions/HealthBotExtensions.cs | 80 +- .../HealthBotResourceGroupMockingExtension.cs | 92 ++ ... HealthBotSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - 206 files changed, 12918 insertions(+), 5532 deletions(-) create mode 100644 sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationArmClientMockingExtension.cs create mode 100644 sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationResourceGroupMockingExtension.cs rename sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataMigrationSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupArmClientMockingExtension.cs create mode 100644 sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupResourceGroupMockingExtension.cs rename sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataProtectionBackupSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareArmClientMockingExtension.cs create mode 100644 sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareResourceGroupMockingExtension.cs rename sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataShareSubscriptionMockingExtension.cs} (85%) rename sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/{TenantResourceExtensionClient.cs => DataShareTenantMockingExtension.cs} (74%) delete mode 100644 sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmArmClientMockingExtension.cs create mode 100644 sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmResourceGroupMockingExtension.cs rename sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DefenderEasmSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationArmClientMockingExtension.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationResourceGroupMockingExtension.cs rename sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DesktopVirtualizationSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterArmClientMockingExtension.cs create mode 100644 sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterResourceGroupMockingExtension.cs rename sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DevCenterSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesArmClientMockingExtension.cs create mode 100644 sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesResourceGroupMockingExtension.cs rename sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DeviceProvisioningServicesSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateArmClientMockingExtension.cs create mode 100644 sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateResourceGroupMockingExtension.cs rename sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DeviceUpdateSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesArmClientMockingExtension.cs rename sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => DevSpacesResourceGroupMockingExtension.cs} (59%) rename sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DevSpacesSubscriptionMockingExtension.cs} (85%) create mode 100644 sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsArmClientMockingExtension.cs create mode 100644 sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsResourceGroupMockingExtension.cs rename sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DevTestLabsSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsArmClientMockingExtension.cs create mode 100644 sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsResourceGroupMockingExtension.cs rename sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DigitalTwinsSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsArmClientMockingExtension.cs create mode 100644 sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsResourceGroupMockingExtension.cs rename sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DnsSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverArmClientMockingExtension.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverResourceGroupMockingExtension.cs rename sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DnsResolverSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceArmClientMockingExtension.cs create mode 100644 sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceResourceGroupMockingExtension.cs rename sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DynatraceSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderArmClientMockingExtension.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderResourceGroupMockingExtension.cs rename sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => EdgeOrderSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticArmClientMockingExtension.cs create mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticResourceGroupMockingExtension.cs rename sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ElasticSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanArmClientMockingExtension.cs create mode 100644 sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanResourceGroupMockingExtension.cs rename sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ElasticSanSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridArmClientMockingExtension.cs create mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridResourceGroupMockingExtension.cs rename sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => EventGridSubscriptionMockingExtension.cs} (70%) create mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridTenantMockingExtension.cs delete mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/TenantResourceExtensionClient.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsArmClientMockingExtension.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsResourceGroupMockingExtension.cs rename sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => EventHubsSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsArmClientMockingExtension.cs create mode 100644 sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsResourceGroupMockingExtension.cs rename sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ExtendedLocationsSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetArmClientMockingExtension.cs create mode 100644 sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetResourceGroupMockingExtension.cs rename sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ContainerServiceFleetSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayArmClientMockingExtension.cs create mode 100644 sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayResourceGroupMockingExtension.cs rename sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => FluidRelaySubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorArmClientMockingExtension.cs create mode 100644 sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorResourceGroupMockingExtension.cs rename sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => FrontDoorSubscriptionMockingExtension.cs} (89%) rename sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/{TenantResourceExtensionClient.cs => FrontDoorTenantMockingExtension.cs} (81%) delete mode 100644 sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaArmClientMockingExtension.cs create mode 100644 sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaResourceGroupMockingExtension.cs rename sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => GrafanaSubscriptionMockingExtension.cs} (86%) delete mode 100644 sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesArmClientMockingExtension.cs create mode 100644 sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesResourceGroupMockingExtension.cs rename sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => GraphServicesSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationArmClientMockingExtension.cs create mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationResourceGroupMockingExtension.cs create mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationSubscriptionMockingExtension.cs delete mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs create mode 100644 sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesArmClientMockingExtension.cs create mode 100644 sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesResourceGroupMockingExtension.cs rename sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HardwareSecurityModulesSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersArmClientMockingExtension.cs create mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersResourceGroupMockingExtension.cs rename sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HDInsightContainersSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightArmClientMockingExtension.cs create mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightResourceGroupMockingExtension.cs rename sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HDInsightSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotArmClientMockingExtension.cs create mode 100644 sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotResourceGroupMockingExtension.cs rename sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => HealthBotSubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/DataMigrationServiceResource.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/DataMigrationServiceResource.cs index 3cf06e017eef..df734afe33e4 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/DataMigrationServiceResource.cs +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/DataMigrationServiceResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceServiceTaskResources and their operations over a ServiceServiceTaskResource. public virtual ServiceServiceTaskCollection GetServiceServiceTasks() { - return GetCachedClient(Client => new ServiceServiceTaskCollection(Client, Id)); + return GetCachedClient(client => new ServiceServiceTaskCollection(client, Id)); } /// @@ -113,8 +113,8 @@ public virtual ServiceServiceTaskCollection GetServiceServiceTasks() /// Name of the Task. /// Expand the response. /// The cancellation token to use. - /// 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> GetServiceServiceTaskAsync(string taskName, string expand = null, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetServiceServic /// Name of the Task. /// Expand the response. /// The cancellation token to use. - /// 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 GetServiceServiceTask(string taskName, string expand = null, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetServiceServiceTask(string /// An object representing collection of ProjectResources and their operations over a ProjectResource. public virtual ProjectCollection GetProjects() { - return GetCachedClient(Client => new ProjectCollection(Client, Id)); + return GetCachedClient(client => new ProjectCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual ProjectCollection GetProjects() /// /// Name of the project. /// The cancellation token to use. - /// 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> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetProjectAsync(string proj /// /// Name of the project. /// The cancellation token to use. - /// 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 GetProject(string projectName, CancellationToken cancellationToken = default) { diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationArmClientMockingExtension.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationArmClientMockingExtension.cs new file mode 100644 index 000000000000..2a3b81298da2 --- /dev/null +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataMigration; + +namespace Azure.ResourceManager.DataMigration.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataMigrationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataMigrationArmClientMockingExtension() + { + } + + /// 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 DataMigrationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataMigrationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DatabaseMigrationSqlDBResource GetDatabaseMigrationSqlDBResource(ResourceIdentifier id) + { + DatabaseMigrationSqlDBResource.ValidateResourceId(id); + return new DatabaseMigrationSqlDBResource(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 DatabaseMigrationSqlMIResource GetDatabaseMigrationSqlMIResource(ResourceIdentifier id) + { + DatabaseMigrationSqlMIResource.ValidateResourceId(id); + return new DatabaseMigrationSqlMIResource(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 DatabaseMigrationSqlVmResource GetDatabaseMigrationSqlVmResource(ResourceIdentifier id) + { + DatabaseMigrationSqlVmResource.ValidateResourceId(id); + return new DatabaseMigrationSqlVmResource(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 SqlMigrationServiceResource GetSqlMigrationServiceResource(ResourceIdentifier id) + { + SqlMigrationServiceResource.ValidateResourceId(id); + return new SqlMigrationServiceResource(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 DataMigrationServiceResource GetDataMigrationServiceResource(ResourceIdentifier id) + { + DataMigrationServiceResource.ValidateResourceId(id); + return new DataMigrationServiceResource(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 ServiceProjectTaskResource GetServiceProjectTaskResource(ResourceIdentifier id) + { + ServiceProjectTaskResource.ValidateResourceId(id); + return new ServiceProjectTaskResource(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 ServiceServiceTaskResource GetServiceServiceTaskResource(ResourceIdentifier id) + { + ServiceServiceTaskResource.ValidateResourceId(id); + return new ServiceServiceTaskResource(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 ProjectResource GetProjectResource(ResourceIdentifier id) + { + ProjectResource.ValidateResourceId(id); + return new ProjectResource(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 ProjectFileResource GetProjectFileResource(ResourceIdentifier id) + { + ProjectFileResource.ValidateResourceId(id); + return new ProjectFileResource(Client, id); + } + } +} diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationExtensions.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationExtensions.cs index d86dcd38a6af..696c9f27c9b6 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationExtensions.cs +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataMigration.Mocking; using Azure.ResourceManager.DataMigration.Models; using Azure.ResourceManager.Resources; @@ -19,214 +20,177 @@ namespace Azure.ResourceManager.DataMigration /// A class to add extension methods to Azure.ResourceManager.DataMigration. public static partial class DataMigrationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataMigrationArmClientMockingExtension GetDataMigrationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataMigrationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataMigrationResourceGroupMockingExtension GetDataMigrationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataMigrationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataMigrationSubscriptionMockingExtension GetDataMigrationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataMigrationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DatabaseMigrationSqlDBResource /// /// 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. /// Returns a object. public static DatabaseMigrationSqlDBResource GetDatabaseMigrationSqlDBResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatabaseMigrationSqlDBResource.ValidateResourceId(id); - return new DatabaseMigrationSqlDBResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetDatabaseMigrationSqlDBResource(id); } - #endregion - #region DatabaseMigrationSqlMIResource /// /// 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. /// Returns a object. public static DatabaseMigrationSqlMIResource GetDatabaseMigrationSqlMIResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatabaseMigrationSqlMIResource.ValidateResourceId(id); - return new DatabaseMigrationSqlMIResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetDatabaseMigrationSqlMIResource(id); } - #endregion - #region DatabaseMigrationSqlVmResource /// /// 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. /// Returns a object. public static DatabaseMigrationSqlVmResource GetDatabaseMigrationSqlVmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatabaseMigrationSqlVmResource.ValidateResourceId(id); - return new DatabaseMigrationSqlVmResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetDatabaseMigrationSqlVmResource(id); } - #endregion - #region SqlMigrationServiceResource /// /// 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. /// Returns a object. public static SqlMigrationServiceResource GetSqlMigrationServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SqlMigrationServiceResource.ValidateResourceId(id); - return new SqlMigrationServiceResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetSqlMigrationServiceResource(id); } - #endregion - #region DataMigrationServiceResource /// /// 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. /// Returns a object. public static DataMigrationServiceResource GetDataMigrationServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataMigrationServiceResource.ValidateResourceId(id); - return new DataMigrationServiceResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetDataMigrationServiceResource(id); } - #endregion - #region ServiceProjectTaskResource /// /// 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. /// Returns a object. public static ServiceProjectTaskResource GetServiceProjectTaskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceProjectTaskResource.ValidateResourceId(id); - return new ServiceProjectTaskResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetServiceProjectTaskResource(id); } - #endregion - #region ServiceServiceTaskResource /// /// 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. /// Returns a object. public static ServiceServiceTaskResource GetServiceServiceTaskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ServiceServiceTaskResource.ValidateResourceId(id); - return new ServiceServiceTaskResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetServiceServiceTaskResource(id); } - #endregion - #region ProjectResource /// /// 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. /// Returns a object. public static ProjectResource GetProjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProjectResource.ValidateResourceId(id); - return new ProjectResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetProjectResource(id); } - #endregion - #region ProjectFileResource /// /// 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. /// Returns a object. public static ProjectFileResource GetProjectFileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProjectFileResource.ValidateResourceId(id); - return new ProjectFileResource(client, id); - } - ); + return GetDataMigrationArmClientMockingExtension(client).GetProjectFileResource(id); } - #endregion - /// Gets a collection of DatabaseMigrationSqlDBResources in the ResourceGroupResource. + /// + /// Gets a collection of DatabaseMigrationSqlDBResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DatabaseMigrationSqlDBResources and their operations over a DatabaseMigrationSqlDBResource. public static DatabaseMigrationSqlDBCollection GetDatabaseMigrationSqlDBs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDatabaseMigrationSqlDBs(); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlDBs(); } /// @@ -241,6 +205,10 @@ public static DatabaseMigrationSqlDBCollection GetDatabaseMigrationSqlDBs(this R /// DatabaseMigrationsSqlDb_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -248,12 +216,12 @@ public static DatabaseMigrationSqlDBCollection GetDatabaseMigrationSqlDBs(this R /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetDatabaseMigrationSqlDBAsync(this ResourceGroupResource resourceGroupResource, string sqlDBInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDatabaseMigrationSqlDBs().GetAsync(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlDBAsync(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -268,6 +236,10 @@ public static async Task> GetDatabaseMi /// DatabaseMigrationsSqlDb_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -275,20 +247,26 @@ public static async Task> GetDatabaseMi /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetDatabaseMigrationSqlDB(this ResourceGroupResource resourceGroupResource, string sqlDBInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDatabaseMigrationSqlDBs().Get(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlDB(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); } - /// Gets a collection of DatabaseMigrationSqlMIResources in the ResourceGroupResource. + /// + /// Gets a collection of DatabaseMigrationSqlMIResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DatabaseMigrationSqlMIResources and their operations over a DatabaseMigrationSqlMIResource. public static DatabaseMigrationSqlMICollection GetDatabaseMigrationSqlMIs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDatabaseMigrationSqlMIs(); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlMIs(); } /// @@ -303,6 +281,10 @@ public static DatabaseMigrationSqlMICollection GetDatabaseMigrationSqlMIs(this R /// DatabaseMigrationsSqlMi_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -310,12 +292,12 @@ public static DatabaseMigrationSqlMICollection GetDatabaseMigrationSqlMIs(this R /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetDatabaseMigrationSqlMIAsync(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDatabaseMigrationSqlMIs().GetAsync(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlMIAsync(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -330,6 +312,10 @@ public static async Task> GetDatabaseMi /// DatabaseMigrationsSqlMi_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -337,20 +323,26 @@ public static async Task> GetDatabaseMi /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetDatabaseMigrationSqlMI(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDatabaseMigrationSqlMIs().Get(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlMI(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); } - /// Gets a collection of DatabaseMigrationSqlVmResources in the ResourceGroupResource. + /// + /// Gets a collection of DatabaseMigrationSqlVmResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DatabaseMigrationSqlVmResources and their operations over a DatabaseMigrationSqlVmResource. public static DatabaseMigrationSqlVmCollection GetDatabaseMigrationSqlVms(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDatabaseMigrationSqlVms(); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlVms(); } /// @@ -365,6 +357,10 @@ public static DatabaseMigrationSqlVmCollection GetDatabaseMigrationSqlVms(this R /// DatabaseMigrationsSqlVm_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -372,12 +368,12 @@ public static DatabaseMigrationSqlVmCollection GetDatabaseMigrationSqlVms(this R /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetDatabaseMigrationSqlVmAsync(this ResourceGroupResource resourceGroupResource, string sqlVirtualMachineName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDatabaseMigrationSqlVms().GetAsync(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlVmAsync(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); } /// @@ -392,6 +388,10 @@ public static async Task> GetDatabaseMi /// DatabaseMigrationsSqlVm_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -399,20 +399,26 @@ public static async Task> GetDatabaseMi /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. /// Complete migration details be included in the response. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetDatabaseMigrationSqlVm(this ResourceGroupResource resourceGroupResource, string sqlVirtualMachineName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDatabaseMigrationSqlVms().Get(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDatabaseMigrationSqlVm(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken); } - /// Gets a collection of SqlMigrationServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of SqlMigrationServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SqlMigrationServiceResources and their operations over a SqlMigrationServiceResource. public static SqlMigrationServiceCollection GetSqlMigrationServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSqlMigrationServices(); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetSqlMigrationServices(); } /// @@ -427,16 +433,20 @@ public static SqlMigrationServiceCollection GetSqlMigrationServices(this Resourc /// SqlMigrationServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL Migration Service. /// The cancellation token to use. - /// 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 static async Task> GetSqlMigrationServiceAsync(this ResourceGroupResource resourceGroupResource, string sqlMigrationServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSqlMigrationServices().GetAsync(sqlMigrationServiceName, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetSqlMigrationServiceAsync(sqlMigrationServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -451,24 +461,34 @@ public static async Task> GetSqlMigrationS /// SqlMigrationServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the SQL Migration Service. /// The cancellation token to use. - /// 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 static Response GetSqlMigrationService(this ResourceGroupResource resourceGroupResource, string sqlMigrationServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSqlMigrationServices().Get(sqlMigrationServiceName, cancellationToken); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetSqlMigrationService(sqlMigrationServiceName, cancellationToken); } - /// Gets a collection of DataMigrationServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of DataMigrationServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataMigrationServiceResources and their operations over a DataMigrationServiceResource. public static DataMigrationServiceCollection GetDataMigrationServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataMigrationServices(); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDataMigrationServices(); } /// @@ -483,16 +503,20 @@ public static DataMigrationServiceCollection GetDataMigrationServices(this Resou /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the service. /// The cancellation token to use. - /// 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 static async Task> GetDataMigrationServiceAsync(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataMigrationServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDataMigrationServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); } /// @@ -507,16 +531,20 @@ public static async Task> GetDataMigratio /// Services_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the service. /// The cancellation token to use. - /// 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 static Response GetDataMigrationService(this ResourceGroupResource resourceGroupResource, string serviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataMigrationServices().Get(serviceName, cancellationToken); + return GetDataMigrationResourceGroupMockingExtension(resourceGroupResource).GetDataMigrationService(serviceName, cancellationToken); } /// @@ -531,13 +559,17 @@ public static Response GetDataMigrationService(thi /// SqlMigrationServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSqlMigrationServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlMigrationServicesAsync(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetSqlMigrationServicesAsync(cancellationToken); } /// @@ -552,13 +584,17 @@ public static AsyncPageable GetSqlMigrationServices /// SqlMigrationServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSqlMigrationServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSqlMigrationServices(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetSqlMigrationServices(cancellationToken); } /// @@ -573,13 +609,17 @@ public static Pageable GetSqlMigrationServices(this /// ResourceSkus_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusResourceSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusResourceSkusAsync(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetSkusResourceSkusAsync(cancellationToken); } /// @@ -594,13 +634,17 @@ public static AsyncPageable GetSkusResourceSkusAsync(this Subscript /// ResourceSkus_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkusResourceSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusResourceSkus(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetSkusResourceSkus(cancellationToken); } /// @@ -615,13 +659,17 @@ public static Pageable GetSkusResourceSkus(this SubscriptionResourc /// Services_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataMigrationServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataMigrationServicesAsync(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetDataMigrationServicesAsync(cancellationToken); } /// @@ -636,13 +684,17 @@ public static AsyncPageable GetDataMigrationServic /// Services_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataMigrationServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataMigrationServices(cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetDataMigrationServices(cancellationToken); } /// @@ -657,6 +709,10 @@ public static Pageable GetDataMigrationServices(th /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region of the operation. @@ -665,9 +721,7 @@ public static Pageable GetDataMigrationServices(th /// is null. public static async Task> CheckNameAvailabilityServiceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, NameAvailabilityRequest nameAvailabilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nameAvailabilityRequest, nameof(nameAvailabilityRequest)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityServiceAsync(location, nameAvailabilityRequest, cancellationToken).ConfigureAwait(false); + return await GetDataMigrationSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityServiceAsync(location, nameAvailabilityRequest, cancellationToken).ConfigureAwait(false); } /// @@ -682,6 +736,10 @@ public static async Task> CheckNameAvailabili /// Services_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region of the operation. @@ -690,9 +748,7 @@ public static async Task> CheckNameAvailabili /// is null. public static Response CheckNameAvailabilityService(this SubscriptionResource subscriptionResource, AzureLocation location, NameAvailabilityRequest nameAvailabilityRequest, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nameAvailabilityRequest, nameof(nameAvailabilityRequest)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityService(location, nameAvailabilityRequest, cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).CheckNameAvailabilityService(location, nameAvailabilityRequest, cancellationToken); } /// @@ -707,6 +763,10 @@ public static Response CheckNameAvailabilityService(th /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region of the operation. @@ -714,7 +774,7 @@ public static Response CheckNameAvailabilityService(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, cancellationToken); } /// @@ -729,6 +789,10 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResource subs /// Usages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region of the operation. @@ -736,7 +800,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResource subs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, cancellationToken); + return GetDataMigrationSubscriptionMockingExtension(subscriptionResource).GetUsages(location, cancellationToken); } } } diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationResourceGroupMockingExtension.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f1c74ebf79c8 --- /dev/null +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationResourceGroupMockingExtension.cs @@ -0,0 +1,322 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataMigration; + +namespace Azure.ResourceManager.DataMigration.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataMigrationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataMigrationResourceGroupMockingExtension() + { + } + + /// 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 DataMigrationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DatabaseMigrationSqlDBResources in the ResourceGroupResource. + /// An object representing collection of DatabaseMigrationSqlDBResources and their operations over a DatabaseMigrationSqlDBResource. + public virtual DatabaseMigrationSqlDBCollection GetDatabaseMigrationSqlDBs() + { + return GetCachedClient(client => new DatabaseMigrationSqlDBCollection(client, Id)); + } + + /// + /// Retrieve the Database Migration resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlDb_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDatabaseMigrationSqlDBAsync(string sqlDBInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDatabaseMigrationSqlDBs().GetAsync(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the Database Migration resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlDb_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDatabaseMigrationSqlDB(string sqlDBInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return GetDatabaseMigrationSqlDBs().Get(sqlDBInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); + } + + /// Gets a collection of DatabaseMigrationSqlMIResources in the ResourceGroupResource. + /// An object representing collection of DatabaseMigrationSqlMIResources and their operations over a DatabaseMigrationSqlMIResource. + public virtual DatabaseMigrationSqlMICollection GetDatabaseMigrationSqlMIs() + { + return GetCachedClient(client => new DatabaseMigrationSqlMICollection(client, Id)); + } + + /// + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlMi_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDatabaseMigrationSqlMIAsync(string managedInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDatabaseMigrationSqlMIs().GetAsync(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the specified database migration for a given SQL Managed Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlMi_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDatabaseMigrationSqlMI(string managedInstanceName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return GetDatabaseMigrationSqlMIs().Get(managedInstanceName, targetDBName, migrationOperationId, expand, cancellationToken); + } + + /// Gets a collection of DatabaseMigrationSqlVmResources in the ResourceGroupResource. + /// An object representing collection of DatabaseMigrationSqlVmResources and their operations over a DatabaseMigrationSqlVmResource. + public virtual DatabaseMigrationSqlVmCollection GetDatabaseMigrationSqlVms() + { + return GetCachedClient(client => new DatabaseMigrationSqlVmCollection(client, Id)); + } + + /// + /// Retrieve the specified database migration for a given SQL VM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlVm_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDatabaseMigrationSqlVmAsync(string sqlVirtualMachineName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDatabaseMigrationSqlVms().GetAsync(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the specified database migration for a given SQL VM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName} + /// + /// + /// Operation Id + /// DatabaseMigrationsSqlVm_Get + /// + /// + /// + /// The String to use. + /// The name of the target database. + /// Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved. + /// Complete migration details be included in the response. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDatabaseMigrationSqlVm(string sqlVirtualMachineName, string targetDBName, Guid? migrationOperationId = null, string expand = null, CancellationToken cancellationToken = default) + { + return GetDatabaseMigrationSqlVms().Get(sqlVirtualMachineName, targetDBName, migrationOperationId, expand, cancellationToken); + } + + /// Gets a collection of SqlMigrationServiceResources in the ResourceGroupResource. + /// An object representing collection of SqlMigrationServiceResources and their operations over a SqlMigrationServiceResource. + public virtual SqlMigrationServiceCollection GetSqlMigrationServices() + { + return GetCachedClient(client => new SqlMigrationServiceCollection(client, Id)); + } + + /// + /// Retrieve the Database Migration Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName} + /// + /// + /// Operation Id + /// SqlMigrationServices_Get + /// + /// + /// + /// Name of the SQL Migration Service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlMigrationServiceAsync(string sqlMigrationServiceName, CancellationToken cancellationToken = default) + { + return await GetSqlMigrationServices().GetAsync(sqlMigrationServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the Database Migration Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName} + /// + /// + /// Operation Id + /// SqlMigrationServices_Get + /// + /// + /// + /// Name of the SQL Migration Service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlMigrationService(string sqlMigrationServiceName, CancellationToken cancellationToken = default) + { + return GetSqlMigrationServices().Get(sqlMigrationServiceName, cancellationToken); + } + + /// Gets a collection of DataMigrationServiceResources in the ResourceGroupResource. + /// An object representing collection of DataMigrationServiceResources and their operations over a DataMigrationServiceResource. + public virtual DataMigrationServiceCollection GetDataMigrationServices() + { + return GetCachedClient(client => new DataMigrationServiceCollection(client, Id)); + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Name of 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> GetDataMigrationServiceAsync(string serviceName, CancellationToken cancellationToken = default) + { + return await GetDataMigrationServices().GetAsync(serviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// The services resource is the top-level resource that represents the Database Migration Service. The GET method retrieves information about a service instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName} + /// + /// + /// Operation Id + /// Services_Get + /// + /// + /// + /// Name of the service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataMigrationService(string serviceName, CancellationToken cancellationToken = default) + { + return GetDataMigrationServices().Get(serviceName, cancellationToken); + } + } +} diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationSubscriptionMockingExtension.cs similarity index 89% rename from sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationSubscriptionMockingExtension.cs index a017b0c3ea15..d8f8b506f05c 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/DataMigrationSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataMigration; using Azure.ResourceManager.DataMigration.Models; -namespace Azure.ResourceManager.DataMigration +namespace Azure.ResourceManager.DataMigration.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataMigrationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _sqlMigrationServiceClientDiagnostics; private SqlMigrationServicesRestOperations _sqlMigrationServiceRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _usagesClientDiagnostics; private UsagesRestOperations _usagesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataMigrationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataMigrationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -75,7 +76,7 @@ public virtual AsyncPageable GetSqlMigrationService { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlMigrationServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlMigrationServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlMigrationServiceResource(Client, SqlMigrationServiceData.DeserializeSqlMigrationServiceData(e)), SqlMigrationServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlMigrationServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlMigrationServiceResource(Client, SqlMigrationServiceData.DeserializeSqlMigrationServiceData(e)), SqlMigrationServiceClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetSqlMigrationServices", "value", "nextLink", cancellationToken); } /// @@ -97,7 +98,7 @@ public virtual Pageable GetSqlMigrationServices(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => SqlMigrationServiceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SqlMigrationServiceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlMigrationServiceResource(Client, SqlMigrationServiceData.DeserializeSqlMigrationServiceData(e)), SqlMigrationServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSqlMigrationServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlMigrationServiceResource(Client, SqlMigrationServiceData.DeserializeSqlMigrationServiceData(e)), SqlMigrationServiceClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetSqlMigrationServices", "value", "nextLink", cancellationToken); } /// @@ -119,7 +120,7 @@ public virtual AsyncPageable GetSkusResourceSkusAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListSkusRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListSkusNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceSku.DeserializeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ResourceSku.DeserializeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetSkusResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -141,7 +142,7 @@ public virtual Pageable GetSkusResourceSkus(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListSkusRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListSkusNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceSku.DeserializeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkusResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ResourceSku.DeserializeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetSkusResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -163,7 +164,7 @@ public virtual AsyncPageable GetDataMigrationServi { HttpMessage FirstPageRequest(int? pageSizeHint) => DataMigrationServiceServicesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataMigrationServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataMigrationServiceResource(Client, DataMigrationServiceData.DeserializeDataMigrationServiceData(e)), DataMigrationServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataMigrationServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataMigrationServiceResource(Client, DataMigrationServiceData.DeserializeDataMigrationServiceData(e)), DataMigrationServiceServicesClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetDataMigrationServices", "value", "nextLink", cancellationToken); } /// @@ -185,7 +186,7 @@ public virtual Pageable GetDataMigrationServices(C { HttpMessage FirstPageRequest(int? pageSizeHint) => DataMigrationServiceServicesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataMigrationServiceServicesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataMigrationServiceResource(Client, DataMigrationServiceData.DeserializeDataMigrationServiceData(e)), DataMigrationServiceServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataMigrationServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataMigrationServiceResource(Client, DataMigrationServiceData.DeserializeDataMigrationServiceData(e)), DataMigrationServiceServicesClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetDataMigrationServices", "value", "nextLink", cancellationToken); } /// @@ -204,9 +205,12 @@ public virtual Pageable GetDataMigrationServices(C /// The Azure region of the operation. /// Requested name to validate. /// The cancellation token to use. + /// is null. public virtual async Task> CheckNameAvailabilityServiceAsync(AzureLocation location, NameAvailabilityRequest nameAvailabilityRequest, CancellationToken cancellationToken = default) { - using var scope = DataMigrationServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityService"); + Argument.AssertNotNull(nameAvailabilityRequest, nameof(nameAvailabilityRequest)); + + using var scope = DataMigrationServiceServicesClientDiagnostics.CreateScope("DataMigrationSubscriptionMockingExtension.CheckNameAvailabilityService"); scope.Start(); try { @@ -236,9 +240,12 @@ public virtual async Task> CheckNameAvailabil /// The Azure region of the operation. /// Requested name to validate. /// The cancellation token to use. + /// is null. public virtual Response CheckNameAvailabilityService(AzureLocation location, NameAvailabilityRequest nameAvailabilityRequest, CancellationToken cancellationToken = default) { - using var scope = DataMigrationServiceServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailabilityService"); + Argument.AssertNotNull(nameAvailabilityRequest, nameof(nameAvailabilityRequest)); + + using var scope = DataMigrationServiceServicesClientDiagnostics.CreateScope("DataMigrationSubscriptionMockingExtension.CheckNameAvailabilityService"); scope.Start(); try { @@ -272,7 +279,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location, Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, Quota.DeserializeQuota, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, Quota.DeserializeQuota, UsagesClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -295,7 +302,7 @@ public virtual Pageable GetUsages(AzureLocation location, CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, Quota.DeserializeQuota, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, Quota.DeserializeQuota, UsagesClientDiagnostics, Pipeline, "DataMigrationSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3c2da0686859..000000000000 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataMigration -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DatabaseMigrationSqlDBResources in the ResourceGroupResource. - /// An object representing collection of DatabaseMigrationSqlDBResources and their operations over a DatabaseMigrationSqlDBResource. - public virtual DatabaseMigrationSqlDBCollection GetDatabaseMigrationSqlDBs() - { - return GetCachedClient(Client => new DatabaseMigrationSqlDBCollection(Client, Id)); - } - - /// Gets a collection of DatabaseMigrationSqlMIResources in the ResourceGroupResource. - /// An object representing collection of DatabaseMigrationSqlMIResources and their operations over a DatabaseMigrationSqlMIResource. - public virtual DatabaseMigrationSqlMICollection GetDatabaseMigrationSqlMIs() - { - return GetCachedClient(Client => new DatabaseMigrationSqlMICollection(Client, Id)); - } - - /// Gets a collection of DatabaseMigrationSqlVmResources in the ResourceGroupResource. - /// An object representing collection of DatabaseMigrationSqlVmResources and their operations over a DatabaseMigrationSqlVmResource. - public virtual DatabaseMigrationSqlVmCollection GetDatabaseMigrationSqlVms() - { - return GetCachedClient(Client => new DatabaseMigrationSqlVmCollection(Client, Id)); - } - - /// Gets a collection of SqlMigrationServiceResources in the ResourceGroupResource. - /// An object representing collection of SqlMigrationServiceResources and their operations over a SqlMigrationServiceResource. - public virtual SqlMigrationServiceCollection GetSqlMigrationServices() - { - return GetCachedClient(Client => new SqlMigrationServiceCollection(Client, Id)); - } - - /// Gets a collection of DataMigrationServiceResources in the ResourceGroupResource. - /// An object representing collection of DataMigrationServiceResources and their operations over a DataMigrationServiceResource. - public virtual DataMigrationServiceCollection GetDataMigrationServices() - { - return GetCachedClient(Client => new DataMigrationServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/ProjectResource.cs b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/ProjectResource.cs index 1ffe878c53d7..1f7902a8587b 100644 --- a/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/ProjectResource.cs +++ b/sdk/datamigration/Azure.ResourceManager.DataMigration/src/Generated/ProjectResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ServiceProjectTaskResources and their operations over a ServiceProjectTaskResource. public virtual ServiceProjectTaskCollection GetServiceProjectTasks() { - return GetCachedClient(Client => new ServiceProjectTaskCollection(Client, Id)); + return GetCachedClient(client => new ServiceProjectTaskCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ServiceProjectTaskCollection GetServiceProjectTasks() /// Name of the Task. /// Expand the response. /// The cancellation token to use. - /// 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> GetServiceProjectTaskAsync(string taskName, string expand = null, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetServiceProjec /// Name of the Task. /// Expand the response. /// The cancellation token to use. - /// 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 GetServiceProjectTask(string taskName, string expand = null, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetServiceProjectTask(string /// An object representing collection of ProjectFileResources and their operations over a ProjectFileResource. public virtual ProjectFileCollection GetProjectFiles() { - return GetCachedClient(Client => new ProjectFileCollection(Client, Id)); + return GetCachedClient(client => new ProjectFileCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ProjectFileCollection GetProjectFiles() /// /// Name of the File. /// The cancellation token to use. - /// 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> GetProjectFileAsync(string fileName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetProjectFileAsync(str /// /// Name of the File. /// The cancellation token to use. - /// 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 GetProjectFile(string fileName, CancellationToken cancellationToken = default) { diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupInstanceResource.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupInstanceResource.cs index 33c6a4d84c08..dbe5f1fce8a8 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupInstanceResource.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupInstanceResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataProtectionBackupRecoveryPointResources and their operations over a DataProtectionBackupRecoveryPointResource. public virtual DataProtectionBackupRecoveryPointCollection GetDataProtectionBackupRecoveryPoints() { - return GetCachedClient(Client => new DataProtectionBackupRecoveryPointCollection(Client, Id)); + return GetCachedClient(client => new DataProtectionBackupRecoveryPointCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual DataProtectionBackupRecoveryPointCollection GetDataProtectionBack /// /// The String to use. /// The cancellation token to use. - /// 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> GetDataProtectionBackupRecoveryPointAsync(string recoveryPointId, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> G /// /// The String to use. /// The cancellation token to use. - /// 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 GetDataProtectionBackupRecoveryPoint(string recoveryPointId, CancellationToken cancellationToken = default) { diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupVaultResource.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupVaultResource.cs index 90deae40c850..b728f3842502 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupVaultResource.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/DataProtectionBackupVaultResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataProtectionBackupPolicyResources and their operations over a DataProtectionBackupPolicyResource. public virtual DataProtectionBackupPolicyCollection GetDataProtectionBackupPolicies() { - return GetCachedClient(Client => new DataProtectionBackupPolicyCollection(Client, Id)); + return GetCachedClient(client => new DataProtectionBackupPolicyCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual DataProtectionBackupPolicyCollection GetDataProtectionBackupPolic /// /// The String to use. /// The cancellation token to use. - /// 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> GetDataProtectionBackupPolicyAsync(string backupPolicyName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> GetDataP /// /// The String to use. /// The cancellation token to use. - /// 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 GetDataProtectionBackupPolicy(string backupPolicyName, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual Response GetDataProtectionBac /// An object representing collection of DataProtectionBackupInstanceResources and their operations over a DataProtectionBackupInstanceResource. public virtual DataProtectionBackupInstanceCollection GetDataProtectionBackupInstances() { - return GetCachedClient(Client => new DataProtectionBackupInstanceCollection(Client, Id)); + return GetCachedClient(client => new DataProtectionBackupInstanceCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual DataProtectionBackupInstanceCollection GetDataProtectionBackupIns /// /// The name of the backup instance. /// The cancellation token to use. - /// 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> GetDataProtectionBackupInstanceAsync(string backupInstanceName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task> GetDat /// /// The name of the backup instance. /// The cancellation token to use. - /// 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 GetDataProtectionBackupInstance(string backupInstanceName, CancellationToken cancellationToken = default) { @@ -208,7 +208,7 @@ public virtual Response GetDataProtectionB /// An object representing collection of DataProtectionBackupJobResources and their operations over a DataProtectionBackupJobResource. public virtual DataProtectionBackupJobCollection GetDataProtectionBackupJobs() { - return GetCachedClient(Client => new DataProtectionBackupJobCollection(Client, Id)); + return GetCachedClient(client => new DataProtectionBackupJobCollection(client, Id)); } /// @@ -226,8 +226,8 @@ public virtual DataProtectionBackupJobCollection GetDataProtectionBackupJobs() /// /// The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The cancellation token to use. - /// 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> GetDataProtectionBackupJobAsync(string jobId, CancellationToken cancellationToken = default) { @@ -249,8 +249,8 @@ public virtual async Task> GetDataProt /// /// The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The cancellation token to use. - /// 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 GetDataProtectionBackupJob(string jobId, CancellationToken cancellationToken = default) { @@ -261,7 +261,7 @@ public virtual Response GetDataProtectionBackup /// An object representing collection of DeletedDataProtectionBackupInstanceResources and their operations over a DeletedDataProtectionBackupInstanceResource. public virtual DeletedDataProtectionBackupInstanceCollection GetDeletedDataProtectionBackupInstances() { - return GetCachedClient(Client => new DeletedDataProtectionBackupInstanceCollection(Client, Id)); + return GetCachedClient(client => new DeletedDataProtectionBackupInstanceCollection(client, Id)); } /// @@ -279,8 +279,8 @@ public virtual DeletedDataProtectionBackupInstanceCollection GetDeletedDataProte /// /// The name of the deleted backup instance. /// The cancellation token to use. - /// 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> GetDeletedDataProtectionBackupInstanceAsync(string backupInstanceName, CancellationToken cancellationToken = default) { @@ -302,8 +302,8 @@ public virtual async Task> /// /// The name of the deleted backup instance. /// The cancellation token to use. - /// 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 GetDeletedDataProtectionBackupInstance(string backupInstanceName, CancellationToken cancellationToken = default) { @@ -314,7 +314,7 @@ public virtual Response GetDeletedD /// An object representing collection of ResourceGuardProxyBaseResources and their operations over a ResourceGuardProxyBaseResource. public virtual ResourceGuardProxyBaseResourceCollection GetResourceGuardProxyBaseResources() { - return GetCachedClient(Client => new ResourceGuardProxyBaseResourceCollection(Client, Id)); + return GetCachedClient(client => new ResourceGuardProxyBaseResourceCollection(client, Id)); } /// @@ -332,8 +332,8 @@ public virtual ResourceGuardProxyBaseResourceCollection GetResourceGuardProxyBas /// /// name of the resource guard proxy. /// The cancellation token to use. - /// 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> GetResourceGuardProxyBaseResourceAsync(string resourceGuardProxyName, CancellationToken cancellationToken = default) { @@ -355,8 +355,8 @@ public virtual async Task> GetResourceG /// /// name of the resource guard proxy. /// The cancellation token to use. - /// 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 GetResourceGuardProxyBaseResource(string resourceGuardProxyName, CancellationToken cancellationToken = default) { diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupArmClientMockingExtension.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupArmClientMockingExtension.cs new file mode 100644 index 000000000000..1f68ae51d22b --- /dev/null +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupArmClientMockingExtension.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataProtectionBackup; + +namespace Azure.ResourceManager.DataProtectionBackup.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataProtectionBackupArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataProtectionBackupArmClientMockingExtension() + { + } + + /// 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 DataProtectionBackupArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataProtectionBackupArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataProtectionBackupVaultResource GetDataProtectionBackupVaultResource(ResourceIdentifier id) + { + DataProtectionBackupVaultResource.ValidateResourceId(id); + return new DataProtectionBackupVaultResource(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 DataProtectionBackupPolicyResource GetDataProtectionBackupPolicyResource(ResourceIdentifier id) + { + DataProtectionBackupPolicyResource.ValidateResourceId(id); + return new DataProtectionBackupPolicyResource(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 DataProtectionBackupInstanceResource GetDataProtectionBackupInstanceResource(ResourceIdentifier id) + { + DataProtectionBackupInstanceResource.ValidateResourceId(id); + return new DataProtectionBackupInstanceResource(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 DataProtectionBackupRecoveryPointResource GetDataProtectionBackupRecoveryPointResource(ResourceIdentifier id) + { + DataProtectionBackupRecoveryPointResource.ValidateResourceId(id); + return new DataProtectionBackupRecoveryPointResource(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 DataProtectionBackupJobResource GetDataProtectionBackupJobResource(ResourceIdentifier id) + { + DataProtectionBackupJobResource.ValidateResourceId(id); + return new DataProtectionBackupJobResource(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 DeletedDataProtectionBackupInstanceResource GetDeletedDataProtectionBackupInstanceResource(ResourceIdentifier id) + { + DeletedDataProtectionBackupInstanceResource.ValidateResourceId(id); + return new DeletedDataProtectionBackupInstanceResource(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 ResourceGuardResource GetResourceGuardResource(ResourceIdentifier id) + { + ResourceGuardResource.ValidateResourceId(id); + return new ResourceGuardResource(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 ResourceGuardProxyBaseResource GetResourceGuardProxyBaseResource(ResourceIdentifier id) + { + ResourceGuardProxyBaseResource.ValidateResourceId(id); + return new ResourceGuardProxyBaseResource(Client, id); + } + } +} diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupExtensions.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupExtensions.cs index cc6d533895be..7ff75e0f29f2 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupExtensions.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataProtectionBackup.Mocking; using Azure.ResourceManager.DataProtectionBackup.Models; using Azure.ResourceManager.Resources; @@ -19,195 +20,161 @@ namespace Azure.ResourceManager.DataProtectionBackup /// A class to add extension methods to Azure.ResourceManager.DataProtectionBackup. public static partial class DataProtectionBackupExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataProtectionBackupArmClientMockingExtension GetDataProtectionBackupArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataProtectionBackupArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataProtectionBackupResourceGroupMockingExtension GetDataProtectionBackupResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataProtectionBackupResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataProtectionBackupSubscriptionMockingExtension GetDataProtectionBackupSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataProtectionBackupSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataProtectionBackupVaultResource /// /// 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. /// Returns a object. public static DataProtectionBackupVaultResource GetDataProtectionBackupVaultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataProtectionBackupVaultResource.ValidateResourceId(id); - return new DataProtectionBackupVaultResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDataProtectionBackupVaultResource(id); } - #endregion - #region DataProtectionBackupPolicyResource /// /// 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. /// Returns a object. public static DataProtectionBackupPolicyResource GetDataProtectionBackupPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataProtectionBackupPolicyResource.ValidateResourceId(id); - return new DataProtectionBackupPolicyResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDataProtectionBackupPolicyResource(id); } - #endregion - #region DataProtectionBackupInstanceResource /// /// 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. /// Returns a object. public static DataProtectionBackupInstanceResource GetDataProtectionBackupInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataProtectionBackupInstanceResource.ValidateResourceId(id); - return new DataProtectionBackupInstanceResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDataProtectionBackupInstanceResource(id); } - #endregion - #region DataProtectionBackupRecoveryPointResource /// /// 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. /// Returns a object. public static DataProtectionBackupRecoveryPointResource GetDataProtectionBackupRecoveryPointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataProtectionBackupRecoveryPointResource.ValidateResourceId(id); - return new DataProtectionBackupRecoveryPointResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDataProtectionBackupRecoveryPointResource(id); } - #endregion - #region DataProtectionBackupJobResource /// /// 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. /// Returns a object. public static DataProtectionBackupJobResource GetDataProtectionBackupJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataProtectionBackupJobResource.ValidateResourceId(id); - return new DataProtectionBackupJobResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDataProtectionBackupJobResource(id); } - #endregion - #region DeletedDataProtectionBackupInstanceResource /// /// 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. /// Returns a object. public static DeletedDataProtectionBackupInstanceResource GetDeletedDataProtectionBackupInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeletedDataProtectionBackupInstanceResource.ValidateResourceId(id); - return new DeletedDataProtectionBackupInstanceResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetDeletedDataProtectionBackupInstanceResource(id); } - #endregion - #region ResourceGuardResource /// /// 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. /// Returns a object. public static ResourceGuardResource GetResourceGuardResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGuardResource.ValidateResourceId(id); - return new ResourceGuardResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetResourceGuardResource(id); } - #endregion - #region ResourceGuardProxyBaseResource /// /// 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. /// Returns a object. public static ResourceGuardProxyBaseResource GetResourceGuardProxyBaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourceGuardProxyBaseResource.ValidateResourceId(id); - return new ResourceGuardProxyBaseResource(client, id); - } - ); + return GetDataProtectionBackupArmClientMockingExtension(client).GetResourceGuardProxyBaseResource(id); } - #endregion - /// Gets a collection of DataProtectionBackupVaultResources in the ResourceGroupResource. + /// + /// Gets a collection of DataProtectionBackupVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataProtectionBackupVaultResources and their operations over a DataProtectionBackupVaultResource. public static DataProtectionBackupVaultCollection GetDataProtectionBackupVaults(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataProtectionBackupVaults(); + return GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetDataProtectionBackupVaults(); } /// @@ -222,16 +189,20 @@ public static DataProtectionBackupVaultCollection GetDataProtectionBackupVaults( /// BackupVaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the backup vault. /// The cancellation token to use. - /// 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 static async Task> GetDataProtectionBackupVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataProtectionBackupVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + return await GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetDataProtectionBackupVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); } /// @@ -246,24 +217,34 @@ public static async Task> GetDataPro /// BackupVaults_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the backup vault. /// The cancellation token to use. - /// 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 static Response GetDataProtectionBackupVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataProtectionBackupVaults().Get(vaultName, cancellationToken); + return GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetDataProtectionBackupVault(vaultName, cancellationToken); } - /// Gets a collection of ResourceGuardResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourceGuardResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ResourceGuardResources and their operations over a ResourceGuardResource. public static ResourceGuardCollection GetResourceGuards(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourceGuards(); + return GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuards(); } /// @@ -278,16 +259,20 @@ public static ResourceGuardCollection GetResourceGuards(this ResourceGroupResour /// ResourceGuards_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of ResourceGuard. /// The cancellation token to use. - /// 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 static async Task> GetResourceGuardAsync(this ResourceGroupResource resourceGroupResource, string resourceGuardsName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourceGuards().GetAsync(resourceGuardsName, cancellationToken).ConfigureAwait(false); + return await GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuardAsync(resourceGuardsName, cancellationToken).ConfigureAwait(false); } /// @@ -302,16 +287,20 @@ public static async Task> GetResourceGuardAsync( /// ResourceGuards_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of ResourceGuard. /// The cancellation token to use. - /// 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 static Response GetResourceGuard(this ResourceGroupResource resourceGroupResource, string resourceGuardsName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourceGuards().Get(resourceGuardsName, cancellationToken); + return GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).GetResourceGuard(resourceGuardsName, cancellationToken); } /// @@ -326,6 +315,10 @@ public static Response GetResourceGuard(this ResourceGrou /// BackupVaults_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -334,9 +327,7 @@ public static Response GetResourceGuard(this ResourceGrou /// is null. public static async Task> CheckDataProtectionBackupVaultNameAvailabilityAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckDataProtectionBackupVaultNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).CheckDataProtectionBackupVaultNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -351,6 +342,10 @@ public static async Task> C /// BackupVaults_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location in which uniqueness will be verified. @@ -359,9 +354,7 @@ public static async Task> C /// is null. public static Response CheckDataProtectionBackupVaultNameAvailability(this ResourceGroupResource resourceGroupResource, AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).CheckDataProtectionBackupVaultNameAvailability(location, content, cancellationToken); + return GetDataProtectionBackupResourceGroupMockingExtension(resourceGroupResource).CheckDataProtectionBackupVaultNameAvailability(location, content, cancellationToken); } /// @@ -376,13 +369,17 @@ public static Response CheckDataProt /// BackupVaults_GetInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataProtectionBackupVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataProtectionBackupVaultsAsync(cancellationToken); + return GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).GetDataProtectionBackupVaultsAsync(cancellationToken); } /// @@ -397,13 +394,17 @@ public static AsyncPageable GetDataProtection /// BackupVaults_GetInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataProtectionBackupVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataProtectionBackupVaults(cancellationToken); + return GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).GetDataProtectionBackupVaults(cancellationToken); } /// @@ -418,6 +419,10 @@ public static Pageable GetDataProtectionBacku /// DataProtection_CheckFeatureSupport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -426,9 +431,7 @@ public static Pageable GetDataProtectionBacku /// is null. public static async Task> CheckDataProtectionBackupFeatureSupportAsync(this SubscriptionResource subscriptionResource, AzureLocation location, BackupFeatureValidationContentBase content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataProtectionBackupFeatureSupportAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).CheckDataProtectionBackupFeatureSupportAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -443,6 +446,10 @@ public static async Task> CheckDataP /// DataProtection_CheckFeatureSupport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The String to use. @@ -451,9 +458,7 @@ public static async Task> CheckDataP /// is null. public static Response CheckDataProtectionBackupFeatureSupport(this SubscriptionResource subscriptionResource, AzureLocation location, BackupFeatureValidationContentBase content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataProtectionBackupFeatureSupport(location, content, cancellationToken); + return GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).CheckDataProtectionBackupFeatureSupport(location, content, cancellationToken); } /// @@ -468,13 +473,17 @@ public static Response CheckDataProtectionBac /// ResourceGuards_GetResourcesInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourceGuardsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceGuardsAsync(cancellationToken); + return GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).GetResourceGuardsAsync(cancellationToken); } /// @@ -489,13 +498,17 @@ public static AsyncPageable GetResourceGuardsAsync(this S /// ResourceGuards_GetResourcesInSubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourceGuards(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourceGuards(cancellationToken); + return GetDataProtectionBackupSubscriptionMockingExtension(subscriptionResource).GetResourceGuards(cancellationToken); } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupResourceGroupMockingExtension.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..b8e2089ac061 --- /dev/null +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupResourceGroupMockingExtension.cs @@ -0,0 +1,223 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DataProtectionBackup; +using Azure.ResourceManager.DataProtectionBackup.Models; + +namespace Azure.ResourceManager.DataProtectionBackup.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataProtectionBackupResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _dataProtectionBackupVaultBackupVaultsClientDiagnostics; + private BackupVaultsRestOperations _dataProtectionBackupVaultBackupVaultsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataProtectionBackupResourceGroupMockingExtension() + { + } + + /// 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 DataProtectionBackupResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DataProtectionBackupVaultBackupVaultsClientDiagnostics => _dataProtectionBackupVaultBackupVaultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DataProtectionBackup", DataProtectionBackupVaultResource.ResourceType.Namespace, Diagnostics); + private BackupVaultsRestOperations DataProtectionBackupVaultBackupVaultsRestClient => _dataProtectionBackupVaultBackupVaultsRestClient ??= new BackupVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataProtectionBackupVaultResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataProtectionBackupVaultResources in the ResourceGroupResource. + /// An object representing collection of DataProtectionBackupVaultResources and their operations over a DataProtectionBackupVaultResource. + public virtual DataProtectionBackupVaultCollection GetDataProtectionBackupVaults() + { + return GetCachedClient(client => new DataProtectionBackupVaultCollection(client, Id)); + } + + /// + /// Returns a resource belonging to a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName} + /// + /// + /// Operation Id + /// BackupVaults_Get + /// + /// + /// + /// The name of the backup vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataProtectionBackupVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetDataProtectionBackupVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a resource belonging to a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName} + /// + /// + /// Operation Id + /// BackupVaults_Get + /// + /// + /// + /// The name of the backup vault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataProtectionBackupVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetDataProtectionBackupVaults().Get(vaultName, cancellationToken); + } + + /// Gets a collection of ResourceGuardResources in the ResourceGroupResource. + /// An object representing collection of ResourceGuardResources and their operations over a ResourceGuardResource. + public virtual ResourceGuardCollection GetResourceGuards() + { + return GetCachedClient(client => new ResourceGuardCollection(client, Id)); + } + + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName} + /// + /// + /// Operation Id + /// ResourceGuards_Get + /// + /// + /// + /// The name of ResourceGuard. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourceGuardAsync(string resourceGuardsName, CancellationToken cancellationToken = default) + { + return await GetResourceGuards().GetAsync(resourceGuardsName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a ResourceGuard belonging to a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName} + /// + /// + /// Operation Id + /// ResourceGuards_Get + /// + /// + /// + /// The name of ResourceGuard. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourceGuard(string resourceGuardsName, CancellationToken cancellationToken = default) + { + return GetResourceGuards().Get(resourceGuardsName, cancellationToken); + } + + /// + /// API to check for resource name availability + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// BackupVaults_CheckNameAvailability + /// + /// + /// + /// The location in which uniqueness will be verified. + /// Check name availability request. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckDataProtectionBackupVaultNameAvailabilityAsync(AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataProtectionBackupVaultBackupVaultsClientDiagnostics.CreateScope("DataProtectionBackupResourceGroupMockingExtension.CheckDataProtectionBackupVaultNameAvailability"); + scope.Start(); + try + { + var response = await DataProtectionBackupVaultBackupVaultsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// API to check for resource name availability + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// BackupVaults_CheckNameAvailability + /// + /// + /// + /// The location in which uniqueness will be verified. + /// Check name availability request. + /// The cancellation token to use. + /// is null. + public virtual Response CheckDataProtectionBackupVaultNameAvailability(AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataProtectionBackupVaultBackupVaultsClientDiagnostics.CreateScope("DataProtectionBackupResourceGroupMockingExtension.CheckDataProtectionBackupVaultNameAvailability"); + scope.Start(); + try + { + var response = DataProtectionBackupVaultBackupVaultsRestClient.CheckNameAvailability(Id.SubscriptionId, Id.ResourceGroupName, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupSubscriptionMockingExtension.cs similarity index 87% rename from sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupSubscriptionMockingExtension.cs index 27ccc29ea03b..bae91e0e0795 100644 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/DataProtectionBackupSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataProtectionBackup; using Azure.ResourceManager.DataProtectionBackup.Models; -namespace Azure.ResourceManager.DataProtectionBackup +namespace Azure.ResourceManager.DataProtectionBackup.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataProtectionBackupSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataProtectionBackupVaultBackupVaultsClientDiagnostics; private BackupVaultsRestOperations _dataProtectionBackupVaultBackupVaultsRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _resourceGuardClientDiagnostics; private ResourceGuardsRestOperations _resourceGuardRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataProtectionBackupSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataProtectionBackupSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +72,7 @@ public virtual AsyncPageable GetDataProtectio { HttpMessage FirstPageRequest(int? pageSizeHint) => DataProtectionBackupVaultBackupVaultsRestClient.CreateGetInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataProtectionBackupVaultBackupVaultsRestClient.CreateGetInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataProtectionBackupVaultResource(Client, DataProtectionBackupVaultData.DeserializeDataProtectionBackupVaultData(e)), DataProtectionBackupVaultBackupVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataProtectionBackupVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataProtectionBackupVaultResource(Client, DataProtectionBackupVaultData.DeserializeDataProtectionBackupVaultData(e)), DataProtectionBackupVaultBackupVaultsClientDiagnostics, Pipeline, "DataProtectionBackupSubscriptionMockingExtension.GetDataProtectionBackupVaults", "value", "nextLink", cancellationToken); } /// @@ -93,7 +94,7 @@ public virtual Pageable GetDataProtectionBack { HttpMessage FirstPageRequest(int? pageSizeHint) => DataProtectionBackupVaultBackupVaultsRestClient.CreateGetInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataProtectionBackupVaultBackupVaultsRestClient.CreateGetInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataProtectionBackupVaultResource(Client, DataProtectionBackupVaultData.DeserializeDataProtectionBackupVaultData(e)), DataProtectionBackupVaultBackupVaultsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataProtectionBackupVaults", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataProtectionBackupVaultResource(Client, DataProtectionBackupVaultData.DeserializeDataProtectionBackupVaultData(e)), DataProtectionBackupVaultBackupVaultsClientDiagnostics, Pipeline, "DataProtectionBackupSubscriptionMockingExtension.GetDataProtectionBackupVaults", "value", "nextLink", cancellationToken); } /// @@ -112,9 +113,12 @@ public virtual Pageable GetDataProtectionBack /// The String to use. /// Feature support request object. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDataProtectionBackupFeatureSupportAsync(AzureLocation location, BackupFeatureValidationContentBase content, CancellationToken cancellationToken = default) { - using var scope = DataProtectionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataProtectionBackupFeatureSupport"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataProtectionClientDiagnostics.CreateScope("DataProtectionBackupSubscriptionMockingExtension.CheckDataProtectionBackupFeatureSupport"); scope.Start(); try { @@ -144,9 +148,12 @@ public virtual async Task> CheckData /// The String to use. /// Feature support request object. /// The cancellation token to use. + /// is null. public virtual Response CheckDataProtectionBackupFeatureSupport(AzureLocation location, BackupFeatureValidationContentBase content, CancellationToken cancellationToken = default) { - using var scope = DataProtectionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataProtectionBackupFeatureSupport"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataProtectionClientDiagnostics.CreateScope("DataProtectionBackupSubscriptionMockingExtension.CheckDataProtectionBackupFeatureSupport"); scope.Start(); try { @@ -179,7 +186,7 @@ public virtual AsyncPageable GetResourceGuardsAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceGuardRestClient.CreateGetResourcesInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceGuardRestClient.CreateGetResourcesInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceGuardResource(Client, ResourceGuardData.DeserializeResourceGuardData(e)), ResourceGuardClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceGuards", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceGuardResource(Client, ResourceGuardData.DeserializeResourceGuardData(e)), ResourceGuardClientDiagnostics, Pipeline, "DataProtectionBackupSubscriptionMockingExtension.GetResourceGuards", "value", "nextLink", cancellationToken); } /// @@ -201,7 +208,7 @@ public virtual Pageable GetResourceGuards(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceGuardRestClient.CreateGetResourcesInSubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceGuardRestClient.CreateGetResourcesInSubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceGuardResource(Client, ResourceGuardData.DeserializeResourceGuardData(e)), ResourceGuardClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourceGuards", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceGuardResource(Client, ResourceGuardData.DeserializeResourceGuardData(e)), ResourceGuardClientDiagnostics, Pipeline, "DataProtectionBackupSubscriptionMockingExtension.GetResourceGuards", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index cfc7042c4859..000000000000 --- a/sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.DataProtectionBackup.Models; - -namespace Azure.ResourceManager.DataProtectionBackup -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _dataProtectionBackupVaultBackupVaultsClientDiagnostics; - private BackupVaultsRestOperations _dataProtectionBackupVaultBackupVaultsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics DataProtectionBackupVaultBackupVaultsClientDiagnostics => _dataProtectionBackupVaultBackupVaultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DataProtectionBackup", DataProtectionBackupVaultResource.ResourceType.Namespace, Diagnostics); - private BackupVaultsRestOperations DataProtectionBackupVaultBackupVaultsRestClient => _dataProtectionBackupVaultBackupVaultsRestClient ??= new BackupVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataProtectionBackupVaultResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataProtectionBackupVaultResources in the ResourceGroupResource. - /// An object representing collection of DataProtectionBackupVaultResources and their operations over a DataProtectionBackupVaultResource. - public virtual DataProtectionBackupVaultCollection GetDataProtectionBackupVaults() - { - return GetCachedClient(Client => new DataProtectionBackupVaultCollection(Client, Id)); - } - - /// Gets a collection of ResourceGuardResources in the ResourceGroupResource. - /// An object representing collection of ResourceGuardResources and their operations over a ResourceGuardResource. - public virtual ResourceGuardCollection GetResourceGuards() - { - return GetCachedClient(Client => new ResourceGuardCollection(Client, Id)); - } - - /// - /// API to check for resource name availability - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability - /// - /// - /// Operation Id - /// BackupVaults_CheckNameAvailability - /// - /// - /// - /// The location in which uniqueness will be verified. - /// Check name availability request. - /// The cancellation token to use. - public virtual async Task> CheckDataProtectionBackupVaultNameAvailabilityAsync(AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = DataProtectionBackupVaultBackupVaultsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckDataProtectionBackupVaultNameAvailability"); - scope.Start(); - try - { - var response = await DataProtectionBackupVaultBackupVaultsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, Id.ResourceGroupName, location, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// API to check for resource name availability - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability - /// - /// - /// Operation Id - /// BackupVaults_CheckNameAvailability - /// - /// - /// - /// The location in which uniqueness will be verified. - /// Check name availability request. - /// The cancellation token to use. - public virtual Response CheckDataProtectionBackupVaultNameAvailability(AzureLocation location, DataProtectionBackupNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = DataProtectionBackupVaultBackupVaultsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CheckDataProtectionBackupVaultNameAvailability"); - scope.Start(); - try - { - var response = DataProtectionBackupVaultBackupVaultsRestClient.CheckNameAvailability(Id.SubscriptionId, Id.ResourceGroupName, location, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareAccountResource.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareAccountResource.cs index bea9a8a26a2e..2197dc81a559 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareAccountResource.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareAccountResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataShareResources and their operations over a DataShareResource. public virtual DataShareCollection GetDataShares() { - return GetCachedClient(Client => new DataShareCollection(Client, Id)); + return GetCachedClient(client => new DataShareCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DataShareCollection GetDataShares() /// /// The name of the share to retrieve. /// The cancellation token to use. - /// 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> GetDataShareAsync(string shareName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDataShareAsync(string /// /// The name of the share to retrieve. /// The cancellation token to use. - /// 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 GetDataShare(string shareName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDataShare(string shareName, Cancel /// An object representing collection of ShareSubscriptionResources and their operations over a ShareSubscriptionResource. public virtual ShareSubscriptionCollection GetShareSubscriptions() { - return GetCachedClient(Client => new ShareSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new ShareSubscriptionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ShareSubscriptionCollection GetShareSubscriptions() /// /// The name of the shareSubscription. /// The cancellation token to use. - /// 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> GetShareSubscriptionAsync(string shareSubscriptionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetShareSubscript /// /// The name of the shareSubscription. /// The cancellation token to use. - /// 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 GetShareSubscription(string shareSubscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareResource.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareResource.cs index c73cb2f8861a..4c6ed2e02b67 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareResource.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/DataShareResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ShareDataSetResources and their operations over a ShareDataSetResource. public virtual ShareDataSetCollection GetShareDataSets() { - return GetCachedClient(Client => new ShareDataSetCollection(Client, Id)); + return GetCachedClient(client => new ShareDataSetCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ShareDataSetCollection GetShareDataSets() /// /// The name of the dataSet. /// The cancellation token to use. - /// 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> GetShareDataSetAsync(string dataSetName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetShareDataSetAsync(s /// /// The name of the dataSet. /// The cancellation token to use. - /// 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 GetShareDataSet(string dataSetName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetShareDataSet(string dataSetName /// An object representing collection of DataShareInvitationResources and their operations over a DataShareInvitationResource. public virtual DataShareInvitationCollection GetDataShareInvitations() { - return GetCachedClient(Client => new DataShareInvitationCollection(Client, Id)); + return GetCachedClient(client => new DataShareInvitationCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual DataShareInvitationCollection GetDataShareInvitations() /// /// The name of the invitation. /// The cancellation token to use. - /// 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> GetDataShareInvitationAsync(string invitationName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> GetDataShareInv /// /// The name of the invitation. /// The cancellation token to use. - /// 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 GetDataShareInvitation(string invitationName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetDataShareInvitation(stri /// An object representing collection of ProviderShareSubscriptionResources and their operations over a ProviderShareSubscriptionResource. public virtual ProviderShareSubscriptionCollection GetProviderShareSubscriptions() { - return GetCachedClient(Client => new ProviderShareSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new ProviderShareSubscriptionCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual ProviderShareSubscriptionCollection GetProviderShareSubscriptions /// /// To locate shareSubscription. /// The cancellation token to use. - /// 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> GetProviderShareSubscriptionAsync(string providerShareSubscriptionId, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> GetProvid /// /// To locate shareSubscription. /// The cancellation token to use. - /// 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 GetProviderShareSubscription(string providerShareSubscriptionId, CancellationToken cancellationToken = default) { @@ -251,7 +251,7 @@ public virtual Response GetProviderShareSubsc /// An object representing collection of DataShareSynchronizationSettingResources and their operations over a DataShareSynchronizationSettingResource. public virtual DataShareSynchronizationSettingCollection GetDataShareSynchronizationSettings() { - return GetCachedClient(Client => new DataShareSynchronizationSettingCollection(Client, Id)); + return GetCachedClient(client => new DataShareSynchronizationSettingCollection(client, Id)); } /// @@ -269,8 +269,8 @@ public virtual DataShareSynchronizationSettingCollection GetDataShareSynchroniza /// /// The name of the synchronizationSetting. /// The cancellation token to use. - /// 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> GetDataShareSynchronizationSettingAsync(string synchronizationSettingName, CancellationToken cancellationToken = default) { @@ -292,8 +292,8 @@ public virtual async Task> Get /// /// The name of the synchronizationSetting. /// The cancellation token to use. - /// 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 GetDataShareSynchronizationSetting(string synchronizationSettingName, CancellationToken cancellationToken = default) { diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareArmClientMockingExtension.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareArmClientMockingExtension.cs new file mode 100644 index 000000000000..496a146bac8f --- /dev/null +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataShare; + +namespace Azure.ResourceManager.DataShare.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataShareArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataShareArmClientMockingExtension() + { + } + + /// 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 DataShareArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataShareArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataShareAccountResource GetDataShareAccountResource(ResourceIdentifier id) + { + DataShareAccountResource.ValidateResourceId(id); + return new DataShareAccountResource(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 DataShareConsumerInvitationResource GetDataShareConsumerInvitationResource(ResourceIdentifier id) + { + DataShareConsumerInvitationResource.ValidateResourceId(id); + return new DataShareConsumerInvitationResource(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 ShareDataSetResource GetShareDataSetResource(ResourceIdentifier id) + { + ShareDataSetResource.ValidateResourceId(id); + return new ShareDataSetResource(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 ShareDataSetMappingResource GetShareDataSetMappingResource(ResourceIdentifier id) + { + ShareDataSetMappingResource.ValidateResourceId(id); + return new ShareDataSetMappingResource(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 DataShareInvitationResource GetDataShareInvitationResource(ResourceIdentifier id) + { + DataShareInvitationResource.ValidateResourceId(id); + return new DataShareInvitationResource(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 DataShareResource GetDataShareResource(ResourceIdentifier id) + { + DataShareResource.ValidateResourceId(id); + return new DataShareResource(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 ProviderShareSubscriptionResource GetProviderShareSubscriptionResource(ResourceIdentifier id) + { + ProviderShareSubscriptionResource.ValidateResourceId(id); + return new ProviderShareSubscriptionResource(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 ShareSubscriptionResource GetShareSubscriptionResource(ResourceIdentifier id) + { + ShareSubscriptionResource.ValidateResourceId(id); + return new ShareSubscriptionResource(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 DataShareSynchronizationSettingResource GetDataShareSynchronizationSettingResource(ResourceIdentifier id) + { + DataShareSynchronizationSettingResource.ValidateResourceId(id); + return new DataShareSynchronizationSettingResource(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 DataShareTriggerResource GetDataShareTriggerResource(ResourceIdentifier id) + { + DataShareTriggerResource.ValidateResourceId(id); + return new DataShareTriggerResource(Client, id); + } + } +} diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareExtensions.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareExtensions.cs index 4f17bdec8c0d..73176a2de9b2 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareExtensions.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataShare.Mocking; using Azure.ResourceManager.DataShare.Models; using Azure.ResourceManager.Resources; @@ -19,249 +20,198 @@ namespace Azure.ResourceManager.DataShare /// A class to add extension methods to Azure.ResourceManager.DataShare. public static partial class DataShareExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataShareArmClientMockingExtension GetDataShareArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataShareArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataShareResourceGroupMockingExtension GetDataShareResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataShareResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataShareSubscriptionMockingExtension GetDataShareSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataShareSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataShareTenantMockingExtension GetDataShareTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataShareTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region DataShareAccountResource /// /// 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. /// Returns a object. public static DataShareAccountResource GetDataShareAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareAccountResource.ValidateResourceId(id); - return new DataShareAccountResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareAccountResource(id); } - #endregion - #region DataShareConsumerInvitationResource /// /// 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. /// Returns a object. public static DataShareConsumerInvitationResource GetDataShareConsumerInvitationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareConsumerInvitationResource.ValidateResourceId(id); - return new DataShareConsumerInvitationResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareConsumerInvitationResource(id); } - #endregion - #region ShareDataSetResource /// /// 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. /// Returns a object. public static ShareDataSetResource GetShareDataSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ShareDataSetResource.ValidateResourceId(id); - return new ShareDataSetResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetShareDataSetResource(id); } - #endregion - #region ShareDataSetMappingResource /// /// 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. /// Returns a object. public static ShareDataSetMappingResource GetShareDataSetMappingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ShareDataSetMappingResource.ValidateResourceId(id); - return new ShareDataSetMappingResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetShareDataSetMappingResource(id); } - #endregion - #region DataShareInvitationResource /// /// 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. /// Returns a object. public static DataShareInvitationResource GetDataShareInvitationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareInvitationResource.ValidateResourceId(id); - return new DataShareInvitationResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareInvitationResource(id); } - #endregion - #region DataShareResource /// /// 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. /// Returns a object. public static DataShareResource GetDataShareResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareResource.ValidateResourceId(id); - return new DataShareResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareResource(id); } - #endregion - #region ProviderShareSubscriptionResource /// /// 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. /// Returns a object. public static ProviderShareSubscriptionResource GetProviderShareSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProviderShareSubscriptionResource.ValidateResourceId(id); - return new ProviderShareSubscriptionResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetProviderShareSubscriptionResource(id); } - #endregion - #region ShareSubscriptionResource /// /// 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. /// Returns a object. public static ShareSubscriptionResource GetShareSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ShareSubscriptionResource.ValidateResourceId(id); - return new ShareSubscriptionResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetShareSubscriptionResource(id); } - #endregion - #region DataShareSynchronizationSettingResource /// /// 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. /// Returns a object. public static DataShareSynchronizationSettingResource GetDataShareSynchronizationSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareSynchronizationSettingResource.ValidateResourceId(id); - return new DataShareSynchronizationSettingResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareSynchronizationSettingResource(id); } - #endregion - #region DataShareTriggerResource /// /// 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. /// Returns a object. public static DataShareTriggerResource GetDataShareTriggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataShareTriggerResource.ValidateResourceId(id); - return new DataShareTriggerResource(client, id); - } - ); + return GetDataShareArmClientMockingExtension(client).GetDataShareTriggerResource(id); } - #endregion - /// Gets a collection of DataShareAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of DataShareAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataShareAccountResources and their operations over a DataShareAccountResource. public static DataShareAccountCollection GetDataShareAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataShareAccounts(); + return GetDataShareResourceGroupMockingExtension(resourceGroupResource).GetDataShareAccounts(); } /// @@ -276,16 +226,20 @@ public static DataShareAccountCollection GetDataShareAccounts(this ResourceGroup /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the share account. /// The cancellation token to use. - /// 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 static async Task> GetDataShareAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataShareAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetDataShareResourceGroupMockingExtension(resourceGroupResource).GetDataShareAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -300,16 +254,20 @@ public static async Task> GetDataShareAccount /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the share account. /// The cancellation token to use. - /// 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 static Response GetDataShareAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataShareAccounts().Get(accountName, cancellationToken); + return GetDataShareResourceGroupMockingExtension(resourceGroupResource).GetDataShareAccount(accountName, cancellationToken); } /// @@ -324,6 +282,10 @@ public static Response GetDataShareAccount(this Resour /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token. @@ -331,7 +293,7 @@ public static Response GetDataShareAccount(this Resour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataShareAccountsAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataShareAccountsAsync(skipToken, cancellationToken); + return GetDataShareSubscriptionMockingExtension(subscriptionResource).GetDataShareAccountsAsync(skipToken, cancellationToken); } /// @@ -346,6 +308,10 @@ public static AsyncPageable GetDataShareAccountsAsync( /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Continuation token. @@ -353,15 +319,21 @@ public static AsyncPageable GetDataShareAccountsAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataShareAccounts(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataShareAccounts(skipToken, cancellationToken); + return GetDataShareSubscriptionMockingExtension(subscriptionResource).GetDataShareAccounts(skipToken, cancellationToken); } - /// Gets a collection of DataShareConsumerInvitationResources in the TenantResource. + /// + /// Gets a collection of DataShareConsumerInvitationResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataShareConsumerInvitationResources and their operations over a DataShareConsumerInvitationResource. public static DataShareConsumerInvitationCollection GetDataShareConsumerInvitations(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetDataShareConsumerInvitations(); + return GetDataShareTenantMockingExtension(tenantResource).GetDataShareConsumerInvitations(); } /// @@ -376,6 +348,10 @@ public static DataShareConsumerInvitationCollection GetDataShareConsumerInvitati /// ConsumerInvitations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the invitation. @@ -384,7 +360,7 @@ public static DataShareConsumerInvitationCollection GetDataShareConsumerInvitati [ForwardsClientCalls] public static async Task> GetDataShareConsumerInvitationAsync(this TenantResource tenantResource, AzureLocation location, Guid invitationId, CancellationToken cancellationToken = default) { - return await tenantResource.GetDataShareConsumerInvitations().GetAsync(location, invitationId, cancellationToken).ConfigureAwait(false); + return await GetDataShareTenantMockingExtension(tenantResource).GetDataShareConsumerInvitationAsync(location, invitationId, cancellationToken).ConfigureAwait(false); } /// @@ -399,6 +375,10 @@ public static async Task> GetDataS /// ConsumerInvitations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the invitation. @@ -407,7 +387,7 @@ public static async Task> GetDataS [ForwardsClientCalls] public static Response GetDataShareConsumerInvitation(this TenantResource tenantResource, AzureLocation location, Guid invitationId, CancellationToken cancellationToken = default) { - return tenantResource.GetDataShareConsumerInvitations().Get(location, invitationId, cancellationToken); + return GetDataShareTenantMockingExtension(tenantResource).GetDataShareConsumerInvitation(location, invitationId, cancellationToken); } /// @@ -422,6 +402,10 @@ public static Response GetDataShareConsumer /// ConsumerInvitations_RejectInvitation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the invitation. @@ -430,9 +414,7 @@ public static Response GetDataShareConsumer /// is null. public static async Task> RejectConsumerInvitationAsync(this TenantResource tenantResource, AzureLocation location, DataShareConsumerInvitationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return await GetTenantResourceExtensionClient(tenantResource).RejectConsumerInvitationAsync(location, data, cancellationToken).ConfigureAwait(false); + return await GetDataShareTenantMockingExtension(tenantResource).RejectConsumerInvitationAsync(location, data, cancellationToken).ConfigureAwait(false); } /// @@ -447,6 +429,10 @@ public static async Task> RejectCo /// ConsumerInvitations_RejectInvitation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the invitation. @@ -455,9 +441,7 @@ public static async Task> RejectCo /// is null. public static Response RejectConsumerInvitation(this TenantResource tenantResource, AzureLocation location, DataShareConsumerInvitationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - return GetTenantResourceExtensionClient(tenantResource).RejectConsumerInvitation(location, data, cancellationToken); + return GetDataShareTenantMockingExtension(tenantResource).RejectConsumerInvitation(location, data, cancellationToken); } /// @@ -472,6 +456,10 @@ public static Response RejectConsumerInvita /// EmailRegistrations_ActivateEmail /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the activation. @@ -480,9 +468,7 @@ public static Response RejectConsumerInvita /// is null. public static async Task> ActivateEmailAsync(this TenantResource tenantResource, AzureLocation location, DataShareEmailRegistration emailRegistration, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(emailRegistration, nameof(emailRegistration)); - - return await GetTenantResourceExtensionClient(tenantResource).ActivateEmailAsync(location, emailRegistration, cancellationToken).ConfigureAwait(false); + return await GetDataShareTenantMockingExtension(tenantResource).ActivateEmailAsync(location, emailRegistration, cancellationToken).ConfigureAwait(false); } /// @@ -497,6 +483,10 @@ public static async Task> ActivateEmailAsyn /// EmailRegistrations_ActivateEmail /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the activation. @@ -505,9 +495,7 @@ public static async Task> ActivateEmailAsyn /// is null. public static Response ActivateEmail(this TenantResource tenantResource, AzureLocation location, DataShareEmailRegistration emailRegistration, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(emailRegistration, nameof(emailRegistration)); - - return GetTenantResourceExtensionClient(tenantResource).ActivateEmail(location, emailRegistration, cancellationToken); + return GetDataShareTenantMockingExtension(tenantResource).ActivateEmail(location, emailRegistration, cancellationToken); } /// @@ -522,13 +510,17 @@ public static Response ActivateEmail(this TenantReso /// EmailRegistrations_RegisterEmail /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the registration. /// The cancellation token to use. public static async Task> RegisterEmailAsync(this TenantResource tenantResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetTenantResourceExtensionClient(tenantResource).RegisterEmailAsync(location, cancellationToken).ConfigureAwait(false); + return await GetDataShareTenantMockingExtension(tenantResource).RegisterEmailAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -543,13 +535,17 @@ public static async Task> RegisterEmailAsyn /// EmailRegistrations_RegisterEmail /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the registration. /// The cancellation token to use. public static Response RegisterEmail(this TenantResource tenantResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetTenantResourceExtensionClient(tenantResource).RegisterEmail(location, cancellationToken); + return GetDataShareTenantMockingExtension(tenantResource).RegisterEmail(location, cancellationToken); } } } diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareResourceGroupMockingExtension.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..66945d637702 --- /dev/null +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataShare; + +namespace Azure.ResourceManager.DataShare.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataShareResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataShareResourceGroupMockingExtension() + { + } + + /// 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 DataShareResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataShareAccountResources in the ResourceGroupResource. + /// An object representing collection of DataShareAccountResources and their operations over a DataShareAccountResource. + public virtual DataShareAccountCollection GetDataShareAccounts() + { + return GetCachedClient(client => new DataShareAccountCollection(client, Id)); + } + + /// + /// Get an account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the share account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataShareAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetDataShareAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an account + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the share account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataShareAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetDataShareAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareSubscriptionMockingExtension.cs similarity index 85% rename from sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareSubscriptionMockingExtension.cs index 657653087537..0e626c3042b4 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataShare; -namespace Azure.ResourceManager.DataShare +namespace Azure.ResourceManager.DataShare.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataShareSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataShareAccountAccountsClientDiagnostics; private AccountsRestOperations _dataShareAccountAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataShareSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataShareSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -61,7 +62,7 @@ public virtual AsyncPageable GetDataShareAccountsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => DataShareAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataShareAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataShareAccountResource(Client, DataShareAccountData.DeserializeDataShareAccountData(e)), DataShareAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataShareAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataShareAccountResource(Client, DataShareAccountData.DeserializeDataShareAccountData(e)), DataShareAccountAccountsClientDiagnostics, Pipeline, "DataShareSubscriptionMockingExtension.GetDataShareAccounts", "value", "nextLink", cancellationToken); } /// @@ -84,7 +85,7 @@ public virtual Pageable GetDataShareAccounts(string sk { HttpMessage FirstPageRequest(int? pageSizeHint) => DataShareAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataShareAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataShareAccountResource(Client, DataShareAccountData.DeserializeDataShareAccountData(e)), DataShareAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataShareAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataShareAccountResource(Client, DataShareAccountData.DeserializeDataShareAccountData(e)), DataShareAccountAccountsClientDiagnostics, Pipeline, "DataShareSubscriptionMockingExtension.GetDataShareAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareTenantMockingExtension.cs similarity index 74% rename from sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareTenantMockingExtension.cs index 60b4a9c74b2b..11d25879462c 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/DataShareTenantMockingExtension.cs @@ -12,27 +12,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataShare; using Azure.ResourceManager.DataShare.Models; -namespace Azure.ResourceManager.DataShare +namespace Azure.ResourceManager.DataShare.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class DataShareTenantMockingExtension : ArmResource { private ClientDiagnostics _dataShareConsumerInvitationConsumerInvitationsClientDiagnostics; private ConsumerInvitationsRestOperations _dataShareConsumerInvitationConsumerInvitationsRestClient; private ClientDiagnostics _emailRegistrationsClientDiagnostics; private EmailRegistrationsRestOperations _emailRegistrationsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataShareTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataShareTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -51,7 +52,51 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of DataShareConsumerInvitationResources and their operations over a DataShareConsumerInvitationResource. public virtual DataShareConsumerInvitationCollection GetDataShareConsumerInvitations() { - return GetCachedClient(Client => new DataShareConsumerInvitationCollection(Client, Id)); + return GetCachedClient(client => new DataShareConsumerInvitationCollection(client, Id)); + } + + /// + /// Get an invitation + /// + /// + /// Request Path + /// /providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId} + /// + /// + /// Operation Id + /// ConsumerInvitations_Get + /// + /// + /// + /// Location of the invitation. + /// An invitation id. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetDataShareConsumerInvitationAsync(AzureLocation location, Guid invitationId, CancellationToken cancellationToken = default) + { + return await GetDataShareConsumerInvitations().GetAsync(location, invitationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an invitation + /// + /// + /// Request Path + /// /providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId} + /// + /// + /// Operation Id + /// ConsumerInvitations_Get + /// + /// + /// + /// Location of the invitation. + /// An invitation id. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetDataShareConsumerInvitation(AzureLocation location, Guid invitationId, CancellationToken cancellationToken = default) + { + return GetDataShareConsumerInvitations().Get(location, invitationId, cancellationToken); } /// @@ -70,9 +115,12 @@ public virtual DataShareConsumerInvitationCollection GetDataShareConsumerInvitat /// Location of the invitation. /// An invitation payload. /// The cancellation token to use. + /// is null. public virtual async Task> RejectConsumerInvitationAsync(AzureLocation location, DataShareConsumerInvitationData data, CancellationToken cancellationToken = default) { - using var scope = DataShareConsumerInvitationConsumerInvitationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RejectConsumerInvitation"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = DataShareConsumerInvitationConsumerInvitationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.RejectConsumerInvitation"); scope.Start(); try { @@ -102,9 +150,12 @@ public virtual async Task> RejectC /// Location of the invitation. /// An invitation payload. /// The cancellation token to use. + /// is null. public virtual Response RejectConsumerInvitation(AzureLocation location, DataShareConsumerInvitationData data, CancellationToken cancellationToken = default) { - using var scope = DataShareConsumerInvitationConsumerInvitationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RejectConsumerInvitation"); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = DataShareConsumerInvitationConsumerInvitationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.RejectConsumerInvitation"); scope.Start(); try { @@ -134,9 +185,12 @@ public virtual Response RejectConsumerInvit /// Location of the activation. /// The payload for tenant domain activation. /// The cancellation token to use. + /// is null. public virtual async Task> ActivateEmailAsync(AzureLocation location, DataShareEmailRegistration emailRegistration, CancellationToken cancellationToken = default) { - using var scope = EmailRegistrationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.ActivateEmail"); + Argument.AssertNotNull(emailRegistration, nameof(emailRegistration)); + + using var scope = EmailRegistrationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.ActivateEmail"); scope.Start(); try { @@ -166,9 +220,12 @@ public virtual async Task> ActivateEmailAsy /// Location of the activation. /// The payload for tenant domain activation. /// The cancellation token to use. + /// is null. public virtual Response ActivateEmail(AzureLocation location, DataShareEmailRegistration emailRegistration, CancellationToken cancellationToken = default) { - using var scope = EmailRegistrationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.ActivateEmail"); + Argument.AssertNotNull(emailRegistration, nameof(emailRegistration)); + + using var scope = EmailRegistrationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.ActivateEmail"); scope.Start(); try { @@ -199,7 +256,7 @@ public virtual Response ActivateEmail(AzureLocation /// The cancellation token to use. public virtual async Task> RegisterEmailAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = EmailRegistrationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RegisterEmail"); + using var scope = EmailRegistrationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.RegisterEmail"); scope.Start(); try { @@ -230,7 +287,7 @@ public virtual async Task> RegisterEmailAsy /// The cancellation token to use. public virtual Response RegisterEmail(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = EmailRegistrationsClientDiagnostics.CreateScope("TenantResourceExtensionClient.RegisterEmail"); + using var scope = EmailRegistrationsClientDiagnostics.CreateScope("DataShareTenantMockingExtension.RegisterEmail"); scope.Start(); try { diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d1f59a01040b..000000000000 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataShare -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataShareAccountResources in the ResourceGroupResource. - /// An object representing collection of DataShareAccountResources and their operations over a DataShareAccountResource. - public virtual DataShareAccountCollection GetDataShareAccounts() - { - return GetCachedClient(Client => new DataShareAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/ShareSubscriptionResource.cs b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/ShareSubscriptionResource.cs index 53c1bc93b63e..61a21d156eb3 100644 --- a/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/ShareSubscriptionResource.cs +++ b/sdk/datashare/Azure.ResourceManager.DataShare/src/Generated/ShareSubscriptionResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ShareDataSetMappingResources and their operations over a ShareDataSetMappingResource. public virtual ShareDataSetMappingCollection GetShareDataSetMappings() { - return GetCachedClient(Client => new ShareDataSetMappingCollection(Client, Id)); + return GetCachedClient(client => new ShareDataSetMappingCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual ShareDataSetMappingCollection GetShareDataSetMappings() /// /// The name of the dataSetMapping. /// The cancellation token to use. - /// 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> GetShareDataSetMappingAsync(string dataSetMappingName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetShareDataSet /// /// The name of the dataSetMapping. /// The cancellation token to use. - /// 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 GetShareDataSetMapping(string dataSetMappingName, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetShareDataSetMapping(stri /// An object representing collection of DataShareTriggerResources and their operations over a DataShareTriggerResource. public virtual DataShareTriggerCollection GetDataShareTriggers() { - return GetCachedClient(Client => new DataShareTriggerCollection(Client, Id)); + return GetCachedClient(client => new DataShareTriggerCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual DataShareTriggerCollection GetDataShareTriggers() /// /// The name of the trigger. /// The cancellation token to use. - /// 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> GetDataShareTriggerAsync(string triggerName, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetDataShareTrigge /// /// The name of the trigger. /// The cancellation token to use. - /// 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 GetDataShareTrigger(string triggerName, CancellationToken cancellationToken = default) { diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/EasmWorkspaceResource.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/EasmWorkspaceResource.cs index 46a0b1840f73..1d2ee74e5a52 100644 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/EasmWorkspaceResource.cs +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/EasmWorkspaceResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of EasmLabelResources and their operations over a EasmLabelResource. public virtual EasmLabelCollection GetEasmLabels() { - return GetCachedClient(Client => new EasmLabelCollection(Client, Id)); + return GetCachedClient(client => new EasmLabelCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual EasmLabelCollection GetEasmLabels() /// /// The name of the Label. /// The cancellation token to use. - /// 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> GetEasmLabelAsync(string labelName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetEasmLabelAsync(string /// /// The name of the Label. /// The cancellation token to use. - /// 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 GetEasmLabel(string labelName, CancellationToken cancellationToken = default) { diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmArmClientMockingExtension.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmArmClientMockingExtension.cs new file mode 100644 index 000000000000..d586ace55011 --- /dev/null +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DefenderEasm; + +namespace Azure.ResourceManager.DefenderEasm.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DefenderEasmArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DefenderEasmArmClientMockingExtension() + { + } + + /// 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 DefenderEasmArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DefenderEasmArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EasmWorkspaceResource GetEasmWorkspaceResource(ResourceIdentifier id) + { + EasmWorkspaceResource.ValidateResourceId(id); + return new EasmWorkspaceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EasmLabelResource GetEasmLabelResource(ResourceIdentifier id) + { + EasmLabelResource.ValidateResourceId(id); + return new EasmLabelResource(Client, id); + } + } +} diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmExtensions.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmExtensions.cs index 2e26600dfdfe..8a472cd4c9d4 100644 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmExtensions.cs +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DefenderEasm.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.DefenderEasm @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.DefenderEasm /// A class to add extension methods to Azure.ResourceManager.DefenderEasm. public static partial class DefenderEasmExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DefenderEasmArmClientMockingExtension GetDefenderEasmArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DefenderEasmArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DefenderEasmResourceGroupMockingExtension GetDefenderEasmResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DefenderEasmResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DefenderEasmSubscriptionMockingExtension GetDefenderEasmSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DefenderEasmSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region EasmWorkspaceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EasmWorkspaceResource GetEasmWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EasmWorkspaceResource.ValidateResourceId(id); - return new EasmWorkspaceResource(client, id); - } - ); + return GetDefenderEasmArmClientMockingExtension(client).GetEasmWorkspaceResource(id); } - #endregion - #region EasmLabelResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EasmLabelResource GetEasmLabelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EasmLabelResource.ValidateResourceId(id); - return new EasmLabelResource(client, id); - } - ); + return GetDefenderEasmArmClientMockingExtension(client).GetEasmLabelResource(id); } - #endregion - /// Gets a collection of EasmWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of EasmWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EasmWorkspaceResources and their operations over a EasmWorkspaceResource. public static EasmWorkspaceCollection GetEasmWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEasmWorkspaces(); + return GetDefenderEasmResourceGroupMockingExtension(resourceGroupResource).GetEasmWorkspaces(); } /// @@ -107,16 +92,20 @@ public static EasmWorkspaceCollection GetEasmWorkspaces(this ResourceGroupResour /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Workspace. /// The cancellation token to use. - /// 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 static async Task> GetEasmWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEasmWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetDefenderEasmResourceGroupMockingExtension(resourceGroupResource).GetEasmWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetEasmWorkspaceAsync( /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Workspace. /// The cancellation token to use. - /// 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 static Response GetEasmWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEasmWorkspaces().Get(workspaceName, cancellationToken); + return GetDefenderEasmResourceGroupMockingExtension(resourceGroupResource).GetEasmWorkspace(workspaceName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetEasmWorkspace(this ResourceGrou /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEasmWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEasmWorkspacesAsync(cancellationToken); + return GetDefenderEasmSubscriptionMockingExtension(subscriptionResource).GetEasmWorkspacesAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetEasmWorkspacesAsync(this S /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEasmWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEasmWorkspaces(cancellationToken); + return GetDefenderEasmSubscriptionMockingExtension(subscriptionResource).GetEasmWorkspaces(cancellationToken); } } } diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmResourceGroupMockingExtension.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..3e64ae1aa1df --- /dev/null +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DefenderEasm; + +namespace Azure.ResourceManager.DefenderEasm.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DefenderEasmResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DefenderEasmResourceGroupMockingExtension() + { + } + + /// 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 DefenderEasmResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EasmWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of EasmWorkspaceResources and their operations over a EasmWorkspaceResource. + public virtual EasmWorkspaceCollection GetEasmWorkspaces() + { + return GetCachedClient(client => new EasmWorkspaceCollection(client, Id)); + } + + /// + /// Returns a workspace with the given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the Workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEasmWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetEasmWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a workspace with the given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Easm/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the Workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEasmWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetEasmWorkspaces().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmSubscriptionMockingExtension.cs similarity index 85% rename from sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmSubscriptionMockingExtension.cs index b288af25e4c2..76fd695d4bfc 100644 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/DefenderEasmSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DefenderEasm; -namespace Azure.ResourceManager.DefenderEasm +namespace Azure.ResourceManager.DefenderEasm.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DefenderEasmSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _easmWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _easmWorkspaceWorkspacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DefenderEasmSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DefenderEasmSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetEasmWorkspacesAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => EasmWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EasmWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EasmWorkspaceResource(Client, EasmWorkspaceData.DeserializeEasmWorkspaceData(e)), EasmWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEasmWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EasmWorkspaceResource(Client, EasmWorkspaceData.DeserializeEasmWorkspaceData(e)), EasmWorkspaceWorkspacesClientDiagnostics, Pipeline, "DefenderEasmSubscriptionMockingExtension.GetEasmWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetEasmWorkspaces(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => EasmWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EasmWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EasmWorkspaceResource(Client, EasmWorkspaceData.DeserializeEasmWorkspaceData(e)), EasmWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEasmWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EasmWorkspaceResource(Client, EasmWorkspaceData.DeserializeEasmWorkspaceData(e)), EasmWorkspaceWorkspacesClientDiagnostics, Pipeline, "DefenderEasmSubscriptionMockingExtension.GetEasmWorkspaces", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e172ba5fcb67..000000000000 --- a/sdk/defendereasm/Azure.ResourceManager.DefenderEasm/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DefenderEasm -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EasmWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of EasmWorkspaceResources and their operations over a EasmWorkspaceResource. - public virtual EasmWorkspaceCollection GetEasmWorkspaces() - { - return GetCachedClient(Client => new EasmWorkspaceCollection(Client, Id)); - } - } -} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationArmClientMockingExtension.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationArmClientMockingExtension.cs new file mode 100644 index 000000000000..44a0770efbe1 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationArmClientMockingExtension.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DesktopVirtualizationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DesktopVirtualizationArmClientMockingExtension() + { + } + + /// 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 DesktopVirtualizationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DesktopVirtualizationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual VirtualWorkspaceResource GetVirtualWorkspaceResource(ResourceIdentifier id) + { + VirtualWorkspaceResource.ValidateResourceId(id); + return new VirtualWorkspaceResource(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 ScalingPlanResource GetScalingPlanResource(ResourceIdentifier id) + { + ScalingPlanResource.ValidateResourceId(id); + return new ScalingPlanResource(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 ScalingPlanPooledScheduleResource GetScalingPlanPooledScheduleResource(ResourceIdentifier id) + { + ScalingPlanPooledScheduleResource.ValidateResourceId(id); + return new ScalingPlanPooledScheduleResource(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 VirtualApplicationGroupResource GetVirtualApplicationGroupResource(ResourceIdentifier id) + { + VirtualApplicationGroupResource.ValidateResourceId(id); + return new VirtualApplicationGroupResource(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 VirtualApplicationResource GetVirtualApplicationResource(ResourceIdentifier id) + { + VirtualApplicationResource.ValidateResourceId(id); + return new VirtualApplicationResource(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 VirtualDesktopResource GetVirtualDesktopResource(ResourceIdentifier id) + { + VirtualDesktopResource.ValidateResourceId(id); + return new VirtualDesktopResource(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 HostPoolResource GetHostPoolResource(ResourceIdentifier id) + { + HostPoolResource.ValidateResourceId(id); + return new HostPoolResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UserSessionResource GetUserSessionResource(ResourceIdentifier id) + { + UserSessionResource.ValidateResourceId(id); + return new UserSessionResource(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 SessionHostResource GetSessionHostResource(ResourceIdentifier id) + { + SessionHostResource.ValidateResourceId(id); + return new SessionHostResource(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 MsixPackageResource GetMsixPackageResource(ResourceIdentifier id) + { + MsixPackageResource.ValidateResourceId(id); + return new MsixPackageResource(Client, id); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs index 484836e61f8f..cd17094ca20c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.DesktopVirtualization @@ -18,233 +19,193 @@ namespace Azure.ResourceManager.DesktopVirtualization /// A class to add extension methods to Azure.ResourceManager.DesktopVirtualization. public static partial class DesktopVirtualizationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DesktopVirtualizationArmClientMockingExtension GetDesktopVirtualizationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DesktopVirtualizationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DesktopVirtualizationResourceGroupMockingExtension GetDesktopVirtualizationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DesktopVirtualizationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DesktopVirtualizationSubscriptionMockingExtension GetDesktopVirtualizationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DesktopVirtualizationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region VirtualWorkspaceResource /// /// 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. /// Returns a object. public static VirtualWorkspaceResource GetVirtualWorkspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualWorkspaceResource.ValidateResourceId(id); - return new VirtualWorkspaceResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetVirtualWorkspaceResource(id); } - #endregion - #region ScalingPlanResource /// /// 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. /// Returns a object. public static ScalingPlanResource GetScalingPlanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScalingPlanResource.ValidateResourceId(id); - return new ScalingPlanResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetScalingPlanResource(id); } - #endregion - #region ScalingPlanPooledScheduleResource /// /// 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. /// Returns a object. public static ScalingPlanPooledScheduleResource GetScalingPlanPooledScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScalingPlanPooledScheduleResource.ValidateResourceId(id); - return new ScalingPlanPooledScheduleResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetScalingPlanPooledScheduleResource(id); } - #endregion - #region VirtualApplicationGroupResource /// /// 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. /// Returns a object. public static VirtualApplicationGroupResource GetVirtualApplicationGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualApplicationGroupResource.ValidateResourceId(id); - return new VirtualApplicationGroupResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetVirtualApplicationGroupResource(id); } - #endregion - #region VirtualApplicationResource /// /// 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. /// Returns a object. public static VirtualApplicationResource GetVirtualApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualApplicationResource.ValidateResourceId(id); - return new VirtualApplicationResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetVirtualApplicationResource(id); } - #endregion - #region VirtualDesktopResource /// /// 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. /// Returns a object. public static VirtualDesktopResource GetVirtualDesktopResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualDesktopResource.ValidateResourceId(id); - return new VirtualDesktopResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetVirtualDesktopResource(id); } - #endregion - #region HostPoolResource /// /// 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. /// Returns a object. public static HostPoolResource GetHostPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HostPoolResource.ValidateResourceId(id); - return new HostPoolResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetHostPoolResource(id); } - #endregion - #region UserSessionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static UserSessionResource GetUserSessionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - UserSessionResource.ValidateResourceId(id); - return new UserSessionResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetUserSessionResource(id); } - #endregion - #region SessionHostResource /// /// 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. /// Returns a object. public static SessionHostResource GetSessionHostResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SessionHostResource.ValidateResourceId(id); - return new SessionHostResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetSessionHostResource(id); } - #endregion - #region MsixPackageResource /// /// 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. /// Returns a object. public static MsixPackageResource GetMsixPackageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MsixPackageResource.ValidateResourceId(id); - return new MsixPackageResource(client, id); - } - ); + return GetDesktopVirtualizationArmClientMockingExtension(client).GetMsixPackageResource(id); } - #endregion - /// Gets a collection of VirtualWorkspaceResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualWorkspaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualWorkspaceResources and their operations over a VirtualWorkspaceResource. public static VirtualWorkspaceCollection GetVirtualWorkspaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualWorkspaces(); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualWorkspaces(); } /// @@ -259,16 +220,20 @@ public static VirtualWorkspaceCollection GetVirtualWorkspaces(this ResourceGroup /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static async Task> GetVirtualWorkspaceAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualWorkspaceAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -283,24 +248,34 @@ public static async Task> GetVirtualWorkspace /// Workspaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the workspace. /// The cancellation token to use. - /// 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 static Response GetVirtualWorkspace(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualWorkspaces().Get(workspaceName, cancellationToken); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualWorkspace(workspaceName, cancellationToken); } - /// Gets a collection of ScalingPlanResources in the ResourceGroupResource. + /// + /// Gets a collection of ScalingPlanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ScalingPlanResources and their operations over a ScalingPlanResource. public static ScalingPlanCollection GetScalingPlans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetScalingPlans(); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetScalingPlans(); } /// @@ -315,16 +290,20 @@ public static ScalingPlanCollection GetScalingPlans(this ResourceGroupResource r /// ScalingPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the scaling plan. /// The cancellation token to use. - /// 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 static async Task> GetScalingPlanAsync(this ResourceGroupResource resourceGroupResource, string scalingPlanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetScalingPlans().GetAsync(scalingPlanName, cancellationToken).ConfigureAwait(false); + return await GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetScalingPlanAsync(scalingPlanName, cancellationToken).ConfigureAwait(false); } /// @@ -339,24 +318,34 @@ public static async Task> GetScalingPlanAsync(this /// ScalingPlans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the scaling plan. /// The cancellation token to use. - /// 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 static Response GetScalingPlan(this ResourceGroupResource resourceGroupResource, string scalingPlanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetScalingPlans().Get(scalingPlanName, cancellationToken); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetScalingPlan(scalingPlanName, cancellationToken); } - /// Gets a collection of VirtualApplicationGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualApplicationGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualApplicationGroupResources and their operations over a VirtualApplicationGroupResource. public static VirtualApplicationGroupCollection GetVirtualApplicationGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualApplicationGroups(); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualApplicationGroups(); } /// @@ -371,16 +360,20 @@ public static VirtualApplicationGroupCollection GetVirtualApplicationGroups(this /// ApplicationGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application group. /// The cancellation token to use. - /// 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 static async Task> GetVirtualApplicationGroupAsync(this ResourceGroupResource resourceGroupResource, string applicationGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualApplicationGroups().GetAsync(applicationGroupName, cancellationToken).ConfigureAwait(false); + return await GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualApplicationGroupAsync(applicationGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -395,24 +388,34 @@ public static async Task> GetVirtualAp /// ApplicationGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the application group. /// The cancellation token to use. - /// 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 static Response GetVirtualApplicationGroup(this ResourceGroupResource resourceGroupResource, string applicationGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualApplicationGroups().Get(applicationGroupName, cancellationToken); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetVirtualApplicationGroup(applicationGroupName, cancellationToken); } - /// Gets a collection of HostPoolResources in the ResourceGroupResource. + /// + /// Gets a collection of HostPoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HostPoolResources and their operations over a HostPoolResource. public static HostPoolCollection GetHostPools(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHostPools(); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetHostPools(); } /// @@ -427,16 +430,20 @@ public static HostPoolCollection GetHostPools(this ResourceGroupResource resourc /// HostPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the host pool within the specified resource group. /// The cancellation token to use. - /// 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 static async Task> GetHostPoolAsync(this ResourceGroupResource resourceGroupResource, string hostPoolName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHostPools().GetAsync(hostPoolName, cancellationToken).ConfigureAwait(false); + return await GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetHostPoolAsync(hostPoolName, cancellationToken).ConfigureAwait(false); } /// @@ -451,16 +458,20 @@ public static async Task> GetHostPoolAsync(this Resou /// HostPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the host pool within the specified resource group. /// The cancellation token to use. - /// 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 static Response GetHostPool(this ResourceGroupResource resourceGroupResource, string hostPoolName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHostPools().Get(hostPoolName, cancellationToken); + return GetDesktopVirtualizationResourceGroupMockingExtension(resourceGroupResource).GetHostPool(hostPoolName, cancellationToken); } /// @@ -475,13 +486,17 @@ public static Response GetHostPool(this ResourceGroupResource /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualWorkspacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualWorkspacesAsync(cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetVirtualWorkspacesAsync(cancellationToken); } /// @@ -496,13 +511,17 @@ public static AsyncPageable GetVirtualWorkspacesAsync( /// Workspaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualWorkspaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualWorkspaces(cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetVirtualWorkspaces(cancellationToken); } /// @@ -517,6 +536,10 @@ public static Pageable GetVirtualWorkspaces(this Subsc /// ScalingPlans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Number of items per page. @@ -526,7 +549,7 @@ public static Pageable GetVirtualWorkspaces(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetScalingPlansAsync(this SubscriptionResource subscriptionResource, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScalingPlansAsync(pageSize, isDescending, initialSkip, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetScalingPlansAsync(pageSize, isDescending, initialSkip, cancellationToken); } /// @@ -541,6 +564,10 @@ public static AsyncPageable GetScalingPlansAsync(this Subsc /// ScalingPlans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Number of items per page. @@ -550,7 +577,7 @@ public static AsyncPageable GetScalingPlansAsync(this Subsc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetScalingPlans(this SubscriptionResource subscriptionResource, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetScalingPlans(pageSize, isDescending, initialSkip, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetScalingPlans(pageSize, isDescending, initialSkip, cancellationToken); } /// @@ -565,6 +592,10 @@ public static Pageable GetScalingPlans(this SubscriptionRes /// ApplicationGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData filter expression. Valid properties for filtering are applicationGroupType. @@ -572,7 +603,7 @@ public static Pageable GetScalingPlans(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualApplicationGroupsAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualApplicationGroupsAsync(filter, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetVirtualApplicationGroupsAsync(filter, cancellationToken); } /// @@ -587,6 +618,10 @@ public static AsyncPageable GetVirtualApplicati /// ApplicationGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// OData filter expression. Valid properties for filtering are applicationGroupType. @@ -594,7 +629,7 @@ public static AsyncPageable GetVirtualApplicati /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualApplicationGroups(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualApplicationGroups(filter, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetVirtualApplicationGroups(filter, cancellationToken); } /// @@ -609,6 +644,10 @@ public static Pageable GetVirtualApplicationGro /// HostPools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Number of items per page. @@ -618,7 +657,7 @@ public static Pageable GetVirtualApplicationGro /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHostPoolsAsync(this SubscriptionResource subscriptionResource, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHostPoolsAsync(pageSize, isDescending, initialSkip, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetHostPoolsAsync(pageSize, isDescending, initialSkip, cancellationToken); } /// @@ -633,6 +672,10 @@ public static AsyncPageable GetHostPoolsAsync(this Subscriptio /// HostPools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Number of items per page. @@ -642,7 +685,7 @@ public static AsyncPageable GetHostPoolsAsync(this Subscriptio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHostPools(this SubscriptionResource subscriptionResource, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHostPools(pageSize, isDescending, initialSkip, cancellationToken); + return GetDesktopVirtualizationSubscriptionMockingExtension(subscriptionResource).GetHostPools(pageSize, isDescending, initialSkip, cancellationToken); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationResourceGroupMockingExtension.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..895831e04bef --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationResourceGroupMockingExtension.cs @@ -0,0 +1,251 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DesktopVirtualizationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DesktopVirtualizationResourceGroupMockingExtension() + { + } + + /// 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 DesktopVirtualizationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of VirtualWorkspaceResources in the ResourceGroupResource. + /// An object representing collection of VirtualWorkspaceResources and their operations over a VirtualWorkspaceResource. + public virtual VirtualWorkspaceCollection GetVirtualWorkspaces() + { + return GetCachedClient(client => new VirtualWorkspaceCollection(client, Id)); + } + + /// + /// Get a workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualWorkspaceAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetVirtualWorkspaces().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// + /// The name of the workspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualWorkspace(string workspaceName, CancellationToken cancellationToken = default) + { + return GetVirtualWorkspaces().Get(workspaceName, cancellationToken); + } + + /// Gets a collection of ScalingPlanResources in the ResourceGroupResource. + /// An object representing collection of ScalingPlanResources and their operations over a ScalingPlanResource. + public virtual ScalingPlanCollection GetScalingPlans() + { + return GetCachedClient(client => new ScalingPlanCollection(client, Id)); + } + + /// + /// Get a scaling plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName} + /// + /// + /// Operation Id + /// ScalingPlans_Get + /// + /// + /// + /// The name of the scaling plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScalingPlanAsync(string scalingPlanName, CancellationToken cancellationToken = default) + { + return await GetScalingPlans().GetAsync(scalingPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a scaling plan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName} + /// + /// + /// Operation Id + /// ScalingPlans_Get + /// + /// + /// + /// The name of the scaling plan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScalingPlan(string scalingPlanName, CancellationToken cancellationToken = default) + { + return GetScalingPlans().Get(scalingPlanName, cancellationToken); + } + + /// Gets a collection of VirtualApplicationGroupResources in the ResourceGroupResource. + /// An object representing collection of VirtualApplicationGroupResources and their operations over a VirtualApplicationGroupResource. + public virtual VirtualApplicationGroupCollection GetVirtualApplicationGroups() + { + return GetCachedClient(client => new VirtualApplicationGroupCollection(client, Id)); + } + + /// + /// Get an application group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName} + /// + /// + /// Operation Id + /// ApplicationGroups_Get + /// + /// + /// + /// The name of the application group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualApplicationGroupAsync(string applicationGroupName, CancellationToken cancellationToken = default) + { + return await GetVirtualApplicationGroups().GetAsync(applicationGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an application group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName} + /// + /// + /// Operation Id + /// ApplicationGroups_Get + /// + /// + /// + /// The name of the application group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualApplicationGroup(string applicationGroupName, CancellationToken cancellationToken = default) + { + return GetVirtualApplicationGroups().Get(applicationGroupName, cancellationToken); + } + + /// Gets a collection of HostPoolResources in the ResourceGroupResource. + /// An object representing collection of HostPoolResources and their operations over a HostPoolResource. + public virtual HostPoolCollection GetHostPools() + { + return GetCachedClient(client => new HostPoolCollection(client, Id)); + } + + /// + /// Get a host pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName} + /// + /// + /// Operation Id + /// HostPools_Get + /// + /// + /// + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHostPoolAsync(string hostPoolName, CancellationToken cancellationToken = default) + { + return await GetHostPools().GetAsync(hostPoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a host pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName} + /// + /// + /// Operation Id + /// HostPools_Get + /// + /// + /// + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHostPool(string hostPoolName, CancellationToken cancellationToken = default) + { + return GetHostPools().Get(hostPoolName, cancellationToken); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationSubscriptionMockingExtension.cs similarity index 91% rename from sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationSubscriptionMockingExtension.cs index 33906259f0a3..7100868d70bc 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; -namespace Azure.ResourceManager.DesktopVirtualization +namespace Azure.ResourceManager.DesktopVirtualization.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DesktopVirtualizationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _virtualWorkspaceWorkspacesClientDiagnostics; private WorkspacesRestOperations _virtualWorkspaceWorkspacesRestClient; @@ -26,15 +27,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _hostPoolClientDiagnostics; private HostPoolsRestOperations _hostPoolRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DesktopVirtualizationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DesktopVirtualizationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -72,7 +73,7 @@ public virtual AsyncPageable GetVirtualWorkspacesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualWorkspaceResource(Client, VirtualWorkspaceData.DeserializeVirtualWorkspaceData(e)), VirtualWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualWorkspaceResource(Client, VirtualWorkspaceData.DeserializeVirtualWorkspaceData(e)), VirtualWorkspaceWorkspacesClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetVirtualWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -94,7 +95,7 @@ public virtual Pageable GetVirtualWorkspaces(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualWorkspaceResource(Client, VirtualWorkspaceData.DeserializeVirtualWorkspaceData(e)), VirtualWorkspaceWorkspacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualWorkspaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualWorkspaceResource(Client, VirtualWorkspaceData.DeserializeVirtualWorkspaceData(e)), VirtualWorkspaceWorkspacesClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetVirtualWorkspaces", "value", "nextLink", cancellationToken); } /// @@ -119,7 +120,7 @@ public virtual AsyncPageable GetScalingPlansAsync(int? page { HttpMessage FirstPageRequest(int? pageSizeHint) => ScalingPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScalingPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanResource(Client, ScalingPlanData.DeserializeScalingPlanData(e)), ScalingPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScalingPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanResource(Client, ScalingPlanData.DeserializeScalingPlanData(e)), ScalingPlanClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetScalingPlans", "value", "nextLink", cancellationToken); } /// @@ -144,7 +145,7 @@ public virtual Pageable GetScalingPlans(int? pageSize = nul { HttpMessage FirstPageRequest(int? pageSizeHint) => ScalingPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ScalingPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanResource(Client, ScalingPlanData.DeserializeScalingPlanData(e)), ScalingPlanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetScalingPlans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanResource(Client, ScalingPlanData.DeserializeScalingPlanData(e)), ScalingPlanClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetScalingPlans", "value", "nextLink", cancellationToken); } /// @@ -167,7 +168,7 @@ public virtual AsyncPageable GetVirtualApplicat { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualApplicationGroupApplicationGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualApplicationGroupApplicationGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualApplicationGroupResource(Client, VirtualApplicationGroupData.DeserializeVirtualApplicationGroupData(e)), VirtualApplicationGroupApplicationGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualApplicationGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualApplicationGroupResource(Client, VirtualApplicationGroupData.DeserializeVirtualApplicationGroupData(e)), VirtualApplicationGroupApplicationGroupsClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetVirtualApplicationGroups", "value", "nextLink", cancellationToken); } /// @@ -190,7 +191,7 @@ public virtual Pageable GetVirtualApplicationGr { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualApplicationGroupApplicationGroupsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualApplicationGroupApplicationGroupsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualApplicationGroupResource(Client, VirtualApplicationGroupData.DeserializeVirtualApplicationGroupData(e)), VirtualApplicationGroupApplicationGroupsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualApplicationGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualApplicationGroupResource(Client, VirtualApplicationGroupData.DeserializeVirtualApplicationGroupData(e)), VirtualApplicationGroupApplicationGroupsClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetVirtualApplicationGroups", "value", "nextLink", cancellationToken); } /// @@ -215,7 +216,7 @@ public virtual AsyncPageable GetHostPoolsAsync(int? pageSize = { HttpMessage FirstPageRequest(int? pageSizeHint) => HostPoolRestClient.CreateListRequest(Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HostPoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HostPoolResource(Client, HostPoolData.DeserializeHostPoolData(e)), HostPoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHostPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HostPoolResource(Client, HostPoolData.DeserializeHostPoolData(e)), HostPoolClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetHostPools", "value", "nextLink", cancellationToken); } /// @@ -240,7 +241,7 @@ public virtual Pageable GetHostPools(int? pageSize = null, boo { HttpMessage FirstPageRequest(int? pageSizeHint) => HostPoolRestClient.CreateListRequest(Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HostPoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, pageSizeHint, isDescending, initialSkip); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HostPoolResource(Client, HostPoolData.DeserializeHostPoolData(e)), HostPoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHostPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HostPoolResource(Client, HostPoolData.DeserializeHostPoolData(e)), HostPoolClientDiagnostics, Pipeline, "DesktopVirtualizationSubscriptionMockingExtension.GetHostPools", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4e2fd4f11d15..000000000000 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DesktopVirtualization -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of VirtualWorkspaceResources in the ResourceGroupResource. - /// An object representing collection of VirtualWorkspaceResources and their operations over a VirtualWorkspaceResource. - public virtual VirtualWorkspaceCollection GetVirtualWorkspaces() - { - return GetCachedClient(Client => new VirtualWorkspaceCollection(Client, Id)); - } - - /// Gets a collection of ScalingPlanResources in the ResourceGroupResource. - /// An object representing collection of ScalingPlanResources and their operations over a ScalingPlanResource. - public virtual ScalingPlanCollection GetScalingPlans() - { - return GetCachedClient(Client => new ScalingPlanCollection(Client, Id)); - } - - /// Gets a collection of VirtualApplicationGroupResources in the ResourceGroupResource. - /// An object representing collection of VirtualApplicationGroupResources and their operations over a VirtualApplicationGroupResource. - public virtual VirtualApplicationGroupCollection GetVirtualApplicationGroups() - { - return GetCachedClient(Client => new VirtualApplicationGroupCollection(Client, Id)); - } - - /// Gets a collection of HostPoolResources in the ResourceGroupResource. - /// An object representing collection of HostPoolResources and their operations over a HostPoolResource. - public virtual HostPoolCollection GetHostPools() - { - return GetCachedClient(Client => new HostPoolCollection(Client, Id)); - } - } -} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs index 9808b2c014d7..1eadb593462b 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs @@ -108,7 +108,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SessionHostResources and their operations over a SessionHostResource. public virtual SessionHostCollection GetSessionHosts() { - return GetCachedClient(Client => new SessionHostCollection(Client, Id)); + return GetCachedClient(client => new SessionHostCollection(client, Id)); } /// @@ -126,8 +126,8 @@ public virtual SessionHostCollection GetSessionHosts() /// /// The name of the session host within the specified host pool. /// The cancellation token to use. - /// 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> GetSessionHostAsync(string sessionHostName, CancellationToken cancellationToken = default) { @@ -149,8 +149,8 @@ public virtual async Task> GetSessionHostAsync(str /// /// The name of the session host within the specified host pool. /// The cancellation token to use. - /// 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 GetSessionHost(string sessionHostName, CancellationToken cancellationToken = default) { @@ -161,7 +161,7 @@ public virtual Response GetSessionHost(string sessionHostNa /// An object representing collection of MsixPackageResources and their operations over a MsixPackageResource. public virtual MsixPackageCollection GetMsixPackages() { - return GetCachedClient(Client => new MsixPackageCollection(Client, Id)); + return GetCachedClient(client => new MsixPackageCollection(client, Id)); } /// @@ -179,8 +179,8 @@ public virtual MsixPackageCollection GetMsixPackages() /// /// The version specific package full name of the MSIX package within specified hostpool. /// The cancellation token to use. - /// 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> GetMsixPackageAsync(string msixPackageFullName, CancellationToken cancellationToken = default) { @@ -202,8 +202,8 @@ public virtual async Task> GetMsixPackageAsync(str /// /// The version specific package full name of the MSIX package within specified hostpool. /// The cancellation token to use. - /// 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 GetMsixPackage(string msixPackageFullName, CancellationToken cancellationToken = default) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs index 9aca0601777d..b5fce706535d 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ScalingPlanPooledScheduleResources and their operations over a ScalingPlanPooledScheduleResource. public virtual ScalingPlanPooledScheduleCollection GetScalingPlanPooledSchedules() { - return GetCachedClient(Client => new ScalingPlanPooledScheduleCollection(Client, Id)); + return GetCachedClient(client => new ScalingPlanPooledScheduleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ScalingPlanPooledScheduleCollection GetScalingPlanPooledSchedules /// /// The name of the ScalingPlanSchedule. /// The cancellation token to use. - /// 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> GetScalingPlanPooledScheduleAsync(string scalingPlanScheduleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetScalin /// /// The name of the ScalingPlanSchedule. /// The cancellation token to use. - /// 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 GetScalingPlanPooledSchedule(string scalingPlanScheduleName, CancellationToken cancellationToken = default) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs index 89ae0e6a7d26..b9983be896a4 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of UserSessionResources and their operations over a UserSessionResource. public virtual UserSessionCollection GetUserSessions() { - return GetCachedClient(Client => new UserSessionCollection(Client, Id)); + return GetCachedClient(client => new UserSessionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual UserSessionCollection GetUserSessions() /// /// The name of the user session within the specified session host. /// The cancellation token to use. - /// 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> GetUserSessionAsync(string userSessionId, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetUserSessionAsync(str /// /// The name of the user session within the specified session host. /// The cancellation token to use. - /// 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 GetUserSession(string userSessionId, CancellationToken cancellationToken = default) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs index fb9cfe82a48f..25bf6914f231 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualApplicationResources and their operations over a VirtualApplicationResource. public virtual VirtualApplicationCollection GetVirtualApplications() { - return GetCachedClient(Client => new VirtualApplicationCollection(Client, Id)); + return GetCachedClient(client => new VirtualApplicationCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual VirtualApplicationCollection GetVirtualApplications() /// /// The name of the application within the specified application group. /// The cancellation token to use. - /// 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> GetVirtualApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetVirtualApplic /// /// The name of the application within the specified application group. /// The cancellation token to use. - /// 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 GetVirtualApplication(string applicationName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetVirtualApplication(string /// An object representing collection of VirtualDesktopResources and their operations over a VirtualDesktopResource. public virtual VirtualDesktopCollection GetVirtualDesktops() { - return GetCachedClient(Client => new VirtualDesktopCollection(Client, Id)); + return GetCachedClient(client => new VirtualDesktopCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual VirtualDesktopCollection GetVirtualDesktops() /// /// The name of the desktop within the specified desktop group. /// The cancellation token to use. - /// 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> GetVirtualDesktopAsync(string desktopName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetVirtualDesktopAsy /// /// The name of the desktop within the specified desktop group. /// The cancellation token to use. - /// 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 GetVirtualDesktop(string desktopName, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterGalleryResource.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterGalleryResource.cs index 68c695e58b9e..80ceef8fabc3 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterGalleryResource.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterGalleryResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevCenterImageResources and their operations over a DevCenterImageResource. public virtual DevCenterImageCollection GetDevCenterImages() { - return GetCachedClient(Client => new DevCenterImageCollection(Client, Id)); + return GetCachedClient(client => new DevCenterImageCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual DevCenterImageCollection GetDevCenterImages() /// /// The name of the image. /// The cancellation token to use. - /// 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> GetDevCenterImageAsync(string imageName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetDevCenterImageAsy /// /// The name of the image. /// The cancellation token to use. - /// 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 GetDevCenterImage(string imageName, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterImageResource.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterImageResource.cs index 6124349c5e12..68385554e8ba 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterImageResource.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterImageResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ImageVersionResources and their operations over a ImageVersionResource. public virtual ImageVersionCollection GetImageVersions() { - return GetCachedClient(Client => new ImageVersionCollection(Client, Id)); + return GetCachedClient(client => new ImageVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ImageVersionCollection GetImageVersions() /// /// The version of the image. /// The cancellation token to use. - /// 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> GetImageVersionAsync(string versionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetImageVersionAsync(s /// /// The version of the image. /// The cancellation token to use. - /// 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 GetImageVersion(string versionName, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterPoolResource.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterPoolResource.cs index 4eeb08bea34f..9363f4bd5139 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterPoolResource.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterPoolResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevCenterScheduleResources and their operations over a DevCenterScheduleResource. public virtual DevCenterScheduleCollection GetDevCenterSchedules() { - return GetCachedClient(Client => new DevCenterScheduleCollection(Client, Id)); + return GetCachedClient(client => new DevCenterScheduleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DevCenterScheduleCollection GetDevCenterSchedules() /// The name of the schedule that uniquely identifies it. /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The cancellation token to use. - /// 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> GetDevCenterScheduleAsync(string scheduleName, int? top = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDevCenterSched /// The name of the schedule that uniquely identifies it. /// The maximum number of resources to return from the operation. Example: '$top=10'. /// The cancellation token to use. - /// 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 GetDevCenterSchedule(string scheduleName, int? top = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterProjectResource.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterProjectResource.cs index 44b0eada425d..1fbbeb80f2d2 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterProjectResource.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterProjectResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ProjectAttachedNetworkConnectionResources and their operations over a ProjectAttachedNetworkConnectionResource. public virtual ProjectAttachedNetworkConnectionCollection GetProjectAttachedNetworkConnections() { - return GetCachedClient(Client => new ProjectAttachedNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new ProjectAttachedNetworkConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ProjectAttachedNetworkConnectionCollection GetProjectAttachedNetw /// /// The name of the attached NetworkConnection. /// The cancellation token to use. - /// 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> GetProjectAttachedNetworkConnectionAsync(string attachedNetworkConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// The name of the attached NetworkConnection. /// The cancellation token to use. - /// 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 GetProjectAttachedNetworkConnection(string attachedNetworkConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetProjectAtta /// An object representing collection of AllowedEnvironmentTypeResources and their operations over a AllowedEnvironmentTypeResource. public virtual AllowedEnvironmentTypeCollection GetAllowedEnvironmentTypes() { - return GetCachedClient(Client => new AllowedEnvironmentTypeCollection(Client, Id)); + return GetCachedClient(client => new AllowedEnvironmentTypeCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual AllowedEnvironmentTypeCollection GetAllowedEnvironmentTypes() /// /// The name of the environment type. /// The cancellation token to use. - /// 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> GetAllowedEnvironmentTypeAsync(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetAllowedEn /// /// The name of the environment type. /// The cancellation token to use. - /// 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 GetAllowedEnvironmentType(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetAllowedEnvironmentTyp /// An object representing collection of DevCenterProjectEnvironmentResources and their operations over a DevCenterProjectEnvironmentResource. public virtual DevCenterProjectEnvironmentCollection GetDevCenterProjectEnvironments() { - return GetCachedClient(Client => new DevCenterProjectEnvironmentCollection(Client, Id)); + return GetCachedClient(client => new DevCenterProjectEnvironmentCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual DevCenterProjectEnvironmentCollection GetDevCenterProjectEnvironm /// /// The name of the environment type. /// The cancellation token to use. - /// 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> GetDevCenterProjectEnvironmentAsync(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetDevC /// /// The name of the environment type. /// The cancellation token to use. - /// 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 GetDevCenterProjectEnvironment(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetDevCenterProject /// An object representing collection of ProjectDevBoxDefinitionResources and their operations over a ProjectDevBoxDefinitionResource. public virtual ProjectDevBoxDefinitionCollection GetProjectDevBoxDefinitions() { - return GetCachedClient(Client => new ProjectDevBoxDefinitionCollection(Client, Id)); + return GetCachedClient(client => new ProjectDevBoxDefinitionCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual ProjectDevBoxDefinitionCollection GetProjectDevBoxDefinitions() /// /// The name of the Dev Box definition. /// The cancellation token to use. - /// 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> GetProjectDevBoxDefinitionAsync(string devBoxDefinitionName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetProjectD /// /// The name of the Dev Box definition. /// The cancellation token to use. - /// 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 GetProjectDevBoxDefinition(string devBoxDefinitionName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetProjectDevBoxDefinit /// An object representing collection of DevCenterPoolResources and their operations over a DevCenterPoolResource. public virtual DevCenterPoolCollection GetDevCenterPools() { - return GetCachedClient(Client => new DevCenterPoolCollection(Client, Id)); + return GetCachedClient(client => new DevCenterPoolCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual DevCenterPoolCollection GetDevCenterPools() /// /// Name of the pool. /// The cancellation token to use. - /// 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> GetDevCenterPoolAsync(string poolName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> GetDevCenterPoolAsync /// /// Name of the pool. /// The cancellation token to use. - /// 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 GetDevCenterPool(string poolName, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterResource.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterResource.cs index 5d9b793d3bc8..7835d3a4defa 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterResource.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/DevCenterResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of AttachedNetworkConnectionResources and their operations over a AttachedNetworkConnectionResource. public virtual AttachedNetworkConnectionCollection GetAttachedNetworkConnections() { - return GetCachedClient(Client => new AttachedNetworkConnectionCollection(Client, Id)); + return GetCachedClient(client => new AttachedNetworkConnectionCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual AttachedNetworkConnectionCollection GetAttachedNetworkConnections /// /// The name of the attached NetworkConnection. /// The cancellation token to use. - /// 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> GetAttachedNetworkConnectionAsync(string attachedNetworkConnectionName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetAttach /// /// The name of the attached NetworkConnection. /// The cancellation token to use. - /// 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 GetAttachedNetworkConnection(string attachedNetworkConnectionName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetAttachedNetworkCon /// An object representing collection of DevCenterGalleryResources and their operations over a DevCenterGalleryResource. public virtual DevCenterGalleryCollection GetDevCenterGalleries() { - return GetCachedClient(Client => new DevCenterGalleryCollection(Client, Id)); + return GetCachedClient(client => new DevCenterGalleryCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual DevCenterGalleryCollection GetDevCenterGalleries() /// /// The name of the gallery. /// The cancellation token to use. - /// 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> GetDevCenterGalleryAsync(string galleryName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetDevCenterGaller /// /// The name of the gallery. /// The cancellation token to use. - /// 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 GetDevCenterGallery(string galleryName, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetDevCenterGallery(string gal /// An object representing collection of DevCenterCatalogResources and their operations over a DevCenterCatalogResource. public virtual DevCenterCatalogCollection GetDevCenterCatalogs() { - return GetCachedClient(Client => new DevCenterCatalogCollection(Client, Id)); + return GetCachedClient(client => new DevCenterCatalogCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual DevCenterCatalogCollection GetDevCenterCatalogs() /// /// The name of the Catalog. /// The cancellation token to use. - /// 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> GetDevCenterCatalogAsync(string catalogName, CancellationToken cancellationToken = default) { @@ -246,8 +246,8 @@ public virtual async Task> GetDevCenterCatalo /// /// The name of the Catalog. /// The cancellation token to use. - /// 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 GetDevCenterCatalog(string catalogName, CancellationToken cancellationToken = default) { @@ -258,7 +258,7 @@ public virtual Response GetDevCenterCatalog(string cat /// An object representing collection of DevCenterEnvironmentTypeResources and their operations over a DevCenterEnvironmentTypeResource. public virtual DevCenterEnvironmentTypeCollection GetDevCenterEnvironmentTypes() { - return GetCachedClient(Client => new DevCenterEnvironmentTypeCollection(Client, Id)); + return GetCachedClient(client => new DevCenterEnvironmentTypeCollection(client, Id)); } /// @@ -276,8 +276,8 @@ public virtual DevCenterEnvironmentTypeCollection GetDevCenterEnvironmentTypes() /// /// The name of the environment type. /// The cancellation token to use. - /// 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> GetDevCenterEnvironmentTypeAsync(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -299,8 +299,8 @@ public virtual async Task> GetDevCent /// /// The name of the environment type. /// The cancellation token to use. - /// 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 GetDevCenterEnvironmentType(string environmentTypeName, CancellationToken cancellationToken = default) { @@ -311,7 +311,7 @@ public virtual Response GetDevCenterEnvironmen /// An object representing collection of DevBoxDefinitionResources and their operations over a DevBoxDefinitionResource. public virtual DevBoxDefinitionCollection GetDevBoxDefinitions() { - return GetCachedClient(Client => new DevBoxDefinitionCollection(Client, Id)); + return GetCachedClient(client => new DevBoxDefinitionCollection(client, Id)); } /// @@ -329,8 +329,8 @@ public virtual DevBoxDefinitionCollection GetDevBoxDefinitions() /// /// The name of the Dev Box definition. /// The cancellation token to use. - /// 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> GetDevBoxDefinitionAsync(string devBoxDefinitionName, CancellationToken cancellationToken = default) { @@ -352,8 +352,8 @@ public virtual async Task> GetDevBoxDefinitio /// /// The name of the Dev Box definition. /// The cancellation token to use. - /// 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 GetDevBoxDefinition(string devBoxDefinitionName, CancellationToken cancellationToken = default) { diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterArmClientMockingExtension.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterArmClientMockingExtension.cs new file mode 100644 index 000000000000..8be8b1c235fb --- /dev/null +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterArmClientMockingExtension.cs @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DevCenter; + +namespace Azure.ResourceManager.DevCenter.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DevCenterArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DevCenterArmClientMockingExtension() + { + } + + /// 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 DevCenterArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DevCenterArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DevCenterResource GetDevCenterResource(ResourceIdentifier id) + { + DevCenterResource.ValidateResourceId(id); + return new DevCenterResource(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 DevCenterProjectResource GetDevCenterProjectResource(ResourceIdentifier id) + { + DevCenterProjectResource.ValidateResourceId(id); + return new DevCenterProjectResource(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 ProjectAttachedNetworkConnectionResource GetProjectAttachedNetworkConnectionResource(ResourceIdentifier id) + { + ProjectAttachedNetworkConnectionResource.ValidateResourceId(id); + return new ProjectAttachedNetworkConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AttachedNetworkConnectionResource GetAttachedNetworkConnectionResource(ResourceIdentifier id) + { + AttachedNetworkConnectionResource.ValidateResourceId(id); + return new AttachedNetworkConnectionResource(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 DevCenterGalleryResource GetDevCenterGalleryResource(ResourceIdentifier id) + { + DevCenterGalleryResource.ValidateResourceId(id); + return new DevCenterGalleryResource(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 DevCenterImageResource GetDevCenterImageResource(ResourceIdentifier id) + { + DevCenterImageResource.ValidateResourceId(id); + return new DevCenterImageResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ImageVersionResource GetImageVersionResource(ResourceIdentifier id) + { + ImageVersionResource.ValidateResourceId(id); + return new ImageVersionResource(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 DevCenterCatalogResource GetDevCenterCatalogResource(ResourceIdentifier id) + { + DevCenterCatalogResource.ValidateResourceId(id); + return new DevCenterCatalogResource(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 DevCenterEnvironmentTypeResource GetDevCenterEnvironmentTypeResource(ResourceIdentifier id) + { + DevCenterEnvironmentTypeResource.ValidateResourceId(id); + return new DevCenterEnvironmentTypeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AllowedEnvironmentTypeResource GetAllowedEnvironmentTypeResource(ResourceIdentifier id) + { + AllowedEnvironmentTypeResource.ValidateResourceId(id); + return new AllowedEnvironmentTypeResource(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 DevCenterProjectEnvironmentResource GetDevCenterProjectEnvironmentResource(ResourceIdentifier id) + { + DevCenterProjectEnvironmentResource.ValidateResourceId(id); + return new DevCenterProjectEnvironmentResource(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 DevBoxDefinitionResource GetDevBoxDefinitionResource(ResourceIdentifier id) + { + DevBoxDefinitionResource.ValidateResourceId(id); + return new DevBoxDefinitionResource(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 ProjectDevBoxDefinitionResource GetProjectDevBoxDefinitionResource(ResourceIdentifier id) + { + ProjectDevBoxDefinitionResource.ValidateResourceId(id); + return new ProjectDevBoxDefinitionResource(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 DevCenterPoolResource GetDevCenterPoolResource(ResourceIdentifier id) + { + DevCenterPoolResource.ValidateResourceId(id); + return new DevCenterPoolResource(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 DevCenterScheduleResource GetDevCenterScheduleResource(ResourceIdentifier id) + { + DevCenterScheduleResource.ValidateResourceId(id); + return new DevCenterScheduleResource(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 DevCenterNetworkConnectionResource GetDevCenterNetworkConnectionResource(ResourceIdentifier id) + { + DevCenterNetworkConnectionResource.ValidateResourceId(id); + return new DevCenterNetworkConnectionResource(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 HealthCheckStatusDetailResource GetHealthCheckStatusDetailResource(ResourceIdentifier id) + { + HealthCheckStatusDetailResource.ValidateResourceId(id); + return new HealthCheckStatusDetailResource(Client, id); + } + } +} diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterExtensions.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterExtensions.cs index d12b5fb44904..dc6ce4ba5a1a 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterExtensions.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DevCenter.Mocking; using Azure.ResourceManager.DevCenter.Models; using Azure.ResourceManager.Resources; @@ -19,366 +20,305 @@ namespace Azure.ResourceManager.DevCenter /// A class to add extension methods to Azure.ResourceManager.DevCenter. public static partial class DevCenterExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DevCenterArmClientMockingExtension GetDevCenterArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DevCenterArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DevCenterResourceGroupMockingExtension GetDevCenterResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DevCenterResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DevCenterSubscriptionMockingExtension GetDevCenterSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DevCenterSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DevCenterResource /// /// 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. /// Returns a object. public static DevCenterResource GetDevCenterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterResource.ValidateResourceId(id); - return new DevCenterResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterResource(id); } - #endregion - #region DevCenterProjectResource /// /// 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. /// Returns a object. public static DevCenterProjectResource GetDevCenterProjectResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterProjectResource.ValidateResourceId(id); - return new DevCenterProjectResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterProjectResource(id); } - #endregion - #region ProjectAttachedNetworkConnectionResource /// /// 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. /// Returns a object. public static ProjectAttachedNetworkConnectionResource GetProjectAttachedNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProjectAttachedNetworkConnectionResource.ValidateResourceId(id); - return new ProjectAttachedNetworkConnectionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetProjectAttachedNetworkConnectionResource(id); } - #endregion - #region AttachedNetworkConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AttachedNetworkConnectionResource GetAttachedNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AttachedNetworkConnectionResource.ValidateResourceId(id); - return new AttachedNetworkConnectionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetAttachedNetworkConnectionResource(id); } - #endregion - #region DevCenterGalleryResource /// /// 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. /// Returns a object. public static DevCenterGalleryResource GetDevCenterGalleryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterGalleryResource.ValidateResourceId(id); - return new DevCenterGalleryResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterGalleryResource(id); } - #endregion - #region DevCenterImageResource /// /// 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. /// Returns a object. public static DevCenterImageResource GetDevCenterImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterImageResource.ValidateResourceId(id); - return new DevCenterImageResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterImageResource(id); } - #endregion - #region ImageVersionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ImageVersionResource GetImageVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ImageVersionResource.ValidateResourceId(id); - return new ImageVersionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetImageVersionResource(id); } - #endregion - #region DevCenterCatalogResource /// /// 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. /// Returns a object. public static DevCenterCatalogResource GetDevCenterCatalogResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterCatalogResource.ValidateResourceId(id); - return new DevCenterCatalogResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterCatalogResource(id); } - #endregion - #region DevCenterEnvironmentTypeResource /// /// 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. /// Returns a object. public static DevCenterEnvironmentTypeResource GetDevCenterEnvironmentTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterEnvironmentTypeResource.ValidateResourceId(id); - return new DevCenterEnvironmentTypeResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterEnvironmentTypeResource(id); } - #endregion - #region AllowedEnvironmentTypeResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AllowedEnvironmentTypeResource GetAllowedEnvironmentTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AllowedEnvironmentTypeResource.ValidateResourceId(id); - return new AllowedEnvironmentTypeResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetAllowedEnvironmentTypeResource(id); } - #endregion - #region DevCenterProjectEnvironmentResource /// /// 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. /// Returns a object. public static DevCenterProjectEnvironmentResource GetDevCenterProjectEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterProjectEnvironmentResource.ValidateResourceId(id); - return new DevCenterProjectEnvironmentResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterProjectEnvironmentResource(id); } - #endregion - #region DevBoxDefinitionResource /// /// 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. /// Returns a object. public static DevBoxDefinitionResource GetDevBoxDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevBoxDefinitionResource.ValidateResourceId(id); - return new DevBoxDefinitionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevBoxDefinitionResource(id); } - #endregion - #region ProjectDevBoxDefinitionResource /// /// 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. /// Returns a object. public static ProjectDevBoxDefinitionResource GetProjectDevBoxDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProjectDevBoxDefinitionResource.ValidateResourceId(id); - return new ProjectDevBoxDefinitionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetProjectDevBoxDefinitionResource(id); } - #endregion - #region DevCenterPoolResource /// /// 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. /// Returns a object. public static DevCenterPoolResource GetDevCenterPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterPoolResource.ValidateResourceId(id); - return new DevCenterPoolResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterPoolResource(id); } - #endregion - #region DevCenterScheduleResource /// /// 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. /// Returns a object. public static DevCenterScheduleResource GetDevCenterScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterScheduleResource.ValidateResourceId(id); - return new DevCenterScheduleResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterScheduleResource(id); } - #endregion - #region DevCenterNetworkConnectionResource /// /// 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. /// Returns a object. public static DevCenterNetworkConnectionResource GetDevCenterNetworkConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevCenterNetworkConnectionResource.ValidateResourceId(id); - return new DevCenterNetworkConnectionResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetDevCenterNetworkConnectionResource(id); } - #endregion - #region HealthCheckStatusDetailResource /// /// 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. /// Returns a object. public static HealthCheckStatusDetailResource GetHealthCheckStatusDetailResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthCheckStatusDetailResource.ValidateResourceId(id); - return new HealthCheckStatusDetailResource(client, id); - } - ); + return GetDevCenterArmClientMockingExtension(client).GetHealthCheckStatusDetailResource(id); } - #endregion - /// Gets a collection of DevCenterResources in the ResourceGroupResource. + /// + /// Gets a collection of DevCenterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DevCenterResources and their operations over a DevCenterResource. public static DevCenterCollection GetDevCenters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDevCenters(); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenters(); } /// @@ -393,16 +333,20 @@ public static DevCenterCollection GetDevCenters(this ResourceGroupResource resou /// DevCenters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the devcenter. /// The cancellation token to use. - /// 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 static async Task> GetDevCenterAsync(this ResourceGroupResource resourceGroupResource, string devCenterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDevCenters().GetAsync(devCenterName, cancellationToken).ConfigureAwait(false); + return await GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterAsync(devCenterName, cancellationToken).ConfigureAwait(false); } /// @@ -417,24 +361,34 @@ public static async Task> GetDevCenterAsync(this Res /// DevCenters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the devcenter. /// The cancellation token to use. - /// 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 static Response GetDevCenter(this ResourceGroupResource resourceGroupResource, string devCenterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDevCenters().Get(devCenterName, cancellationToken); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenter(devCenterName, cancellationToken); } - /// Gets a collection of DevCenterProjectResources in the ResourceGroupResource. + /// + /// Gets a collection of DevCenterProjectResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DevCenterProjectResources and their operations over a DevCenterProjectResource. public static DevCenterProjectCollection GetDevCenterProjects(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDevCenterProjects(); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterProjects(); } /// @@ -449,16 +403,20 @@ public static DevCenterProjectCollection GetDevCenterProjects(this ResourceGroup /// Projects_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the project. /// The cancellation token to use. - /// 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 static async Task> GetDevCenterProjectAsync(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDevCenterProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + return await GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterProjectAsync(projectName, cancellationToken).ConfigureAwait(false); } /// @@ -473,24 +431,34 @@ public static async Task> GetDevCenterProject /// Projects_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the project. /// The cancellation token to use. - /// 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 static Response GetDevCenterProject(this ResourceGroupResource resourceGroupResource, string projectName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDevCenterProjects().Get(projectName, cancellationToken); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterProject(projectName, cancellationToken); } - /// Gets a collection of DevCenterNetworkConnectionResources in the ResourceGroupResource. + /// + /// Gets a collection of DevCenterNetworkConnectionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DevCenterNetworkConnectionResources and their operations over a DevCenterNetworkConnectionResource. public static DevCenterNetworkConnectionCollection GetDevCenterNetworkConnections(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDevCenterNetworkConnections(); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterNetworkConnections(); } /// @@ -505,16 +473,20 @@ public static DevCenterNetworkConnectionCollection GetDevCenterNetworkConnection /// NetworkConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Connection that can be applied to a Pool. /// The cancellation token to use. - /// 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 static async Task> GetDevCenterNetworkConnectionAsync(this ResourceGroupResource resourceGroupResource, string networkConnectionName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDevCenterNetworkConnections().GetAsync(networkConnectionName, cancellationToken).ConfigureAwait(false); + return await GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterNetworkConnectionAsync(networkConnectionName, cancellationToken).ConfigureAwait(false); } /// @@ -529,16 +501,20 @@ public static async Task> GetDevCen /// NetworkConnections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Network Connection that can be applied to a Pool. /// The cancellation token to use. - /// 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 static Response GetDevCenterNetworkConnection(this ResourceGroupResource resourceGroupResource, string networkConnectionName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDevCenterNetworkConnections().Get(networkConnectionName, cancellationToken); + return GetDevCenterResourceGroupMockingExtension(resourceGroupResource).GetDevCenterNetworkConnection(networkConnectionName, cancellationToken); } /// @@ -553,6 +529,10 @@ public static Response GetDevCenterNetworkCo /// DevCenters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -560,7 +540,7 @@ public static Response GetDevCenterNetworkCo /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevCentersAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCentersAsync(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCentersAsync(top, cancellationToken); } /// @@ -575,6 +555,10 @@ public static AsyncPageable GetDevCentersAsync(this Subscript /// DevCenters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -582,7 +566,7 @@ public static AsyncPageable GetDevCentersAsync(this Subscript /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevCenters(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenters(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenters(top, cancellationToken); } /// @@ -597,6 +581,10 @@ public static Pageable GetDevCenters(this SubscriptionResourc /// Projects_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -604,7 +592,7 @@ public static Pageable GetDevCenters(this SubscriptionResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevCenterProjectsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterProjectsAsync(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterProjectsAsync(top, cancellationToken); } /// @@ -619,6 +607,10 @@ public static AsyncPageable GetDevCenterProjectsAsync( /// Projects_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -626,7 +618,7 @@ public static AsyncPageable GetDevCenterProjectsAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevCenterProjects(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterProjects(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterProjects(top, cancellationToken); } /// @@ -641,6 +633,10 @@ public static Pageable GetDevCenterProjects(this Subsc /// OperationStatuses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region. @@ -650,9 +646,7 @@ public static Pageable GetDevCenterProjects(this Subsc /// is null. public static async Task> GetDevCenterOperationStatusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterOperationStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); + return await GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterOperationStatusAsync(location, operationId, cancellationToken).ConfigureAwait(false); } /// @@ -667,6 +661,10 @@ public static async Task> GetDevCenterOperati /// OperationStatuses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region. @@ -676,9 +674,7 @@ public static async Task> GetDevCenterOperati /// is null. public static Response GetDevCenterOperationStatus(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterOperationStatus(location, operationId, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterOperationStatus(location, operationId, cancellationToken); } /// @@ -693,6 +689,10 @@ public static Response GetDevCenterOperationStatus(thi /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region. @@ -700,7 +700,7 @@ public static Response GetDevCenterOperationStatus(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevCenterUsagesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterUsagesByLocationAsync(location, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterUsagesByLocationAsync(location, cancellationToken); } /// @@ -715,6 +715,10 @@ public static AsyncPageable GetDevCenterUsagesByLocationAsync(th /// Usages_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure region. @@ -722,7 +726,7 @@ public static AsyncPageable GetDevCenterUsagesByLocationAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevCenterUsagesByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterUsagesByLocation(location, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterUsagesByLocation(location, cancellationToken); } /// @@ -737,6 +741,10 @@ public static Pageable GetDevCenterUsagesByLocation(this Subscri /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -744,9 +752,7 @@ public static Pageable GetDevCenterUsagesByLocation(this Subscri /// is null. public static async Task> CheckDevCenterNameAvailabilityAsync(this SubscriptionResource subscriptionResource, DevCenterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDevCenterNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetDevCenterSubscriptionMockingExtension(subscriptionResource).CheckDevCenterNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -761,6 +767,10 @@ public static async Task> CheckDevCent /// CheckNameAvailability_Execute /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if resource name is available. @@ -768,9 +778,7 @@ public static async Task> CheckDevCent /// is null. public static Response CheckDevCenterNameAvailability(this SubscriptionResource subscriptionResource, DevCenterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDevCenterNameAvailability(content, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).CheckDevCenterNameAvailability(content, cancellationToken); } /// @@ -785,6 +793,10 @@ public static Response CheckDevCenterNameAvaila /// Skus_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -792,7 +804,7 @@ public static Response CheckDevCenterNameAvaila /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevCenterSkusBySubscriptionAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterSkusBySubscriptionAsync(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterSkusBySubscriptionAsync(top, cancellationToken); } /// @@ -807,6 +819,10 @@ public static AsyncPageable GetDevCenterSkusBySubscriptionA /// Skus_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -814,7 +830,7 @@ public static AsyncPageable GetDevCenterSkusBySubscriptionA /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevCenterSkusBySubscription(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterSkusBySubscription(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterSkusBySubscription(top, cancellationToken); } /// @@ -829,6 +845,10 @@ public static Pageable GetDevCenterSkusBySubscription(this /// NetworkConnections_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -836,7 +856,7 @@ public static Pageable GetDevCenterSkusBySubscription(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevCenterNetworkConnectionsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterNetworkConnectionsAsync(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterNetworkConnectionsAsync(top, cancellationToken); } /// @@ -851,6 +871,10 @@ public static AsyncPageable GetDevCenterNetw /// NetworkConnections_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of resources to return from the operation. Example: '$top=10'. @@ -858,7 +882,7 @@ public static AsyncPageable GetDevCenterNetw /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevCenterNetworkConnections(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevCenterNetworkConnections(top, cancellationToken); + return GetDevCenterSubscriptionMockingExtension(subscriptionResource).GetDevCenterNetworkConnections(top, cancellationToken); } } } diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterResourceGroupMockingExtension.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..0a0f71434fad --- /dev/null +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterResourceGroupMockingExtension.cs @@ -0,0 +1,198 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DevCenter; + +namespace Azure.ResourceManager.DevCenter.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DevCenterResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DevCenterResourceGroupMockingExtension() + { + } + + /// 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 DevCenterResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DevCenterResources in the ResourceGroupResource. + /// An object representing collection of DevCenterResources and their operations over a DevCenterResource. + public virtual DevCenterCollection GetDevCenters() + { + return GetCachedClient(client => new DevCenterCollection(client, Id)); + } + + /// + /// Gets a devcenter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName} + /// + /// + /// Operation Id + /// DevCenters_Get + /// + /// + /// + /// The name of the devcenter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDevCenterAsync(string devCenterName, CancellationToken cancellationToken = default) + { + return await GetDevCenters().GetAsync(devCenterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a devcenter. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName} + /// + /// + /// Operation Id + /// DevCenters_Get + /// + /// + /// + /// The name of the devcenter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDevCenter(string devCenterName, CancellationToken cancellationToken = default) + { + return GetDevCenters().Get(devCenterName, cancellationToken); + } + + /// Gets a collection of DevCenterProjectResources in the ResourceGroupResource. + /// An object representing collection of DevCenterProjectResources and their operations over a DevCenterProjectResource. + public virtual DevCenterProjectCollection GetDevCenterProjects() + { + return GetCachedClient(client => new DevCenterProjectCollection(client, Id)); + } + + /// + /// Gets a specific project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// + /// The name of the project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDevCenterProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + return await GetDevCenterProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a specific project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// + /// The name of the project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDevCenterProject(string projectName, CancellationToken cancellationToken = default) + { + return GetDevCenterProjects().Get(projectName, cancellationToken); + } + + /// Gets a collection of DevCenterNetworkConnectionResources in the ResourceGroupResource. + /// An object representing collection of DevCenterNetworkConnectionResources and their operations over a DevCenterNetworkConnectionResource. + public virtual DevCenterNetworkConnectionCollection GetDevCenterNetworkConnections() + { + return GetCachedClient(client => new DevCenterNetworkConnectionCollection(client, Id)); + } + + /// + /// Gets a network connection resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName} + /// + /// + /// Operation Id + /// NetworkConnections_Get + /// + /// + /// + /// Name of the Network Connection that can be applied to a Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDevCenterNetworkConnectionAsync(string networkConnectionName, CancellationToken cancellationToken = default) + { + return await GetDevCenterNetworkConnections().GetAsync(networkConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a network connection resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName} + /// + /// + /// Operation Id + /// NetworkConnections_Get + /// + /// + /// + /// Name of the Network Connection that can be applied to a Pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDevCenterNetworkConnection(string networkConnectionName, CancellationToken cancellationToken = default) + { + return GetDevCenterNetworkConnections().Get(networkConnectionName, cancellationToken); + } + } +} diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterSubscriptionMockingExtension.cs similarity index 88% rename from sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterSubscriptionMockingExtension.cs index 817beb45dc0b..639bcf1384e6 100644 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/DevCenterSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DevCenter; using Azure.ResourceManager.DevCenter.Models; -namespace Azure.ResourceManager.DevCenter +namespace Azure.ResourceManager.DevCenter.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DevCenterSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _devCenterClientDiagnostics; private DevCentersRestOperations _devCenterRestClient; @@ -35,15 +36,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _devCenterNetworkConnectionNetworkConnectionsClientDiagnostics; private NetworkConnectionsRestOperations _devCenterNetworkConnectionNetworkConnectionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DevCenterSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DevCenterSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -88,7 +89,7 @@ public virtual AsyncPageable GetDevCentersAsync(int? top = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterResource(Client, DevCenterData.DeserializeDevCenterData(e)), DevCenterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterResource(Client, DevCenterData.DeserializeDevCenterData(e)), DevCenterClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenters", "value", "nextLink", cancellationToken); } /// @@ -111,7 +112,7 @@ public virtual Pageable GetDevCenters(int? top = null, Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterResource(Client, DevCenterData.DeserializeDevCenterData(e)), DevCenterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterResource(Client, DevCenterData.DeserializeDevCenterData(e)), DevCenterClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenters", "value", "nextLink", cancellationToken); } /// @@ -134,7 +135,7 @@ public virtual AsyncPageable GetDevCenterProjectsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterProjectProjectsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterProjectProjectsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterProjectResource(Client, DevCenterProjectData.DeserializeDevCenterProjectData(e)), DevCenterProjectProjectsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterProjects", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterProjectResource(Client, DevCenterProjectData.DeserializeDevCenterProjectData(e)), DevCenterProjectProjectsClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterProjects", "value", "nextLink", cancellationToken); } /// @@ -157,7 +158,7 @@ public virtual Pageable GetDevCenterProjects(int? top { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterProjectProjectsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterProjectProjectsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterProjectResource(Client, DevCenterProjectData.DeserializeDevCenterProjectData(e)), DevCenterProjectProjectsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterProjects", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterProjectResource(Client, DevCenterProjectData.DeserializeDevCenterProjectData(e)), DevCenterProjectProjectsClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterProjects", "value", "nextLink", cancellationToken); } /// @@ -176,9 +177,13 @@ public virtual Pageable GetDevCenterProjects(int? top /// The Azure region. /// The ID of an ongoing async operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetDevCenterOperationStatusAsync(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = OperationStatusesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDevCenterOperationStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationStatusesClientDiagnostics.CreateScope("DevCenterSubscriptionMockingExtension.GetDevCenterOperationStatus"); scope.Start(); try { @@ -208,9 +213,13 @@ public virtual async Task> GetDevCenterOperat /// The Azure region. /// The ID of an ongoing async operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetDevCenterOperationStatus(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - using var scope = OperationStatusesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDevCenterOperationStatus"); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationStatusesClientDiagnostics.CreateScope("DevCenterSubscriptionMockingExtension.GetDevCenterOperationStatus"); scope.Start(); try { @@ -244,7 +253,7 @@ public virtual AsyncPageable GetDevCenterUsagesByLocationAsync(A { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DevCenterUsage.DeserializeDevCenterUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterUsagesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DevCenterUsage.DeserializeDevCenterUsage, UsagesClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterUsagesByLocation", "value", "nextLink", cancellationToken); } /// @@ -267,7 +276,7 @@ public virtual Pageable GetDevCenterUsagesByLocation(AzureLocati { HttpMessage FirstPageRequest(int? pageSizeHint) => UsagesRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsagesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DevCenterUsage.DeserializeDevCenterUsage, UsagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterUsagesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DevCenterUsage.DeserializeDevCenterUsage, UsagesClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterUsagesByLocation", "value", "nextLink", cancellationToken); } /// @@ -285,9 +294,12 @@ public virtual Pageable GetDevCenterUsagesByLocation(AzureLocati /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDevCenterNameAvailabilityAsync(DevCenterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDevCenterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("DevCenterSubscriptionMockingExtension.CheckDevCenterNameAvailability"); scope.Start(); try { @@ -316,9 +328,12 @@ public virtual async Task> CheckDevCen /// /// The required parameters for checking if resource name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckDevCenterNameAvailability(DevCenterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDevCenterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("DevCenterSubscriptionMockingExtension.CheckDevCenterNameAvailability"); scope.Start(); try { @@ -352,7 +367,7 @@ public virtual AsyncPageable GetDevCenterSkusBySubscription { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DevCenterSkuDetails.DeserializeDevCenterSkuDetails, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterSkusBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DevCenterSkuDetails.DeserializeDevCenterSkuDetails, SkusClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterSkusBySubscription", "value", "nextLink", cancellationToken); } /// @@ -375,7 +390,7 @@ public virtual Pageable GetDevCenterSkusBySubscription(int? { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SkusRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DevCenterSkuDetails.DeserializeDevCenterSkuDetails, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterSkusBySubscription", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DevCenterSkuDetails.DeserializeDevCenterSkuDetails, SkusClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterSkusBySubscription", "value", "nextLink", cancellationToken); } /// @@ -398,7 +413,7 @@ public virtual AsyncPageable GetDevCenterNet { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterNetworkConnectionNetworkConnectionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterNetworkConnectionNetworkConnectionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterNetworkConnectionResource(Client, DevCenterNetworkConnectionData.DeserializeDevCenterNetworkConnectionData(e)), DevCenterNetworkConnectionNetworkConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterNetworkConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterNetworkConnectionResource(Client, DevCenterNetworkConnectionData.DeserializeDevCenterNetworkConnectionData(e)), DevCenterNetworkConnectionNetworkConnectionsClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterNetworkConnections", "value", "nextLink", cancellationToken); } /// @@ -421,7 +436,7 @@ public virtual Pageable GetDevCenterNetworkC { HttpMessage FirstPageRequest(int? pageSizeHint) => DevCenterNetworkConnectionNetworkConnectionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevCenterNetworkConnectionNetworkConnectionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterNetworkConnectionResource(Client, DevCenterNetworkConnectionData.DeserializeDevCenterNetworkConnectionData(e)), DevCenterNetworkConnectionNetworkConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevCenterNetworkConnections", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterNetworkConnectionResource(Client, DevCenterNetworkConnectionData.DeserializeDevCenterNetworkConnectionData(e)), DevCenterNetworkConnectionNetworkConnectionsClientDiagnostics, Pipeline, "DevCenterSubscriptionMockingExtension.GetDevCenterNetworkConnections", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 0bb4b529cc26..000000000000 --- a/sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DevCenter -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DevCenterResources in the ResourceGroupResource. - /// An object representing collection of DevCenterResources and their operations over a DevCenterResource. - public virtual DevCenterCollection GetDevCenters() - { - return GetCachedClient(Client => new DevCenterCollection(Client, Id)); - } - - /// Gets a collection of DevCenterProjectResources in the ResourceGroupResource. - /// An object representing collection of DevCenterProjectResources and their operations over a DevCenterProjectResource. - public virtual DevCenterProjectCollection GetDevCenterProjects() - { - return GetCachedClient(Client => new DevCenterProjectCollection(Client, Id)); - } - - /// Gets a collection of DevCenterNetworkConnectionResources in the ResourceGroupResource. - /// An object representing collection of DevCenterNetworkConnectionResources and their operations over a DevCenterNetworkConnectionResource. - public virtual DevCenterNetworkConnectionCollection GetDevCenterNetworkConnections() - { - return GetCachedClient(Client => new DevCenterNetworkConnectionCollection(Client, Id)); - } - } -} diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs index 34fbfe674902..6df96443cb88 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/DeviceProvisioningServiceResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DeviceProvisioningServicesCertificateResources and their operations over a DeviceProvisioningServicesCertificateResource. public virtual DeviceProvisioningServicesCertificateCollection GetDeviceProvisioningServicesCertificates() { - return GetCachedClient(Client => new DeviceProvisioningServicesCertificateCollection(Client, Id)); + return GetCachedClient(client => new DeviceProvisioningServicesCertificateCollection(client, Id)); } /// @@ -113,8 +113,8 @@ public virtual DeviceProvisioningServicesCertificateCollection GetDeviceProvisio /// Name of the certificate to retrieve. /// ETag of the certificate. /// The cancellation token to use. - /// 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> GetDeviceProvisioningServicesCertificateAsync(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task Name of the certificate to retrieve. /// ETag of the certificate. /// The cancellation token to use. - /// 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 GetDeviceProvisioningServicesCertificate(string certificateName, string ifMatch = null, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetDevice /// An object representing collection of DeviceProvisioningServicesPrivateLinkResources and their operations over a DeviceProvisioningServicesPrivateLinkResource. public virtual DeviceProvisioningServicesPrivateLinkResourceCollection GetDeviceProvisioningServicesPrivateLinkResources() { - return GetCachedClient(Client => new DeviceProvisioningServicesPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new DeviceProvisioningServicesPrivateLinkResourceCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual DeviceProvisioningServicesPrivateLinkResourceCollection GetDevice /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetDeviceProvisioningServicesPrivateLinkResourceAsync(string groupId, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetDeviceProvisioningServicesPrivateLinkResource(string groupId, CancellationToken cancellationToken = default) { @@ -202,7 +202,7 @@ public virtual Response GetDevice /// An object representing collection of DeviceProvisioningServicesPrivateEndpointConnectionResources and their operations over a DeviceProvisioningServicesPrivateEndpointConnectionResource. public virtual DeviceProvisioningServicesPrivateEndpointConnectionCollection GetDeviceProvisioningServicesPrivateEndpointConnections() { - return GetCachedClient(Client => new DeviceProvisioningServicesPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new DeviceProvisioningServicesPrivateEndpointConnectionCollection(client, Id)); } /// @@ -220,8 +220,8 @@ public virtual DeviceProvisioningServicesPrivateEndpointConnectionCollection Get /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetDeviceProvisioningServicesPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -243,8 +243,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetDeviceProvisioningServicesPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesArmClientMockingExtension.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..22e79b755037 --- /dev/null +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DeviceProvisioningServices; + +namespace Azure.ResourceManager.DeviceProvisioningServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DeviceProvisioningServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DeviceProvisioningServicesArmClientMockingExtension() + { + } + + /// 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 DeviceProvisioningServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DeviceProvisioningServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(ResourceIdentifier id) + { + DeviceProvisioningServicesCertificateResource.ValidateResourceId(id); + return new DeviceProvisioningServicesCertificateResource(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 DeviceProvisioningServiceResource GetDeviceProvisioningServiceResource(ResourceIdentifier id) + { + DeviceProvisioningServiceResource.ValidateResourceId(id); + return new DeviceProvisioningServiceResource(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 DeviceProvisioningServicesPrivateLinkResource GetDeviceProvisioningServicesPrivateLinkResource(ResourceIdentifier id) + { + DeviceProvisioningServicesPrivateLinkResource.ValidateResourceId(id); + return new DeviceProvisioningServicesPrivateLinkResource(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 DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DeviceProvisioningServicesPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DeviceProvisioningServicesPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs index 68c9a1fa75b4..2e873b800ba6 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DeviceProvisioningServices.Mocking; using Azure.ResourceManager.DeviceProvisioningServices.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.DeviceProvisioningServices /// A class to add extension methods to Azure.ResourceManager.DeviceProvisioningServices. public static partial class DeviceProvisioningServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DeviceProvisioningServicesArmClientMockingExtension GetDeviceProvisioningServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DeviceProvisioningServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DeviceProvisioningServicesResourceGroupMockingExtension GetDeviceProvisioningServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DeviceProvisioningServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DeviceProvisioningServicesSubscriptionMockingExtension GetDeviceProvisioningServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DeviceProvisioningServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DeviceProvisioningServicesCertificateResource /// /// 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. /// Returns a object. public static DeviceProvisioningServicesCertificateResource GetDeviceProvisioningServicesCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceProvisioningServicesCertificateResource.ValidateResourceId(id); - return new DeviceProvisioningServicesCertificateResource(client, id); - } - ); + return GetDeviceProvisioningServicesArmClientMockingExtension(client).GetDeviceProvisioningServicesCertificateResource(id); } - #endregion - #region DeviceProvisioningServiceResource /// /// 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. /// Returns a object. public static DeviceProvisioningServiceResource GetDeviceProvisioningServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceProvisioningServiceResource.ValidateResourceId(id); - return new DeviceProvisioningServiceResource(client, id); - } - ); + return GetDeviceProvisioningServicesArmClientMockingExtension(client).GetDeviceProvisioningServiceResource(id); } - #endregion - #region DeviceProvisioningServicesPrivateLinkResource /// /// 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. /// Returns a object. public static DeviceProvisioningServicesPrivateLinkResource GetDeviceProvisioningServicesPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceProvisioningServicesPrivateLinkResource.ValidateResourceId(id); - return new DeviceProvisioningServicesPrivateLinkResource(client, id); - } - ); + return GetDeviceProvisioningServicesArmClientMockingExtension(client).GetDeviceProvisioningServicesPrivateLinkResource(id); } - #endregion - #region DeviceProvisioningServicesPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static DeviceProvisioningServicesPrivateEndpointConnectionResource GetDeviceProvisioningServicesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceProvisioningServicesPrivateEndpointConnectionResource.ValidateResourceId(id); - return new DeviceProvisioningServicesPrivateEndpointConnectionResource(client, id); - } - ); + return GetDeviceProvisioningServicesArmClientMockingExtension(client).GetDeviceProvisioningServicesPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of DeviceProvisioningServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of DeviceProvisioningServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeviceProvisioningServiceResources and their operations over a DeviceProvisioningServiceResource. public static DeviceProvisioningServiceCollection GetDeviceProvisioningServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDeviceProvisioningServices(); + return GetDeviceProvisioningServicesResourceGroupMockingExtension(resourceGroupResource).GetDeviceProvisioningServices(); } /// @@ -146,16 +125,20 @@ public static DeviceProvisioningServiceCollection GetDeviceProvisioningServices( /// IotDpsResource_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// 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 static async Task> GetDeviceProvisioningServiceAsync(this ResourceGroupResource resourceGroupResource, string provisioningServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDeviceProvisioningServices().GetAsync(provisioningServiceName, cancellationToken).ConfigureAwait(false); + return await GetDeviceProvisioningServicesResourceGroupMockingExtension(resourceGroupResource).GetDeviceProvisioningServiceAsync(provisioningServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetDeviceP /// IotDpsResource_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the provisioning service to retrieve. /// The cancellation token to use. - /// 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 static Response GetDeviceProvisioningService(this ResourceGroupResource resourceGroupResource, string provisioningServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDeviceProvisioningServices().Get(provisioningServiceName, cancellationToken); + return GetDeviceProvisioningServicesResourceGroupMockingExtension(resourceGroupResource).GetDeviceProvisioningService(provisioningServiceName, cancellationToken); } /// @@ -194,13 +181,17 @@ public static Response GetDeviceProvisioningS /// IotDpsResource_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeviceProvisioningServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeviceProvisioningServicesAsync(cancellationToken); + return GetDeviceProvisioningServicesSubscriptionMockingExtension(subscriptionResource).GetDeviceProvisioningServicesAsync(cancellationToken); } /// @@ -215,13 +206,17 @@ public static AsyncPageable GetDeviceProvisio /// IotDpsResource_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeviceProvisioningServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeviceProvisioningServices(cancellationToken); + return GetDeviceProvisioningServicesSubscriptionMockingExtension(subscriptionResource).GetDeviceProvisioningServices(cancellationToken); } /// @@ -236,6 +231,10 @@ public static Pageable GetDeviceProvisioningS /// IotDpsResource_CheckProvisioningServiceNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. @@ -243,9 +242,7 @@ public static Pageable GetDeviceProvisioningS /// is null. public static async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDeviceProvisioningServicesNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetDeviceProvisioningServicesSubscriptionMockingExtension(subscriptionResource).CheckDeviceProvisioningServicesNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -260,6 +257,10 @@ public static async TaskIotDpsResource_CheckProvisioningServiceNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. @@ -267,9 +268,7 @@ public static async Task is null. public static Response CheckDeviceProvisioningServicesNameAvailability(this SubscriptionResource subscriptionResource, DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDeviceProvisioningServicesNameAvailability(content, cancellationToken); + return GetDeviceProvisioningServicesSubscriptionMockingExtension(subscriptionResource).CheckDeviceProvisioningServicesNameAvailability(content, cancellationToken); } } } diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesResourceGroupMockingExtension.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..168d759f745d --- /dev/null +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DeviceProvisioningServices; + +namespace Azure.ResourceManager.DeviceProvisioningServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DeviceProvisioningServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DeviceProvisioningServicesResourceGroupMockingExtension() + { + } + + /// 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 DeviceProvisioningServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DeviceProvisioningServiceResources in the ResourceGroupResource. + /// An object representing collection of DeviceProvisioningServiceResources and their operations over a DeviceProvisioningServiceResource. + public virtual DeviceProvisioningServiceCollection GetDeviceProvisioningServices() + { + return GetCachedClient(client => new DeviceProvisioningServiceCollection(client, Id)); + } + + /// + /// Get the metadata of the provisioning service without SAS keys. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName} + /// + /// + /// Operation Id + /// IotDpsResource_Get + /// + /// + /// + /// Name of the provisioning service to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceProvisioningServiceAsync(string provisioningServiceName, CancellationToken cancellationToken = default) + { + return await GetDeviceProvisioningServices().GetAsync(provisioningServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the metadata of the provisioning service without SAS keys. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName} + /// + /// + /// Operation Id + /// IotDpsResource_Get + /// + /// + /// + /// Name of the provisioning service to retrieve. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceProvisioningService(string provisioningServiceName, CancellationToken cancellationToken = default) + { + return GetDeviceProvisioningServices().Get(provisioningServiceName, cancellationToken); + } + } +} diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesSubscriptionMockingExtension.cs similarity index 84% rename from sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesSubscriptionMockingExtension.cs index b4f5af9fcacf..3db5d282e47f 100644 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/DeviceProvisioningServicesSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DeviceProvisioningServices; using Azure.ResourceManager.DeviceProvisioningServices.Models; -namespace Azure.ResourceManager.DeviceProvisioningServices +namespace Azure.ResourceManager.DeviceProvisioningServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DeviceProvisioningServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _deviceProvisioningServiceIotDpsResourceClientDiagnostics; private IotDpsResourceRestOperations _deviceProvisioningServiceIotDpsResourceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DeviceProvisioningServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeviceProvisioningServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetDeviceProvisi { HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServicesSubscriptionMockingExtension.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetDeviceProvisioning { HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceProvisioningServiceIotDpsResourceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceProvisioningServiceResource(Client, DeviceProvisioningServiceData.DeserializeDeviceProvisioningServiceData(e)), DeviceProvisioningServiceIotDpsResourceClientDiagnostics, Pipeline, "DeviceProvisioningServicesSubscriptionMockingExtension.GetDeviceProvisioningServices", "value", "nextLink", cancellationToken); } /// @@ -103,9 +104,12 @@ public virtual Pageable GetDeviceProvisioning /// /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDeviceProvisioningServicesNameAvailabilityAsync(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDeviceProvisioningServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServicesSubscriptionMockingExtension.CheckDeviceProvisioningServicesNameAvailability"); scope.Start(); try { @@ -134,9 +138,12 @@ public virtual async Task /// Set the name parameter in the OperationInputs structure to the name of the provisioning service to check. /// The cancellation token to use. + /// is null. public virtual Response CheckDeviceProvisioningServicesNameAvailability(DeviceProvisioningServicesNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDeviceProvisioningServicesNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DeviceProvisioningServiceIotDpsResourceClientDiagnostics.CreateScope("DeviceProvisioningServicesSubscriptionMockingExtension.CheckDeviceProvisioningServicesNameAvailability"); scope.Start(); try { diff --git a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 1edaa3a07901..000000000000 --- a/sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DeviceProvisioningServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DeviceProvisioningServiceResources in the ResourceGroupResource. - /// An object representing collection of DeviceProvisioningServiceResources and their operations over a DeviceProvisioningServiceResource. - public virtual DeviceProvisioningServiceCollection GetDeviceProvisioningServices() - { - return GetCachedClient(Client => new DeviceProvisioningServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/DeviceUpdateAccountResource.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/DeviceUpdateAccountResource.cs index 5a749c13bdd2..bcc0835ed762 100644 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/DeviceUpdateAccountResource.cs +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/DeviceUpdateAccountResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DeviceUpdateInstanceResources and their operations over a DeviceUpdateInstanceResource. public virtual DeviceUpdateInstanceCollection GetDeviceUpdateInstances() { - return GetCachedClient(Client => new DeviceUpdateInstanceCollection(Client, Id)); + return GetCachedClient(client => new DeviceUpdateInstanceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DeviceUpdateInstanceCollection GetDeviceUpdateInstances() /// /// Instance name. /// The cancellation token to use. - /// 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> GetDeviceUpdateInstanceAsync(string instanceName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDeviceUpdat /// /// Instance name. /// The cancellation token to use. - /// 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 GetDeviceUpdateInstance(string instanceName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDeviceUpdateInstance(st /// An object representing collection of DeviceUpdatePrivateEndpointConnectionResources and their operations over a DeviceUpdatePrivateEndpointConnectionResource. public virtual DeviceUpdatePrivateEndpointConnectionCollection GetDeviceUpdatePrivateEndpointConnections() { - return GetCachedClient(Client => new DeviceUpdatePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new DeviceUpdatePrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DeviceUpdatePrivateEndpointConnectionCollection GetDeviceUpdatePr /// /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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> GetDeviceUpdatePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// 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 GetDeviceUpdatePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetDevice /// An object representing collection of PrivateLinkResources and their operations over a PrivateLinkResource. public virtual PrivateLinkCollection GetPrivateLinks() { - return GetCachedClient(Client => new PrivateLinkCollection(Client, Id)); + return GetCachedClient(client => new PrivateLinkCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual PrivateLinkCollection GetPrivateLinks() /// /// The group ID of the private link resource. /// The cancellation token to use. - /// 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> GetPrivateLinkAsync(string groupId, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetPrivateLinkAsync(str /// /// The group ID of the private link resource. /// The cancellation token to use. - /// 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 GetPrivateLink(string groupId, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetPrivateLink(string groupId, Canc /// An object representing collection of PrivateEndpointConnectionProxyResources and their operations over a PrivateEndpointConnectionProxyResource. public virtual PrivateEndpointConnectionProxyCollection GetPrivateEndpointConnectionProxies() { - return GetCachedClient(Client => new PrivateEndpointConnectionProxyCollection(Client, Id)); + return GetCachedClient(client => new PrivateEndpointConnectionProxyCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual PrivateEndpointConnectionProxyCollection GetPrivateEndpointConnec /// /// The ID of the private endpoint connection proxy object. /// The cancellation token to use. - /// 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> GetPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyId, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetP /// /// The ID of the private endpoint connection proxy object. /// The cancellation token to use. - /// 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 GetPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyId, CancellationToken cancellationToken = default) { diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateArmClientMockingExtension.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateArmClientMockingExtension.cs new file mode 100644 index 000000000000..e7718a1937e7 --- /dev/null +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DeviceUpdate; + +namespace Azure.ResourceManager.DeviceUpdate.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DeviceUpdateArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DeviceUpdateArmClientMockingExtension() + { + } + + /// 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 DeviceUpdateArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DeviceUpdateArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeviceUpdateAccountResource GetDeviceUpdateAccountResource(ResourceIdentifier id) + { + DeviceUpdateAccountResource.ValidateResourceId(id); + return new DeviceUpdateAccountResource(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 DeviceUpdateInstanceResource GetDeviceUpdateInstanceResource(ResourceIdentifier id) + { + DeviceUpdateInstanceResource.ValidateResourceId(id); + return new DeviceUpdateInstanceResource(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 DeviceUpdatePrivateEndpointConnectionResource GetDeviceUpdatePrivateEndpointConnectionResource(ResourceIdentifier id) + { + DeviceUpdatePrivateEndpointConnectionResource.ValidateResourceId(id); + return new DeviceUpdatePrivateEndpointConnectionResource(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 PrivateLinkResource GetPrivateLinkResource(ResourceIdentifier id) + { + PrivateLinkResource.ValidateResourceId(id); + return new PrivateLinkResource(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 PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(ResourceIdentifier id) + { + PrivateEndpointConnectionProxyResource.ValidateResourceId(id); + return new PrivateEndpointConnectionProxyResource(Client, id); + } + } +} diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateExtensions.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateExtensions.cs index 95187897d187..1396319b5430 100644 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateExtensions.cs +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DeviceUpdate.Mocking; using Azure.ResourceManager.DeviceUpdate.Models; using Azure.ResourceManager.Resources; @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.DeviceUpdate /// A class to add extension methods to Azure.ResourceManager.DeviceUpdate. public static partial class DeviceUpdateExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DeviceUpdateArmClientMockingExtension GetDeviceUpdateArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DeviceUpdateArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DeviceUpdateResourceGroupMockingExtension GetDeviceUpdateResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DeviceUpdateResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DeviceUpdateSubscriptionMockingExtension GetDeviceUpdateSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DeviceUpdateSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DeviceUpdateAccountResource /// /// 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. /// Returns a object. public static DeviceUpdateAccountResource GetDeviceUpdateAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceUpdateAccountResource.ValidateResourceId(id); - return new DeviceUpdateAccountResource(client, id); - } - ); + return GetDeviceUpdateArmClientMockingExtension(client).GetDeviceUpdateAccountResource(id); } - #endregion - #region DeviceUpdateInstanceResource /// /// 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. /// Returns a object. public static DeviceUpdateInstanceResource GetDeviceUpdateInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceUpdateInstanceResource.ValidateResourceId(id); - return new DeviceUpdateInstanceResource(client, id); - } - ); + return GetDeviceUpdateArmClientMockingExtension(client).GetDeviceUpdateInstanceResource(id); } - #endregion - #region DeviceUpdatePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static DeviceUpdatePrivateEndpointConnectionResource GetDeviceUpdatePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DeviceUpdatePrivateEndpointConnectionResource.ValidateResourceId(id); - return new DeviceUpdatePrivateEndpointConnectionResource(client, id); - } - ); + return GetDeviceUpdateArmClientMockingExtension(client).GetDeviceUpdatePrivateEndpointConnectionResource(id); } - #endregion - #region PrivateLinkResource /// /// 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. /// Returns a object. public static PrivateLinkResource GetPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateLinkResource.ValidateResourceId(id); - return new PrivateLinkResource(client, id); - } - ); + return GetDeviceUpdateArmClientMockingExtension(client).GetPrivateLinkResource(id); } - #endregion - #region PrivateEndpointConnectionProxyResource /// /// 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. /// Returns a object. public static PrivateEndpointConnectionProxyResource GetPrivateEndpointConnectionProxyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PrivateEndpointConnectionProxyResource.ValidateResourceId(id); - return new PrivateEndpointConnectionProxyResource(client, id); - } - ); + return GetDeviceUpdateArmClientMockingExtension(client).GetPrivateEndpointConnectionProxyResource(id); } - #endregion - /// Gets a collection of DeviceUpdateAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of DeviceUpdateAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DeviceUpdateAccountResources and their operations over a DeviceUpdateAccountResource. public static DeviceUpdateAccountCollection GetDeviceUpdateAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDeviceUpdateAccounts(); + return GetDeviceUpdateResourceGroupMockingExtension(resourceGroupResource).GetDeviceUpdateAccounts(); } /// @@ -165,16 +141,20 @@ public static DeviceUpdateAccountCollection GetDeviceUpdateAccounts(this Resourc /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Account name. /// The cancellation token to use. - /// 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 static async Task> GetDeviceUpdateAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDeviceUpdateAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetDeviceUpdateResourceGroupMockingExtension(resourceGroupResource).GetDeviceUpdateAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetDeviceUpdateA /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Account name. /// The cancellation token to use. - /// 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 static Response GetDeviceUpdateAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDeviceUpdateAccounts().Get(accountName, cancellationToken); + return GetDeviceUpdateResourceGroupMockingExtension(resourceGroupResource).GetDeviceUpdateAccount(accountName, cancellationToken); } /// @@ -213,6 +197,10 @@ public static Response GetDeviceUpdateAccount(this /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Check Name Availability Request. @@ -220,9 +208,7 @@ public static Response GetDeviceUpdateAccount(this /// is null. public static async Task> CheckDeviceUpdateNameAvailabilityAsync(this SubscriptionResource subscriptionResource, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDeviceUpdateNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetDeviceUpdateSubscriptionMockingExtension(subscriptionResource).CheckDeviceUpdateNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -237,6 +223,10 @@ public static async Task> CheckDeviceUpd /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Check Name Availability Request. @@ -244,9 +234,7 @@ public static async Task> CheckDeviceUpd /// is null. public static Response CheckDeviceUpdateNameAvailability(this SubscriptionResource subscriptionResource, CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDeviceUpdateNameAvailability(content, cancellationToken); + return GetDeviceUpdateSubscriptionMockingExtension(subscriptionResource).CheckDeviceUpdateNameAvailability(content, cancellationToken); } /// @@ -261,13 +249,17 @@ public static Response CheckDeviceUpdateNameAvail /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDeviceUpdateAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeviceUpdateAccountsAsync(cancellationToken); + return GetDeviceUpdateSubscriptionMockingExtension(subscriptionResource).GetDeviceUpdateAccountsAsync(cancellationToken); } /// @@ -282,13 +274,17 @@ public static AsyncPageable GetDeviceUpdateAccounts /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDeviceUpdateAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDeviceUpdateAccounts(cancellationToken); + return GetDeviceUpdateSubscriptionMockingExtension(subscriptionResource).GetDeviceUpdateAccounts(cancellationToken); } } } diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateResourceGroupMockingExtension.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c5a2adad03f6 --- /dev/null +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DeviceUpdate; + +namespace Azure.ResourceManager.DeviceUpdate.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DeviceUpdateResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DeviceUpdateResourceGroupMockingExtension() + { + } + + /// 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 DeviceUpdateResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DeviceUpdateAccountResources in the ResourceGroupResource. + /// An object representing collection of DeviceUpdateAccountResources and their operations over a DeviceUpdateAccountResource. + public virtual DeviceUpdateAccountCollection GetDeviceUpdateAccounts() + { + return GetCachedClient(client => new DeviceUpdateAccountCollection(client, Id)); + } + + /// + /// Returns account details for the given account name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// Account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeviceUpdateAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetDeviceUpdateAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns account details for the given account name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// Account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeviceUpdateAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetDeviceUpdateAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateSubscriptionMockingExtension.cs similarity index 86% rename from sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateSubscriptionMockingExtension.cs index cbbd0011167c..76e2131a64c2 100644 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/DeviceUpdateSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DeviceUpdate; using Azure.ResourceManager.DeviceUpdate.Models; -namespace Azure.ResourceManager.DeviceUpdate +namespace Azure.ResourceManager.DeviceUpdate.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DeviceUpdateSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private DeviceUpdateRestOperations _defaultRestClient; private ClientDiagnostics _deviceUpdateAccountAccountsClientDiagnostics; private AccountsRestOperations _deviceUpdateAccountAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DeviceUpdateSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeviceUpdateSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,9 +64,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Check Name Availability Request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDeviceUpdateNameAvailabilityAsync(CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDeviceUpdateNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("DeviceUpdateSubscriptionMockingExtension.CheckDeviceUpdateNameAvailability"); scope.Start(); try { @@ -94,9 +98,12 @@ public virtual async Task> CheckDeviceUp /// /// Check Name Availability Request. /// The cancellation token to use. + /// is null. public virtual Response CheckDeviceUpdateNameAvailability(CheckNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDeviceUpdateNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("DeviceUpdateSubscriptionMockingExtension.CheckDeviceUpdateNameAvailability"); scope.Start(); try { @@ -129,7 +136,7 @@ public virtual AsyncPageable GetDeviceUpdateAccount { HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceUpdateAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceUpdateAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceUpdateAccountResource(Client, DeviceUpdateAccountData.DeserializeDeviceUpdateAccountData(e)), DeviceUpdateAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeviceUpdateAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceUpdateAccountResource(Client, DeviceUpdateAccountData.DeserializeDeviceUpdateAccountData(e)), DeviceUpdateAccountAccountsClientDiagnostics, Pipeline, "DeviceUpdateSubscriptionMockingExtension.GetDeviceUpdateAccounts", "value", "nextLink", cancellationToken); } /// @@ -151,7 +158,7 @@ public virtual Pageable GetDeviceUpdateAccounts(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => DeviceUpdateAccountAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DeviceUpdateAccountAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceUpdateAccountResource(Client, DeviceUpdateAccountData.DeserializeDeviceUpdateAccountData(e)), DeviceUpdateAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDeviceUpdateAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceUpdateAccountResource(Client, DeviceUpdateAccountData.DeserializeDeviceUpdateAccountData(e)), DeviceUpdateAccountAccountsClientDiagnostics, Pipeline, "DeviceUpdateSubscriptionMockingExtension.GetDeviceUpdateAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 366e738c273b..000000000000 --- a/sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DeviceUpdate -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DeviceUpdateAccountResources in the ResourceGroupResource. - /// An object representing collection of DeviceUpdateAccountResources and their operations over a DeviceUpdateAccountResource. - public virtual DeviceUpdateAccountCollection GetDeviceUpdateAccounts() - { - return GetCachedClient(Client => new DeviceUpdateAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesArmClientMockingExtension.cs b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesArmClientMockingExtension.cs new file mode 100644 index 000000000000..a75118169bd6 --- /dev/null +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DevSpaces; + +namespace Azure.ResourceManager.DevSpaces.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DevSpacesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DevSpacesArmClientMockingExtension() + { + } + + /// 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 DevSpacesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DevSpacesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ControllerResource GetControllerResource(ResourceIdentifier id) + { + ControllerResource.ValidateResourceId(id); + return new ControllerResource(Client, id); + } + } +} diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesExtensions.cs b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesExtensions.cs index 9ecbb6892987..f716ae1e23c2 100644 --- a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesExtensions.cs +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DevSpaces.Mocking; using Azure.ResourceManager.DevSpaces.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.DevSpaces /// A class to add extension methods to Azure.ResourceManager.DevSpaces. public static partial class DevSpacesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DevSpacesArmClientMockingExtension GetDevSpacesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DevSpacesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DevSpacesResourceGroupMockingExtension GetDevSpacesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DevSpacesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DevSpacesSubscriptionMockingExtension GetDevSpacesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DevSpacesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ControllerResource /// /// 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. /// Returns a object. public static ControllerResource GetControllerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ControllerResource.ValidateResourceId(id); - return new ControllerResource(client, id); - } - ); + return GetDevSpacesArmClientMockingExtension(client).GetControllerResource(id); } - #endregion - /// Gets a collection of ControllerResources in the ResourceGroupResource. + /// + /// Gets a collection of ControllerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ControllerResources and their operations over a ControllerResource. public static ControllerCollection GetControllers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetControllers(); + return GetDevSpacesResourceGroupMockingExtension(resourceGroupResource).GetControllers(); } /// @@ -89,16 +77,20 @@ public static ControllerCollection GetControllers(this ResourceGroupResource res /// Controllers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the resource. /// The cancellation token to use. - /// 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 static async Task> GetControllerAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetControllers().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetDevSpacesResourceGroupMockingExtension(resourceGroupResource).GetControllerAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetControllerAsync(this R /// Controllers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the resource. /// The cancellation token to use. - /// 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 static Response GetController(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetControllers().Get(name, cancellationToken); + return GetDevSpacesResourceGroupMockingExtension(resourceGroupResource).GetController(name, cancellationToken); } /// @@ -137,6 +133,10 @@ public static Response GetController(this ResourceGroupResou /// ContainerHostMappings_GetContainerHostMapping /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the container host. @@ -145,9 +145,7 @@ public static Response GetController(this ResourceGroupResou /// is null. public static async Task> GetContainerHostMappingContainerHostMappingAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, ContainerHostMapping containerHostMapping, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(containerHostMapping, nameof(containerHostMapping)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerHostMappingContainerHostMappingAsync(location, containerHostMapping, cancellationToken).ConfigureAwait(false); + return await GetDevSpacesResourceGroupMockingExtension(resourceGroupResource).GetContainerHostMappingContainerHostMappingAsync(location, containerHostMapping, cancellationToken).ConfigureAwait(false); } /// @@ -162,6 +160,10 @@ public static async Task> GetContainerHostMapping /// ContainerHostMappings_GetContainerHostMapping /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of the container host. @@ -170,9 +172,7 @@ public static async Task> GetContainerHostMapping /// is null. public static Response GetContainerHostMappingContainerHostMapping(this ResourceGroupResource resourceGroupResource, AzureLocation location, ContainerHostMapping containerHostMapping, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(containerHostMapping, nameof(containerHostMapping)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerHostMappingContainerHostMapping(location, containerHostMapping, cancellationToken); + return GetDevSpacesResourceGroupMockingExtension(resourceGroupResource).GetContainerHostMappingContainerHostMapping(location, containerHostMapping, cancellationToken); } /// @@ -187,13 +187,17 @@ public static Response GetContainerHostMappingContainerHos /// Controllers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetControllersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetControllersAsync(cancellationToken); + return GetDevSpacesSubscriptionMockingExtension(subscriptionResource).GetControllersAsync(cancellationToken); } /// @@ -208,13 +212,17 @@ public static AsyncPageable GetControllersAsync(this Subscri /// Controllers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetControllers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetControllers(cancellationToken); + return GetDevSpacesSubscriptionMockingExtension(subscriptionResource).GetControllers(cancellationToken); } } } diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesResourceGroupMockingExtension.cs similarity index 59% rename from sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesResourceGroupMockingExtension.cs index cc1f48334525..2d3769602963 100644 --- a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesResourceGroupMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DevSpaces; using Azure.ResourceManager.DevSpaces.Models; -namespace Azure.ResourceManager.DevSpaces +namespace Azure.ResourceManager.DevSpaces.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class DevSpacesResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _containerHostMappingsClientDiagnostics; private ContainerHostMappingsRestOperations _containerHostMappingsRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DevSpacesResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DevSpacesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -47,7 +48,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ControllerResources and their operations over a ControllerResource. public virtual ControllerCollection GetControllers() { - return GetCachedClient(Client => new ControllerCollection(Client, Id)); + return GetCachedClient(client => new ControllerCollection(client, Id)); + } + + /// + /// Gets the properties for an Azure Dev Spaces Controller. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name} + /// + /// + /// Operation Id + /// Controllers_Get + /// + /// + /// + /// Name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetControllerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetControllers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties for an Azure Dev Spaces Controller. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name} + /// + /// + /// Operation Id + /// Controllers_Get + /// + /// + /// + /// Name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetController(string name, CancellationToken cancellationToken = default) + { + return GetControllers().Get(name, cancellationToken); } /// @@ -66,9 +113,12 @@ public virtual ControllerCollection GetControllers() /// Location of the container host. /// The ContainerHostMapping to use. /// The cancellation token to use. + /// is null. public virtual async Task> GetContainerHostMappingContainerHostMappingAsync(AzureLocation location, ContainerHostMapping containerHostMapping, CancellationToken cancellationToken = default) { - using var scope = ContainerHostMappingsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetContainerHostMappingContainerHostMapping"); + Argument.AssertNotNull(containerHostMapping, nameof(containerHostMapping)); + + using var scope = ContainerHostMappingsClientDiagnostics.CreateScope("DevSpacesResourceGroupMockingExtension.GetContainerHostMappingContainerHostMapping"); scope.Start(); try { @@ -98,9 +148,12 @@ public virtual async Task> GetContainerHostMappin /// Location of the container host. /// The ContainerHostMapping to use. /// The cancellation token to use. + /// is null. public virtual Response GetContainerHostMappingContainerHostMapping(AzureLocation location, ContainerHostMapping containerHostMapping, CancellationToken cancellationToken = default) { - using var scope = ContainerHostMappingsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetContainerHostMappingContainerHostMapping"); + Argument.AssertNotNull(containerHostMapping, nameof(containerHostMapping)); + + using var scope = ContainerHostMappingsClientDiagnostics.CreateScope("DevSpacesResourceGroupMockingExtension.GetContainerHostMappingContainerHostMapping"); scope.Start(); try { diff --git a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesSubscriptionMockingExtension.cs similarity index 85% rename from sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesSubscriptionMockingExtension.cs index 487d2aad736a..b509f5acf29a 100644 --- a/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/devspaces/Azure.ResourceManager.DevSpaces/src/Generated/Extensions/DevSpacesSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DevSpaces; -namespace Azure.ResourceManager.DevSpaces +namespace Azure.ResourceManager.DevSpaces.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DevSpacesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _controllerClientDiagnostics; private ControllersRestOperations _controllerRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DevSpacesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DevSpacesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetControllersAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ControllerRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ControllerRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ControllerResource(Client, ControllerData.DeserializeControllerData(e)), ControllerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ControllerResource(Client, ControllerData.DeserializeControllerData(e)), ControllerClientDiagnostics, Pipeline, "DevSpacesSubscriptionMockingExtension.GetControllers", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetControllers(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => ControllerRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ControllerRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ControllerResource(Client, ControllerData.DeserializeControllerData(e)), ControllerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetControllers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ControllerResource(Client, ControllerData.DeserializeControllerData(e)), ControllerClientDiagnostics, Pipeline, "DevSpacesSubscriptionMockingExtension.GetControllers", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabArtifactSourceResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabArtifactSourceResource.cs index 4f9320fdb56b..2899020c684b 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabArtifactSourceResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabArtifactSourceResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevTestLabArmTemplateResources and their operations over a DevTestLabArmTemplateResource. public virtual DevTestLabArmTemplateCollection GetDevTestLabArmTemplates() { - return GetCachedClient(Client => new DevTestLabArmTemplateCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabArmTemplateCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DevTestLabArmTemplateCollection GetDevTestLabArmTemplates() /// The name of the azure resource manager template. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The cancellation token to use. - /// 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> GetDevTestLabArmTemplateAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDevTestLab /// The name of the azure resource manager template. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The cancellation token to use. - /// 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 GetDevTestLabArmTemplate(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetDevTestLabArmTemplate( /// An object representing collection of DevTestLabArtifactResources and their operations over a DevTestLabArtifactResource. public virtual DevTestLabArtifactCollection GetDevTestLabArtifacts() { - return GetCachedClient(Client => new DevTestLabArtifactCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabArtifactCollection(client, Id)); } /// @@ -166,8 +166,8 @@ public virtual DevTestLabArtifactCollection GetDevTestLabArtifacts() /// The name of the artifact. /// Specify the $expand query. Example: 'properties($select=title)'. /// The cancellation token to use. - /// 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> GetDevTestLabArtifactAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetDevTestLabArt /// The name of the artifact. /// Specify the $expand query. Example: 'properties($select=title)'. /// The cancellation token to use. - /// 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 GetDevTestLabArtifact(string name, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs index f24fee4f6b0c..012cae05dfe0 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevTestLabScheduleResources and their operations over a DevTestLabScheduleResource. public virtual DevTestLabScheduleCollection GetDevTestLabSchedules() { - return GetCachedClient(Client => new DevTestLabScheduleCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabScheduleCollection(client, Id)); } /// @@ -123,8 +123,8 @@ public virtual DevTestLabScheduleCollection GetDevTestLabSchedules() /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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> GetDevTestLabScheduleAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -147,8 +147,8 @@ public virtual async Task> GetDevTestLabSch /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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 GetDevTestLabSchedule(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -159,7 +159,7 @@ public virtual Response GetDevTestLabSchedule(string /// An object representing collection of DevTestLabArtifactSourceResources and their operations over a DevTestLabArtifactSourceResource. public virtual DevTestLabArtifactSourceCollection GetDevTestLabArtifactSources() { - return GetCachedClient(Client => new DevTestLabArtifactSourceCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabArtifactSourceCollection(client, Id)); } /// @@ -178,8 +178,8 @@ public virtual DevTestLabArtifactSourceCollection GetDevTestLabArtifactSources() /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The cancellation token to use. - /// 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> GetDevTestLabArtifactSourceAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -202,8 +202,8 @@ public virtual async Task> GetDevTest /// The name of the artifact source. /// Specify the $expand query. Example: 'properties($select=displayName)'. /// The cancellation token to use. - /// 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 GetDevTestLabArtifactSource(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -214,7 +214,7 @@ public virtual Response GetDevTestLabArtifactS /// An object representing collection of DevTestLabCostResources and their operations over a DevTestLabCostResource. public virtual DevTestLabCostCollection GetDevTestLabCosts() { - return GetCachedClient(Client => new DevTestLabCostCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabCostCollection(client, Id)); } /// @@ -233,8 +233,8 @@ public virtual DevTestLabCostCollection GetDevTestLabCosts() /// The name of the cost. /// Specify the $expand query. Example: 'properties($expand=labCostDetails)'. /// The cancellation token to use. - /// 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> GetDevTestLabCostAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -257,8 +257,8 @@ public virtual async Task> GetDevTestLabCostAsy /// The name of the cost. /// Specify the $expand query. Example: 'properties($expand=labCostDetails)'. /// The cancellation token to use. - /// 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 GetDevTestLabCost(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -269,7 +269,7 @@ public virtual Response GetDevTestLabCost(string name, s /// An object representing collection of DevTestLabCustomImageResources and their operations over a DevTestLabCustomImageResource. public virtual DevTestLabCustomImageCollection GetDevTestLabCustomImages() { - return GetCachedClient(Client => new DevTestLabCustomImageCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabCustomImageCollection(client, Id)); } /// @@ -288,8 +288,8 @@ public virtual DevTestLabCustomImageCollection GetDevTestLabCustomImages() /// The name of the custom image. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The cancellation token to use. - /// 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> GetDevTestLabCustomImageAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -312,8 +312,8 @@ public virtual async Task> GetDevTestLab /// The name of the custom image. /// Specify the $expand query. Example: 'properties($select=vm)'. /// The cancellation token to use. - /// 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 GetDevTestLabCustomImage(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -324,7 +324,7 @@ public virtual Response GetDevTestLabCustomImage( /// An object representing collection of DevTestLabFormulaResources and their operations over a DevTestLabFormulaResource. public virtual DevTestLabFormulaCollection GetDevTestLabFormulas() { - return GetCachedClient(Client => new DevTestLabFormulaCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabFormulaCollection(client, Id)); } /// @@ -343,8 +343,8 @@ public virtual DevTestLabFormulaCollection GetDevTestLabFormulas() /// The name of the formula. /// Specify the $expand query. Example: 'properties($select=description)'. /// The cancellation token to use. - /// 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> GetDevTestLabFormulaAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -367,8 +367,8 @@ public virtual async Task> GetDevTestLabForm /// The name of the formula. /// Specify the $expand query. Example: 'properties($select=description)'. /// The cancellation token to use. - /// 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 GetDevTestLabFormula(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -379,7 +379,7 @@ public virtual Response GetDevTestLabFormula(string n /// An object representing collection of DevTestLabNotificationChannelResources and their operations over a DevTestLabNotificationChannelResource. public virtual DevTestLabNotificationChannelCollection GetDevTestLabNotificationChannels() { - return GetCachedClient(Client => new DevTestLabNotificationChannelCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabNotificationChannelCollection(client, Id)); } /// @@ -398,8 +398,8 @@ public virtual DevTestLabNotificationChannelCollection GetDevTestLabNotification /// The name of the notification channel. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The cancellation token to use. - /// 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> GetDevTestLabNotificationChannelAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -422,8 +422,8 @@ public virtual async Task> GetDe /// The name of the notification channel. /// Specify the $expand query. Example: 'properties($select=webHookUrl)'. /// The cancellation token to use. - /// 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 GetDevTestLabNotificationChannel(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -432,13 +432,11 @@ public virtual Response GetDevTestLabNoti /// Gets a collection of DevTestLabPolicyResources in the DevTestLab. /// The name of the policy set. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of DevTestLabPolicyResources and their operations over a DevTestLabPolicyResource. public virtual DevTestLabPolicyCollection GetDevTestLabPolicies(string policySetName) { - Argument.AssertNotNullOrEmpty(policySetName, nameof(policySetName)); - return new DevTestLabPolicyCollection(Client, Id, policySetName); } @@ -459,8 +457,8 @@ public virtual DevTestLabPolicyCollection GetDevTestLabPolicies(string policySet /// The name of the policy. /// Specify the $expand query. Example: 'properties($select=description)'. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetDevTestLabPolicyAsync(string policySetName, string name, string expand = null, CancellationToken cancellationToken = default) { @@ -484,8 +482,8 @@ public virtual async Task> GetDevTestLabPolic /// The name of the policy. /// Specify the $expand query. Example: 'properties($select=description)'. /// The cancellation token to use. - /// or is an empty string, and was expected to be non-empty. /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetDevTestLabPolicy(string policySetName, string name, string expand = null, CancellationToken cancellationToken = default) { @@ -496,7 +494,7 @@ public virtual Response GetDevTestLabPolicy(string pol /// An object representing collection of DevTestLabServiceRunnerResources and their operations over a DevTestLabServiceRunnerResource. public virtual DevTestLabServiceRunnerCollection GetDevTestLabServiceRunners() { - return GetCachedClient(Client => new DevTestLabServiceRunnerCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabServiceRunnerCollection(client, Id)); } /// @@ -514,8 +512,8 @@ public virtual DevTestLabServiceRunnerCollection GetDevTestLabServiceRunners() /// /// The name of the service runner. /// The cancellation token to use. - /// 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> GetDevTestLabServiceRunnerAsync(string name, CancellationToken cancellationToken = default) { @@ -537,8 +535,8 @@ public virtual async Task> GetDevTestL /// /// The name of the service runner. /// The cancellation token to use. - /// 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 GetDevTestLabServiceRunner(string name, CancellationToken cancellationToken = default) { @@ -549,7 +547,7 @@ public virtual Response GetDevTestLabServiceRun /// An object representing collection of DevTestLabUserResources and their operations over a DevTestLabUserResource. public virtual DevTestLabUserCollection GetDevTestLabUsers() { - return GetCachedClient(Client => new DevTestLabUserCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabUserCollection(client, Id)); } /// @@ -568,8 +566,8 @@ public virtual DevTestLabUserCollection GetDevTestLabUsers() /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The cancellation token to use. - /// 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> GetDevTestLabUserAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -592,8 +590,8 @@ public virtual async Task> GetDevTestLabUserAsy /// The name of the user profile. /// Specify the $expand query. Example: 'properties($select=identity)'. /// The cancellation token to use. - /// 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 GetDevTestLabUser(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -604,7 +602,7 @@ public virtual Response GetDevTestLabUser(string name, s /// An object representing collection of DevTestLabVmResources and their operations over a DevTestLabVmResource. public virtual DevTestLabVmCollection GetDevTestLabVms() { - return GetCachedClient(Client => new DevTestLabVmCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabVmCollection(client, Id)); } /// @@ -623,8 +621,8 @@ public virtual DevTestLabVmCollection GetDevTestLabVms() /// The name of the virtual machine. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The cancellation token to use. - /// 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> GetDevTestLabVmAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -647,8 +645,8 @@ public virtual async Task> GetDevTestLabVmAsync(s /// The name of the virtual machine. /// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. /// The cancellation token to use. - /// 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 GetDevTestLabVm(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -659,7 +657,7 @@ public virtual Response GetDevTestLabVm(string name, strin /// An object representing collection of DevTestLabVirtualNetworkResources and their operations over a DevTestLabVirtualNetworkResource. public virtual DevTestLabVirtualNetworkCollection GetDevTestLabVirtualNetworks() { - return GetCachedClient(Client => new DevTestLabVirtualNetworkCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabVirtualNetworkCollection(client, Id)); } /// @@ -678,8 +676,8 @@ public virtual DevTestLabVirtualNetworkCollection GetDevTestLabVirtualNetworks() /// The name of the virtual network. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The cancellation token to use. - /// 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> GetDevTestLabVirtualNetworkAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -702,8 +700,8 @@ public virtual async Task> GetDevTest /// The name of the virtual network. /// Specify the $expand query. Example: 'properties($expand=externalSubnets)'. /// The cancellation token to use. - /// 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 GetDevTestLabVirtualNetwork(string name, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabServiceFabricResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabServiceFabricResource.cs index 1a46550c5bb2..fcc171228515 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabServiceFabricResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabServiceFabricResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevTestLabServiceFabricScheduleResources and their operations over a DevTestLabServiceFabricScheduleResource. public virtual DevTestLabServiceFabricScheduleCollection GetDevTestLabServiceFabricSchedules() { - return GetCachedClient(Client => new DevTestLabServiceFabricScheduleCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabServiceFabricScheduleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DevTestLabServiceFabricScheduleCollection GetDevTestLabServiceFab /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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> GetDevTestLabServiceFabricScheduleAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> Get /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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 GetDevTestLabServiceFabricSchedule(string name, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabUserResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabUserResource.cs index ffa5fdffee21..5d4143949753 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabUserResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabUserResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevTestLabDiskResources and their operations over a DevTestLabDiskResource. public virtual DevTestLabDiskCollection GetDevTestLabDisks() { - return GetCachedClient(Client => new DevTestLabDiskCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabDiskCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DevTestLabDiskCollection GetDevTestLabDisks() /// The name of the disk. /// Specify the $expand query. Example: 'properties($select=diskType)'. /// The cancellation token to use. - /// 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> GetDevTestLabDiskAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDevTestLabDiskAsy /// The name of the disk. /// Specify the $expand query. Example: 'properties($select=diskType)'. /// The cancellation token to use. - /// 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 GetDevTestLabDisk(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetDevTestLabDisk(string name, s /// An object representing collection of DevTestLabEnvironmentResources and their operations over a DevTestLabEnvironmentResource. public virtual DevTestLabEnvironmentCollection GetDevTestLabEnvironments() { - return GetCachedClient(Client => new DevTestLabEnvironmentCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabEnvironmentCollection(client, Id)); } /// @@ -166,8 +166,8 @@ public virtual DevTestLabEnvironmentCollection GetDevTestLabEnvironments() /// The name of the environment. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. /// The cancellation token to use. - /// 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> GetDevTestLabEnvironmentAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetDevTestLab /// The name of the environment. /// Specify the $expand query. Example: 'properties($select=deploymentProperties)'. /// The cancellation token to use. - /// 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 GetDevTestLabEnvironment(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -202,7 +202,7 @@ public virtual Response GetDevTestLabEnvironment( /// An object representing collection of DevTestLabSecretResources and their operations over a DevTestLabSecretResource. public virtual DevTestLabSecretCollection GetDevTestLabSecrets() { - return GetCachedClient(Client => new DevTestLabSecretCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabSecretCollection(client, Id)); } /// @@ -221,8 +221,8 @@ public virtual DevTestLabSecretCollection GetDevTestLabSecrets() /// The name of the secret. /// Specify the $expand query. Example: 'properties($select=value)'. /// The cancellation token to use. - /// 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> GetDevTestLabSecretAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task> GetDevTestLabSecre /// The name of the secret. /// Specify the $expand query. Example: 'properties($select=value)'. /// The cancellation token to use. - /// 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 GetDevTestLabSecret(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -257,7 +257,7 @@ public virtual Response GetDevTestLabSecret(string nam /// An object representing collection of DevTestLabServiceFabricResources and their operations over a DevTestLabServiceFabricResource. public virtual DevTestLabServiceFabricCollection GetDevTestLabServiceFabrics() { - return GetCachedClient(Client => new DevTestLabServiceFabricCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabServiceFabricCollection(client, Id)); } /// @@ -276,8 +276,8 @@ public virtual DevTestLabServiceFabricCollection GetDevTestLabServiceFabrics() /// The name of the service fabric. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. /// The cancellation token to use. - /// 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> GetDevTestLabServiceFabricAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -300,8 +300,8 @@ public virtual async Task> GetDevTestL /// The name of the service fabric. /// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. /// The cancellation token to use. - /// 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 GetDevTestLabServiceFabric(string name, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabVmResource.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabVmResource.cs index 972b43eff03f..83636ce9f879 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabVmResource.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/DevTestLabVmResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DevTestLabVmScheduleResources and their operations over a DevTestLabVmScheduleResource. public virtual DevTestLabVmScheduleCollection GetDevTestLabVmSchedules() { - return GetCachedClient(Client => new DevTestLabVmScheduleCollection(Client, Id)); + return GetCachedClient(client => new DevTestLabVmScheduleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DevTestLabVmScheduleCollection GetDevTestLabVmSchedules() /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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> GetDevTestLabVmScheduleAsync(string name, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDevTestLabV /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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 GetDevTestLabVmSchedule(string name, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsArmClientMockingExtension.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsArmClientMockingExtension.cs new file mode 100644 index 000000000000..53482ba9f1ce --- /dev/null +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsArmClientMockingExtension.cs @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DevTestLabs; + +namespace Azure.ResourceManager.DevTestLabs.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DevTestLabsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DevTestLabsArmClientMockingExtension() + { + } + + /// 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 DevTestLabsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DevTestLabsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DevTestLabResource GetDevTestLabResource(ResourceIdentifier id) + { + DevTestLabResource.ValidateResourceId(id); + return new DevTestLabResource(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 DevTestLabGlobalScheduleResource GetDevTestLabGlobalScheduleResource(ResourceIdentifier id) + { + DevTestLabGlobalScheduleResource.ValidateResourceId(id); + return new DevTestLabGlobalScheduleResource(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 DevTestLabScheduleResource GetDevTestLabScheduleResource(ResourceIdentifier id) + { + DevTestLabScheduleResource.ValidateResourceId(id); + return new DevTestLabScheduleResource(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 DevTestLabServiceFabricScheduleResource GetDevTestLabServiceFabricScheduleResource(ResourceIdentifier id) + { + DevTestLabServiceFabricScheduleResource.ValidateResourceId(id); + return new DevTestLabServiceFabricScheduleResource(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 DevTestLabVmScheduleResource GetDevTestLabVmScheduleResource(ResourceIdentifier id) + { + DevTestLabVmScheduleResource.ValidateResourceId(id); + return new DevTestLabVmScheduleResource(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 DevTestLabArtifactSourceResource GetDevTestLabArtifactSourceResource(ResourceIdentifier id) + { + DevTestLabArtifactSourceResource.ValidateResourceId(id); + return new DevTestLabArtifactSourceResource(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 DevTestLabArmTemplateResource GetDevTestLabArmTemplateResource(ResourceIdentifier id) + { + DevTestLabArmTemplateResource.ValidateResourceId(id); + return new DevTestLabArmTemplateResource(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 DevTestLabArtifactResource GetDevTestLabArtifactResource(ResourceIdentifier id) + { + DevTestLabArtifactResource.ValidateResourceId(id); + return new DevTestLabArtifactResource(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 DevTestLabCostResource GetDevTestLabCostResource(ResourceIdentifier id) + { + DevTestLabCostResource.ValidateResourceId(id); + return new DevTestLabCostResource(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 DevTestLabCustomImageResource GetDevTestLabCustomImageResource(ResourceIdentifier id) + { + DevTestLabCustomImageResource.ValidateResourceId(id); + return new DevTestLabCustomImageResource(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 DevTestLabFormulaResource GetDevTestLabFormulaResource(ResourceIdentifier id) + { + DevTestLabFormulaResource.ValidateResourceId(id); + return new DevTestLabFormulaResource(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 DevTestLabNotificationChannelResource GetDevTestLabNotificationChannelResource(ResourceIdentifier id) + { + DevTestLabNotificationChannelResource.ValidateResourceId(id); + return new DevTestLabNotificationChannelResource(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 DevTestLabPolicyResource GetDevTestLabPolicyResource(ResourceIdentifier id) + { + DevTestLabPolicyResource.ValidateResourceId(id); + return new DevTestLabPolicyResource(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 DevTestLabServiceRunnerResource GetDevTestLabServiceRunnerResource(ResourceIdentifier id) + { + DevTestLabServiceRunnerResource.ValidateResourceId(id); + return new DevTestLabServiceRunnerResource(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 DevTestLabUserResource GetDevTestLabUserResource(ResourceIdentifier id) + { + DevTestLabUserResource.ValidateResourceId(id); + return new DevTestLabUserResource(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 DevTestLabDiskResource GetDevTestLabDiskResource(ResourceIdentifier id) + { + DevTestLabDiskResource.ValidateResourceId(id); + return new DevTestLabDiskResource(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 DevTestLabEnvironmentResource GetDevTestLabEnvironmentResource(ResourceIdentifier id) + { + DevTestLabEnvironmentResource.ValidateResourceId(id); + return new DevTestLabEnvironmentResource(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 DevTestLabSecretResource GetDevTestLabSecretResource(ResourceIdentifier id) + { + DevTestLabSecretResource.ValidateResourceId(id); + return new DevTestLabSecretResource(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 DevTestLabServiceFabricResource GetDevTestLabServiceFabricResource(ResourceIdentifier id) + { + DevTestLabServiceFabricResource.ValidateResourceId(id); + return new DevTestLabServiceFabricResource(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 DevTestLabVmResource GetDevTestLabVmResource(ResourceIdentifier id) + { + DevTestLabVmResource.ValidateResourceId(id); + return new DevTestLabVmResource(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 DevTestLabVirtualNetworkResource GetDevTestLabVirtualNetworkResource(ResourceIdentifier id) + { + DevTestLabVirtualNetworkResource.ValidateResourceId(id); + return new DevTestLabVirtualNetworkResource(Client, id); + } + } +} diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsExtensions.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsExtensions.cs index 8f3189b14004..90320198fc60 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsExtensions.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DevTestLabs.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.DevTestLabs @@ -18,442 +19,369 @@ namespace Azure.ResourceManager.DevTestLabs /// A class to add extension methods to Azure.ResourceManager.DevTestLabs. public static partial class DevTestLabsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DevTestLabsArmClientMockingExtension GetDevTestLabsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DevTestLabsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DevTestLabsResourceGroupMockingExtension GetDevTestLabsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DevTestLabsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DevTestLabsSubscriptionMockingExtension GetDevTestLabsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DevTestLabsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DevTestLabResource /// /// 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. /// Returns a object. public static DevTestLabResource GetDevTestLabResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabResource.ValidateResourceId(id); - return new DevTestLabResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabResource(id); } - #endregion - #region DevTestLabGlobalScheduleResource /// /// 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. /// Returns a object. public static DevTestLabGlobalScheduleResource GetDevTestLabGlobalScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabGlobalScheduleResource.ValidateResourceId(id); - return new DevTestLabGlobalScheduleResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabGlobalScheduleResource(id); } - #endregion - #region DevTestLabScheduleResource /// /// 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. /// Returns a object. public static DevTestLabScheduleResource GetDevTestLabScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabScheduleResource.ValidateResourceId(id); - return new DevTestLabScheduleResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabScheduleResource(id); } - #endregion - #region DevTestLabServiceFabricScheduleResource /// /// 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. /// Returns a object. public static DevTestLabServiceFabricScheduleResource GetDevTestLabServiceFabricScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabServiceFabricScheduleResource.ValidateResourceId(id); - return new DevTestLabServiceFabricScheduleResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabServiceFabricScheduleResource(id); } - #endregion - #region DevTestLabVmScheduleResource /// /// 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. /// Returns a object. public static DevTestLabVmScheduleResource GetDevTestLabVmScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabVmScheduleResource.ValidateResourceId(id); - return new DevTestLabVmScheduleResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabVmScheduleResource(id); } - #endregion - #region DevTestLabArtifactSourceResource /// /// 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. /// Returns a object. public static DevTestLabArtifactSourceResource GetDevTestLabArtifactSourceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabArtifactSourceResource.ValidateResourceId(id); - return new DevTestLabArtifactSourceResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabArtifactSourceResource(id); } - #endregion - #region DevTestLabArmTemplateResource /// /// 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. /// Returns a object. public static DevTestLabArmTemplateResource GetDevTestLabArmTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabArmTemplateResource.ValidateResourceId(id); - return new DevTestLabArmTemplateResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabArmTemplateResource(id); } - #endregion - #region DevTestLabArtifactResource /// /// 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. /// Returns a object. public static DevTestLabArtifactResource GetDevTestLabArtifactResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabArtifactResource.ValidateResourceId(id); - return new DevTestLabArtifactResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabArtifactResource(id); } - #endregion - #region DevTestLabCostResource /// /// 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. /// Returns a object. public static DevTestLabCostResource GetDevTestLabCostResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabCostResource.ValidateResourceId(id); - return new DevTestLabCostResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabCostResource(id); } - #endregion - #region DevTestLabCustomImageResource /// /// 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. /// Returns a object. public static DevTestLabCustomImageResource GetDevTestLabCustomImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabCustomImageResource.ValidateResourceId(id); - return new DevTestLabCustomImageResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabCustomImageResource(id); } - #endregion - #region DevTestLabFormulaResource /// /// 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. /// Returns a object. public static DevTestLabFormulaResource GetDevTestLabFormulaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabFormulaResource.ValidateResourceId(id); - return new DevTestLabFormulaResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabFormulaResource(id); } - #endregion - #region DevTestLabNotificationChannelResource /// /// 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. /// Returns a object. public static DevTestLabNotificationChannelResource GetDevTestLabNotificationChannelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabNotificationChannelResource.ValidateResourceId(id); - return new DevTestLabNotificationChannelResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabNotificationChannelResource(id); } - #endregion - #region DevTestLabPolicyResource /// /// 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. /// Returns a object. public static DevTestLabPolicyResource GetDevTestLabPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabPolicyResource.ValidateResourceId(id); - return new DevTestLabPolicyResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabPolicyResource(id); } - #endregion - #region DevTestLabServiceRunnerResource /// /// 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. /// Returns a object. public static DevTestLabServiceRunnerResource GetDevTestLabServiceRunnerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabServiceRunnerResource.ValidateResourceId(id); - return new DevTestLabServiceRunnerResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabServiceRunnerResource(id); } - #endregion - #region DevTestLabUserResource /// /// 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. /// Returns a object. public static DevTestLabUserResource GetDevTestLabUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabUserResource.ValidateResourceId(id); - return new DevTestLabUserResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabUserResource(id); } - #endregion - #region DevTestLabDiskResource /// /// 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. /// Returns a object. public static DevTestLabDiskResource GetDevTestLabDiskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabDiskResource.ValidateResourceId(id); - return new DevTestLabDiskResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabDiskResource(id); } - #endregion - #region DevTestLabEnvironmentResource /// /// 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. /// Returns a object. public static DevTestLabEnvironmentResource GetDevTestLabEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabEnvironmentResource.ValidateResourceId(id); - return new DevTestLabEnvironmentResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabEnvironmentResource(id); } - #endregion - #region DevTestLabSecretResource /// /// 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. /// Returns a object. public static DevTestLabSecretResource GetDevTestLabSecretResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabSecretResource.ValidateResourceId(id); - return new DevTestLabSecretResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabSecretResource(id); } - #endregion - #region DevTestLabServiceFabricResource /// /// 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. /// Returns a object. public static DevTestLabServiceFabricResource GetDevTestLabServiceFabricResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabServiceFabricResource.ValidateResourceId(id); - return new DevTestLabServiceFabricResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabServiceFabricResource(id); } - #endregion - #region DevTestLabVmResource /// /// 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. /// Returns a object. public static DevTestLabVmResource GetDevTestLabVmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabVmResource.ValidateResourceId(id); - return new DevTestLabVmResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabVmResource(id); } - #endregion - #region DevTestLabVirtualNetworkResource /// /// 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. /// Returns a object. public static DevTestLabVirtualNetworkResource GetDevTestLabVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DevTestLabVirtualNetworkResource.ValidateResourceId(id); - return new DevTestLabVirtualNetworkResource(client, id); - } - ); + return GetDevTestLabsArmClientMockingExtension(client).GetDevTestLabVirtualNetworkResource(id); } - #endregion - /// Gets a collection of DevTestLabResources in the ResourceGroupResource. + /// + /// Gets a collection of DevTestLabResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DevTestLabResources and their operations over a DevTestLabResource. public static DevTestLabCollection GetDevTestLabs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDevTestLabs(); + return GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLabs(); } /// @@ -468,17 +396,21 @@ public static DevTestLabCollection GetDevTestLabs(this ResourceGroupResource res /// Labs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The cancellation token to use. - /// 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 static async Task> GetDevTestLabAsync(this ResourceGroupResource resourceGroupResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDevTestLabs().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + return await GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLabAsync(name, expand, cancellationToken).ConfigureAwait(false); } /// @@ -493,25 +425,35 @@ public static async Task> GetDevTestLabAsync(this R /// Labs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the lab. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. /// The cancellation token to use. - /// 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 static Response GetDevTestLab(this ResourceGroupResource resourceGroupResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDevTestLabs().Get(name, expand, cancellationToken); + return GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLab(name, expand, cancellationToken); } - /// Gets a collection of DevTestLabGlobalScheduleResources in the ResourceGroupResource. + /// + /// Gets a collection of DevTestLabGlobalScheduleResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DevTestLabGlobalScheduleResources and their operations over a DevTestLabGlobalScheduleResource. public static DevTestLabGlobalScheduleCollection GetDevTestLabGlobalSchedules(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDevTestLabGlobalSchedules(); + return GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLabGlobalSchedules(); } /// @@ -526,17 +468,21 @@ public static DevTestLabGlobalScheduleCollection GetDevTestLabGlobalSchedules(th /// GlobalSchedules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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 static async Task> GetDevTestLabGlobalScheduleAsync(this ResourceGroupResource resourceGroupResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDevTestLabGlobalSchedules().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + return await GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLabGlobalScheduleAsync(name, expand, cancellationToken).ConfigureAwait(false); } /// @@ -551,17 +497,21 @@ public static async Task> GetDevTestL /// GlobalSchedules_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the schedule. /// Specify the $expand query. Example: 'properties($select=status)'. /// The cancellation token to use. - /// 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 static Response GetDevTestLabGlobalSchedule(this ResourceGroupResource resourceGroupResource, string name, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDevTestLabGlobalSchedules().Get(name, expand, cancellationToken); + return GetDevTestLabsResourceGroupMockingExtension(resourceGroupResource).GetDevTestLabGlobalSchedule(name, expand, cancellationToken); } /// @@ -576,6 +526,10 @@ public static Response GetDevTestLabGlobalSche /// Labs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. @@ -586,7 +540,7 @@ public static Response GetDevTestLabGlobalSche /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevTestLabsAsync(this SubscriptionResource subscriptionResource, string expand = null, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevTestLabsAsync(expand, filter, top, orderby, cancellationToken); + return GetDevTestLabsSubscriptionMockingExtension(subscriptionResource).GetDevTestLabsAsync(expand, filter, top, orderby, cancellationToken); } /// @@ -601,6 +555,10 @@ public static AsyncPageable GetDevTestLabsAsync(this Subscri /// Labs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. @@ -611,7 +569,7 @@ public static AsyncPageable GetDevTestLabsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevTestLabs(this SubscriptionResource subscriptionResource, string expand = null, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevTestLabs(expand, filter, top, orderby, cancellationToken); + return GetDevTestLabsSubscriptionMockingExtension(subscriptionResource).GetDevTestLabs(expand, filter, top, orderby, cancellationToken); } /// @@ -626,6 +584,10 @@ public static Pageable GetDevTestLabs(this SubscriptionResou /// GlobalSchedules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify the $expand query. Example: 'properties($select=status)'. @@ -636,7 +598,7 @@ public static Pageable GetDevTestLabs(this SubscriptionResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDevTestLabGlobalSchedulesAsync(this SubscriptionResource subscriptionResource, string expand = null, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevTestLabGlobalSchedulesAsync(expand, filter, top, orderby, cancellationToken); + return GetDevTestLabsSubscriptionMockingExtension(subscriptionResource).GetDevTestLabGlobalSchedulesAsync(expand, filter, top, orderby, cancellationToken); } /// @@ -651,6 +613,10 @@ public static AsyncPageable GetDevTestLabGloba /// GlobalSchedules_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify the $expand query. Example: 'properties($select=status)'. @@ -661,7 +627,7 @@ public static AsyncPageable GetDevTestLabGloba /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDevTestLabGlobalSchedules(this SubscriptionResource subscriptionResource, string expand = null, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDevTestLabGlobalSchedules(expand, filter, top, orderby, cancellationToken); + return GetDevTestLabsSubscriptionMockingExtension(subscriptionResource).GetDevTestLabGlobalSchedules(expand, filter, top, orderby, cancellationToken); } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsResourceGroupMockingExtension.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..47588cd8eec0 --- /dev/null +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsResourceGroupMockingExtension.cs @@ -0,0 +1,149 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DevTestLabs; + +namespace Azure.ResourceManager.DevTestLabs.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DevTestLabsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DevTestLabsResourceGroupMockingExtension() + { + } + + /// 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 DevTestLabsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DevTestLabResources in the ResourceGroupResource. + /// An object representing collection of DevTestLabResources and their operations over a DevTestLabResource. + public virtual DevTestLabCollection GetDevTestLabs() + { + return GetCachedClient(client => new DevTestLabCollection(client, Id)); + } + + /// + /// Get lab. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name} + /// + /// + /// Operation Id + /// Labs_Get + /// + /// + /// + /// The name of the lab. + /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDevTestLabAsync(string name, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDevTestLabs().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get lab. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name} + /// + /// + /// Operation Id + /// Labs_Get + /// + /// + /// + /// The name of the lab. + /// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDevTestLab(string name, string expand = null, CancellationToken cancellationToken = default) + { + return GetDevTestLabs().Get(name, expand, cancellationToken); + } + + /// Gets a collection of DevTestLabGlobalScheduleResources in the ResourceGroupResource. + /// An object representing collection of DevTestLabGlobalScheduleResources and their operations over a DevTestLabGlobalScheduleResource. + public virtual DevTestLabGlobalScheduleCollection GetDevTestLabGlobalSchedules() + { + return GetCachedClient(client => new DevTestLabGlobalScheduleCollection(client, Id)); + } + + /// + /// Get schedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name} + /// + /// + /// Operation Id + /// GlobalSchedules_Get + /// + /// + /// + /// The name of the schedule. + /// Specify the $expand query. Example: 'properties($select=status)'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDevTestLabGlobalScheduleAsync(string name, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDevTestLabGlobalSchedules().GetAsync(name, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get schedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name} + /// + /// + /// Operation Id + /// GlobalSchedules_Get + /// + /// + /// + /// The name of the schedule. + /// Specify the $expand query. Example: 'properties($select=status)'. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDevTestLabGlobalSchedule(string name, string expand = null, CancellationToken cancellationToken = default) + { + return GetDevTestLabGlobalSchedules().Get(name, expand, cancellationToken); + } + } +} diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsSubscriptionMockingExtension.cs similarity index 91% rename from sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsSubscriptionMockingExtension.cs index 1f37b3222ddd..8bf43e17f8f7 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/DevTestLabsSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DevTestLabs; -namespace Azure.ResourceManager.DevTestLabs +namespace Azure.ResourceManager.DevTestLabs.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DevTestLabsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _devTestLabLabsClientDiagnostics; private LabsRestOperations _devTestLabLabsRestClient; private ClientDiagnostics _devTestLabGlobalScheduleGlobalSchedulesClientDiagnostics; private GlobalSchedulesRestOperations _devTestLabGlobalScheduleGlobalSchedulesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DevTestLabsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DevTestLabsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,7 +69,7 @@ public virtual AsyncPageable GetDevTestLabsAsync(string expa { HttpMessage FirstPageRequest(int? pageSizeHint) => DevTestLabLabsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand, filter, top, orderby); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevTestLabLabsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand, filter, top, orderby); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevTestLabResource(Client, DevTestLabData.DeserializeDevTestLabData(e)), DevTestLabLabsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevTestLabs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevTestLabResource(Client, DevTestLabData.DeserializeDevTestLabData(e)), DevTestLabLabsClientDiagnostics, Pipeline, "DevTestLabsSubscriptionMockingExtension.GetDevTestLabs", "value", "nextLink", cancellationToken); } /// @@ -94,7 +95,7 @@ public virtual Pageable GetDevTestLabs(string expand = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => DevTestLabLabsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand, filter, top, orderby); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevTestLabLabsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand, filter, top, orderby); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevTestLabResource(Client, DevTestLabData.DeserializeDevTestLabData(e)), DevTestLabLabsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevTestLabs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevTestLabResource(Client, DevTestLabData.DeserializeDevTestLabData(e)), DevTestLabLabsClientDiagnostics, Pipeline, "DevTestLabsSubscriptionMockingExtension.GetDevTestLabs", "value", "nextLink", cancellationToken); } /// @@ -120,7 +121,7 @@ public virtual AsyncPageable GetDevTestLabGlob { HttpMessage FirstPageRequest(int? pageSizeHint) => DevTestLabGlobalScheduleGlobalSchedulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand, filter, top, orderby); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevTestLabGlobalScheduleGlobalSchedulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand, filter, top, orderby); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevTestLabGlobalScheduleResource(Client, DevTestLabScheduleData.DeserializeDevTestLabScheduleData(e)), DevTestLabGlobalScheduleGlobalSchedulesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevTestLabGlobalSchedules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevTestLabGlobalScheduleResource(Client, DevTestLabScheduleData.DeserializeDevTestLabScheduleData(e)), DevTestLabGlobalScheduleGlobalSchedulesClientDiagnostics, Pipeline, "DevTestLabsSubscriptionMockingExtension.GetDevTestLabGlobalSchedules", "value", "nextLink", cancellationToken); } /// @@ -146,7 +147,7 @@ public virtual Pageable GetDevTestLabGlobalSch { HttpMessage FirstPageRequest(int? pageSizeHint) => DevTestLabGlobalScheduleGlobalSchedulesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand, filter, top, orderby); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DevTestLabGlobalScheduleGlobalSchedulesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand, filter, top, orderby); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevTestLabGlobalScheduleResource(Client, DevTestLabScheduleData.DeserializeDevTestLabScheduleData(e)), DevTestLabGlobalScheduleGlobalSchedulesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDevTestLabGlobalSchedules", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevTestLabGlobalScheduleResource(Client, DevTestLabScheduleData.DeserializeDevTestLabScheduleData(e)), DevTestLabGlobalScheduleGlobalSchedulesClientDiagnostics, Pipeline, "DevTestLabsSubscriptionMockingExtension.GetDevTestLabGlobalSchedules", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index c15281e9a375..000000000000 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DevTestLabs -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DevTestLabResources in the ResourceGroupResource. - /// An object representing collection of DevTestLabResources and their operations over a DevTestLabResource. - public virtual DevTestLabCollection GetDevTestLabs() - { - return GetCachedClient(Client => new DevTestLabCollection(Client, Id)); - } - - /// Gets a collection of DevTestLabGlobalScheduleResources in the ResourceGroupResource. - /// An object representing collection of DevTestLabGlobalScheduleResources and their operations over a DevTestLabGlobalScheduleResource. - public virtual DevTestLabGlobalScheduleCollection GetDevTestLabGlobalSchedules() - { - return GetCachedClient(Client => new DevTestLabGlobalScheduleCollection(Client, Id)); - } - } -} diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/DigitalTwinsDescriptionResource.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/DigitalTwinsDescriptionResource.cs index 460f5785ffa6..7383a659ebe9 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/DigitalTwinsDescriptionResource.cs +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/DigitalTwinsDescriptionResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DigitalTwinsEndpointResources and their operations over a DigitalTwinsEndpointResource. public virtual DigitalTwinsEndpointResourceCollection GetDigitalTwinsEndpointResources() { - return GetCachedClient(Client => new DigitalTwinsEndpointResourceCollection(Client, Id)); + return GetCachedClient(client => new DigitalTwinsEndpointResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DigitalTwinsEndpointResourceCollection GetDigitalTwinsEndpointRes /// /// Name of Endpoint Resource. /// The cancellation token to use. - /// 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> GetDigitalTwinsEndpointResourceAsync(string endpointName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDigitalTwin /// /// Name of Endpoint Resource. /// The cancellation token to use. - /// 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 GetDigitalTwinsEndpointResource(string endpointName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDigitalTwinsEndpointRes /// An object representing collection of DigitalTwinsPrivateLinkResources and their operations over a DigitalTwinsPrivateLinkResource. public virtual DigitalTwinsPrivateLinkResourceCollection GetDigitalTwinsPrivateLinkResources() { - return GetCachedClient(Client => new DigitalTwinsPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new DigitalTwinsPrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DigitalTwinsPrivateLinkResourceCollection GetDigitalTwinsPrivateL /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetDigitalTwinsPrivateLinkResourceAsync(string resourceId, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetDigitalT /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetDigitalTwinsPrivateLinkResource(string resourceId, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetDigitalTwinsPrivateL /// An object representing collection of DigitalTwinsPrivateEndpointConnectionResources and their operations over a DigitalTwinsPrivateEndpointConnectionResource. public virtual DigitalTwinsPrivateEndpointConnectionCollection GetDigitalTwinsPrivateEndpointConnections() { - return GetCachedClient(Client => new DigitalTwinsPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new DigitalTwinsPrivateEndpointConnectionCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual DigitalTwinsPrivateEndpointConnectionCollection GetDigitalTwinsPr /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetDigitalTwinsPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetDigitalTwinsPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetDigita /// An object representing collection of TimeSeriesDatabaseConnectionResources and their operations over a TimeSeriesDatabaseConnectionResource. public virtual TimeSeriesDatabaseConnectionCollection GetTimeSeriesDatabaseConnections() { - return GetCachedClient(Client => new TimeSeriesDatabaseConnectionCollection(Client, Id)); + return GetCachedClient(client => new TimeSeriesDatabaseConnectionCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual TimeSeriesDatabaseConnectionCollection GetTimeSeriesDatabaseConne /// /// Name of time series database connection. /// The cancellation token to use. - /// 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> GetTimeSeriesDatabaseConnectionAsync(string timeSeriesDatabaseConnectionName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetTim /// /// Name of time series database connection. /// The cancellation token to use. - /// 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 GetTimeSeriesDatabaseConnection(string timeSeriesDatabaseConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsArmClientMockingExtension.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsArmClientMockingExtension.cs new file mode 100644 index 000000000000..89fadd9ecea3 --- /dev/null +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsArmClientMockingExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DigitalTwins; + +namespace Azure.ResourceManager.DigitalTwins.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DigitalTwinsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DigitalTwinsArmClientMockingExtension() + { + } + + /// 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 DigitalTwinsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DigitalTwinsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DigitalTwinsDescriptionResource GetDigitalTwinsDescriptionResource(ResourceIdentifier id) + { + DigitalTwinsDescriptionResource.ValidateResourceId(id); + return new DigitalTwinsDescriptionResource(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 DigitalTwinsEndpointResource GetDigitalTwinsEndpointResource(ResourceIdentifier id) + { + DigitalTwinsEndpointResource.ValidateResourceId(id); + return new DigitalTwinsEndpointResource(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 DigitalTwinsPrivateLinkResource GetDigitalTwinsPrivateLinkResource(ResourceIdentifier id) + { + DigitalTwinsPrivateLinkResource.ValidateResourceId(id); + return new DigitalTwinsPrivateLinkResource(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 DigitalTwinsPrivateEndpointConnectionResource GetDigitalTwinsPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DigitalTwinsPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DigitalTwinsPrivateEndpointConnectionResource(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 TimeSeriesDatabaseConnectionResource GetTimeSeriesDatabaseConnectionResource(ResourceIdentifier id) + { + TimeSeriesDatabaseConnectionResource.ValidateResourceId(id); + return new TimeSeriesDatabaseConnectionResource(Client, id); + } + } +} diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsExtensions.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsExtensions.cs index 6cdbd7f2d23d..032bcc7c6179 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsExtensions.cs +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DigitalTwins.Mocking; using Azure.ResourceManager.DigitalTwins.Models; using Azure.ResourceManager.Resources; @@ -19,138 +20,113 @@ namespace Azure.ResourceManager.DigitalTwins /// A class to add extension methods to Azure.ResourceManager.DigitalTwins. public static partial class DigitalTwinsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DigitalTwinsArmClientMockingExtension GetDigitalTwinsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DigitalTwinsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DigitalTwinsResourceGroupMockingExtension GetDigitalTwinsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DigitalTwinsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DigitalTwinsSubscriptionMockingExtension GetDigitalTwinsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DigitalTwinsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DigitalTwinsDescriptionResource /// /// 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. /// Returns a object. public static DigitalTwinsDescriptionResource GetDigitalTwinsDescriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DigitalTwinsDescriptionResource.ValidateResourceId(id); - return new DigitalTwinsDescriptionResource(client, id); - } - ); + return GetDigitalTwinsArmClientMockingExtension(client).GetDigitalTwinsDescriptionResource(id); } - #endregion - #region DigitalTwinsEndpointResource /// /// 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. /// Returns a object. public static DigitalTwinsEndpointResource GetDigitalTwinsEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DigitalTwinsEndpointResource.ValidateResourceId(id); - return new DigitalTwinsEndpointResource(client, id); - } - ); + return GetDigitalTwinsArmClientMockingExtension(client).GetDigitalTwinsEndpointResource(id); } - #endregion - #region DigitalTwinsPrivateLinkResource /// /// 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. /// Returns a object. public static DigitalTwinsPrivateLinkResource GetDigitalTwinsPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DigitalTwinsPrivateLinkResource.ValidateResourceId(id); - return new DigitalTwinsPrivateLinkResource(client, id); - } - ); + return GetDigitalTwinsArmClientMockingExtension(client).GetDigitalTwinsPrivateLinkResource(id); } - #endregion - #region DigitalTwinsPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static DigitalTwinsPrivateEndpointConnectionResource GetDigitalTwinsPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DigitalTwinsPrivateEndpointConnectionResource.ValidateResourceId(id); - return new DigitalTwinsPrivateEndpointConnectionResource(client, id); - } - ); + return GetDigitalTwinsArmClientMockingExtension(client).GetDigitalTwinsPrivateEndpointConnectionResource(id); } - #endregion - #region TimeSeriesDatabaseConnectionResource /// /// 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. /// Returns a object. public static TimeSeriesDatabaseConnectionResource GetTimeSeriesDatabaseConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TimeSeriesDatabaseConnectionResource.ValidateResourceId(id); - return new TimeSeriesDatabaseConnectionResource(client, id); - } - ); + return GetDigitalTwinsArmClientMockingExtension(client).GetTimeSeriesDatabaseConnectionResource(id); } - #endregion - /// Gets a collection of DigitalTwinsDescriptionResources in the ResourceGroupResource. + /// + /// Gets a collection of DigitalTwinsDescriptionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DigitalTwinsDescriptionResources and their operations over a DigitalTwinsDescriptionResource. public static DigitalTwinsDescriptionCollection GetDigitalTwinsDescriptions(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDigitalTwinsDescriptions(); + return GetDigitalTwinsResourceGroupMockingExtension(resourceGroupResource).GetDigitalTwinsDescriptions(); } /// @@ -165,16 +141,20 @@ public static DigitalTwinsDescriptionCollection GetDigitalTwinsDescriptions(this /// DigitalTwins_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DigitalTwinsInstance. /// The cancellation token to use. - /// 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 static async Task> GetDigitalTwinsDescriptionAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDigitalTwinsDescriptions().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetDigitalTwinsResourceGroupMockingExtension(resourceGroupResource).GetDigitalTwinsDescriptionAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -189,16 +169,20 @@ public static async Task> GetDigitalTw /// DigitalTwins_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DigitalTwinsInstance. /// The cancellation token to use. - /// 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 static Response GetDigitalTwinsDescription(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDigitalTwinsDescriptions().Get(resourceName, cancellationToken); + return GetDigitalTwinsResourceGroupMockingExtension(resourceGroupResource).GetDigitalTwinsDescription(resourceName, cancellationToken); } /// @@ -213,13 +197,17 @@ public static Response GetDigitalTwinsDescripti /// DigitalTwins_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDigitalTwinsDescriptionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDigitalTwinsDescriptionsAsync(cancellationToken); + return GetDigitalTwinsSubscriptionMockingExtension(subscriptionResource).GetDigitalTwinsDescriptionsAsync(cancellationToken); } /// @@ -234,13 +222,17 @@ public static AsyncPageable GetDigitalTwinsDesc /// DigitalTwins_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDigitalTwinsDescriptions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDigitalTwinsDescriptions(cancellationToken); + return GetDigitalTwinsSubscriptionMockingExtension(subscriptionResource).GetDigitalTwinsDescriptions(cancellationToken); } /// @@ -255,6 +247,10 @@ public static Pageable GetDigitalTwinsDescripti /// DigitalTwins_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of DigitalTwinsInstance. @@ -263,9 +259,7 @@ public static Pageable GetDigitalTwinsDescripti /// is null. public static async Task> CheckDigitalTwinsNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DigitalTwinsNameContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDigitalTwinsNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDigitalTwinsSubscriptionMockingExtension(subscriptionResource).CheckDigitalTwinsNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -280,6 +274,10 @@ public static async Task> CheckDigitalTwinsName /// DigitalTwins_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Location of DigitalTwinsInstance. @@ -288,9 +286,7 @@ public static async Task> CheckDigitalTwinsName /// is null. public static Response CheckDigitalTwinsNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DigitalTwinsNameContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDigitalTwinsNameAvailability(location, content, cancellationToken); + return GetDigitalTwinsSubscriptionMockingExtension(subscriptionResource).CheckDigitalTwinsNameAvailability(location, content, cancellationToken); } } } diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsResourceGroupMockingExtension.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f660cfe08403 --- /dev/null +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DigitalTwins; + +namespace Azure.ResourceManager.DigitalTwins.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DigitalTwinsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DigitalTwinsResourceGroupMockingExtension() + { + } + + /// 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 DigitalTwinsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DigitalTwinsDescriptionResources in the ResourceGroupResource. + /// An object representing collection of DigitalTwinsDescriptionResources and their operations over a DigitalTwinsDescriptionResource. + public virtual DigitalTwinsDescriptionCollection GetDigitalTwinsDescriptions() + { + return GetCachedClient(client => new DigitalTwinsDescriptionCollection(client, Id)); + } + + /// + /// Get DigitalTwinsInstances resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName} + /// + /// + /// Operation Id + /// DigitalTwins_Get + /// + /// + /// + /// The name of the DigitalTwinsInstance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDigitalTwinsDescriptionAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetDigitalTwinsDescriptions().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get DigitalTwinsInstances resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName} + /// + /// + /// Operation Id + /// DigitalTwins_Get + /// + /// + /// + /// The name of the DigitalTwinsInstance. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDigitalTwinsDescription(string resourceName, CancellationToken cancellationToken = default) + { + return GetDigitalTwinsDescriptions().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsSubscriptionMockingExtension.cs similarity index 86% rename from sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsSubscriptionMockingExtension.cs index ed8a7b0e1d7a..1b49450ef869 100644 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/DigitalTwinsSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DigitalTwins; using Azure.ResourceManager.DigitalTwins.Models; -namespace Azure.ResourceManager.DigitalTwins +namespace Azure.ResourceManager.DigitalTwins.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DigitalTwinsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _digitalTwinsDescriptionDigitalTwinsClientDiagnostics; private DigitalTwinsRestOperations _digitalTwinsDescriptionDigitalTwinsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DigitalTwinsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DigitalTwinsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetDigitalTwinsDes { HttpMessage FirstPageRequest(int? pageSizeHint) => DigitalTwinsDescriptionDigitalTwinsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DigitalTwinsDescriptionDigitalTwinsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DigitalTwinsDescriptionResource(Client, DigitalTwinsDescriptionData.DeserializeDigitalTwinsDescriptionData(e)), DigitalTwinsDescriptionDigitalTwinsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDigitalTwinsDescriptions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DigitalTwinsDescriptionResource(Client, DigitalTwinsDescriptionData.DeserializeDigitalTwinsDescriptionData(e)), DigitalTwinsDescriptionDigitalTwinsClientDiagnostics, Pipeline, "DigitalTwinsSubscriptionMockingExtension.GetDigitalTwinsDescriptions", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetDigitalTwinsDescript { HttpMessage FirstPageRequest(int? pageSizeHint) => DigitalTwinsDescriptionDigitalTwinsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DigitalTwinsDescriptionDigitalTwinsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DigitalTwinsDescriptionResource(Client, DigitalTwinsDescriptionData.DeserializeDigitalTwinsDescriptionData(e)), DigitalTwinsDescriptionDigitalTwinsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDigitalTwinsDescriptions", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DigitalTwinsDescriptionResource(Client, DigitalTwinsDescriptionData.DeserializeDigitalTwinsDescriptionData(e)), DigitalTwinsDescriptionDigitalTwinsClientDiagnostics, Pipeline, "DigitalTwinsSubscriptionMockingExtension.GetDigitalTwinsDescriptions", "value", "nextLink", cancellationToken); } /// @@ -104,9 +105,12 @@ public virtual Pageable GetDigitalTwinsDescript /// Location of DigitalTwinsInstance. /// Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDigitalTwinsNameAvailabilityAsync(AzureLocation location, DigitalTwinsNameContent content, CancellationToken cancellationToken = default) { - using var scope = DigitalTwinsDescriptionDigitalTwinsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDigitalTwinsNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DigitalTwinsDescriptionDigitalTwinsClientDiagnostics.CreateScope("DigitalTwinsSubscriptionMockingExtension.CheckDigitalTwinsNameAvailability"); scope.Start(); try { @@ -136,9 +140,12 @@ public virtual async Task> CheckDigitalTwinsNam /// Location of DigitalTwinsInstance. /// Set the name parameter in the DigitalTwinsInstanceCheckName structure to the name of the DigitalTwinsInstance to check. /// The cancellation token to use. + /// is null. public virtual Response CheckDigitalTwinsNameAvailability(AzureLocation location, DigitalTwinsNameContent content, CancellationToken cancellationToken = default) { - using var scope = DigitalTwinsDescriptionDigitalTwinsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDigitalTwinsNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DigitalTwinsDescriptionDigitalTwinsClientDiagnostics.CreateScope("DigitalTwinsSubscriptionMockingExtension.CheckDigitalTwinsNameAvailability"); scope.Start(); try { diff --git a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d59779ea0d8d..000000000000 --- a/sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DigitalTwins -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DigitalTwinsDescriptionResources in the ResourceGroupResource. - /// An object representing collection of DigitalTwinsDescriptionResources and their operations over a DigitalTwinsDescriptionResource. - public virtual DigitalTwinsDescriptionCollection GetDigitalTwinsDescriptions() - { - return GetCachedClient(Client => new DigitalTwinsDescriptionCollection(Client, Id)); - } - } -} diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsArmClientMockingExtension.cs b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsArmClientMockingExtension.cs new file mode 100644 index 000000000000..1a29fc2ab717 --- /dev/null +++ b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsArmClientMockingExtension.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Dns; + +namespace Azure.ResourceManager.Dns.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DnsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DnsArmClientMockingExtension() + { + } + + /// 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 DnsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DnsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DnsARecordResource GetDnsARecordResource(ResourceIdentifier id) + { + DnsARecordResource.ValidateResourceId(id); + return new DnsARecordResource(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 DnsAaaaRecordResource GetDnsAaaaRecordResource(ResourceIdentifier id) + { + DnsAaaaRecordResource.ValidateResourceId(id); + return new DnsAaaaRecordResource(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 DnsCaaRecordResource GetDnsCaaRecordResource(ResourceIdentifier id) + { + DnsCaaRecordResource.ValidateResourceId(id); + return new DnsCaaRecordResource(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 DnsCnameRecordResource GetDnsCnameRecordResource(ResourceIdentifier id) + { + DnsCnameRecordResource.ValidateResourceId(id); + return new DnsCnameRecordResource(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 DnsMXRecordResource GetDnsMXRecordResource(ResourceIdentifier id) + { + DnsMXRecordResource.ValidateResourceId(id); + return new DnsMXRecordResource(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 DnsNSRecordResource GetDnsNSRecordResource(ResourceIdentifier id) + { + DnsNSRecordResource.ValidateResourceId(id); + return new DnsNSRecordResource(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 DnsPtrRecordResource GetDnsPtrRecordResource(ResourceIdentifier id) + { + DnsPtrRecordResource.ValidateResourceId(id); + return new DnsPtrRecordResource(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 DnsSoaRecordResource GetDnsSoaRecordResource(ResourceIdentifier id) + { + DnsSoaRecordResource.ValidateResourceId(id); + return new DnsSoaRecordResource(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 DnsSrvRecordResource GetDnsSrvRecordResource(ResourceIdentifier id) + { + DnsSrvRecordResource.ValidateResourceId(id); + return new DnsSrvRecordResource(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 DnsTxtRecordResource GetDnsTxtRecordResource(ResourceIdentifier id) + { + DnsTxtRecordResource.ValidateResourceId(id); + return new DnsTxtRecordResource(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 DnsZoneResource GetDnsZoneResource(ResourceIdentifier id) + { + DnsZoneResource.ValidateResourceId(id); + return new DnsZoneResource(Client, id); + } + } +} diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsExtensions.cs b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsExtensions.cs index e4ad455c51ee..5afd33e9c004 100644 --- a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsExtensions.cs +++ b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Dns.Mocking; using Azure.ResourceManager.Dns.Models; using Azure.ResourceManager.Resources; @@ -19,252 +20,209 @@ namespace Azure.ResourceManager.Dns /// A class to add extension methods to Azure.ResourceManager.Dns. public static partial class DnsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DnsArmClientMockingExtension GetDnsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DnsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DnsResourceGroupMockingExtension GetDnsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DnsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DnsSubscriptionMockingExtension GetDnsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DnsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DnsARecordResource /// /// 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. /// Returns a object. public static DnsARecordResource GetDnsARecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsARecordResource.ValidateResourceId(id); - return new DnsARecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsARecordResource(id); } - #endregion - #region DnsAaaaRecordResource /// /// 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. /// Returns a object. public static DnsAaaaRecordResource GetDnsAaaaRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsAaaaRecordResource.ValidateResourceId(id); - return new DnsAaaaRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsAaaaRecordResource(id); } - #endregion - #region DnsCaaRecordResource /// /// 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. /// Returns a object. public static DnsCaaRecordResource GetDnsCaaRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsCaaRecordResource.ValidateResourceId(id); - return new DnsCaaRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsCaaRecordResource(id); } - #endregion - #region DnsCnameRecordResource /// /// 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. /// Returns a object. public static DnsCnameRecordResource GetDnsCnameRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsCnameRecordResource.ValidateResourceId(id); - return new DnsCnameRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsCnameRecordResource(id); } - #endregion - #region DnsMXRecordResource /// /// 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. /// Returns a object. public static DnsMXRecordResource GetDnsMXRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsMXRecordResource.ValidateResourceId(id); - return new DnsMXRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsMXRecordResource(id); } - #endregion - #region DnsNSRecordResource /// /// 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. /// Returns a object. public static DnsNSRecordResource GetDnsNSRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsNSRecordResource.ValidateResourceId(id); - return new DnsNSRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsNSRecordResource(id); } - #endregion - #region DnsPtrRecordResource /// /// 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. /// Returns a object. public static DnsPtrRecordResource GetDnsPtrRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsPtrRecordResource.ValidateResourceId(id); - return new DnsPtrRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsPtrRecordResource(id); } - #endregion - #region DnsSoaRecordResource /// /// 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. /// Returns a object. public static DnsSoaRecordResource GetDnsSoaRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsSoaRecordResource.ValidateResourceId(id); - return new DnsSoaRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsSoaRecordResource(id); } - #endregion - #region DnsSrvRecordResource /// /// 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. /// Returns a object. public static DnsSrvRecordResource GetDnsSrvRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsSrvRecordResource.ValidateResourceId(id); - return new DnsSrvRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsSrvRecordResource(id); } - #endregion - #region DnsTxtRecordResource /// /// 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. /// Returns a object. public static DnsTxtRecordResource GetDnsTxtRecordResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsTxtRecordResource.ValidateResourceId(id); - return new DnsTxtRecordResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsTxtRecordResource(id); } - #endregion - #region DnsZoneResource /// /// 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. /// Returns a object. public static DnsZoneResource GetDnsZoneResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsZoneResource.ValidateResourceId(id); - return new DnsZoneResource(client, id); - } - ); + return GetDnsArmClientMockingExtension(client).GetDnsZoneResource(id); } - #endregion - /// Gets a collection of DnsZoneResources in the ResourceGroupResource. + /// + /// Gets a collection of DnsZoneResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DnsZoneResources and their operations over a DnsZoneResource. public static DnsZoneCollection GetDnsZones(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDnsZones(); + return GetDnsResourceGroupMockingExtension(resourceGroupResource).GetDnsZones(); } /// @@ -279,16 +237,20 @@ public static DnsZoneCollection GetDnsZones(this ResourceGroupResource resourceG /// Zones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS zone (without a terminating dot). /// The cancellation token to use. - /// 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 static async Task> GetDnsZoneAsync(this ResourceGroupResource resourceGroupResource, string zoneName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDnsZones().GetAsync(zoneName, cancellationToken).ConfigureAwait(false); + return await GetDnsResourceGroupMockingExtension(resourceGroupResource).GetDnsZoneAsync(zoneName, cancellationToken).ConfigureAwait(false); } /// @@ -303,16 +265,20 @@ public static async Task> GetDnsZoneAsync(this Resourc /// Zones_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS zone (without a terminating dot). /// The cancellation token to use. - /// 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 static Response GetDnsZone(this ResourceGroupResource resourceGroupResource, string zoneName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDnsZones().Get(zoneName, cancellationToken); + return GetDnsResourceGroupMockingExtension(resourceGroupResource).GetDnsZone(zoneName, cancellationToken); } /// @@ -327,6 +293,10 @@ public static Response GetDnsZone(this ResourceGroupResource re /// Zones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of DNS zones to return. If not specified, returns up to 100 zones. @@ -334,7 +304,7 @@ public static Response GetDnsZone(this ResourceGroupResource re /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDnsZonesAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsZonesAsync(top, cancellationToken); + return GetDnsSubscriptionMockingExtension(subscriptionResource).GetDnsZonesAsync(top, cancellationToken); } /// @@ -349,6 +319,10 @@ public static AsyncPageable GetDnsZonesAsync(this SubscriptionR /// Zones_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of DNS zones to return. If not specified, returns up to 100 zones. @@ -356,7 +330,7 @@ public static AsyncPageable GetDnsZonesAsync(this SubscriptionR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDnsZones(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsZones(top, cancellationToken); + return GetDnsSubscriptionMockingExtension(subscriptionResource).GetDnsZones(top, cancellationToken); } /// @@ -371,6 +345,10 @@ public static Pageable GetDnsZones(this SubscriptionResource su /// DnsResourceReference_GetByTargetResources /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Properties for dns resource reference request. @@ -378,9 +356,7 @@ public static Pageable GetDnsZones(this SubscriptionResource su /// is null. public static async Task> GetDnsResourceReferencesByTargetResourcesAsync(this SubscriptionResource subscriptionResource, DnsResourceReferenceContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsResourceReferencesByTargetResourcesAsync(content, cancellationToken).ConfigureAwait(false); + return await GetDnsSubscriptionMockingExtension(subscriptionResource).GetDnsResourceReferencesByTargetResourcesAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -395,6 +371,10 @@ public static async Task> GetDnsResourceRef /// DnsResourceReference_GetByTargetResources /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Properties for dns resource reference request. @@ -402,9 +382,7 @@ public static async Task> GetDnsResourceRef /// is null. public static Response GetDnsResourceReferencesByTargetResources(this SubscriptionResource subscriptionResource, DnsResourceReferenceContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsResourceReferencesByTargetResources(content, cancellationToken); + return GetDnsSubscriptionMockingExtension(subscriptionResource).GetDnsResourceReferencesByTargetResources(content, cancellationToken); } } } diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsResourceGroupMockingExtension.cs b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c87f80be8900 --- /dev/null +++ b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Dns; + +namespace Azure.ResourceManager.Dns.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DnsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DnsResourceGroupMockingExtension() + { + } + + /// 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 DnsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DnsZoneResources in the ResourceGroupResource. + /// An object representing collection of DnsZoneResources and their operations over a DnsZoneResource. + public virtual DnsZoneCollection GetDnsZones() + { + return GetCachedClient(client => new DnsZoneCollection(client, Id)); + } + + /// + /// Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName} + /// + /// + /// Operation Id + /// Zones_Get + /// + /// + /// + /// The name of the DNS zone (without a terminating dot). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsZoneAsync(string zoneName, CancellationToken cancellationToken = default) + { + return await GetDnsZones().GetAsync(zoneName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName} + /// + /// + /// Operation Id + /// Zones_Get + /// + /// + /// + /// The name of the DNS zone (without a terminating dot). + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsZone(string zoneName, CancellationToken cancellationToken = default) + { + return GetDnsZones().Get(zoneName, cancellationToken); + } + } +} diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsSubscriptionMockingExtension.cs similarity index 87% rename from sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsSubscriptionMockingExtension.cs index d0dd4976fa5a..a644e848823a 100644 --- a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/DnsSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Dns; using Azure.ResourceManager.Dns.Models; -namespace Azure.ResourceManager.Dns +namespace Azure.ResourceManager.Dns.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DnsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dnsZoneZonesClientDiagnostics; private ZonesRestOperations _dnsZoneZonesRestClient; private ClientDiagnostics _dnsResourceReferenceClientDiagnostics; private DnsResourceReferenceRestOperations _dnsResourceReferenceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DnsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DnsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,7 +69,7 @@ public virtual AsyncPageable GetDnsZonesAsync(int? top = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsZoneZonesRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsZoneZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsZoneResource(Client, DnsZoneData.DeserializeDnsZoneData(e)), DnsZoneZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsZoneResource(Client, DnsZoneData.DeserializeDnsZoneData(e)), DnsZoneZonesClientDiagnostics, Pipeline, "DnsSubscriptionMockingExtension.GetDnsZones", "value", "nextLink", cancellationToken); } /// @@ -91,7 +92,7 @@ public virtual Pageable GetDnsZones(int? top = null, Cancellati { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsZoneZonesRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsZoneZonesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsZoneResource(Client, DnsZoneData.DeserializeDnsZoneData(e)), DnsZoneZonesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsZones", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsZoneResource(Client, DnsZoneData.DeserializeDnsZoneData(e)), DnsZoneZonesClientDiagnostics, Pipeline, "DnsSubscriptionMockingExtension.GetDnsZones", "value", "nextLink", cancellationToken); } /// @@ -109,9 +110,12 @@ public virtual Pageable GetDnsZones(int? top = null, Cancellati /// /// Properties for dns resource reference request. /// The cancellation token to use. + /// is null. public virtual async Task> GetDnsResourceReferencesByTargetResourcesAsync(DnsResourceReferenceContent content, CancellationToken cancellationToken = default) { - using var scope = DnsResourceReferenceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDnsResourceReferencesByTargetResources"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DnsResourceReferenceClientDiagnostics.CreateScope("DnsSubscriptionMockingExtension.GetDnsResourceReferencesByTargetResources"); scope.Start(); try { @@ -140,9 +144,12 @@ public virtual async Task> GetDnsResourceRe /// /// Properties for dns resource reference request. /// The cancellation token to use. + /// is null. public virtual Response GetDnsResourceReferencesByTargetResources(DnsResourceReferenceContent content, CancellationToken cancellationToken = default) { - using var scope = DnsResourceReferenceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetDnsResourceReferencesByTargetResources"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DnsResourceReferenceClientDiagnostics.CreateScope("DnsSubscriptionMockingExtension.GetDnsResourceReferencesByTargetResources"); scope.Start(); try { diff --git a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 0750fe110607..000000000000 --- a/sdk/dns/Azure.ResourceManager.Dns/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Dns -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DnsZoneResources in the ResourceGroupResource. - /// An object representing collection of DnsZoneResources and their operations over a DnsZoneResource. - public virtual DnsZoneCollection GetDnsZones() - { - return GetCachedClient(Client => new DnsZoneCollection(Client, Id)); - } - } -} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs index 7de343f46110..7f3df8e1de13 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DnsForwardingRuleResources and their operations over a DnsForwardingRuleResource. public virtual DnsForwardingRuleCollection GetDnsForwardingRules() { - return GetCachedClient(Client => new DnsForwardingRuleCollection(Client, Id)); + return GetCachedClient(client => new DnsForwardingRuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DnsForwardingRuleCollection GetDnsForwardingRules() /// /// The name of the forwarding rule. /// The cancellation token to use. - /// 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> GetDnsForwardingRuleAsync(string forwardingRuleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDnsForwardingR /// /// The name of the forwarding rule. /// The cancellation token to use. - /// 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 GetDnsForwardingRule(string forwardingRuleName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDnsForwardingRule(string f /// An object representing collection of DnsForwardingRulesetVirtualNetworkLinkResources and their operations over a DnsForwardingRulesetVirtualNetworkLinkResource. public virtual DnsForwardingRulesetVirtualNetworkLinkCollection GetDnsForwardingRulesetVirtualNetworkLinks() { - return GetCachedClient(Client => new DnsForwardingRulesetVirtualNetworkLinkCollection(Client, Id)); + return GetCachedClient(client => new DnsForwardingRulesetVirtualNetworkLinkCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DnsForwardingRulesetVirtualNetworkLinkCollection GetDnsForwarding /// /// The name of the virtual network link. /// The cancellation token to use. - /// 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> GetDnsForwardingRulesetVirtualNetworkLinkAsync(string virtualNetworkLinkName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The name of the virtual network link. /// The cancellation token to use. - /// 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 GetDnsForwardingRulesetVirtualNetworkLink(string virtualNetworkLinkName, CancellationToken cancellationToken = default) { diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs index fa4b7e1d1fb2..31f62d666327 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DnsResolverInboundEndpointResources and their operations over a DnsResolverInboundEndpointResource. public virtual DnsResolverInboundEndpointCollection GetDnsResolverInboundEndpoints() { - return GetCachedClient(Client => new DnsResolverInboundEndpointCollection(Client, Id)); + return GetCachedClient(client => new DnsResolverInboundEndpointCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DnsResolverInboundEndpointCollection GetDnsResolverInboundEndpoin /// /// The name of the inbound endpoint for the DNS resolver. /// The cancellation token to use. - /// 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> GetDnsResolverInboundEndpointAsync(string inboundEndpointName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDnsRe /// /// The name of the inbound endpoint for the DNS resolver. /// The cancellation token to use. - /// 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 GetDnsResolverInboundEndpoint(string inboundEndpointName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDnsResolverInboun /// An object representing collection of DnsResolverOutboundEndpointResources and their operations over a DnsResolverOutboundEndpointResource. public virtual DnsResolverOutboundEndpointCollection GetDnsResolverOutboundEndpoints() { - return GetCachedClient(Client => new DnsResolverOutboundEndpointCollection(Client, Id)); + return GetCachedClient(client => new DnsResolverOutboundEndpointCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DnsResolverOutboundEndpointCollection GetDnsResolverOutboundEndpo /// /// The name of the outbound endpoint for the DNS resolver. /// The cancellation token to use. - /// 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> GetDnsResolverOutboundEndpointAsync(string outboundEndpointName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetDnsR /// /// The name of the outbound endpoint for the DNS resolver. /// The cancellation token to use. - /// 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 GetDnsResolverOutboundEndpoint(string outboundEndpointName, CancellationToken cancellationToken = default) { diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverArmClientMockingExtension.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverArmClientMockingExtension.cs new file mode 100644 index 000000000000..cf0f55b96e6d --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverArmClientMockingExtension.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DnsResolver; + +namespace Azure.ResourceManager.DnsResolver.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DnsResolverArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DnsResolverArmClientMockingExtension() + { + } + + /// 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 DnsResolverArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DnsResolverArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DnsResolverResource GetDnsResolverResource(ResourceIdentifier id) + { + DnsResolverResource.ValidateResourceId(id); + return new DnsResolverResource(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 DnsResolverInboundEndpointResource GetDnsResolverInboundEndpointResource(ResourceIdentifier id) + { + DnsResolverInboundEndpointResource.ValidateResourceId(id); + return new DnsResolverInboundEndpointResource(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 DnsResolverOutboundEndpointResource GetDnsResolverOutboundEndpointResource(ResourceIdentifier id) + { + DnsResolverOutboundEndpointResource.ValidateResourceId(id); + return new DnsResolverOutboundEndpointResource(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 DnsForwardingRulesetResource GetDnsForwardingRulesetResource(ResourceIdentifier id) + { + DnsForwardingRulesetResource.ValidateResourceId(id); + return new DnsForwardingRulesetResource(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 DnsForwardingRuleResource GetDnsForwardingRuleResource(ResourceIdentifier id) + { + DnsForwardingRuleResource.ValidateResourceId(id); + return new DnsForwardingRuleResource(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 DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRulesetVirtualNetworkLinkResource(ResourceIdentifier id) + { + DnsForwardingRulesetVirtualNetworkLinkResource.ValidateResourceId(id); + return new DnsForwardingRulesetVirtualNetworkLinkResource(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 VirtualNetworkDnsResolverResource GetVirtualNetworkDnsResolverResource(ResourceIdentifier id) + { + VirtualNetworkDnsResolverResource.ValidateResourceId(id); + return new VirtualNetworkDnsResolverResource(Client, id); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs index 1a9ab38a65a2..9e4255ce33c7 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DnsResolver.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.DnsResolver @@ -18,176 +19,145 @@ namespace Azure.ResourceManager.DnsResolver /// A class to add extension methods to Azure.ResourceManager.DnsResolver. public static partial class DnsResolverExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DnsResolverArmClientMockingExtension GetDnsResolverArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DnsResolverArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DnsResolverResourceGroupMockingExtension GetDnsResolverResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DnsResolverResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DnsResolverSubscriptionMockingExtension GetDnsResolverSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DnsResolverSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DnsResolverResource /// /// 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. /// Returns a object. public static DnsResolverResource GetDnsResolverResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsResolverResource.ValidateResourceId(id); - return new DnsResolverResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsResolverResource(id); } - #endregion - #region DnsResolverInboundEndpointResource /// /// 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. /// Returns a object. public static DnsResolverInboundEndpointResource GetDnsResolverInboundEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsResolverInboundEndpointResource.ValidateResourceId(id); - return new DnsResolverInboundEndpointResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsResolverInboundEndpointResource(id); } - #endregion - #region DnsResolverOutboundEndpointResource /// /// 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. /// Returns a object. public static DnsResolverOutboundEndpointResource GetDnsResolverOutboundEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsResolverOutboundEndpointResource.ValidateResourceId(id); - return new DnsResolverOutboundEndpointResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsResolverOutboundEndpointResource(id); } - #endregion - #region DnsForwardingRulesetResource /// /// 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. /// Returns a object. public static DnsForwardingRulesetResource GetDnsForwardingRulesetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsForwardingRulesetResource.ValidateResourceId(id); - return new DnsForwardingRulesetResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsForwardingRulesetResource(id); } - #endregion - #region DnsForwardingRuleResource /// /// 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. /// Returns a object. public static DnsForwardingRuleResource GetDnsForwardingRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsForwardingRuleResource.ValidateResourceId(id); - return new DnsForwardingRuleResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsForwardingRuleResource(id); } - #endregion - #region DnsForwardingRulesetVirtualNetworkLinkResource /// /// 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. /// Returns a object. public static DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRulesetVirtualNetworkLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DnsForwardingRulesetVirtualNetworkLinkResource.ValidateResourceId(id); - return new DnsForwardingRulesetVirtualNetworkLinkResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetDnsForwardingRulesetVirtualNetworkLinkResource(id); } - #endregion - #region VirtualNetworkDnsResolverResource /// /// 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. /// Returns a object. public static VirtualNetworkDnsResolverResource GetVirtualNetworkDnsResolverResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkDnsResolverResource.ValidateResourceId(id); - return new VirtualNetworkDnsResolverResource(client, id); - } - ); + return GetDnsResolverArmClientMockingExtension(client).GetVirtualNetworkDnsResolverResource(id); } - #endregion - /// Gets a collection of DnsResolverResources in the ResourceGroupResource. + /// + /// Gets a collection of DnsResolverResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DnsResolverResources and their operations over a DnsResolverResource. public static DnsResolverCollection GetDnsResolvers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDnsResolvers(); + return GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsResolvers(); } /// @@ -202,16 +172,20 @@ public static DnsResolverCollection GetDnsResolvers(this ResourceGroupResource r /// DnsResolvers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS resolver. /// The cancellation token to use. - /// 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 static async Task> GetDnsResolverAsync(this ResourceGroupResource resourceGroupResource, string dnsResolverName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDnsResolvers().GetAsync(dnsResolverName, cancellationToken).ConfigureAwait(false); + return await GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsResolverAsync(dnsResolverName, cancellationToken).ConfigureAwait(false); } /// @@ -226,24 +200,34 @@ public static async Task> GetDnsResolverAsync(this /// DnsResolvers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS resolver. /// The cancellation token to use. - /// 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 static Response GetDnsResolver(this ResourceGroupResource resourceGroupResource, string dnsResolverName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDnsResolvers().Get(dnsResolverName, cancellationToken); + return GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsResolver(dnsResolverName, cancellationToken); } - /// Gets a collection of DnsForwardingRulesetResources in the ResourceGroupResource. + /// + /// Gets a collection of DnsForwardingRulesetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DnsForwardingRulesetResources and their operations over a DnsForwardingRulesetResource. public static DnsForwardingRulesetCollection GetDnsForwardingRulesets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDnsForwardingRulesets(); + return GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsForwardingRulesets(); } /// @@ -258,16 +242,20 @@ public static DnsForwardingRulesetCollection GetDnsForwardingRulesets(this Resou /// DnsForwardingRulesets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS forwarding ruleset. /// The cancellation token to use. - /// 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 static async Task> GetDnsForwardingRulesetAsync(this ResourceGroupResource resourceGroupResource, string rulesetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDnsForwardingRulesets().GetAsync(rulesetName, cancellationToken).ConfigureAwait(false); + return await GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsForwardingRulesetAsync(rulesetName, cancellationToken).ConfigureAwait(false); } /// @@ -282,16 +270,20 @@ public static async Task> GetDnsForwardin /// DnsForwardingRulesets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the DNS forwarding ruleset. /// The cancellation token to use. - /// 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 static Response GetDnsForwardingRuleset(this ResourceGroupResource resourceGroupResource, string rulesetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDnsForwardingRulesets().Get(rulesetName, cancellationToken); + return GetDnsResolverResourceGroupMockingExtension(resourceGroupResource).GetDnsForwardingRuleset(rulesetName, cancellationToken); } /// @@ -306,6 +298,10 @@ public static Response GetDnsForwardingRuleset(thi /// DnsResolvers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of results to return. If not specified, returns up to 100 results. @@ -313,7 +309,7 @@ public static Response GetDnsForwardingRuleset(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDnsResolversAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsResolversAsync(top, cancellationToken); + return GetDnsResolverSubscriptionMockingExtension(subscriptionResource).GetDnsResolversAsync(top, cancellationToken); } /// @@ -328,6 +324,10 @@ public static AsyncPageable GetDnsResolversAsync(this Subsc /// DnsResolvers_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of results to return. If not specified, returns up to 100 results. @@ -335,7 +335,7 @@ public static AsyncPageable GetDnsResolversAsync(this Subsc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDnsResolvers(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsResolvers(top, cancellationToken); + return GetDnsResolverSubscriptionMockingExtension(subscriptionResource).GetDnsResolvers(top, cancellationToken); } /// @@ -350,6 +350,10 @@ public static Pageable GetDnsResolvers(this SubscriptionRes /// DnsForwardingRulesets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of results to return. If not specified, returns up to 100 results. @@ -357,7 +361,7 @@ public static Pageable GetDnsResolvers(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDnsForwardingRulesetsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsForwardingRulesetsAsync(top, cancellationToken); + return GetDnsResolverSubscriptionMockingExtension(subscriptionResource).GetDnsForwardingRulesetsAsync(top, cancellationToken); } /// @@ -372,6 +376,10 @@ public static AsyncPageable GetDnsForwardingRulese /// DnsForwardingRulesets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The maximum number of results to return. If not specified, returns up to 100 results. @@ -379,7 +387,7 @@ public static AsyncPageable GetDnsForwardingRulese /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDnsForwardingRulesets(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDnsForwardingRulesets(top, cancellationToken); + return GetDnsResolverSubscriptionMockingExtension(subscriptionResource).GetDnsForwardingRulesets(top, cancellationToken); } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverResourceGroupMockingExtension.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..d47beff32057 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DnsResolver; + +namespace Azure.ResourceManager.DnsResolver.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DnsResolverResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DnsResolverResourceGroupMockingExtension() + { + } + + /// 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 DnsResolverResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DnsResolverResources in the ResourceGroupResource. + /// An object representing collection of DnsResolverResources and their operations over a DnsResolverResource. + public virtual DnsResolverCollection GetDnsResolvers() + { + return GetCachedClient(client => new DnsResolverCollection(client, Id)); + } + + /// + /// Gets properties of a DNS resolver. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName} + /// + /// + /// Operation Id + /// DnsResolvers_Get + /// + /// + /// + /// The name of the DNS resolver. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsResolverAsync(string dnsResolverName, CancellationToken cancellationToken = default) + { + return await GetDnsResolvers().GetAsync(dnsResolverName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets properties of a DNS resolver. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolvers/{dnsResolverName} + /// + /// + /// Operation Id + /// DnsResolvers_Get + /// + /// + /// + /// The name of the DNS resolver. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsResolver(string dnsResolverName, CancellationToken cancellationToken = default) + { + return GetDnsResolvers().Get(dnsResolverName, cancellationToken); + } + + /// Gets a collection of DnsForwardingRulesetResources in the ResourceGroupResource. + /// An object representing collection of DnsForwardingRulesetResources and their operations over a DnsForwardingRulesetResource. + public virtual DnsForwardingRulesetCollection GetDnsForwardingRulesets() + { + return GetCachedClient(client => new DnsForwardingRulesetCollection(client, Id)); + } + + /// + /// Gets a DNS forwarding ruleset properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName} + /// + /// + /// Operation Id + /// DnsForwardingRulesets_Get + /// + /// + /// + /// The name of the DNS forwarding ruleset. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsForwardingRulesetAsync(string rulesetName, CancellationToken cancellationToken = default) + { + return await GetDnsForwardingRulesets().GetAsync(rulesetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a DNS forwarding ruleset properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName} + /// + /// + /// Operation Id + /// DnsForwardingRulesets_Get + /// + /// + /// + /// The name of the DNS forwarding ruleset. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsForwardingRuleset(string rulesetName, CancellationToken cancellationToken = default) + { + return GetDnsForwardingRulesets().Get(rulesetName, cancellationToken); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverSubscriptionMockingExtension.cs similarity index 89% rename from sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverSubscriptionMockingExtension.cs index e0bf4b74acbc..e278ed211aaf 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DnsResolver; -namespace Azure.ResourceManager.DnsResolver +namespace Azure.ResourceManager.DnsResolver.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DnsResolverSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dnsResolverClientDiagnostics; private DnsResolversRestOperations _dnsResolverRestClient; private ClientDiagnostics _dnsForwardingRulesetClientDiagnostics; private DnsForwardingRulesetsRestOperations _dnsForwardingRulesetRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DnsResolverSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DnsResolverSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetDnsResolversAsync(int? top { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverResource(Client, DnsResolverData.DeserializeDnsResolverData(e)), DnsResolverClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsResolvers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverResource(Client, DnsResolverData.DeserializeDnsResolverData(e)), DnsResolverClientDiagnostics, Pipeline, "DnsResolverSubscriptionMockingExtension.GetDnsResolvers", "value", "nextLink", cancellationToken); } /// @@ -88,7 +89,7 @@ public virtual Pageable GetDnsResolvers(int? top = null, Ca { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverResource(Client, DnsResolverData.DeserializeDnsResolverData(e)), DnsResolverClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsResolvers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverResource(Client, DnsResolverData.DeserializeDnsResolverData(e)), DnsResolverClientDiagnostics, Pipeline, "DnsResolverSubscriptionMockingExtension.GetDnsResolvers", "value", "nextLink", cancellationToken); } /// @@ -111,7 +112,7 @@ public virtual AsyncPageable GetDnsForwardingRules { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsForwardingRulesetRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsForwardingRulesetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsForwardingRulesetResource(Client, DnsForwardingRulesetData.DeserializeDnsForwardingRulesetData(e)), DnsForwardingRulesetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsForwardingRulesetResource(Client, DnsForwardingRulesetData.DeserializeDnsForwardingRulesetData(e)), DnsForwardingRulesetClientDiagnostics, Pipeline, "DnsResolverSubscriptionMockingExtension.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); } /// @@ -134,7 +135,7 @@ public virtual Pageable GetDnsForwardingRulesets(i { HttpMessage FirstPageRequest(int? pageSizeHint) => DnsForwardingRulesetRestClient.CreateListRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsForwardingRulesetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsForwardingRulesetResource(Client, DnsForwardingRulesetData.DeserializeDnsForwardingRulesetData(e)), DnsForwardingRulesetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsForwardingRulesetResource(Client, DnsForwardingRulesetData.DeserializeDnsForwardingRulesetData(e)), DnsForwardingRulesetClientDiagnostics, Pipeline, "DnsResolverSubscriptionMockingExtension.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index e0ea8a2b99f3..000000000000 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DnsResolver -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DnsResolverResources in the ResourceGroupResource. - /// An object representing collection of DnsResolverResources and their operations over a DnsResolverResource. - public virtual DnsResolverCollection GetDnsResolvers() - { - return GetCachedClient(Client => new DnsResolverCollection(Client, Id)); - } - - /// Gets a collection of DnsForwardingRulesetResources in the ResourceGroupResource. - /// An object representing collection of DnsForwardingRulesetResources and their operations over a DnsForwardingRulesetResource. - public virtual DnsForwardingRulesetCollection GetDnsForwardingRulesets() - { - return GetCachedClient(Client => new DnsForwardingRulesetCollection(Client, Id)); - } - } -} diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/DynatraceMonitorResource.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/DynatraceMonitorResource.cs index f381dfc109d4..9fa3e19d721c 100644 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/DynatraceMonitorResource.cs +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/DynatraceMonitorResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DynatraceTagRuleResources and their operations over a DynatraceTagRuleResource. public virtual DynatraceTagRuleCollection GetDynatraceTagRules() { - return GetCachedClient(Client => new DynatraceTagRuleCollection(Client, Id)); + return GetCachedClient(client => new DynatraceTagRuleCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual DynatraceTagRuleCollection GetDynatraceTagRules() /// /// Monitor resource name. /// The cancellation token to use. - /// 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> GetDynatraceTagRuleAsync(string ruleSetName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetDynatraceTagRul /// /// Monitor resource name. /// The cancellation token to use. - /// 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 GetDynatraceTagRule(string ruleSetName, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetDynatraceTagRule(string rul /// An object representing collection of DynatraceSingleSignOnResources and their operations over a DynatraceSingleSignOnResource. public virtual DynatraceSingleSignOnCollection GetDynatraceSingleSignOns() { - return GetCachedClient(Client => new DynatraceSingleSignOnCollection(Client, Id)); + return GetCachedClient(client => new DynatraceSingleSignOnCollection(client, Id)); } /// @@ -165,8 +165,8 @@ public virtual DynatraceSingleSignOnCollection GetDynatraceSingleSignOns() /// /// Single Sign On Configuration Name. /// The cancellation token to use. - /// 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> GetDynatraceSingleSignOnAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -188,8 +188,8 @@ public virtual async Task> GetDynatraceS /// /// Single Sign On Configuration Name. /// The cancellation token to use. - /// 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 GetDynatraceSingleSignOn(string configurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceArmClientMockingExtension.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceArmClientMockingExtension.cs new file mode 100644 index 000000000000..223c2726dad0 --- /dev/null +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Dynatrace; + +namespace Azure.ResourceManager.Dynatrace.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DynatraceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DynatraceArmClientMockingExtension() + { + } + + /// 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 DynatraceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DynatraceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DynatraceMonitorResource GetDynatraceMonitorResource(ResourceIdentifier id) + { + DynatraceMonitorResource.ValidateResourceId(id); + return new DynatraceMonitorResource(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 DynatraceTagRuleResource GetDynatraceTagRuleResource(ResourceIdentifier id) + { + DynatraceTagRuleResource.ValidateResourceId(id); + return new DynatraceTagRuleResource(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 DynatraceSingleSignOnResource GetDynatraceSingleSignOnResource(ResourceIdentifier id) + { + DynatraceSingleSignOnResource.ValidateResourceId(id); + return new DynatraceSingleSignOnResource(Client, id); + } + } +} diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceExtensions.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceExtensions.cs index 99b1769090d9..98a91442e085 100644 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceExtensions.cs +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Dynatrace.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Dynatrace @@ -18,100 +19,81 @@ namespace Azure.ResourceManager.Dynatrace /// A class to add extension methods to Azure.ResourceManager.Dynatrace. public static partial class DynatraceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DynatraceArmClientMockingExtension GetDynatraceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DynatraceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DynatraceResourceGroupMockingExtension GetDynatraceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DynatraceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DynatraceSubscriptionMockingExtension GetDynatraceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DynatraceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DynatraceMonitorResource /// /// 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. /// Returns a object. public static DynatraceMonitorResource GetDynatraceMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DynatraceMonitorResource.ValidateResourceId(id); - return new DynatraceMonitorResource(client, id); - } - ); + return GetDynatraceArmClientMockingExtension(client).GetDynatraceMonitorResource(id); } - #endregion - #region DynatraceTagRuleResource /// /// 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. /// Returns a object. public static DynatraceTagRuleResource GetDynatraceTagRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DynatraceTagRuleResource.ValidateResourceId(id); - return new DynatraceTagRuleResource(client, id); - } - ); + return GetDynatraceArmClientMockingExtension(client).GetDynatraceTagRuleResource(id); } - #endregion - #region DynatraceSingleSignOnResource /// /// 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. /// Returns a object. public static DynatraceSingleSignOnResource GetDynatraceSingleSignOnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DynatraceSingleSignOnResource.ValidateResourceId(id); - return new DynatraceSingleSignOnResource(client, id); - } - ); + return GetDynatraceArmClientMockingExtension(client).GetDynatraceSingleSignOnResource(id); } - #endregion - /// Gets a collection of DynatraceMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of DynatraceMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DynatraceMonitorResources and their operations over a DynatraceMonitorResource. public static DynatraceMonitorCollection GetDynatraceMonitors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDynatraceMonitors(); + return GetDynatraceResourceGroupMockingExtension(resourceGroupResource).GetDynatraceMonitors(); } /// @@ -126,16 +108,20 @@ public static DynatraceMonitorCollection GetDynatraceMonitors(this ResourceGroup /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static async Task> GetDynatraceMonitorAsync(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDynatraceMonitors().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + return await GetDynatraceResourceGroupMockingExtension(resourceGroupResource).GetDynatraceMonitorAsync(monitorName, cancellationToken).ConfigureAwait(false); } /// @@ -150,16 +136,20 @@ public static async Task> GetDynatraceMonitor /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static Response GetDynatraceMonitor(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDynatraceMonitors().Get(monitorName, cancellationToken); + return GetDynatraceResourceGroupMockingExtension(resourceGroupResource).GetDynatraceMonitor(monitorName, cancellationToken); } /// @@ -174,13 +164,17 @@ public static Response GetDynatraceMonitor(this Resour /// Monitors_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDynatraceMonitorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDynatraceMonitorsAsync(cancellationToken); + return GetDynatraceSubscriptionMockingExtension(subscriptionResource).GetDynatraceMonitorsAsync(cancellationToken); } /// @@ -195,13 +189,17 @@ public static AsyncPageable GetDynatraceMonitorsAsync( /// Monitors_ListBySubscriptionId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDynatraceMonitors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDynatraceMonitors(cancellationToken); + return GetDynatraceSubscriptionMockingExtension(subscriptionResource).GetDynatraceMonitors(cancellationToken); } } } diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceResourceGroupMockingExtension.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..a041e5a0ad16 --- /dev/null +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Dynatrace; + +namespace Azure.ResourceManager.Dynatrace.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DynatraceResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DynatraceResourceGroupMockingExtension() + { + } + + /// 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 DynatraceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DynatraceMonitorResources in the ResourceGroupResource. + /// An object representing collection of DynatraceMonitorResources and their operations over a DynatraceMonitorResource. + public virtual DynatraceMonitorCollection GetDynatraceMonitors() + { + return GetCachedClient(client => new DynatraceMonitorCollection(client, Id)); + } + + /// + /// Get a MonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDynatraceMonitorAsync(string monitorName, CancellationToken cancellationToken = default) + { + return await GetDynatraceMonitors().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a MonitorResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDynatraceMonitor(string monitorName, CancellationToken cancellationToken = default) + { + return GetDynatraceMonitors().Get(monitorName, cancellationToken); + } + } +} diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceSubscriptionMockingExtension.cs similarity index 84% rename from sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceSubscriptionMockingExtension.cs index 217284f0d0c3..b16f0d1a150f 100644 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/DynatraceSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Dynatrace; -namespace Azure.ResourceManager.Dynatrace +namespace Azure.ResourceManager.Dynatrace.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DynatraceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dynatraceMonitorMonitorsClientDiagnostics; private MonitorsRestOperations _dynatraceMonitorMonitorsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DynatraceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DynatraceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetDynatraceMonitorsAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => DynatraceMonitorMonitorsRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DynatraceMonitorMonitorsRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DynatraceMonitorResource(Client, DynatraceMonitorData.DeserializeDynatraceMonitorData(e)), DynatraceMonitorMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDynatraceMonitors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DynatraceMonitorResource(Client, DynatraceMonitorData.DeserializeDynatraceMonitorData(e)), DynatraceMonitorMonitorsClientDiagnostics, Pipeline, "DynatraceSubscriptionMockingExtension.GetDynatraceMonitors", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetDynatraceMonitors(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => DynatraceMonitorMonitorsRestClient.CreateListBySubscriptionIdRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DynatraceMonitorMonitorsRestClient.CreateListBySubscriptionIdNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DynatraceMonitorResource(Client, DynatraceMonitorData.DeserializeDynatraceMonitorData(e)), DynatraceMonitorMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDynatraceMonitors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DynatraceMonitorResource(Client, DynatraceMonitorData.DeserializeDynatraceMonitorData(e)), DynatraceMonitorMonitorsClientDiagnostics, Pipeline, "DynatraceSubscriptionMockingExtension.GetDynatraceMonitors", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 604a09c292bd..000000000000 --- a/sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Dynatrace -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DynatraceMonitorResources in the ResourceGroupResource. - /// An object representing collection of DynatraceMonitorResources and their operations over a DynatraceMonitorResource. - public virtual DynatraceMonitorCollection GetDynatraceMonitors() - { - return GetCachedClient(Client => new DynatraceMonitorCollection(Client, Id)); - } - } -} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderArmClientMockingExtension.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderArmClientMockingExtension.cs new file mode 100644 index 000000000000..2435fca656c9 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EdgeOrder; + +namespace Azure.ResourceManager.EdgeOrder.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class EdgeOrderArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EdgeOrderArmClientMockingExtension() + { + } + + /// 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 EdgeOrderArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal EdgeOrderArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EdgeOrderAddressResource GetEdgeOrderAddressResource(ResourceIdentifier id) + { + EdgeOrderAddressResource.ValidateResourceId(id); + return new EdgeOrderAddressResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EdgeOrderResource GetEdgeOrderResource(ResourceIdentifier id) + { + EdgeOrderResource.ValidateResourceId(id); + return new EdgeOrderResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EdgeOrderItemResource GetEdgeOrderItemResource(ResourceIdentifier id) + { + EdgeOrderItemResource.ValidateResourceId(id); + return new EdgeOrderItemResource(Client, id); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs index 131b6cf1c107..f8e421dba7cd 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.EdgeOrder.Mocking; using Azure.ResourceManager.EdgeOrder.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.EdgeOrder /// A class to add extension methods to Azure.ResourceManager.EdgeOrder. public static partial class EdgeOrderExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static EdgeOrderArmClientMockingExtension GetEdgeOrderArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new EdgeOrderArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static EdgeOrderResourceGroupMockingExtension GetEdgeOrderResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new EdgeOrderResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static EdgeOrderSubscriptionMockingExtension GetEdgeOrderSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new EdgeOrderSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region EdgeOrderAddressResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EdgeOrderAddressResource GetEdgeOrderAddressResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EdgeOrderAddressResource.ValidateResourceId(id); - return new EdgeOrderAddressResource(client, id); - } - ); + return GetEdgeOrderArmClientMockingExtension(client).GetEdgeOrderAddressResource(id); } - #endregion - #region EdgeOrderResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EdgeOrderResource GetEdgeOrderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EdgeOrderResource.ValidateResourceId(id); - return new EdgeOrderResource(client, id); - } - ); + return GetEdgeOrderArmClientMockingExtension(client).GetEdgeOrderResource(id); } - #endregion - #region EdgeOrderItemResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EdgeOrderItemResource GetEdgeOrderItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EdgeOrderItemResource.ValidateResourceId(id); - return new EdgeOrderItemResource(client, id); - } - ); + return GetEdgeOrderArmClientMockingExtension(client).GetEdgeOrderItemResource(id); } - #endregion - /// Gets a collection of EdgeOrderAddressResources in the ResourceGroupResource. + /// + /// Gets a collection of EdgeOrderAddressResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EdgeOrderAddressResources and their operations over a EdgeOrderAddressResource. public static EdgeOrderAddressCollection GetEdgeOrderAddresses(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEdgeOrderAddresses(); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderAddresses(); } /// @@ -127,16 +109,20 @@ public static EdgeOrderAddressCollection GetEdgeOrderAddresses(this ResourceGrou /// GetAddressByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. /// The cancellation token to use. - /// 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 static async Task> GetEdgeOrderAddressAsync(this ResourceGroupResource resourceGroupResource, string addressName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEdgeOrderAddresses().GetAsync(addressName, cancellationToken).ConfigureAwait(false); + return await GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderAddressAsync(addressName, cancellationToken).ConfigureAwait(false); } /// @@ -151,24 +137,34 @@ public static async Task> GetEdgeOrderAddress /// GetAddressByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. /// The cancellation token to use. - /// 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 static Response GetEdgeOrderAddress(this ResourceGroupResource resourceGroupResource, string addressName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEdgeOrderAddresses().Get(addressName, cancellationToken); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderAddress(addressName, cancellationToken); } - /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. + /// + /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. public static EdgeOrderCollection GetEdgeOrders(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEdgeOrders(); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrders(); } /// @@ -183,17 +179,21 @@ public static EdgeOrderCollection GetEdgeOrders(this ResourceGroupResource resou /// GetOrderByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// The name of the order. /// The cancellation token to use. - /// 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 static async Task> GetEdgeOrderAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEdgeOrders().GetAsync(location, orderName, cancellationToken).ConfigureAwait(false); + return await GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderAsync(location, orderName, cancellationToken).ConfigureAwait(false); } /// @@ -208,25 +208,35 @@ public static async Task> GetEdgeOrderAsync(this Res /// GetOrderByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. /// The name of the order. /// The cancellation token to use. - /// 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 static Response GetEdgeOrder(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEdgeOrders().Get(location, orderName, cancellationToken); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrder(location, orderName, cancellationToken); } - /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. + /// + /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. public static EdgeOrderItemCollection GetEdgeOrderItems(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEdgeOrderItems(); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderItems(); } /// @@ -241,17 +251,21 @@ public static EdgeOrderItemCollection GetEdgeOrderItems(this ResourceGroupResour /// GetOrderItemByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the order item. /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. - /// 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 static async Task> GetEdgeOrderItemAsync(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEdgeOrderItems().GetAsync(orderItemName, expand, cancellationToken).ConfigureAwait(false); + return await GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderItemAsync(orderItemName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -266,17 +280,21 @@ public static async Task> GetEdgeOrderItemAsync( /// GetOrderItemByName /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the order item. /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. - /// 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 static Response GetEdgeOrderItem(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEdgeOrderItems().Get(orderItemName, expand, cancellationToken); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrderItem(orderItemName, expand, cancellationToken); } /// @@ -291,6 +309,10 @@ public static Response GetEdgeOrderItem(this ResourceGrou /// ListOrderAtResourceGroupLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of order, which provides the next page in the list of order. @@ -298,7 +320,7 @@ public static Response GetEdgeOrderItem(this ResourceGrou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEdgeOrdersAsync(this ResourceGroupResource resourceGroupResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEdgeOrdersAsync(skipToken, cancellationToken); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrdersAsync(skipToken, cancellationToken); } /// @@ -313,6 +335,10 @@ public static AsyncPageable GetEdgeOrdersAsync(this ResourceG /// ListOrderAtResourceGroupLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of order, which provides the next page in the list of order. @@ -320,7 +346,7 @@ public static AsyncPageable GetEdgeOrdersAsync(this ResourceG /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEdgeOrders(this ResourceGroupResource resourceGroupResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEdgeOrders(skipToken, cancellationToken); + return GetEdgeOrderResourceGroupMockingExtension(resourceGroupResource).GetEdgeOrders(skipToken, cancellationToken); } /// @@ -335,6 +361,10 @@ public static Pageable GetEdgeOrders(this ResourceGroupResour /// ListAddressesAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. @@ -343,7 +373,7 @@ public static Pageable GetEdgeOrders(this ResourceGroupResour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEdgeOrderAddressesAsync(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrderAddressesAsync(filter, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrderAddressesAsync(filter, skipToken, cancellationToken); } /// @@ -358,6 +388,10 @@ public static AsyncPageable GetEdgeOrderAddressesAsync /// ListAddressesAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. @@ -366,7 +400,7 @@ public static AsyncPageable GetEdgeOrderAddressesAsync /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEdgeOrderAddresses(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrderAddresses(filter, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrderAddresses(filter, skipToken, cancellationToken); } /// @@ -381,6 +415,10 @@ public static Pageable GetEdgeOrderAddresses(this Subs /// ListProductFamilies /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filters for showing the product families. @@ -391,9 +429,7 @@ public static Pageable GetEdgeOrderAddresses(this Subs /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProductFamiliesAsync(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProductFamiliesAsync(content, expand, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetProductFamiliesAsync(content, expand, skipToken, cancellationToken); } /// @@ -408,6 +444,10 @@ public static AsyncPageable GetProductFamiliesAsync(this Subscrip /// ListProductFamilies /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filters for showing the product families. @@ -418,9 +458,7 @@ public static AsyncPageable GetProductFamiliesAsync(this Subscrip /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProductFamilies(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProductFamilies(content, expand, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetProductFamilies(content, expand, skipToken, cancellationToken); } /// @@ -435,6 +473,10 @@ public static Pageable GetProductFamilies(this SubscriptionResour /// ListConfigurations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filters for showing the configurations. @@ -444,9 +486,7 @@ public static Pageable GetProductFamilies(this SubscriptionResour /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfigurationsAsync(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurationsAsync(content, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetConfigurationsAsync(content, skipToken, cancellationToken); } /// @@ -461,6 +501,10 @@ public static AsyncPageable GetConfigurationsAsync(this Su /// ListConfigurations /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Filters for showing the configurations. @@ -470,9 +514,7 @@ public static AsyncPageable GetConfigurationsAsync(this Su /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfigurations(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfigurations(content, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetConfigurations(content, skipToken, cancellationToken); } /// @@ -487,6 +529,10 @@ public static Pageable GetConfigurations(this Subscription /// ListProductFamiliesMetadata /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. @@ -494,7 +540,7 @@ public static Pageable GetConfigurations(this Subscription /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProductFamiliesMetadataAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProductFamiliesMetadataAsync(skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetProductFamiliesMetadataAsync(skipToken, cancellationToken); } /// @@ -509,6 +555,10 @@ public static AsyncPageable GetProductFamiliesMetadataA /// ListProductFamiliesMetadata /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. @@ -516,7 +566,7 @@ public static AsyncPageable GetProductFamiliesMetadataA /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProductFamiliesMetadata(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProductFamiliesMetadata(skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetProductFamiliesMetadata(skipToken, cancellationToken); } /// @@ -531,6 +581,10 @@ public static Pageable GetProductFamiliesMetadata(this /// ListOrderAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of order, which provides the next page in the list of order. @@ -538,7 +592,7 @@ public static Pageable GetProductFamiliesMetadata(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEdgeOrdersAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrdersAsync(skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrdersAsync(skipToken, cancellationToken); } /// @@ -553,6 +607,10 @@ public static AsyncPageable GetEdgeOrdersAsync(this Subscript /// ListOrderAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of order, which provides the next page in the list of order. @@ -560,7 +618,7 @@ public static AsyncPageable GetEdgeOrdersAsync(this Subscript /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEdgeOrders(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrders(skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrders(skipToken, cancellationToken); } /// @@ -575,6 +633,10 @@ public static Pageable GetEdgeOrders(this SubscriptionResourc /// ListOrderItemsAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $filter is supported to filter based on order id. Filter supports only equals operation. @@ -584,7 +646,7 @@ public static Pageable GetEdgeOrders(this SubscriptionResourc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEdgeOrderItemsAsync(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrderItemsAsync(filter, expand, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrderItemsAsync(filter, expand, skipToken, cancellationToken); } /// @@ -599,6 +661,10 @@ public static AsyncPageable GetEdgeOrderItemsAsync(this S /// ListOrderItemsAtSubscriptionLevel /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $filter is supported to filter based on order id. Filter supports only equals operation. @@ -608,7 +674,7 @@ public static AsyncPageable GetEdgeOrderItemsAsync(this S /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEdgeOrderItems(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEdgeOrderItems(filter, expand, skipToken, cancellationToken); + return GetEdgeOrderSubscriptionMockingExtension(subscriptionResource).GetEdgeOrderItems(filter, expand, skipToken, cancellationToken); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderResourceGroupMockingExtension.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..ea4c3b9ee1f8 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderResourceGroupMockingExtension.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.EdgeOrder; + +namespace Azure.ResourceManager.EdgeOrder.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class EdgeOrderResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _defaultClientDiagnostics; + private EdgeOrderManagementRestOperations _defaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected EdgeOrderResourceGroupMockingExtension() + { + } + + /// 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 EdgeOrderResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private EdgeOrderManagementRestOperations DefaultRestClient => _defaultRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EdgeOrderAddressResources in the ResourceGroupResource. + /// An object representing collection of EdgeOrderAddressResources and their operations over a EdgeOrderAddressResource. + public virtual EdgeOrderAddressCollection GetEdgeOrderAddresses() + { + return GetCachedClient(client => new EdgeOrderAddressCollection(client, Id)); + } + + /// + /// Gets information about the specified address. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName} + /// + /// + /// Operation Id + /// GetAddressByName + /// + /// + /// + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEdgeOrderAddressAsync(string addressName, CancellationToken cancellationToken = default) + { + return await GetEdgeOrderAddresses().GetAsync(addressName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified address. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName} + /// + /// + /// Operation Id + /// GetAddressByName + /// + /// + /// + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEdgeOrderAddress(string addressName, CancellationToken cancellationToken = default) + { + return GetEdgeOrderAddresses().Get(addressName, cancellationToken); + } + + /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. + /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. + public virtual EdgeOrderCollection GetEdgeOrders() + { + return GetCachedClient(client => new EdgeOrderCollection(client, Id)); + } + + /// + /// Gets an order. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} + /// + /// + /// Operation Id + /// GetOrderByName + /// + /// + /// + /// The name of Azure region. + /// The name of the order. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEdgeOrderAsync(AzureLocation location, string orderName, CancellationToken cancellationToken = default) + { + return await GetEdgeOrders().GetAsync(location, orderName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an order. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} + /// + /// + /// Operation Id + /// GetOrderByName + /// + /// + /// + /// The name of Azure region. + /// The name of the order. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEdgeOrder(AzureLocation location, string orderName, CancellationToken cancellationToken = default) + { + return GetEdgeOrders().Get(location, orderName, cancellationToken); + } + + /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. + /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. + public virtual EdgeOrderItemCollection GetEdgeOrderItems() + { + return GetCachedClient(client => new EdgeOrderItemCollection(client, Id)); + } + + /// + /// Gets an order item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} + /// + /// + /// Operation Id + /// GetOrderItemByName + /// + /// + /// + /// The name of the order item. + /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEdgeOrderItemAsync(string orderItemName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetEdgeOrderItems().GetAsync(orderItemName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an order item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} + /// + /// + /// Operation Id + /// GetOrderItemByName + /// + /// + /// + /// The name of the order item. + /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEdgeOrderItem(string orderItemName, string expand = null, CancellationToken cancellationToken = default) + { + return GetEdgeOrderItems().Get(orderItemName, expand, cancellationToken); + } + + /// + /// Lists order at resource group level. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders + /// + /// + /// Operation Id + /// ListOrderAtResourceGroupLevel + /// + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "EdgeOrderResourceGroupMockingExtension.GetEdgeOrders", "value", "nextLink", cancellationToken); + } + + /// + /// Lists order at resource group level. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders + /// + /// + /// Operation Id + /// ListOrderAtResourceGroupLevel + /// + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEdgeOrders(string skipToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "EdgeOrderResourceGroupMockingExtension.GetEdgeOrders", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderSubscriptionMockingExtension.cs similarity index 89% rename from sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderSubscriptionMockingExtension.cs index 5eb27a9b0c10..f61942128e0f 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderSubscriptionMockingExtension.cs @@ -5,18 +5,20 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.EdgeOrder; using Azure.ResourceManager.EdgeOrder.Models; -namespace Azure.ResourceManager.EdgeOrder +namespace Azure.ResourceManager.EdgeOrder.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class EdgeOrderSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _edgeOrderAddressClientDiagnostics; private EdgeOrderManagementRestOperations _edgeOrderAddressRestClient; @@ -25,15 +27,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _edgeOrderItemClientDiagnostics; private EdgeOrderManagementRestOperations _edgeOrderItemRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected EdgeOrderSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal EdgeOrderSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -71,7 +73,7 @@ public virtual AsyncPageable GetEdgeOrderAddressesAsyn { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelRequest(Id.SubscriptionId, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); } /// @@ -95,7 +97,7 @@ public virtual Pageable GetEdgeOrderAddresses(string f { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelRequest(Id.SubscriptionId, filter, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); } /// @@ -115,12 +117,15 @@ public virtual Pageable GetEdgeOrderAddresses(string f /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetProductFamiliesAsync(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamilies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetProductFamilies", "value", "nextLink", cancellationToken); } /// @@ -140,12 +145,15 @@ public virtual AsyncPageable GetProductFamiliesAsync(ProductFamil /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetProductFamilies(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamilies", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetProductFamilies", "value", "nextLink", cancellationToken); } /// @@ -164,12 +172,15 @@ public virtual Pageable GetProductFamilies(ProductFamiliesContent /// Filters for showing the configurations. /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetConfigurationsAsync(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetConfigurations", "value", "nextLink", cancellationToken); } /// @@ -188,12 +199,15 @@ public virtual AsyncPageable GetConfigurationsAsync(Config /// Filters for showing the configurations. /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetConfigurations(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetConfigurations", "value", "nextLink", cancellationToken); } /// @@ -216,7 +230,7 @@ public virtual AsyncPageable GetProductFamiliesMetadata { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); } /// @@ -239,7 +253,7 @@ public virtual Pageable GetProductFamiliesMetadata(stri { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); } /// @@ -262,7 +276,7 @@ public virtual AsyncPageable GetEdgeOrdersAsync(string skipTo { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtSubscriptionLevelRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrders", "value", "nextLink", cancellationToken); } /// @@ -285,7 +299,7 @@ public virtual Pageable GetEdgeOrders(string skipToken = null { HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtSubscriptionLevelRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrders", "value", "nextLink", cancellationToken); } /// @@ -310,7 +324,7 @@ public virtual AsyncPageable GetEdgeOrderItemsAsync(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelRequest(Id.SubscriptionId, filter, expand, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrderItems", "value", "nextLink", cancellationToken); } /// @@ -335,7 +349,7 @@ public virtual Pageable GetEdgeOrderItems(string filter = { HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelRequest(Id.SubscriptionId, filter, expand, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "EdgeOrderSubscriptionMockingExtension.GetEdgeOrderItems", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 9373009ee72a..000000000000 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.EdgeOrder -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _defaultClientDiagnostics; - private EdgeOrderManagementRestOperations _defaultRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private EdgeOrderManagementRestOperations DefaultRestClient => _defaultRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EdgeOrderAddressResources in the ResourceGroupResource. - /// An object representing collection of EdgeOrderAddressResources and their operations over a EdgeOrderAddressResource. - public virtual EdgeOrderAddressCollection GetEdgeOrderAddresses() - { - return GetCachedClient(Client => new EdgeOrderAddressCollection(Client, Id)); - } - - /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. - /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. - public virtual EdgeOrderCollection GetEdgeOrders() - { - return GetCachedClient(Client => new EdgeOrderCollection(Client, Id)); - } - - /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. - /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. - public virtual EdgeOrderItemCollection GetEdgeOrderItems() - { - return GetCachedClient(Client => new EdgeOrderItemCollection(Client, Id)); - } - - /// - /// Lists order at resource group level. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders - /// - /// - /// Operation Id - /// ListOrderAtResourceGroupLevel - /// - /// - /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); - } - - /// - /// Lists order at resource group level. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders - /// - /// - /// Operation Id - /// ListOrderAtResourceGroupLevel - /// - /// - /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEdgeOrders(string skipToken = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/ElasticMonitorResource.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/ElasticMonitorResource.cs index 705816e3b2f4..9967f283c586 100644 --- a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/ElasticMonitorResource.cs +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/ElasticMonitorResource.cs @@ -114,7 +114,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MonitoringTagRuleResources and their operations over a MonitoringTagRuleResource. public virtual MonitoringTagRuleCollection GetMonitoringTagRules() { - return GetCachedClient(Client => new MonitoringTagRuleCollection(Client, Id)); + return GetCachedClient(client => new MonitoringTagRuleCollection(client, Id)); } /// @@ -132,8 +132,8 @@ public virtual MonitoringTagRuleCollection GetMonitoringTagRules() /// /// Tag Rule Set resource name. /// The cancellation token to use. - /// 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> GetMonitoringTagRuleAsync(string ruleSetName, CancellationToken cancellationToken = default) { @@ -155,8 +155,8 @@ public virtual async Task> GetMonitoringTagR /// /// Tag Rule Set resource name. /// The cancellation token to use. - /// 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 GetMonitoringTagRule(string ruleSetName, CancellationToken cancellationToken = default) { diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticArmClientMockingExtension.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticArmClientMockingExtension.cs new file mode 100644 index 000000000000..66edfc7af6ee --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Elastic; + +namespace Azure.ResourceManager.Elastic.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ElasticArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ElasticArmClientMockingExtension() + { + } + + /// 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 ElasticArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ElasticArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticMonitorResource GetElasticMonitorResource(ResourceIdentifier id) + { + ElasticMonitorResource.ValidateResourceId(id); + return new ElasticMonitorResource(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 MonitoringTagRuleResource GetMonitoringTagRuleResource(ResourceIdentifier id) + { + MonitoringTagRuleResource.ValidateResourceId(id); + return new MonitoringTagRuleResource(Client, id); + } + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticExtensions.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticExtensions.cs index 23a67ac78a0f..9bbc06b2eb42 100644 --- a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticExtensions.cs +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Elastic.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Elastic @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.Elastic /// A class to add extension methods to Azure.ResourceManager.Elastic. public static partial class ElasticExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ElasticArmClientMockingExtension GetElasticArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ElasticArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ElasticResourceGroupMockingExtension GetElasticResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ElasticResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ElasticSubscriptionMockingExtension GetElasticSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ElasticSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ElasticMonitorResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticMonitorResource GetElasticMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticMonitorResource.ValidateResourceId(id); - return new ElasticMonitorResource(client, id); - } - ); + return GetElasticArmClientMockingExtension(client).GetElasticMonitorResource(id); } - #endregion - #region MonitoringTagRuleResource /// /// 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. /// Returns a object. public static MonitoringTagRuleResource GetMonitoringTagRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MonitoringTagRuleResource.ValidateResourceId(id); - return new MonitoringTagRuleResource(client, id); - } - ); + return GetElasticArmClientMockingExtension(client).GetMonitoringTagRuleResource(id); } - #endregion - /// Gets a collection of ElasticMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of ElasticMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ElasticMonitorResources and their operations over a ElasticMonitorResource. public static ElasticMonitorResourceCollection GetElasticMonitorResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetElasticMonitorResources(); + return GetElasticResourceGroupMockingExtension(resourceGroupResource).GetElasticMonitorResources(); } /// @@ -107,16 +92,20 @@ public static ElasticMonitorResourceCollection GetElasticMonitorResources(this R /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static async Task> GetElasticMonitorResourceAsync(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetElasticMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + return await GetElasticResourceGroupMockingExtension(resourceGroupResource).GetElasticMonitorResourceAsync(monitorName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetElasticMonitorReso /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static Response GetElasticMonitorResource(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetElasticMonitorResources().Get(monitorName, cancellationToken); + return GetElasticResourceGroupMockingExtension(resourceGroupResource).GetElasticMonitorResource(monitorName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetElasticMonitorResource(this Re /// Monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetElasticMonitorResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetElasticMonitorResourcesAsync(cancellationToken); + return GetElasticSubscriptionMockingExtension(subscriptionResource).GetElasticMonitorResourcesAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetElasticMonitorResourcesAs /// Monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetElasticMonitorResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetElasticMonitorResources(cancellationToken); + return GetElasticSubscriptionMockingExtension(subscriptionResource).GetElasticMonitorResources(cancellationToken); } } } diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticResourceGroupMockingExtension.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..6f66b506b702 --- /dev/null +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Elastic; + +namespace Azure.ResourceManager.Elastic.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ElasticResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ElasticResourceGroupMockingExtension() + { + } + + /// 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 ElasticResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ElasticMonitorResources in the ResourceGroupResource. + /// An object representing collection of ElasticMonitorResources and their operations over a ElasticMonitorResource. + public virtual ElasticMonitorResourceCollection GetElasticMonitorResources() + { + return GetCachedClient(client => new ElasticMonitorResourceCollection(client, Id)); + } + + /// + /// Get the properties of a specific monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetElasticMonitorResourceAsync(string monitorName, CancellationToken cancellationToken = default) + { + return await GetElasticMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a specific monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetElasticMonitorResource(string monitorName, CancellationToken cancellationToken = default) + { + return GetElasticMonitorResources().Get(monitorName, cancellationToken); + } + } +} diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticSubscriptionMockingExtension.cs similarity index 89% rename from sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticSubscriptionMockingExtension.cs index 86cb1b328824..88e6b652f178 100644 --- a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ElasticSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Elastic; -namespace Azure.ResourceManager.Elastic +namespace Azure.ResourceManager.Elastic.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ElasticSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _elasticMonitorResourceMonitorsClientDiagnostics; private MonitorsRestOperations _elasticMonitorResourceMonitorsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ElasticSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ElasticSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetElasticMonitorResourcesA { HttpMessage FirstPageRequest(int? pageSizeHint) => ElasticMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ElasticMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ElasticMonitorResource(Client, ElasticMonitorResourceData.DeserializeElasticMonitorResourceData(e)), ElasticMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetElasticMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ElasticMonitorResource(Client, ElasticMonitorResourceData.DeserializeElasticMonitorResourceData(e)), ElasticMonitorResourceMonitorsClientDiagnostics, Pipeline, "ElasticSubscriptionMockingExtension.GetElasticMonitorResources", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetElasticMonitorResources(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => ElasticMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ElasticMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ElasticMonitorResource(Client, ElasticMonitorResourceData.DeserializeElasticMonitorResourceData(e)), ElasticMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetElasticMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ElasticMonitorResource(Client, ElasticMonitorResourceData.DeserializeElasticMonitorResourceData(e)), ElasticMonitorResourceMonitorsClientDiagnostics, Pipeline, "ElasticSubscriptionMockingExtension.GetElasticMonitorResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 8ce3859d9bb5..000000000000 --- a/sdk/elastic/Azure.ResourceManager.Elastic/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Elastic -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ElasticMonitorResources in the ResourceGroupResource. - /// An object representing collection of ElasticMonitorResources and their operations over a ElasticMonitorResource. - public virtual ElasticMonitorResourceCollection GetElasticMonitorResources() - { - return GetCachedClient(Client => new ElasticMonitorResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs index 9ec016d99383..04282a525f60 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ElasticSanVolumeGroupResources and their operations over a ElasticSanVolumeGroupResource. public virtual ElasticSanVolumeGroupCollection GetElasticSanVolumeGroups() { - return GetCachedClient(Client => new ElasticSanVolumeGroupCollection(Client, Id)); + return GetCachedClient(client => new ElasticSanVolumeGroupCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual ElasticSanVolumeGroupCollection GetElasticSanVolumeGroups() /// /// The name of the VolumeGroup. /// The cancellation token to use. - /// 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> GetElasticSanVolumeGroupAsync(string volumeGroupName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetElasticSan /// /// The name of the VolumeGroup. /// The cancellation token to use. - /// 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 GetElasticSanVolumeGroup(string volumeGroupName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetElasticSanVolumeGroup( /// An object representing collection of ElasticSanPrivateEndpointConnectionResources and their operations over a ElasticSanPrivateEndpointConnectionResource. public virtual ElasticSanPrivateEndpointConnectionCollection GetElasticSanPrivateEndpointConnections() { - return GetCachedClient(Client => new ElasticSanPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ElasticSanPrivateEndpointConnectionCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual ElasticSanPrivateEndpointConnectionCollection GetElasticSanPrivat /// /// The name of the Private Endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetElasticSanPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> /// /// The name of the Private Endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetElasticSanPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs index 50f065ce9f32..bd3a61c765bf 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ElasticSanVolumeResources and their operations over a ElasticSanVolumeResource. public virtual ElasticSanVolumeCollection GetElasticSanVolumes() { - return GetCachedClient(Client => new ElasticSanVolumeCollection(Client, Id)); + return GetCachedClient(client => new ElasticSanVolumeCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual ElasticSanVolumeCollection GetElasticSanVolumes() /// /// The name of the Volume. /// The cancellation token to use. - /// 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> GetElasticSanVolumeAsync(string volumeName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetElasticSanVolum /// /// The name of the Volume. /// The cancellation token to use. - /// 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 GetElasticSanVolume(string volumeName, CancellationToken cancellationToken = default) { diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanArmClientMockingExtension.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanArmClientMockingExtension.cs new file mode 100644 index 000000000000..c74859dbe539 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan; + +namespace Azure.ResourceManager.ElasticSan.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ElasticSanArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ElasticSanArmClientMockingExtension() + { + } + + /// 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 ElasticSanArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ElasticSanArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticSanResource GetElasticSanResource(ResourceIdentifier id) + { + ElasticSanResource.ValidateResourceId(id); + return new ElasticSanResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticSanVolumeGroupResource GetElasticSanVolumeGroupResource(ResourceIdentifier id) + { + ElasticSanVolumeGroupResource.ValidateResourceId(id); + return new ElasticSanVolumeGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticSanVolumeResource GetElasticSanVolumeResource(ResourceIdentifier id) + { + ElasticSanVolumeResource.ValidateResourceId(id); + return new ElasticSanVolumeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ElasticSanPrivateEndpointConnectionResource GetElasticSanPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ElasticSanPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ElasticSanPrivateEndpointConnectionResource(Client, id); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs index 46c8d8d790bb..ae699923538c 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan.Mocking; using Azure.ResourceManager.ElasticSan.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.ElasticSan /// A class to add extension methods to Azure.ResourceManager.ElasticSan. public static partial class ElasticSanExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ElasticSanArmClientMockingExtension GetElasticSanArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ElasticSanArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ElasticSanResourceGroupMockingExtension GetElasticSanResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ElasticSanResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ElasticSanSubscriptionMockingExtension GetElasticSanSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ElasticSanSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ElasticSanResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticSanResource GetElasticSanResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticSanResource.ValidateResourceId(id); - return new ElasticSanResource(client, id); - } - ); + return GetElasticSanArmClientMockingExtension(client).GetElasticSanResource(id); } - #endregion - #region ElasticSanVolumeGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticSanVolumeGroupResource GetElasticSanVolumeGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticSanVolumeGroupResource.ValidateResourceId(id); - return new ElasticSanVolumeGroupResource(client, id); - } - ); + return GetElasticSanArmClientMockingExtension(client).GetElasticSanVolumeGroupResource(id); } - #endregion - #region ElasticSanVolumeResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticSanVolumeResource GetElasticSanVolumeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticSanVolumeResource.ValidateResourceId(id); - return new ElasticSanVolumeResource(client, id); - } - ); + return GetElasticSanArmClientMockingExtension(client).GetElasticSanVolumeResource(id); } - #endregion - #region ElasticSanPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ElasticSanPrivateEndpointConnectionResource GetElasticSanPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ElasticSanPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ElasticSanPrivateEndpointConnectionResource(client, id); - } - ); + return GetElasticSanArmClientMockingExtension(client).GetElasticSanPrivateEndpointConnectionResource(id); } - #endregion - /// Gets a collection of ElasticSanResources in the ResourceGroupResource. + /// + /// Gets a collection of ElasticSanResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ElasticSanResources and their operations over a ElasticSanResource. public static ElasticSanCollection GetElasticSans(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetElasticSans(); + return GetElasticSanResourceGroupMockingExtension(resourceGroupResource).GetElasticSans(); } /// @@ -146,16 +125,20 @@ public static ElasticSanCollection GetElasticSans(this ResourceGroupResource res /// ElasticSans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ElasticSan. /// The cancellation token to use. - /// 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 static async Task> GetElasticSanAsync(this ResourceGroupResource resourceGroupResource, string elasticSanName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetElasticSans().GetAsync(elasticSanName, cancellationToken).ConfigureAwait(false); + return await GetElasticSanResourceGroupMockingExtension(resourceGroupResource).GetElasticSanAsync(elasticSanName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetElasticSanAsync(this R /// ElasticSans_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the ElasticSan. /// The cancellation token to use. - /// 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 static Response GetElasticSan(this ResourceGroupResource resourceGroupResource, string elasticSanName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetElasticSans().Get(elasticSanName, cancellationToken); + return GetElasticSanResourceGroupMockingExtension(resourceGroupResource).GetElasticSan(elasticSanName, cancellationToken); } /// @@ -194,6 +181,10 @@ public static Response GetElasticSan(this ResourceGroupResou /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify $filter='location eq <location>' to filter on location. @@ -201,7 +192,7 @@ public static Response GetElasticSan(this ResourceGroupResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkusAsync(filter, cancellationToken); + return GetElasticSanSubscriptionMockingExtension(subscriptionResource).GetSkusAsync(filter, cancellationToken); } /// @@ -216,6 +207,10 @@ public static AsyncPageable GetSkusAsync(this Subscrip /// Skus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify $filter='location eq <location>' to filter on location. @@ -223,7 +218,7 @@ public static AsyncPageable GetSkusAsync(this Subscrip /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSkus(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSkus(filter, cancellationToken); + return GetElasticSanSubscriptionMockingExtension(subscriptionResource).GetSkus(filter, cancellationToken); } /// @@ -238,13 +233,17 @@ public static Pageable GetSkus(this SubscriptionResour /// ElasticSans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetElasticSansAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetElasticSansAsync(cancellationToken); + return GetElasticSanSubscriptionMockingExtension(subscriptionResource).GetElasticSansAsync(cancellationToken); } /// @@ -259,13 +258,17 @@ public static AsyncPageable GetElasticSansAsync(this Subscri /// ElasticSans_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetElasticSans(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetElasticSans(cancellationToken); + return GetElasticSanSubscriptionMockingExtension(subscriptionResource).GetElasticSans(cancellationToken); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanResourceGroupMockingExtension.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..16fd08c53f80 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan; + +namespace Azure.ResourceManager.ElasticSan.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ElasticSanResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ElasticSanResourceGroupMockingExtension() + { + } + + /// 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 ElasticSanResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ElasticSanResources in the ResourceGroupResource. + /// An object representing collection of ElasticSanResources and their operations over a ElasticSanResource. + public virtual ElasticSanCollection GetElasticSans() + { + return GetCachedClient(client => new ElasticSanCollection(client, Id)); + } + + /// + /// Get a ElasticSan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName} + /// + /// + /// Operation Id + /// ElasticSans_Get + /// + /// + /// + /// The name of the ElasticSan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetElasticSanAsync(string elasticSanName, CancellationToken cancellationToken = default) + { + return await GetElasticSans().GetAsync(elasticSanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ElasticSan. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName} + /// + /// + /// Operation Id + /// ElasticSans_Get + /// + /// + /// + /// The name of the ElasticSan. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetElasticSan(string elasticSanName, CancellationToken cancellationToken = default) + { + return GetElasticSans().Get(elasticSanName, cancellationToken); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanSubscriptionMockingExtension.cs similarity index 87% rename from sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanSubscriptionMockingExtension.cs index 8e6e781a5fcd..9237fbaa7946 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanSubscriptionMockingExtension.cs @@ -11,27 +11,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan; using Azure.ResourceManager.ElasticSan.Models; -namespace Azure.ResourceManager.ElasticSan +namespace Azure.ResourceManager.ElasticSan.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ElasticSanSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _skusClientDiagnostics; private SkusRestOperations _skusRestClient; private ClientDiagnostics _elasticSanClientDiagnostics; private ElasticSansRestOperations _elasticSanRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ElasticSanSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ElasticSanSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetSkusAsync(string filter = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ElasticSanSkuInformation.DeserializeElasticSanSkuInformation, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ElasticSanSkuInformation.DeserializeElasticSanSkuInformation, SkusClientDiagnostics, Pipeline, "ElasticSanSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual AsyncPageable GetSkusAsync(string filte public virtual Pageable GetSkus(string filter = null, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => SkusRestClient.CreateListRequest(Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ElasticSanSkuInformation.DeserializeElasticSanSkuInformation, SkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSkus", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ElasticSanSkuInformation.DeserializeElasticSanSkuInformation, SkusClientDiagnostics, Pipeline, "ElasticSanSubscriptionMockingExtension.GetSkus", "value", null, cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual AsyncPageable GetElasticSansAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ElasticSanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ElasticSanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ElasticSanResource(Client, ElasticSanData.DeserializeElasticSanData(e)), ElasticSanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetElasticSans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ElasticSanResource(Client, ElasticSanData.DeserializeElasticSanData(e)), ElasticSanClientDiagnostics, Pipeline, "ElasticSanSubscriptionMockingExtension.GetElasticSans", "value", "nextLink", cancellationToken); } /// @@ -131,7 +132,7 @@ public virtual Pageable GetElasticSans(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => ElasticSanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ElasticSanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ElasticSanResource(Client, ElasticSanData.DeserializeElasticSanData(e)), ElasticSanClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetElasticSans", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ElasticSanResource(Client, ElasticSanData.DeserializeElasticSanData(e)), ElasticSanClientDiagnostics, Pipeline, "ElasticSanSubscriptionMockingExtension.GetElasticSans", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 10400472451d..000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ElasticSan -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ElasticSanResources in the ResourceGroupResource. - /// An object representing collection of ElasticSanResources and their operations over a ElasticSanResource. - public virtual ElasticSanCollection GetElasticSans() - { - return GetCachedClient(Client => new ElasticSanCollection(Client, Id)); - } - } -} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/DomainTopicResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/DomainTopicResource.cs index a11dd0bbc5fa..0df7d37c8bd2 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/DomainTopicResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/DomainTopicResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DomainTopicEventSubscriptionResources and their operations over a DomainTopicEventSubscriptionResource. public virtual DomainTopicEventSubscriptionCollection GetDomainTopicEventSubscriptions() { - return GetCachedClient(Client => new DomainTopicEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new DomainTopicEventSubscriptionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual DomainTopicEventSubscriptionCollection GetDomainTopicEventSubscri /// /// Name of the event subscription. /// The cancellation token to use. - /// 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> GetDomainTopicEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetDom /// /// Name of the event subscription. /// The cancellation token to use. - /// 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 GetDomainTopicEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridDomainResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridDomainResource.cs index 58992f129f9d..0ee1e2eb7bb4 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridDomainResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridDomainResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DomainTopicResources and their operations over a DomainTopicResource. public virtual DomainTopicCollection GetDomainTopics() { - return GetCachedClient(Client => new DomainTopicCollection(Client, Id)); + return GetCachedClient(client => new DomainTopicCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual DomainTopicCollection GetDomainTopics() /// /// Name of the topic. /// The cancellation token to use. - /// 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> GetDomainTopicAsync(string domainTopicName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetDomainTopicAsync(str /// /// Name of the topic. /// The cancellation token to use. - /// 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 GetDomainTopic(string domainTopicName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetDomainTopic(string domainTopicNa /// An object representing collection of DomainEventSubscriptionResources and their operations over a DomainEventSubscriptionResource. public virtual DomainEventSubscriptionCollection GetDomainEventSubscriptions() { - return GetCachedClient(Client => new DomainEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new DomainEventSubscriptionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual DomainEventSubscriptionCollection GetDomainEventSubscriptions() /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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> GetDomainEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetDomainEv /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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 GetDomainEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetDomainEventSubscript /// An object representing collection of EventGridDomainPrivateEndpointConnectionResources and their operations over a EventGridDomainPrivateEndpointConnectionResource. public virtual EventGridDomainPrivateEndpointConnectionCollection GetEventGridDomainPrivateEndpointConnections() { - return GetCachedClient(Client => new EventGridDomainPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new EventGridDomainPrivateEndpointConnectionCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual EventGridDomainPrivateEndpointConnectionCollection GetEventGridDo /// /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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> GetEventGridDomainPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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 GetEventGridDomainPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetEve /// An object representing collection of EventGridDomainPrivateLinkResources and their operations over a EventGridDomainPrivateLinkResource. public virtual EventGridDomainPrivateLinkResourceCollection GetEventGridDomainPrivateLinkResources() { - return GetCachedClient(Client => new EventGridDomainPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new EventGridDomainPrivateLinkResourceCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual EventGridDomainPrivateLinkResourceCollection GetEventGridDomainPr /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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> GetEventGridDomainPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetEvent /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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 GetEventGridDomainPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridNamespaceResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridNamespaceResource.cs index 0638e189d5f4..f6c4794e363b 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridNamespaceResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridNamespaceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CaCertificateResources and their operations over a CaCertificateResource. public virtual CaCertificateCollection GetCaCertificates() { - return GetCachedClient(Client => new CaCertificateCollection(Client, Id)); + return GetCachedClient(client => new CaCertificateCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CaCertificateCollection GetCaCertificates() /// /// Name of the CA certificate. /// The cancellation token to use. - /// 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> GetCaCertificateAsync(string caCertificateName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCaCertificateAsync /// /// Name of the CA certificate. /// The cancellation token to use. - /// 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 GetCaCertificate(string caCertificateName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetCaCertificate(string caCertifi /// An object representing collection of EventGridNamespaceClientGroupResources and their operations over a EventGridNamespaceClientGroupResource. public virtual EventGridNamespaceClientGroupCollection GetEventGridNamespaceClientGroups() { - return GetCachedClient(Client => new EventGridNamespaceClientGroupCollection(Client, Id)); + return GetCachedClient(client => new EventGridNamespaceClientGroupCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual EventGridNamespaceClientGroupCollection GetEventGridNamespaceClie /// /// Name of the client group. /// The cancellation token to use. - /// 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> GetEventGridNamespaceClientGroupAsync(string clientGroupName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetEv /// /// Name of the client group. /// The cancellation token to use. - /// 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 GetEventGridNamespaceClientGroup(string clientGroupName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetEventGridNames /// An object representing collection of EventGridNamespaceClientResources and their operations over a EventGridNamespaceClientResource. public virtual EventGridNamespaceClientCollection GetEventGridNamespaceClients() { - return GetCachedClient(Client => new EventGridNamespaceClientCollection(Client, Id)); + return GetCachedClient(client => new EventGridNamespaceClientCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual EventGridNamespaceClientCollection GetEventGridNamespaceClients() /// /// Name of the client. /// The cancellation token to use. - /// 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> GetEventGridNamespaceClientAsync(string clientName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetEventGr /// /// Name of the client. /// The cancellation token to use. - /// 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 GetEventGridNamespaceClient(string clientName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response GetEventGridNamespaceC /// An object representing collection of NamespaceTopicResources and their operations over a NamespaceTopicResource. public virtual NamespaceTopicCollection GetNamespaceTopics() { - return GetCachedClient(Client => new NamespaceTopicCollection(Client, Id)); + return GetCachedClient(client => new NamespaceTopicCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual NamespaceTopicCollection GetNamespaceTopics() /// /// Name of the namespace topic. /// The cancellation token to use. - /// 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> GetNamespaceTopicAsync(string topicName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task> GetNamespaceTopicAsy /// /// Name of the namespace topic. /// The cancellation token to use. - /// 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 GetNamespaceTopic(string topicName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetNamespaceTopic(string topicNa /// An object representing collection of EventGridNamespacePermissionBindingResources and their operations over a EventGridNamespacePermissionBindingResource. public virtual EventGridNamespacePermissionBindingCollection GetEventGridNamespacePermissionBindings() { - return GetCachedClient(Client => new EventGridNamespacePermissionBindingCollection(Client, Id)); + return GetCachedClient(client => new EventGridNamespacePermissionBindingCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual EventGridNamespacePermissionBindingCollection GetEventGridNamespa /// /// Name of the permission binding. /// The cancellation token to use. - /// 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> GetEventGridNamespacePermissionBindingAsync(string permissionBindingName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> /// /// Name of the permission binding. /// The cancellation token to use. - /// 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 GetEventGridNamespacePermissionBinding(string permissionBindingName, CancellationToken cancellationToken = default) { @@ -358,7 +358,7 @@ public virtual Response GetEventGri /// An object representing collection of TopicSpaceResources and their operations over a TopicSpaceResource. public virtual TopicSpaceCollection GetTopicSpaces() { - return GetCachedClient(Client => new TopicSpaceCollection(Client, Id)); + return GetCachedClient(client => new TopicSpaceCollection(client, Id)); } /// @@ -376,8 +376,8 @@ public virtual TopicSpaceCollection GetTopicSpaces() /// /// Name of the Topic space. /// The cancellation token to use. - /// 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> GetTopicSpaceAsync(string topicSpaceName, CancellationToken cancellationToken = default) { @@ -399,8 +399,8 @@ public virtual async Task> GetTopicSpaceAsync(strin /// /// Name of the Topic space. /// The cancellation token to use. - /// 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 GetTopicSpace(string topicSpaceName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridTopicResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridTopicResource.cs index 674b176eb7dc..af919068270a 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridTopicResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/EventGridTopicResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of TopicEventSubscriptionResources and their operations over a TopicEventSubscriptionResource. public virtual TopicEventSubscriptionCollection GetTopicEventSubscriptions() { - return GetCachedClient(Client => new TopicEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new TopicEventSubscriptionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual TopicEventSubscriptionCollection GetTopicEventSubscriptions() /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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> GetTopicEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetTopicEven /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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 GetTopicEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetTopicEventSubscriptio /// An object representing collection of EventGridTopicPrivateEndpointConnectionResources and their operations over a EventGridTopicPrivateEndpointConnectionResource. public virtual EventGridTopicPrivateEndpointConnectionCollection GetEventGridTopicPrivateEndpointConnections() { - return GetCachedClient(Client => new EventGridTopicPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new EventGridTopicPrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual EventGridTopicPrivateEndpointConnectionCollection GetEventGridTop /// /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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> GetEventGridTopicPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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 GetEventGridTopicPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetEven /// An object representing collection of EventGridTopicPrivateLinkResources and their operations over a EventGridTopicPrivateLinkResource. public virtual EventGridTopicPrivateLinkResourceCollection GetEventGridTopicPrivateLinkResources() { - return GetCachedClient(Client => new EventGridTopicPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new EventGridTopicPrivateLinkResourceCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual EventGridTopicPrivateLinkResourceCollection GetEventGridTopicPriv /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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> GetEventGridTopicPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetEventG /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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 GetEventGridTopicPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index c8a1b5fefc0c..000000000000 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.EventGrid -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EventSubscriptionResources in the ArmResource. - /// An object representing collection of EventSubscriptionResources and their operations over a EventSubscriptionResource. - public virtual EventSubscriptionCollection GetEventSubscriptions() - { - return GetCachedClient(Client => new EventSubscriptionCollection(Client, Id)); - } - - /// Gets an object representing a ExtensionTopicResource along with the instance operations that can be performed on it in the ArmResource. - /// Returns a object. - public virtual ExtensionTopicResource GetExtensionTopic() - { - return new ExtensionTopicResource(Client, Id.AppendProviderResource("Microsoft.EventGrid", "extensionTopics", "default")); - } - } -} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridArmClientMockingExtension.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridArmClientMockingExtension.cs new file mode 100644 index 000000000000..ad39034e6d83 --- /dev/null +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridArmClientMockingExtension.cs @@ -0,0 +1,503 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EventGrid; + +namespace Azure.ResourceManager.EventGrid.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class EventGridArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EventGridArmClientMockingExtension() + { + } + + /// 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 EventGridArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal EventGridArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EventSubscriptionResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of EventSubscriptionResources and their operations over a EventSubscriptionResource. + public virtual EventSubscriptionCollection GetEventSubscriptions(ResourceIdentifier scope) + { + return new EventSubscriptionCollection(Client, scope); + } + + /// + /// Get properties of an event subscription. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} + /// + /// + /// Operation Id + /// EventSubscriptions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the event subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventSubscriptionAsync(ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) + { + return await GetEventSubscriptions(scope).GetAsync(eventSubscriptionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of an event subscription. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} + /// + /// + /// Operation Id + /// EventSubscriptions_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the event subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventSubscription(ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) + { + return GetEventSubscriptions(scope).Get(eventSubscriptionName, cancellationToken); + } + + /// Gets an object representing a ExtensionTopicResource along with the instance operations that can be performed on it in the ArmClient. + /// The scope that the resource will apply against. + /// Returns a object. + public virtual ExtensionTopicResource GetExtensionTopic(ResourceIdentifier scope) + { + return new ExtensionTopicResource(Client, scope.AppendProviderResource("Microsoft.EventGrid", "extensionTopics", "default")); + } + + /// + /// 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 CaCertificateResource GetCaCertificateResource(ResourceIdentifier id) + { + CaCertificateResource.ValidateResourceId(id); + return new CaCertificateResource(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 PartnerNamespaceChannelResource GetPartnerNamespaceChannelResource(ResourceIdentifier id) + { + PartnerNamespaceChannelResource.ValidateResourceId(id); + return new PartnerNamespaceChannelResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridNamespaceClientGroupResource GetEventGridNamespaceClientGroupResource(ResourceIdentifier id) + { + EventGridNamespaceClientGroupResource.ValidateResourceId(id); + return new EventGridNamespaceClientGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridNamespaceClientResource GetEventGridNamespaceClientResource(ResourceIdentifier id) + { + EventGridNamespaceClientResource.ValidateResourceId(id); + return new EventGridNamespaceClientResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridDomainResource GetEventGridDomainResource(ResourceIdentifier id) + { + EventGridDomainResource.ValidateResourceId(id); + return new EventGridDomainResource(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 DomainTopicResource GetDomainTopicResource(ResourceIdentifier id) + { + DomainTopicResource.ValidateResourceId(id); + return new DomainTopicResource(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 DomainTopicEventSubscriptionResource GetDomainTopicEventSubscriptionResource(ResourceIdentifier id) + { + DomainTopicEventSubscriptionResource.ValidateResourceId(id); + return new DomainTopicEventSubscriptionResource(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 TopicEventSubscriptionResource GetTopicEventSubscriptionResource(ResourceIdentifier id) + { + TopicEventSubscriptionResource.ValidateResourceId(id); + return new TopicEventSubscriptionResource(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 DomainEventSubscriptionResource GetDomainEventSubscriptionResource(ResourceIdentifier id) + { + DomainEventSubscriptionResource.ValidateResourceId(id); + return new DomainEventSubscriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventSubscriptionResource GetEventSubscriptionResource(ResourceIdentifier id) + { + EventSubscriptionResource.ValidateResourceId(id); + return new EventSubscriptionResource(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 SystemTopicEventSubscriptionResource GetSystemTopicEventSubscriptionResource(ResourceIdentifier id) + { + SystemTopicEventSubscriptionResource.ValidateResourceId(id); + return new SystemTopicEventSubscriptionResource(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 PartnerTopicEventSubscriptionResource GetPartnerTopicEventSubscriptionResource(ResourceIdentifier id) + { + PartnerTopicEventSubscriptionResource.ValidateResourceId(id); + return new PartnerTopicEventSubscriptionResource(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 NamespaceTopicEventSubscriptionResource GetNamespaceTopicEventSubscriptionResource(ResourceIdentifier id) + { + NamespaceTopicEventSubscriptionResource.ValidateResourceId(id); + return new NamespaceTopicEventSubscriptionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridNamespaceResource GetEventGridNamespaceResource(ResourceIdentifier id) + { + EventGridNamespaceResource.ValidateResourceId(id); + return new EventGridNamespaceResource(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 NamespaceTopicResource GetNamespaceTopicResource(ResourceIdentifier id) + { + NamespaceTopicResource.ValidateResourceId(id); + return new NamespaceTopicResource(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 PartnerConfigurationResource GetPartnerConfigurationResource(ResourceIdentifier id) + { + PartnerConfigurationResource.ValidateResourceId(id); + return new PartnerConfigurationResource(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 PartnerDestinationResource GetPartnerDestinationResource(ResourceIdentifier id) + { + PartnerDestinationResource.ValidateResourceId(id); + return new PartnerDestinationResource(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 PartnerNamespaceResource GetPartnerNamespaceResource(ResourceIdentifier id) + { + PartnerNamespaceResource.ValidateResourceId(id); + return new PartnerNamespaceResource(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 PartnerRegistrationResource GetPartnerRegistrationResource(ResourceIdentifier id) + { + PartnerRegistrationResource.ValidateResourceId(id); + return new PartnerRegistrationResource(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 PartnerTopicResource GetPartnerTopicResource(ResourceIdentifier id) + { + PartnerTopicResource.ValidateResourceId(id); + return new PartnerTopicResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridNamespacePermissionBindingResource GetEventGridNamespacePermissionBindingResource(ResourceIdentifier id) + { + EventGridNamespacePermissionBindingResource.ValidateResourceId(id); + return new EventGridNamespacePermissionBindingResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridTopicPrivateEndpointConnectionResource GetEventGridTopicPrivateEndpointConnectionResource(ResourceIdentifier id) + { + EventGridTopicPrivateEndpointConnectionResource.ValidateResourceId(id); + return new EventGridTopicPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridDomainPrivateEndpointConnectionResource GetEventGridDomainPrivateEndpointConnectionResource(ResourceIdentifier id) + { + EventGridDomainPrivateEndpointConnectionResource.ValidateResourceId(id); + return new EventGridDomainPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridPartnerNamespacePrivateEndpointConnectionResource GetEventGridPartnerNamespacePrivateEndpointConnectionResource(ResourceIdentifier id) + { + EventGridPartnerNamespacePrivateEndpointConnectionResource.ValidateResourceId(id); + return new EventGridPartnerNamespacePrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridTopicPrivateLinkResource GetEventGridTopicPrivateLinkResource(ResourceIdentifier id) + { + EventGridTopicPrivateLinkResource.ValidateResourceId(id); + return new EventGridTopicPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridDomainPrivateLinkResource GetEventGridDomainPrivateLinkResource(ResourceIdentifier id) + { + EventGridDomainPrivateLinkResource.ValidateResourceId(id); + return new EventGridDomainPrivateLinkResource(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 PartnerNamespacePrivateLinkResource GetPartnerNamespacePrivateLinkResource(ResourceIdentifier id) + { + PartnerNamespacePrivateLinkResource.ValidateResourceId(id); + return new PartnerNamespacePrivateLinkResource(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 SystemTopicResource GetSystemTopicResource(ResourceIdentifier id) + { + SystemTopicResource.ValidateResourceId(id); + return new SystemTopicResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventGridTopicResource GetEventGridTopicResource(ResourceIdentifier id) + { + EventGridTopicResource.ValidateResourceId(id); + return new EventGridTopicResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExtensionTopicResource GetExtensionTopicResource(ResourceIdentifier id) + { + ExtensionTopicResource.ValidateResourceId(id); + return new ExtensionTopicResource(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 TopicSpaceResource GetTopicSpaceResource(ResourceIdentifier id) + { + TopicSpaceResource.ValidateResourceId(id); + return new TopicSpaceResource(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 TopicTypeResource GetTopicTypeResource(ResourceIdentifier id) + { + TopicTypeResource.ValidateResourceId(id); + return new TopicTypeResource(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 VerifiedPartnerResource GetVerifiedPartnerResource(ResourceIdentifier id) + { + VerifiedPartnerResource.ValidateResourceId(id); + return new VerifiedPartnerResource(Client, id); + } + } +} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridExtensions.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridExtensions.cs index 80f463ceac09..4ad896dbb9a2 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridExtensions.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.EventGrid.Mocking; using Azure.ResourceManager.EventGrid.Models; using Azure.ResourceManager.Resources; @@ -19,770 +20,654 @@ namespace Azure.ResourceManager.EventGrid /// A class to add extension methods to Azure.ResourceManager.EventGrid. public static partial class EventGridExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static EventGridArmClientMockingExtension GetEventGridArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new EventGridArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static EventGridResourceGroupMockingExtension GetEventGridResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new EventGridResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static EventGridSubscriptionMockingExtension GetEventGridSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new EventGridSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static EventGridTenantMockingExtension GetEventGridTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new EventGridTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + /// + /// Gets a collection of EventSubscriptionResources 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. + /// An object representing collection of EventSubscriptionResources and their operations over a EventSubscriptionResource. + public static EventSubscriptionCollection GetEventSubscriptions(this ArmClient client, ResourceIdentifier scope) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return GetEventGridArmClientMockingExtension(client).GetEventSubscriptions(scope); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// Get properties of an event subscription. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} + /// + /// + /// Operation Id + /// EventSubscriptions_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Name of the event subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetEventSubscriptionAsync(this ArmClient client, ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return await GetEventGridArmClientMockingExtension(client).GetEventSubscriptionAsync(scope, eventSubscriptionName, cancellationToken).ConfigureAwait(false); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) + /// + /// Get properties of an event subscription. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} + /// + /// + /// Operation Id + /// EventSubscriptions_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Name of the event subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetEventSubscription(this ArmClient client, ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); + return GetEventGridArmClientMockingExtension(client).GetEventSubscription(scope, eventSubscriptionName, cancellationToken); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + /// + /// Gets an object representing a ExtensionTopicResource along with the instance operations that can be performed on it 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. + /// Returns a object. + public static ExtensionTopicResource GetExtensionTopic(this ArmClient client, ResourceIdentifier scope) { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); + return GetEventGridArmClientMockingExtension(client).GetExtensionTopic(scope); } - #region CaCertificateResource + /// /// 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. /// Returns a object. public static CaCertificateResource GetCaCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CaCertificateResource.ValidateResourceId(id); - return new CaCertificateResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetCaCertificateResource(id); } - #endregion - #region PartnerNamespaceChannelResource /// /// 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. /// Returns a object. public static PartnerNamespaceChannelResource GetPartnerNamespaceChannelResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerNamespaceChannelResource.ValidateResourceId(id); - return new PartnerNamespaceChannelResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerNamespaceChannelResource(id); } - #endregion - #region EventGridNamespaceClientGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridNamespaceClientGroupResource GetEventGridNamespaceClientGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridNamespaceClientGroupResource.ValidateResourceId(id); - return new EventGridNamespaceClientGroupResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridNamespaceClientGroupResource(id); } - #endregion - #region EventGridNamespaceClientResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridNamespaceClientResource GetEventGridNamespaceClientResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridNamespaceClientResource.ValidateResourceId(id); - return new EventGridNamespaceClientResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridNamespaceClientResource(id); } - #endregion - #region EventGridDomainResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridDomainResource GetEventGridDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridDomainResource.ValidateResourceId(id); - return new EventGridDomainResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridDomainResource(id); } - #endregion - #region DomainTopicResource /// /// 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. /// Returns a object. public static DomainTopicResource GetDomainTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DomainTopicResource.ValidateResourceId(id); - return new DomainTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetDomainTopicResource(id); } - #endregion - #region DomainTopicEventSubscriptionResource /// /// 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. /// Returns a object. public static DomainTopicEventSubscriptionResource GetDomainTopicEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DomainTopicEventSubscriptionResource.ValidateResourceId(id); - return new DomainTopicEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetDomainTopicEventSubscriptionResource(id); } - #endregion - #region TopicEventSubscriptionResource /// /// 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. /// Returns a object. public static TopicEventSubscriptionResource GetTopicEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TopicEventSubscriptionResource.ValidateResourceId(id); - return new TopicEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetTopicEventSubscriptionResource(id); } - #endregion - #region DomainEventSubscriptionResource /// /// 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. /// Returns a object. public static DomainEventSubscriptionResource GetDomainEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DomainEventSubscriptionResource.ValidateResourceId(id); - return new DomainEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetDomainEventSubscriptionResource(id); } - #endregion - #region EventSubscriptionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventSubscriptionResource GetEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventSubscriptionResource.ValidateResourceId(id); - return new EventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventSubscriptionResource(id); } - #endregion - #region SystemTopicEventSubscriptionResource /// /// 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. /// Returns a object. public static SystemTopicEventSubscriptionResource GetSystemTopicEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SystemTopicEventSubscriptionResource.ValidateResourceId(id); - return new SystemTopicEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetSystemTopicEventSubscriptionResource(id); } - #endregion - #region PartnerTopicEventSubscriptionResource /// /// 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. /// Returns a object. public static PartnerTopicEventSubscriptionResource GetPartnerTopicEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerTopicEventSubscriptionResource.ValidateResourceId(id); - return new PartnerTopicEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerTopicEventSubscriptionResource(id); } - #endregion - #region NamespaceTopicEventSubscriptionResource /// /// 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. /// Returns a object. public static NamespaceTopicEventSubscriptionResource GetNamespaceTopicEventSubscriptionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NamespaceTopicEventSubscriptionResource.ValidateResourceId(id); - return new NamespaceTopicEventSubscriptionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetNamespaceTopicEventSubscriptionResource(id); } - #endregion - #region EventGridNamespaceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridNamespaceResource GetEventGridNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridNamespaceResource.ValidateResourceId(id); - return new EventGridNamespaceResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridNamespaceResource(id); } - #endregion - #region NamespaceTopicResource /// /// 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. /// Returns a object. public static NamespaceTopicResource GetNamespaceTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - NamespaceTopicResource.ValidateResourceId(id); - return new NamespaceTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetNamespaceTopicResource(id); } - #endregion - #region PartnerConfigurationResource /// /// 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. /// Returns a object. public static PartnerConfigurationResource GetPartnerConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerConfigurationResource.ValidateResourceId(id); - return new PartnerConfigurationResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerConfigurationResource(id); } - #endregion - #region PartnerDestinationResource /// /// 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. /// Returns a object. public static PartnerDestinationResource GetPartnerDestinationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerDestinationResource.ValidateResourceId(id); - return new PartnerDestinationResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerDestinationResource(id); } - #endregion - #region PartnerNamespaceResource /// /// 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. /// Returns a object. public static PartnerNamespaceResource GetPartnerNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerNamespaceResource.ValidateResourceId(id); - return new PartnerNamespaceResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerNamespaceResource(id); } - #endregion - #region PartnerRegistrationResource /// /// 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. /// Returns a object. public static PartnerRegistrationResource GetPartnerRegistrationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerRegistrationResource.ValidateResourceId(id); - return new PartnerRegistrationResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerRegistrationResource(id); } - #endregion - #region PartnerTopicResource /// /// 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. /// Returns a object. public static PartnerTopicResource GetPartnerTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerTopicResource.ValidateResourceId(id); - return new PartnerTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerTopicResource(id); } - #endregion - #region EventGridNamespacePermissionBindingResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridNamespacePermissionBindingResource GetEventGridNamespacePermissionBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridNamespacePermissionBindingResource.ValidateResourceId(id); - return new EventGridNamespacePermissionBindingResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridNamespacePermissionBindingResource(id); } - #endregion - #region EventGridTopicPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridTopicPrivateEndpointConnectionResource GetEventGridTopicPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridTopicPrivateEndpointConnectionResource.ValidateResourceId(id); - return new EventGridTopicPrivateEndpointConnectionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridTopicPrivateEndpointConnectionResource(id); } - #endregion - #region EventGridDomainPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridDomainPrivateEndpointConnectionResource GetEventGridDomainPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridDomainPrivateEndpointConnectionResource.ValidateResourceId(id); - return new EventGridDomainPrivateEndpointConnectionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridDomainPrivateEndpointConnectionResource(id); } - #endregion - #region EventGridPartnerNamespacePrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridPartnerNamespacePrivateEndpointConnectionResource GetEventGridPartnerNamespacePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridPartnerNamespacePrivateEndpointConnectionResource.ValidateResourceId(id); - return new EventGridPartnerNamespacePrivateEndpointConnectionResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridPartnerNamespacePrivateEndpointConnectionResource(id); } - #endregion - #region EventGridTopicPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridTopicPrivateLinkResource GetEventGridTopicPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridTopicPrivateLinkResource.ValidateResourceId(id); - return new EventGridTopicPrivateLinkResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridTopicPrivateLinkResource(id); } - #endregion - #region EventGridDomainPrivateLinkResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridDomainPrivateLinkResource GetEventGridDomainPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridDomainPrivateLinkResource.ValidateResourceId(id); - return new EventGridDomainPrivateLinkResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridDomainPrivateLinkResource(id); } - #endregion - #region PartnerNamespacePrivateLinkResource /// /// 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. /// Returns a object. public static PartnerNamespacePrivateLinkResource GetPartnerNamespacePrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PartnerNamespacePrivateLinkResource.ValidateResourceId(id); - return new PartnerNamespacePrivateLinkResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetPartnerNamespacePrivateLinkResource(id); } - #endregion - #region SystemTopicResource /// /// 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. /// Returns a object. public static SystemTopicResource GetSystemTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SystemTopicResource.ValidateResourceId(id); - return new SystemTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetSystemTopicResource(id); } - #endregion - #region EventGridTopicResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventGridTopicResource GetEventGridTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventGridTopicResource.ValidateResourceId(id); - return new EventGridTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetEventGridTopicResource(id); } - #endregion - #region ExtensionTopicResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static ExtensionTopicResource GetExtensionTopicResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ExtensionTopicResource.ValidateResourceId(id); - return new ExtensionTopicResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetExtensionTopicResource(id); } - #endregion - #region TopicSpaceResource /// /// 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. /// Returns a object. public static TopicSpaceResource GetTopicSpaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TopicSpaceResource.ValidateResourceId(id); - return new TopicSpaceResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetTopicSpaceResource(id); } - #endregion - #region TopicTypeResource /// /// 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. /// Returns a object. public static TopicTypeResource GetTopicTypeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - TopicTypeResource.ValidateResourceId(id); - return new TopicTypeResource(client, id); - } - ); + return GetEventGridArmClientMockingExtension(client).GetTopicTypeResource(id); } - #endregion - #region VerifiedPartnerResource /// /// 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. /// Returns a object. public static VerifiedPartnerResource GetVerifiedPartnerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VerifiedPartnerResource.ValidateResourceId(id); - return new VerifiedPartnerResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of EventSubscriptionResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of EventSubscriptionResources and their operations over a EventSubscriptionResource. - public static EventSubscriptionCollection GetEventSubscriptions(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetEventSubscriptions(); + return GetEventGridArmClientMockingExtension(client).GetVerifiedPartnerResource(id); } /// - /// Get properties of an event subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} - /// + /// Gets a collection of EventGridDomainResources in the ResourceGroupResource. /// - /// Operation Id - /// EventSubscriptions_Get + /// Mocking + /// To mock this method, please mock instead. /// - /// /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the event subscription. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetEventSubscriptionAsync(this ArmClient client, ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) - { - return await client.GetEventSubscriptions(scope).GetAsync(eventSubscriptionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get properties of an event subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName} - /// - /// - /// Operation Id - /// EventSubscriptions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the event subscription. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetEventSubscription(this ArmClient client, ResourceIdentifier scope, string eventSubscriptionName, CancellationToken cancellationToken = default) - { - return client.GetEventSubscriptions(scope).Get(eventSubscriptionName, cancellationToken); - } - - /// Gets an object representing a ExtensionTopicResource along with the instance operations that can be performed on it in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Returns a object. - public static ExtensionTopicResource GetExtensionTopic(this ArmClient client, ResourceIdentifier scope) - { - return GetArmResourceExtensionClient(client, scope).GetExtensionTopic(); - } - - /// Gets a collection of EventGridDomainResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of EventGridDomainResources and their operations over a EventGridDomainResource. public static EventGridDomainCollection GetEventGridDomains(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEventGridDomains(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridDomains(); } /// @@ -797,16 +682,20 @@ public static EventGridDomainCollection GetEventGridDomains(this ResourceGroupRe /// Domains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. /// The cancellation token to use. - /// 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 static async Task> GetEventGridDomainAsync(this ResourceGroupResource resourceGroupResource, string domainName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEventGridDomains().GetAsync(domainName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridDomainAsync(domainName, cancellationToken).ConfigureAwait(false); } /// @@ -821,24 +710,34 @@ public static async Task> GetEventGridDomainAs /// Domains_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the domain. /// The cancellation token to use. - /// 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 static Response GetEventGridDomain(this ResourceGroupResource resourceGroupResource, string domainName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEventGridDomains().Get(domainName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridDomain(domainName, cancellationToken); } - /// Gets a collection of EventGridNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of EventGridNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EventGridNamespaceResources and their operations over a EventGridNamespaceResource. public static EventGridNamespaceCollection GetEventGridNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEventGridNamespaces(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridNamespaces(); } /// @@ -853,16 +752,20 @@ public static EventGridNamespaceCollection GetEventGridNamespaces(this ResourceG /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the namespace. /// The cancellation token to use. - /// 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 static async Task> GetEventGridNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEventGridNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -877,32 +780,48 @@ public static async Task> GetEventGridNames /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the namespace. /// The cancellation token to use. - /// 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 static Response GetEventGridNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEventGridNamespaces().Get(namespaceName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridNamespace(namespaceName, cancellationToken); } - /// Gets an object representing a PartnerConfigurationResource along with the instance operations that can be performed on it in the ResourceGroupResource. + /// + /// Gets an object representing a PartnerConfigurationResource along with the instance operations that can be performed on it in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Returns a object. public static PartnerConfigurationResource GetPartnerConfiguration(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPartnerConfiguration(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerConfiguration(); } - /// Gets a collection of PartnerDestinationResources in the ResourceGroupResource. + /// + /// Gets a collection of PartnerDestinationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PartnerDestinationResources and their operations over a PartnerDestinationResource. public static PartnerDestinationCollection GetPartnerDestinations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPartnerDestinations(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerDestinations(); } /// @@ -917,16 +836,20 @@ public static PartnerDestinationCollection GetPartnerDestinations(this ResourceG /// PartnerDestinations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner destination. /// The cancellation token to use. - /// 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 static async Task> GetPartnerDestinationAsync(this ResourceGroupResource resourceGroupResource, string partnerDestinationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPartnerDestinations().GetAsync(partnerDestinationName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerDestinationAsync(partnerDestinationName, cancellationToken).ConfigureAwait(false); } /// @@ -941,24 +864,34 @@ public static async Task> GetPartnerDestina /// PartnerDestinations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner destination. /// The cancellation token to use. - /// 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 static Response GetPartnerDestination(this ResourceGroupResource resourceGroupResource, string partnerDestinationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPartnerDestinations().Get(partnerDestinationName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerDestination(partnerDestinationName, cancellationToken); } - /// Gets a collection of PartnerNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of PartnerNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PartnerNamespaceResources and their operations over a PartnerNamespaceResource. public static PartnerNamespaceCollection GetPartnerNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPartnerNamespaces(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerNamespaces(); } /// @@ -973,16 +906,20 @@ public static PartnerNamespaceCollection GetPartnerNamespaces(this ResourceGroup /// PartnerNamespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner namespace. /// The cancellation token to use. - /// 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 static async Task> GetPartnerNamespaceAsync(this ResourceGroupResource resourceGroupResource, string partnerNamespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPartnerNamespaces().GetAsync(partnerNamespaceName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerNamespaceAsync(partnerNamespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -997,24 +934,34 @@ public static async Task> GetPartnerNamespace /// PartnerNamespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner namespace. /// The cancellation token to use. - /// 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 static Response GetPartnerNamespace(this ResourceGroupResource resourceGroupResource, string partnerNamespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPartnerNamespaces().Get(partnerNamespaceName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerNamespace(partnerNamespaceName, cancellationToken); } - /// Gets a collection of PartnerRegistrationResources in the ResourceGroupResource. + /// + /// Gets a collection of PartnerRegistrationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PartnerRegistrationResources and their operations over a PartnerRegistrationResource. public static PartnerRegistrationCollection GetPartnerRegistrations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPartnerRegistrations(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerRegistrations(); } /// @@ -1029,16 +976,20 @@ public static PartnerRegistrationCollection GetPartnerRegistrations(this Resourc /// PartnerRegistrations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner registration. /// The cancellation token to use. - /// 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 static async Task> GetPartnerRegistrationAsync(this ResourceGroupResource resourceGroupResource, string partnerRegistrationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPartnerRegistrations().GetAsync(partnerRegistrationName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerRegistrationAsync(partnerRegistrationName, cancellationToken).ConfigureAwait(false); } /// @@ -1053,24 +1004,34 @@ public static async Task> GetPartnerRegist /// PartnerRegistrations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner registration. /// The cancellation token to use. - /// 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 static Response GetPartnerRegistration(this ResourceGroupResource resourceGroupResource, string partnerRegistrationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPartnerRegistrations().Get(partnerRegistrationName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerRegistration(partnerRegistrationName, cancellationToken); } - /// Gets a collection of PartnerTopicResources in the ResourceGroupResource. + /// + /// Gets a collection of PartnerTopicResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of PartnerTopicResources and their operations over a PartnerTopicResource. public static PartnerTopicCollection GetPartnerTopics(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetPartnerTopics(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerTopics(); } /// @@ -1085,16 +1046,20 @@ public static PartnerTopicCollection GetPartnerTopics(this ResourceGroupResource /// PartnerTopics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner topic. /// The cancellation token to use. - /// 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 static async Task> GetPartnerTopicAsync(this ResourceGroupResource resourceGroupResource, string partnerTopicName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetPartnerTopics().GetAsync(partnerTopicName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerTopicAsync(partnerTopicName, cancellationToken).ConfigureAwait(false); } /// @@ -1109,24 +1074,34 @@ public static async Task> GetPartnerTopicAsync(th /// PartnerTopics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the partner topic. /// The cancellation token to use. - /// 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 static Response GetPartnerTopic(this ResourceGroupResource resourceGroupResource, string partnerTopicName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetPartnerTopics().Get(partnerTopicName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetPartnerTopic(partnerTopicName, cancellationToken); } - /// Gets a collection of SystemTopicResources in the ResourceGroupResource. + /// + /// Gets a collection of SystemTopicResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SystemTopicResources and their operations over a SystemTopicResource. public static SystemTopicCollection GetSystemTopics(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSystemTopics(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetSystemTopics(); } /// @@ -1141,16 +1116,20 @@ public static SystemTopicCollection GetSystemTopics(this ResourceGroupResource r /// SystemTopics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the system topic. /// The cancellation token to use. - /// 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 static async Task> GetSystemTopicAsync(this ResourceGroupResource resourceGroupResource, string systemTopicName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSystemTopics().GetAsync(systemTopicName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetSystemTopicAsync(systemTopicName, cancellationToken).ConfigureAwait(false); } /// @@ -1165,24 +1144,34 @@ public static async Task> GetSystemTopicAsync(this /// SystemTopics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the system topic. /// The cancellation token to use. - /// 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 static Response GetSystemTopic(this ResourceGroupResource resourceGroupResource, string systemTopicName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSystemTopics().Get(systemTopicName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetSystemTopic(systemTopicName, cancellationToken); } - /// Gets a collection of EventGridTopicResources in the ResourceGroupResource. + /// + /// Gets a collection of EventGridTopicResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EventGridTopicResources and their operations over a EventGridTopicResource. public static EventGridTopicCollection GetEventGridTopics(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEventGridTopics(); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridTopics(); } /// @@ -1197,16 +1186,20 @@ public static EventGridTopicCollection GetEventGridTopics(this ResourceGroupReso /// Topics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the topic. /// The cancellation token to use. - /// 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 static async Task> GetEventGridTopicAsync(this ResourceGroupResource resourceGroupResource, string topicName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEventGridTopics().GetAsync(topicName, cancellationToken).ConfigureAwait(false); + return await GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridTopicAsync(topicName, cancellationToken).ConfigureAwait(false); } /// @@ -1221,16 +1214,20 @@ public static async Task> GetEventGridTopicAsyn /// Topics_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the topic. /// The cancellation token to use. - /// 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 static Response GetEventGridTopic(this ResourceGroupResource resourceGroupResource, string topicName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEventGridTopics().Get(topicName, cancellationToken); + return GetEventGridResourceGroupMockingExtension(resourceGroupResource).GetEventGridTopic(topicName, cancellationToken); } /// @@ -1245,6 +1242,10 @@ public static Response GetEventGridTopic(this ResourceGr /// Domains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1253,7 +1254,7 @@ public static Response GetEventGridTopic(this ResourceGr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventGridDomainsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridDomainsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridDomainsAsync(filter, top, cancellationToken); } /// @@ -1268,6 +1269,10 @@ public static AsyncPageable GetEventGridDomainsAsync(th /// Domains_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1276,7 +1281,7 @@ public static AsyncPageable GetEventGridDomainsAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventGridDomains(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridDomains(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridDomains(filter, top, cancellationToken); } /// @@ -1291,6 +1296,10 @@ public static Pageable GetEventGridDomains(this Subscri /// Namespaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1299,7 +1308,7 @@ public static Pageable GetEventGridDomains(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventGridNamespacesAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridNamespacesAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridNamespacesAsync(filter, top, cancellationToken); } /// @@ -1314,6 +1323,10 @@ public static AsyncPageable GetEventGridNamespacesAs /// Namespaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1322,7 +1335,7 @@ public static AsyncPageable GetEventGridNamespacesAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventGridNamespaces(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridNamespaces(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridNamespaces(filter, top, cancellationToken); } /// @@ -1337,6 +1350,10 @@ public static Pageable GetEventGridNamespaces(this S /// PartnerConfigurations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1345,7 +1362,7 @@ public static Pageable GetEventGridNamespaces(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPartnerConfigurationsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerConfigurationsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerConfigurationsAsync(filter, top, cancellationToken); } /// @@ -1360,6 +1377,10 @@ public static AsyncPageable GetPartnerConfiguratio /// PartnerConfigurations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1368,7 +1389,7 @@ public static AsyncPageable GetPartnerConfiguratio /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPartnerConfigurations(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerConfigurations(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerConfigurations(filter, top, cancellationToken); } /// @@ -1383,6 +1404,10 @@ public static Pageable GetPartnerConfigurations(th /// PartnerDestinations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1391,7 +1416,7 @@ public static Pageable GetPartnerConfigurations(th /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPartnerDestinationsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerDestinationsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerDestinationsAsync(filter, top, cancellationToken); } /// @@ -1406,6 +1431,10 @@ public static AsyncPageable GetPartnerDestinationsAs /// PartnerDestinations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1414,7 +1443,7 @@ public static AsyncPageable GetPartnerDestinationsAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPartnerDestinations(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerDestinations(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerDestinations(filter, top, cancellationToken); } /// @@ -1429,6 +1458,10 @@ public static Pageable GetPartnerDestinations(this S /// PartnerNamespaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1437,7 +1470,7 @@ public static Pageable GetPartnerDestinations(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPartnerNamespacesAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerNamespacesAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerNamespacesAsync(filter, top, cancellationToken); } /// @@ -1452,6 +1485,10 @@ public static AsyncPageable GetPartnerNamespacesAsync( /// PartnerNamespaces_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1460,7 +1497,7 @@ public static AsyncPageable GetPartnerNamespacesAsync( /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPartnerNamespaces(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerNamespaces(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerNamespaces(filter, top, cancellationToken); } /// @@ -1475,6 +1512,10 @@ public static Pageable GetPartnerNamespaces(this Subsc /// PartnerRegistrations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1483,7 +1524,7 @@ public static Pageable GetPartnerNamespaces(this Subsc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPartnerRegistrationsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerRegistrationsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerRegistrationsAsync(filter, top, cancellationToken); } /// @@ -1498,6 +1539,10 @@ public static AsyncPageable GetPartnerRegistrations /// PartnerRegistrations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1506,7 +1551,7 @@ public static AsyncPageable GetPartnerRegistrations /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPartnerRegistrations(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerRegistrations(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerRegistrations(filter, top, cancellationToken); } /// @@ -1521,6 +1566,10 @@ public static Pageable GetPartnerRegistrations(this /// PartnerTopics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1529,7 +1578,7 @@ public static Pageable GetPartnerRegistrations(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPartnerTopicsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerTopicsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerTopicsAsync(filter, top, cancellationToken); } /// @@ -1544,6 +1593,10 @@ public static AsyncPageable GetPartnerTopicsAsync(this Sub /// PartnerTopics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1552,7 +1605,7 @@ public static AsyncPageable GetPartnerTopicsAsync(this Sub /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPartnerTopics(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPartnerTopics(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetPartnerTopics(filter, top, cancellationToken); } /// @@ -1567,6 +1620,10 @@ public static Pageable GetPartnerTopics(this SubscriptionR /// SystemTopics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1575,7 +1632,7 @@ public static Pageable GetPartnerTopics(this SubscriptionR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSystemTopicsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSystemTopicsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetSystemTopicsAsync(filter, top, cancellationToken); } /// @@ -1590,6 +1647,10 @@ public static AsyncPageable GetSystemTopicsAsync(this Subsc /// SystemTopics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1598,7 +1659,7 @@ public static AsyncPageable GetSystemTopicsAsync(this Subsc /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSystemTopics(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSystemTopics(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetSystemTopics(filter, top, cancellationToken); } /// @@ -1613,6 +1674,10 @@ public static Pageable GetSystemTopics(this SubscriptionRes /// Topics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1621,7 +1686,7 @@ public static Pageable GetSystemTopics(this SubscriptionRes /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventGridTopicsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridTopicsAsync(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridTopicsAsync(filter, top, cancellationToken); } /// @@ -1636,6 +1701,10 @@ public static AsyncPageable GetEventGridTopicsAsync(this /// Topics_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. @@ -1644,15 +1713,21 @@ public static AsyncPageable GetEventGridTopicsAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventGridTopics(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventGridTopics(filter, top, cancellationToken); + return GetEventGridSubscriptionMockingExtension(subscriptionResource).GetEventGridTopics(filter, top, cancellationToken); } - /// Gets a collection of TopicTypeResources in the TenantResource. + /// + /// Gets a collection of TopicTypeResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TopicTypeResources and their operations over a TopicTypeResource. public static TopicTypeCollection GetTopicTypes(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTopicTypes(); + return GetEventGridTenantMockingExtension(tenantResource).GetTopicTypes(); } /// @@ -1667,16 +1742,20 @@ public static TopicTypeCollection GetTopicTypes(this TenantResource tenantResour /// TopicTypes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the topic type. /// The cancellation token to use. - /// 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 static async Task> GetTopicTypeAsync(this TenantResource tenantResource, string topicTypeName, CancellationToken cancellationToken = default) { - return await tenantResource.GetTopicTypes().GetAsync(topicTypeName, cancellationToken).ConfigureAwait(false); + return await GetEventGridTenantMockingExtension(tenantResource).GetTopicTypeAsync(topicTypeName, cancellationToken).ConfigureAwait(false); } /// @@ -1691,24 +1770,34 @@ public static async Task> GetTopicTypeAsync(this Ten /// TopicTypes_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the topic type. /// The cancellation token to use. - /// 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 static Response GetTopicType(this TenantResource tenantResource, string topicTypeName, CancellationToken cancellationToken = default) { - return tenantResource.GetTopicTypes().Get(topicTypeName, cancellationToken); + return GetEventGridTenantMockingExtension(tenantResource).GetTopicType(topicTypeName, cancellationToken); } - /// Gets a collection of VerifiedPartnerResources in the TenantResource. + /// + /// Gets a collection of VerifiedPartnerResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VerifiedPartnerResources and their operations over a VerifiedPartnerResource. public static VerifiedPartnerCollection GetVerifiedPartners(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetVerifiedPartners(); + return GetEventGridTenantMockingExtension(tenantResource).GetVerifiedPartners(); } /// @@ -1723,16 +1812,20 @@ public static VerifiedPartnerCollection GetVerifiedPartners(this TenantResource /// VerifiedPartners_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the verified partner. /// The cancellation token to use. - /// 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 static async Task> GetVerifiedPartnerAsync(this TenantResource tenantResource, string verifiedPartnerName, CancellationToken cancellationToken = default) { - return await tenantResource.GetVerifiedPartners().GetAsync(verifiedPartnerName, cancellationToken).ConfigureAwait(false); + return await GetEventGridTenantMockingExtension(tenantResource).GetVerifiedPartnerAsync(verifiedPartnerName, cancellationToken).ConfigureAwait(false); } /// @@ -1747,16 +1840,20 @@ public static async Task> GetVerifiedPartnerAs /// VerifiedPartners_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the verified partner. /// The cancellation token to use. - /// 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 static Response GetVerifiedPartner(this TenantResource tenantResource, string verifiedPartnerName, CancellationToken cancellationToken = default) { - return tenantResource.GetVerifiedPartners().Get(verifiedPartnerName, cancellationToken); + return GetEventGridTenantMockingExtension(tenantResource).GetVerifiedPartner(verifiedPartnerName, cancellationToken); } } } diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridResourceGroupMockingExtension.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..aba144103abb --- /dev/null +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridResourceGroupMockingExtension.cs @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.EventGrid; +using Azure.ResourceManager.EventGrid.Models; + +namespace Azure.ResourceManager.EventGrid.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class EventGridResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _eventSubscriptionClientDiagnostics; + private EventSubscriptionsRestOperations _eventSubscriptionRestClient; + private ClientDiagnostics _eventGridTopicTopicsClientDiagnostics; + private TopicsRestOperations _eventGridTopicTopicsRestClient; + + /// Initializes a new instance of the class for mocking. + protected EventGridResourceGroupMockingExtension() + { + } + + /// 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 EventGridResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics EventSubscriptionClientDiagnostics => _eventSubscriptionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EventGrid", EventSubscriptionResource.ResourceType.Namespace, Diagnostics); + private EventSubscriptionsRestOperations EventSubscriptionRestClient => _eventSubscriptionRestClient ??= new EventSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EventSubscriptionResource.ResourceType)); + private ClientDiagnostics EventGridTopicTopicsClientDiagnostics => _eventGridTopicTopicsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EventGrid", EventGridTopicResource.ResourceType.Namespace, Diagnostics); + private TopicsRestOperations EventGridTopicTopicsRestClient => _eventGridTopicTopicsRestClient ??= new TopicsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EventGridTopicResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EventGridDomainResources in the ResourceGroupResource. + /// An object representing collection of EventGridDomainResources and their operations over a EventGridDomainResource. + public virtual EventGridDomainCollection GetEventGridDomains() + { + return GetCachedClient(client => new EventGridDomainCollection(client, Id)); + } + + /// + /// Get properties of a domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName} + /// + /// + /// Operation Id + /// Domains_Get + /// + /// + /// + /// Name of the domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventGridDomainAsync(string domainName, CancellationToken cancellationToken = default) + { + return await GetEventGridDomains().GetAsync(domainName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a domain. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName} + /// + /// + /// Operation Id + /// Domains_Get + /// + /// + /// + /// Name of the domain. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventGridDomain(string domainName, CancellationToken cancellationToken = default) + { + return GetEventGridDomains().Get(domainName, cancellationToken); + } + + /// Gets a collection of EventGridNamespaceResources in the ResourceGroupResource. + /// An object representing collection of EventGridNamespaceResources and their operations over a EventGridNamespaceResource. + public virtual EventGridNamespaceCollection GetEventGridNamespaces() + { + return GetCachedClient(client => new EventGridNamespaceCollection(client, Id)); + } + + /// + /// Get properties of a namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// Name of the namespace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventGridNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + { + return await GetEventGridNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// Name of the namespace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventGridNamespace(string namespaceName, CancellationToken cancellationToken = default) + { + return GetEventGridNamespaces().Get(namespaceName, cancellationToken); + } + + /// Gets an object representing a PartnerConfigurationResource along with the instance operations that can be performed on it in the ResourceGroupResource. + /// Returns a object. + public virtual PartnerConfigurationResource GetPartnerConfiguration() + { + return new PartnerConfigurationResource(Client, Id.AppendProviderResource("Microsoft.EventGrid", "partnerConfigurations", "default")); + } + + /// Gets a collection of PartnerDestinationResources in the ResourceGroupResource. + /// An object representing collection of PartnerDestinationResources and their operations over a PartnerDestinationResource. + public virtual PartnerDestinationCollection GetPartnerDestinations() + { + return GetCachedClient(client => new PartnerDestinationCollection(client, Id)); + } + + /// + /// Get properties of a partner destination. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName} + /// + /// + /// Operation Id + /// PartnerDestinations_Get + /// + /// + /// + /// Name of the partner destination. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPartnerDestinationAsync(string partnerDestinationName, CancellationToken cancellationToken = default) + { + return await GetPartnerDestinations().GetAsync(partnerDestinationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a partner destination. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName} + /// + /// + /// Operation Id + /// PartnerDestinations_Get + /// + /// + /// + /// Name of the partner destination. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPartnerDestination(string partnerDestinationName, CancellationToken cancellationToken = default) + { + return GetPartnerDestinations().Get(partnerDestinationName, cancellationToken); + } + + /// Gets a collection of PartnerNamespaceResources in the ResourceGroupResource. + /// An object representing collection of PartnerNamespaceResources and their operations over a PartnerNamespaceResource. + public virtual PartnerNamespaceCollection GetPartnerNamespaces() + { + return GetCachedClient(client => new PartnerNamespaceCollection(client, Id)); + } + + /// + /// Get properties of a partner namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName} + /// + /// + /// Operation Id + /// PartnerNamespaces_Get + /// + /// + /// + /// Name of the partner namespace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPartnerNamespaceAsync(string partnerNamespaceName, CancellationToken cancellationToken = default) + { + return await GetPartnerNamespaces().GetAsync(partnerNamespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a partner namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName} + /// + /// + /// Operation Id + /// PartnerNamespaces_Get + /// + /// + /// + /// Name of the partner namespace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPartnerNamespace(string partnerNamespaceName, CancellationToken cancellationToken = default) + { + return GetPartnerNamespaces().Get(partnerNamespaceName, cancellationToken); + } + + /// Gets a collection of PartnerRegistrationResources in the ResourceGroupResource. + /// An object representing collection of PartnerRegistrationResources and their operations over a PartnerRegistrationResource. + public virtual PartnerRegistrationCollection GetPartnerRegistrations() + { + return GetCachedClient(client => new PartnerRegistrationCollection(client, Id)); + } + + /// + /// Gets a partner registration with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName} + /// + /// + /// Operation Id + /// PartnerRegistrations_Get + /// + /// + /// + /// Name of the partner registration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPartnerRegistrationAsync(string partnerRegistrationName, CancellationToken cancellationToken = default) + { + return await GetPartnerRegistrations().GetAsync(partnerRegistrationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a partner registration with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName} + /// + /// + /// Operation Id + /// PartnerRegistrations_Get + /// + /// + /// + /// Name of the partner registration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPartnerRegistration(string partnerRegistrationName, CancellationToken cancellationToken = default) + { + return GetPartnerRegistrations().Get(partnerRegistrationName, cancellationToken); + } + + /// Gets a collection of PartnerTopicResources in the ResourceGroupResource. + /// An object representing collection of PartnerTopicResources and their operations over a PartnerTopicResource. + public virtual PartnerTopicCollection GetPartnerTopics() + { + return GetCachedClient(client => new PartnerTopicCollection(client, Id)); + } + + /// + /// Get properties of a partner topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName} + /// + /// + /// Operation Id + /// PartnerTopics_Get + /// + /// + /// + /// Name of the partner topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPartnerTopicAsync(string partnerTopicName, CancellationToken cancellationToken = default) + { + return await GetPartnerTopics().GetAsync(partnerTopicName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a partner topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName} + /// + /// + /// Operation Id + /// PartnerTopics_Get + /// + /// + /// + /// Name of the partner topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPartnerTopic(string partnerTopicName, CancellationToken cancellationToken = default) + { + return GetPartnerTopics().Get(partnerTopicName, cancellationToken); + } + + /// Gets a collection of SystemTopicResources in the ResourceGroupResource. + /// An object representing collection of SystemTopicResources and their operations over a SystemTopicResource. + public virtual SystemTopicCollection GetSystemTopics() + { + return GetCachedClient(client => new SystemTopicCollection(client, Id)); + } + + /// + /// Get properties of a system topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName} + /// + /// + /// Operation Id + /// SystemTopics_Get + /// + /// + /// + /// Name of the system topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSystemTopicAsync(string systemTopicName, CancellationToken cancellationToken = default) + { + return await GetSystemTopics().GetAsync(systemTopicName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a system topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName} + /// + /// + /// Operation Id + /// SystemTopics_Get + /// + /// + /// + /// Name of the system topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSystemTopic(string systemTopicName, CancellationToken cancellationToken = default) + { + return GetSystemTopics().Get(systemTopicName, cancellationToken); + } + + /// Gets a collection of EventGridTopicResources in the ResourceGroupResource. + /// An object representing collection of EventGridTopicResources and their operations over a EventGridTopicResource. + public virtual EventGridTopicCollection GetEventGridTopics() + { + return GetCachedClient(client => new EventGridTopicCollection(client, Id)); + } + + /// + /// Get properties of a topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName} + /// + /// + /// Operation Id + /// Topics_Get + /// + /// + /// + /// Name of the topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventGridTopicAsync(string topicName, CancellationToken cancellationToken = default) + { + return await GetEventGridTopics().GetAsync(topicName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName} + /// + /// + /// Operation Id + /// Topics_Get + /// + /// + /// + /// Name of the topic. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventGridTopic(string topicName, CancellationToken cancellationToken = default) + { + return GetEventGridTopics().Get(topicName, cancellationToken); + } + + /// + /// List all global event subscriptions under a resource group for a specific topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListGlobalByResourceGroupForTopicType + /// + /// + /// + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGlobalEventSubscriptionsDataForTopicTypeAsync(string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListGlobalByResourceGroupForTopicTypeRequest(Id.SubscriptionId, Id.ResourceGroupName, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListGlobalByResourceGroupForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetGlobalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all global event subscriptions under a resource group for a specific topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListGlobalByResourceGroupForTopicType + /// + /// + /// + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGlobalEventSubscriptionsDataForTopicType(string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListGlobalByResourceGroupForTopicTypeRequest(Id.SubscriptionId, Id.ResourceGroupName, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListGlobalByResourceGroupForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetGlobalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalByResourceGroup + /// + /// + /// + /// Name of the location. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRegionalEventSubscriptionsDataAsync(AzureLocation location, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetRegionalEventSubscriptionsData", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalByResourceGroup + /// + /// + /// + /// Name of the location. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRegionalEventSubscriptionsData(AzureLocation location, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetRegionalEventSubscriptionsData", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalByResourceGroupForTopicType + /// + /// + /// + /// Name of the location. + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRegionalEventSubscriptionsDataForTopicTypeAsync(AzureLocation location, string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupForTopicTypeRequest(Id.SubscriptionId, Id.ResourceGroupName, location, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetRegionalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalByResourceGroupForTopicType + /// + /// + /// + /// Name of the location. + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRegionalEventSubscriptionsDataForTopicType(AzureLocation location, string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupForTopicTypeRequest(Id.SubscriptionId, Id.ResourceGroupName, location, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalByResourceGroupForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetRegionalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List event types for a topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes + /// + /// + /// Operation Id + /// Topics_ListEventTypes + /// + /// + /// + /// Namespace of the provider of the topic. + /// Name of the topic type. + /// Name of the topic. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEventTypesAsync(string providerNamespace, string resourceTypeName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(providerNamespace, nameof(providerNamespace)); + Argument.AssertNotNullOrEmpty(resourceTypeName, nameof(resourceTypeName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListEventTypesRequest(Id.SubscriptionId, Id.ResourceGroupName, providerNamespace, resourceTypeName, resourceName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, EventTypeUnderTopic.DeserializeEventTypeUnderTopic, EventGridTopicTopicsClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetEventTypes", "value", null, cancellationToken); + } + + /// + /// List event types for a topic. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes + /// + /// + /// Operation Id + /// Topics_ListEventTypes + /// + /// + /// + /// Namespace of the provider of the topic. + /// Name of the topic type. + /// Name of the topic. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEventTypes(string providerNamespace, string resourceTypeName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(providerNamespace, nameof(providerNamespace)); + Argument.AssertNotNullOrEmpty(resourceTypeName, nameof(resourceTypeName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListEventTypesRequest(Id.SubscriptionId, Id.ResourceGroupName, providerNamespace, resourceTypeName, resourceName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, EventTypeUnderTopic.DeserializeEventTypeUnderTopic, EventGridTopicTopicsClientDiagnostics, Pipeline, "EventGridResourceGroupMockingExtension.GetEventTypes", "value", null, cancellationToken); + } + } +} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridSubscriptionMockingExtension.cs similarity index 70% rename from sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridSubscriptionMockingExtension.cs index 34a12c90d428..4e15469cb5ae 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridSubscriptionMockingExtension.cs @@ -5,17 +5,19 @@ #nullable disable +using System; using System.Threading; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.EventGrid; -namespace Azure.ResourceManager.EventGrid +namespace Azure.ResourceManager.EventGrid.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class EventGridSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _eventGridDomainDomainsClientDiagnostics; private DomainsRestOperations _eventGridDomainDomainsRestClient; @@ -38,15 +40,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _eventGridTopicTopicsClientDiagnostics; private TopicsRestOperations _eventGridTopicTopicsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected EventGridSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal EventGridSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -98,7 +100,7 @@ public virtual AsyncPageable GetEventGridDomainsAsync(s { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridDomainDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridDomainDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridDomainResource(Client, EventGridDomainData.DeserializeEventGridDomainData(e)), EventGridDomainDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridDomainResource(Client, EventGridDomainData.DeserializeEventGridDomainData(e)), EventGridDomainDomainsClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridDomains", "value", "nextLink", cancellationToken); } /// @@ -122,7 +124,175 @@ public virtual Pageable GetEventGridDomains(string filt { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridDomainDomainsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridDomainDomainsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridDomainResource(Client, EventGridDomainData.DeserializeEventGridDomainData(e)), EventGridDomainDomainsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridDomains", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridDomainResource(Client, EventGridDomainData.DeserializeEventGridDomainData(e)), EventGridDomainDomainsClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridDomains", "value", "nextLink", cancellationToken); + } + + /// + /// List all global event subscriptions under an Azure subscription for a topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListGlobalBySubscriptionForTopicType + /// + /// + /// + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGlobalEventSubscriptionsDataForTopicTypeAsync(string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListGlobalBySubscriptionForTopicTypeRequest(Id.SubscriptionId, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListGlobalBySubscriptionForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetGlobalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all global event subscriptions under an Azure subscription for a topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListGlobalBySubscriptionForTopicType + /// + /// + /// + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGlobalEventSubscriptionsDataForTopicType(string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListGlobalBySubscriptionForTopicTypeRequest(Id.SubscriptionId, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListGlobalBySubscriptionForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetGlobalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalBySubscription + /// + /// + /// + /// Name of the location. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRegionalEventSubscriptionsDataAsync(AzureLocation location, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionRequest(Id.SubscriptionId, location, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, location, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetRegionalEventSubscriptionsData", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalBySubscription + /// + /// + /// + /// Name of the location. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRegionalEventSubscriptionsData(AzureLocation location, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionRequest(Id.SubscriptionId, location, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, location, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetRegionalEventSubscriptionsData", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalBySubscriptionForTopicType + /// + /// + /// + /// Name of the location. + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRegionalEventSubscriptionsDataForTopicTypeAsync(AzureLocation location, string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionForTopicTypeRequest(Id.SubscriptionId, location, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, location, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetRegionalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); + } + + /// + /// List all event subscriptions from the given location under a specific Azure subscription and topic type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions + /// + /// + /// Operation Id + /// EventSubscriptions_ListRegionalBySubscriptionForTopicType + /// + /// + /// + /// Name of the location. + /// Name of the topic type. + /// The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. + /// The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRegionalEventSubscriptionsDataForTopicType(AzureLocation location, string topicTypeName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(topicTypeName, nameof(topicTypeName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionForTopicTypeRequest(Id.SubscriptionId, location, topicTypeName, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventSubscriptionRestClient.CreateListRegionalBySubscriptionForTopicTypeNextPageRequest(nextLink, Id.SubscriptionId, location, topicTypeName, filter, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventSubscriptionResource(Client, EventGridSubscriptionData.DeserializeEventGridSubscriptionData(e)), EventSubscriptionClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetRegionalEventSubscriptionsDataForTopicType", "value", "nextLink", cancellationToken); } /// @@ -146,7 +316,7 @@ public virtual AsyncPageable GetEventGridNamespacesA { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridNamespaceNamespacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridNamespaceNamespacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridNamespaceResource(Client, EventGridNamespaceData.DeserializeEventGridNamespaceData(e)), EventGridNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridNamespaceResource(Client, EventGridNamespaceData.DeserializeEventGridNamespaceData(e)), EventGridNamespaceNamespacesClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridNamespaces", "value", "nextLink", cancellationToken); } /// @@ -170,7 +340,7 @@ public virtual Pageable GetEventGridNamespaces(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridNamespaceNamespacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridNamespaceNamespacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridNamespaceResource(Client, EventGridNamespaceData.DeserializeEventGridNamespaceData(e)), EventGridNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridNamespaceResource(Client, EventGridNamespaceData.DeserializeEventGridNamespaceData(e)), EventGridNamespaceNamespacesClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridNamespaces", "value", "nextLink", cancellationToken); } /// @@ -194,7 +364,7 @@ public virtual AsyncPageable GetPartnerConfigurati { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerConfigurationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerConfigurationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerConfigurationResource(Client, PartnerConfigurationData.DeserializePartnerConfigurationData(e)), PartnerConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerConfigurationResource(Client, PartnerConfigurationData.DeserializePartnerConfigurationData(e)), PartnerConfigurationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerConfigurations", "value", "nextLink", cancellationToken); } /// @@ -218,7 +388,7 @@ public virtual Pageable GetPartnerConfigurations(s { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerConfigurationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerConfigurationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerConfigurationResource(Client, PartnerConfigurationData.DeserializePartnerConfigurationData(e)), PartnerConfigurationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerConfigurations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerConfigurationResource(Client, PartnerConfigurationData.DeserializePartnerConfigurationData(e)), PartnerConfigurationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerConfigurations", "value", "nextLink", cancellationToken); } /// @@ -242,7 +412,7 @@ public virtual AsyncPageable GetPartnerDestinationsA { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerDestinationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerDestinationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerDestinationResource(Client, PartnerDestinationData.DeserializePartnerDestinationData(e)), PartnerDestinationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerDestinations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerDestinationResource(Client, PartnerDestinationData.DeserializePartnerDestinationData(e)), PartnerDestinationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerDestinations", "value", "nextLink", cancellationToken); } /// @@ -266,7 +436,7 @@ public virtual Pageable GetPartnerDestinations(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerDestinationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerDestinationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerDestinationResource(Client, PartnerDestinationData.DeserializePartnerDestinationData(e)), PartnerDestinationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerDestinations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerDestinationResource(Client, PartnerDestinationData.DeserializePartnerDestinationData(e)), PartnerDestinationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerDestinations", "value", "nextLink", cancellationToken); } /// @@ -290,7 +460,7 @@ public virtual AsyncPageable GetPartnerNamespacesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerNamespaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerNamespaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerNamespaceResource(Client, PartnerNamespaceData.DeserializePartnerNamespaceData(e)), PartnerNamespaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerNamespaceResource(Client, PartnerNamespaceData.DeserializePartnerNamespaceData(e)), PartnerNamespaceClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerNamespaces", "value", "nextLink", cancellationToken); } /// @@ -314,7 +484,7 @@ public virtual Pageable GetPartnerNamespaces(string fi { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerNamespaceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerNamespaceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerNamespaceResource(Client, PartnerNamespaceData.DeserializePartnerNamespaceData(e)), PartnerNamespaceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerNamespaceResource(Client, PartnerNamespaceData.DeserializePartnerNamespaceData(e)), PartnerNamespaceClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerNamespaces", "value", "nextLink", cancellationToken); } /// @@ -338,7 +508,7 @@ public virtual AsyncPageable GetPartnerRegistration { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerRegistrationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerRegistrationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerRegistrationResource(Client, PartnerRegistrationData.DeserializePartnerRegistrationData(e)), PartnerRegistrationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerRegistrations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerRegistrationResource(Client, PartnerRegistrationData.DeserializePartnerRegistrationData(e)), PartnerRegistrationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerRegistrations", "value", "nextLink", cancellationToken); } /// @@ -362,7 +532,7 @@ public virtual Pageable GetPartnerRegistrations(str { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerRegistrationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerRegistrationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerRegistrationResource(Client, PartnerRegistrationData.DeserializePartnerRegistrationData(e)), PartnerRegistrationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerRegistrations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerRegistrationResource(Client, PartnerRegistrationData.DeserializePartnerRegistrationData(e)), PartnerRegistrationClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerRegistrations", "value", "nextLink", cancellationToken); } /// @@ -386,7 +556,7 @@ public virtual AsyncPageable GetPartnerTopicsAsync(string { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerTopicRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerTopicRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerTopicResource(Client, PartnerTopicData.DeserializePartnerTopicData(e)), PartnerTopicClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PartnerTopicResource(Client, PartnerTopicData.DeserializePartnerTopicData(e)), PartnerTopicClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerTopics", "value", "nextLink", cancellationToken); } /// @@ -410,7 +580,7 @@ public virtual Pageable GetPartnerTopics(string filter = n { HttpMessage FirstPageRequest(int? pageSizeHint) => PartnerTopicRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PartnerTopicRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerTopicResource(Client, PartnerTopicData.DeserializePartnerTopicData(e)), PartnerTopicClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPartnerTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PartnerTopicResource(Client, PartnerTopicData.DeserializePartnerTopicData(e)), PartnerTopicClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetPartnerTopics", "value", "nextLink", cancellationToken); } /// @@ -434,7 +604,7 @@ public virtual AsyncPageable GetSystemTopicsAsync(string fi { HttpMessage FirstPageRequest(int? pageSizeHint) => SystemTopicRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SystemTopicRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SystemTopicResource(Client, SystemTopicData.DeserializeSystemTopicData(e)), SystemTopicClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSystemTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SystemTopicResource(Client, SystemTopicData.DeserializeSystemTopicData(e)), SystemTopicClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetSystemTopics", "value", "nextLink", cancellationToken); } /// @@ -458,7 +628,7 @@ public virtual Pageable GetSystemTopics(string filter = nul { HttpMessage FirstPageRequest(int? pageSizeHint) => SystemTopicRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SystemTopicRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SystemTopicResource(Client, SystemTopicData.DeserializeSystemTopicData(e)), SystemTopicClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSystemTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SystemTopicResource(Client, SystemTopicData.DeserializeSystemTopicData(e)), SystemTopicClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetSystemTopics", "value", "nextLink", cancellationToken); } /// @@ -482,7 +652,7 @@ public virtual AsyncPageable GetEventGridTopicsAsync(str { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridTopicTopicsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridTopicResource(Client, EventGridTopicData.DeserializeEventGridTopicData(e)), EventGridTopicTopicsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventGridTopicResource(Client, EventGridTopicData.DeserializeEventGridTopicData(e)), EventGridTopicTopicsClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridTopics", "value", "nextLink", cancellationToken); } /// @@ -506,7 +676,7 @@ public virtual Pageable GetEventGridTopics(string filter { HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventGridTopicTopicsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridTopicResource(Client, EventGridTopicData.DeserializeEventGridTopicData(e)), EventGridTopicTopicsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventGridTopics", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventGridTopicResource(Client, EventGridTopicData.DeserializeEventGridTopicData(e)), EventGridTopicTopicsClientDiagnostics, Pipeline, "EventGridSubscriptionMockingExtension.GetEventGridTopics", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridTenantMockingExtension.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridTenantMockingExtension.cs new file mode 100644 index 000000000000..8be068a46206 --- /dev/null +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/EventGridTenantMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EventGrid; + +namespace Azure.ResourceManager.EventGrid.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class EventGridTenantMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EventGridTenantMockingExtension() + { + } + + /// 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 EventGridTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of TopicTypeResources in the TenantResource. + /// An object representing collection of TopicTypeResources and their operations over a TopicTypeResource. + public virtual TopicTypeCollection GetTopicTypes() + { + return GetCachedClient(client => new TopicTypeCollection(client, Id)); + } + + /// + /// Get information about a topic type. + /// + /// + /// Request Path + /// /providers/Microsoft.EventGrid/topicTypes/{topicTypeName} + /// + /// + /// Operation Id + /// TopicTypes_Get + /// + /// + /// + /// Name of the topic type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTopicTypeAsync(string topicTypeName, CancellationToken cancellationToken = default) + { + return await GetTopicTypes().GetAsync(topicTypeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a topic type. + /// + /// + /// Request Path + /// /providers/Microsoft.EventGrid/topicTypes/{topicTypeName} + /// + /// + /// Operation Id + /// TopicTypes_Get + /// + /// + /// + /// Name of the topic type. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTopicType(string topicTypeName, CancellationToken cancellationToken = default) + { + return GetTopicTypes().Get(topicTypeName, cancellationToken); + } + + /// Gets a collection of VerifiedPartnerResources in the TenantResource. + /// An object representing collection of VerifiedPartnerResources and their operations over a VerifiedPartnerResource. + public virtual VerifiedPartnerCollection GetVerifiedPartners() + { + return GetCachedClient(client => new VerifiedPartnerCollection(client, Id)); + } + + /// + /// Get properties of a verified partner. + /// + /// + /// Request Path + /// /providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName} + /// + /// + /// Operation Id + /// VerifiedPartners_Get + /// + /// + /// + /// Name of the verified partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVerifiedPartnerAsync(string verifiedPartnerName, CancellationToken cancellationToken = default) + { + return await GetVerifiedPartners().GetAsync(verifiedPartnerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get properties of a verified partner. + /// + /// + /// Request Path + /// /providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName} + /// + /// + /// Operation Id + /// VerifiedPartners_Get + /// + /// + /// + /// Name of the verified partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVerifiedPartner(string verifiedPartnerName, CancellationToken cancellationToken = default) + { + return GetVerifiedPartners().Get(verifiedPartnerName, cancellationToken); + } + } +} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6fd2b6076b4f..000000000000 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.EventGrid.Models; - -namespace Azure.ResourceManager.EventGrid -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _eventSubscriptionClientDiagnostics; - private EventSubscriptionsRestOperations _eventSubscriptionRestClient; - private ClientDiagnostics _eventGridTopicTopicsClientDiagnostics; - private TopicsRestOperations _eventGridTopicTopicsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics EventSubscriptionClientDiagnostics => _eventSubscriptionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EventGrid", EventSubscriptionResource.ResourceType.Namespace, Diagnostics); - private EventSubscriptionsRestOperations EventSubscriptionRestClient => _eventSubscriptionRestClient ??= new EventSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EventSubscriptionResource.ResourceType)); - private ClientDiagnostics EventGridTopicTopicsClientDiagnostics => _eventGridTopicTopicsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EventGrid", EventGridTopicResource.ResourceType.Namespace, Diagnostics); - private TopicsRestOperations EventGridTopicTopicsRestClient => _eventGridTopicTopicsRestClient ??= new TopicsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EventGridTopicResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EventGridDomainResources in the ResourceGroupResource. - /// An object representing collection of EventGridDomainResources and their operations over a EventGridDomainResource. - public virtual EventGridDomainCollection GetEventGridDomains() - { - return GetCachedClient(Client => new EventGridDomainCollection(Client, Id)); - } - - /// Gets a collection of EventGridNamespaceResources in the ResourceGroupResource. - /// An object representing collection of EventGridNamespaceResources and their operations over a EventGridNamespaceResource. - public virtual EventGridNamespaceCollection GetEventGridNamespaces() - { - return GetCachedClient(Client => new EventGridNamespaceCollection(Client, Id)); - } - - /// Gets an object representing a PartnerConfigurationResource along with the instance operations that can be performed on it in the ResourceGroupResource. - /// Returns a object. - public virtual PartnerConfigurationResource GetPartnerConfiguration() - { - return new PartnerConfigurationResource(Client, Id.AppendProviderResource("Microsoft.EventGrid", "partnerConfigurations", "default")); - } - - /// Gets a collection of PartnerDestinationResources in the ResourceGroupResource. - /// An object representing collection of PartnerDestinationResources and their operations over a PartnerDestinationResource. - public virtual PartnerDestinationCollection GetPartnerDestinations() - { - return GetCachedClient(Client => new PartnerDestinationCollection(Client, Id)); - } - - /// Gets a collection of PartnerNamespaceResources in the ResourceGroupResource. - /// An object representing collection of PartnerNamespaceResources and their operations over a PartnerNamespaceResource. - public virtual PartnerNamespaceCollection GetPartnerNamespaces() - { - return GetCachedClient(Client => new PartnerNamespaceCollection(Client, Id)); - } - - /// Gets a collection of PartnerRegistrationResources in the ResourceGroupResource. - /// An object representing collection of PartnerRegistrationResources and their operations over a PartnerRegistrationResource. - public virtual PartnerRegistrationCollection GetPartnerRegistrations() - { - return GetCachedClient(Client => new PartnerRegistrationCollection(Client, Id)); - } - - /// Gets a collection of PartnerTopicResources in the ResourceGroupResource. - /// An object representing collection of PartnerTopicResources and their operations over a PartnerTopicResource. - public virtual PartnerTopicCollection GetPartnerTopics() - { - return GetCachedClient(Client => new PartnerTopicCollection(Client, Id)); - } - - /// Gets a collection of SystemTopicResources in the ResourceGroupResource. - /// An object representing collection of SystemTopicResources and their operations over a SystemTopicResource. - public virtual SystemTopicCollection GetSystemTopics() - { - return GetCachedClient(Client => new SystemTopicCollection(Client, Id)); - } - - /// Gets a collection of EventGridTopicResources in the ResourceGroupResource. - /// An object representing collection of EventGridTopicResources and their operations over a EventGridTopicResource. - public virtual EventGridTopicCollection GetEventGridTopics() - { - return GetCachedClient(Client => new EventGridTopicCollection(Client, Id)); - } - - /// - /// List event types for a topic. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes - /// - /// - /// Operation Id - /// Topics_ListEventTypes - /// - /// - /// - /// Namespace of the provider of the topic. - /// Name of the topic type. - /// Name of the topic. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEventTypesAsync(string providerNamespace, string resourceTypeName, string resourceName, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListEventTypesRequest(Id.SubscriptionId, Id.ResourceGroupName, providerNamespace, resourceTypeName, resourceName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, EventTypeUnderTopic.DeserializeEventTypeUnderTopic, EventGridTopicTopicsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEventTypes", "value", null, cancellationToken); - } - - /// - /// List event types for a topic. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes - /// - /// - /// Operation Id - /// Topics_ListEventTypes - /// - /// - /// - /// Namespace of the provider of the topic. - /// Name of the topic type. - /// Name of the topic. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEventTypes(string providerNamespace, string resourceTypeName, string resourceName, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => EventGridTopicTopicsRestClient.CreateListEventTypesRequest(Id.SubscriptionId, Id.ResourceGroupName, providerNamespace, resourceTypeName, resourceName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, EventTypeUnderTopic.DeserializeEventTypeUnderTopic, EventGridTopicTopicsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEventTypes", "value", null, cancellationToken); - } - } -} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index 0b72cd7670e0..000000000000 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.EventGrid -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of TopicTypeResources in the TenantResource. - /// An object representing collection of TopicTypeResources and their operations over a TopicTypeResource. - public virtual TopicTypeCollection GetTopicTypes() - { - return GetCachedClient(Client => new TopicTypeCollection(Client, Id)); - } - - /// Gets a collection of VerifiedPartnerResources in the TenantResource. - /// An object representing collection of VerifiedPartnerResources and their operations over a VerifiedPartnerResource. - public virtual VerifiedPartnerCollection GetVerifiedPartners() - { - return GetCachedClient(Client => new VerifiedPartnerCollection(Client, Id)); - } - } -} diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/NamespaceTopicResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/NamespaceTopicResource.cs index 62016a795781..254fb37e238c 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/NamespaceTopicResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/NamespaceTopicResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of NamespaceTopicEventSubscriptionResources and their operations over a NamespaceTopicEventSubscriptionResource. public virtual NamespaceTopicEventSubscriptionCollection GetNamespaceTopicEventSubscriptions() { - return GetCachedClient(Client => new NamespaceTopicEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new NamespaceTopicEventSubscriptionCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual NamespaceTopicEventSubscriptionCollection GetNamespaceTopicEventS /// /// Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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> GetNamespaceTopicEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> Get /// /// Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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 GetNamespaceTopicEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerNamespaceResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerNamespaceResource.cs index eca2ad2a02e8..b9ad0eb49874 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerNamespaceResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerNamespaceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PartnerNamespaceChannelResources and their operations over a PartnerNamespaceChannelResource. public virtual PartnerNamespaceChannelCollection GetPartnerNamespaceChannels() { - return GetCachedClient(Client => new PartnerNamespaceChannelCollection(Client, Id)); + return GetCachedClient(client => new PartnerNamespaceChannelCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual PartnerNamespaceChannelCollection GetPartnerNamespaceChannels() /// /// Name of the channel. /// The cancellation token to use. - /// 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> GetPartnerNamespaceChannelAsync(string channelName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetPartnerN /// /// Name of the channel. /// The cancellation token to use. - /// 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 GetPartnerNamespaceChannel(string channelName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetPartnerNamespaceChan /// An object representing collection of EventGridPartnerNamespacePrivateEndpointConnectionResources and their operations over a EventGridPartnerNamespacePrivateEndpointConnectionResource. public virtual EventGridPartnerNamespacePrivateEndpointConnectionCollection GetEventGridPartnerNamespacePrivateEndpointConnections() { - return GetCachedClient(Client => new EventGridPartnerNamespacePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new EventGridPartnerNamespacePrivateEndpointConnectionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual EventGridPartnerNamespacePrivateEndpointConnectionCollection GetE /// /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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> GetEventGridPartnerNamespacePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task /// The name of the private endpoint connection connection. /// The cancellation token to use. - /// 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 GetEventGridPartnerNamespacePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response An object representing collection of PartnerNamespacePrivateLinkResources and their operations over a PartnerNamespacePrivateLinkResource. public virtual PartnerNamespacePrivateLinkResourceCollection GetPartnerNamespacePrivateLinkResources() { - return GetCachedClient(Client => new PartnerNamespacePrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new PartnerNamespacePrivateLinkResourceCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual PartnerNamespacePrivateLinkResourceCollection GetPartnerNamespace /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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> GetPartnerNamespacePrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetPart /// /// The name of private link resource will be either topic, domain, partnerNamespace or namespace. /// The cancellation token to use. - /// 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 GetPartnerNamespacePrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerTopicResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerTopicResource.cs index f3661bd96e89..4ab959d92846 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerTopicResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/PartnerTopicResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of PartnerTopicEventSubscriptionResources and their operations over a PartnerTopicEventSubscriptionResource. public virtual PartnerTopicEventSubscriptionCollection GetPartnerTopicEventSubscriptions() { - return GetCachedClient(Client => new PartnerTopicEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new PartnerTopicEventSubscriptionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual PartnerTopicEventSubscriptionCollection GetPartnerTopicEventSubsc /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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> GetPartnerTopicEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetPa /// /// Name of the event subscription to be found. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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 GetPartnerTopicEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/SystemTopicResource.cs b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/SystemTopicResource.cs index ec0771afe07b..876abac913a0 100644 --- a/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/SystemTopicResource.cs +++ b/sdk/eventgrid/Azure.ResourceManager.EventGrid/src/Generated/SystemTopicResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SystemTopicEventSubscriptionResources and their operations over a SystemTopicEventSubscriptionResource. public virtual SystemTopicEventSubscriptionCollection GetSystemTopicEventSubscriptions() { - return GetCachedClient(Client => new SystemTopicEventSubscriptionCollection(Client, Id)); + return GetCachedClient(client => new SystemTopicEventSubscriptionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual SystemTopicEventSubscriptionCollection GetSystemTopicEventSubscri /// /// Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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> GetSystemTopicEventSubscriptionAsync(string eventSubscriptionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetSys /// /// Name of the event subscription to be created. Event subscription names must be between 3 and 100 characters in length and use alphanumeric letters only. /// The cancellation token to use. - /// 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 GetSystemTopicEventSubscription(string eventSubscriptionName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubResource.cs index 752dc6729858..1d165db13c7a 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of EventHubAuthorizationRuleResources and their operations over a EventHubAuthorizationRuleResource. public virtual EventHubAuthorizationRuleCollection GetEventHubAuthorizationRules() { - return GetCachedClient(Client => new EventHubAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new EventHubAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual EventHubAuthorizationRuleCollection GetEventHubAuthorizationRules /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetEventHubAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetEventH /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetEventHubAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -143,7 +143,7 @@ public virtual Response GetEventHubAuthorizat /// An object representing collection of EventHubsConsumerGroupResources and their operations over a EventHubsConsumerGroupResource. public virtual EventHubsConsumerGroupCollection GetEventHubsConsumerGroups() { - return GetCachedClient(Client => new EventHubsConsumerGroupCollection(Client, Id)); + return GetCachedClient(client => new EventHubsConsumerGroupCollection(client, Id)); } /// @@ -161,8 +161,8 @@ public virtual EventHubsConsumerGroupCollection GetEventHubsConsumerGroups() /// /// The consumer group name. /// The cancellation token to use. - /// 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> GetEventHubsConsumerGroupAsync(string consumerGroupName, CancellationToken cancellationToken = default) { @@ -184,8 +184,8 @@ public virtual async Task> GetEventHubs /// /// The consumer group name. /// The cancellation token to use. - /// 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 GetEventHubsConsumerGroup(string consumerGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsDisasterRecoveryResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsDisasterRecoveryResource.cs index 30b6f491b0d5..3323fbf9d8ce 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsDisasterRecoveryResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsDisasterRecoveryResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of EventHubsDisasterRecoveryAuthorizationRuleResources and their operations over a EventHubsDisasterRecoveryAuthorizationRuleResource. public virtual EventHubsDisasterRecoveryAuthorizationRuleCollection GetEventHubsDisasterRecoveryAuthorizationRules() { - return GetCachedClient(Client => new EventHubsDisasterRecoveryAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new EventHubsDisasterRecoveryAuthorizationRuleCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual EventHubsDisasterRecoveryAuthorizationRuleCollection GetEventHubs /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetEventHubsDisasterRecoveryAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task /// The authorization rule name. /// The cancellation token to use. - /// 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 GetEventHubsDisasterRecoveryAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs index 6aa8088fb181..309b04efd434 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs @@ -117,7 +117,7 @@ public virtual EventHubsNetworkRuleSetResource GetEventHubsNetworkRuleSet() /// An object representing collection of EventHubsNamespaceAuthorizationRuleResources and their operations over a EventHubsNamespaceAuthorizationRuleResource. public virtual EventHubsNamespaceAuthorizationRuleCollection GetEventHubsNamespaceAuthorizationRules() { - return GetCachedClient(Client => new EventHubsNamespaceAuthorizationRuleCollection(Client, Id)); + return GetCachedClient(client => new EventHubsNamespaceAuthorizationRuleCollection(client, Id)); } /// @@ -135,8 +135,8 @@ public virtual EventHubsNamespaceAuthorizationRuleCollection GetEventHubsNamespa /// /// The authorization rule name. /// The cancellation token to use. - /// 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> GetEventHubsNamespaceAuthorizationRuleAsync(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -158,8 +158,8 @@ public virtual async Task> /// /// The authorization rule name. /// The cancellation token to use. - /// 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 GetEventHubsNamespaceAuthorizationRule(string authorizationRuleName, CancellationToken cancellationToken = default) { @@ -170,7 +170,7 @@ public virtual Response GetEventHub /// An object representing collection of EventHubsPrivateEndpointConnectionResources and their operations over a EventHubsPrivateEndpointConnectionResource. public virtual EventHubsPrivateEndpointConnectionCollection GetEventHubsPrivateEndpointConnections() { - return GetCachedClient(Client => new EventHubsPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new EventHubsPrivateEndpointConnectionCollection(client, Id)); } /// @@ -188,8 +188,8 @@ public virtual EventHubsPrivateEndpointConnectionCollection GetEventHubsPrivateE /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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> GetEventHubsPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -211,8 +211,8 @@ public virtual async Task> /// /// The PrivateEndpointConnection name. /// The cancellation token to use. - /// 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 GetEventHubsPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -223,7 +223,7 @@ public virtual Response GetEventHubs /// An object representing collection of EventHubsDisasterRecoveryResources and their operations over a EventHubsDisasterRecoveryResource. public virtual EventHubsDisasterRecoveryCollection GetEventHubsDisasterRecoveries() { - return GetCachedClient(Client => new EventHubsDisasterRecoveryCollection(Client, Id)); + return GetCachedClient(client => new EventHubsDisasterRecoveryCollection(client, Id)); } /// @@ -241,12 +241,12 @@ public virtual EventHubsDisasterRecoveryCollection GetEventHubsDisasterRecoverie /// /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// 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> GetEventHubsDisasterRecoveryAsync(string @alias, CancellationToken cancellationToken = default) { - return await GetEventHubsDisasterRecoveries().GetAsync(alias, cancellationToken).ConfigureAwait(false); + return await GetEventHubsDisasterRecoveries().GetAsync(@alias, cancellationToken).ConfigureAwait(false); } /// @@ -264,19 +264,19 @@ public virtual async Task> GetEventH /// /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// 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 GetEventHubsDisasterRecovery(string @alias, CancellationToken cancellationToken = default) { - return GetEventHubsDisasterRecoveries().Get(alias, cancellationToken); + return GetEventHubsDisasterRecoveries().Get(@alias, cancellationToken); } /// Gets a collection of EventHubResources in the EventHubsNamespace. /// An object representing collection of EventHubResources and their operations over a EventHubResource. public virtual EventHubCollection GetEventHubs() { - return GetCachedClient(Client => new EventHubCollection(Client, Id)); + return GetCachedClient(client => new EventHubCollection(client, Id)); } /// @@ -294,8 +294,8 @@ public virtual EventHubCollection GetEventHubs() /// /// The Event Hub name. /// The cancellation token to use. - /// 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> GetEventHubAsync(string eventHubName, CancellationToken cancellationToken = default) { @@ -317,8 +317,8 @@ public virtual async Task> GetEventHubAsync(string ev /// /// The Event Hub name. /// The cancellation token to use. - /// 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 GetEventHub(string eventHubName, CancellationToken cancellationToken = default) { @@ -329,7 +329,7 @@ public virtual Response GetEventHub(string eventHubName, Cance /// An object representing collection of EventHubsSchemaGroupResources and their operations over a EventHubsSchemaGroupResource. public virtual EventHubsSchemaGroupCollection GetEventHubsSchemaGroups() { - return GetCachedClient(Client => new EventHubsSchemaGroupCollection(Client, Id)); + return GetCachedClient(client => new EventHubsSchemaGroupCollection(client, Id)); } /// @@ -346,8 +346,8 @@ public virtual EventHubsSchemaGroupCollection GetEventHubsSchemaGroups() /// /// The Schema Group name. /// The cancellation token to use. - /// 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> GetEventHubsSchemaGroupAsync(string schemaGroupName, CancellationToken cancellationToken = default) { @@ -368,8 +368,8 @@ public virtual async Task> GetEventHubsSc /// /// The Schema Group name. /// The cancellation token to use. - /// 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 GetEventHubsSchemaGroup(string schemaGroupName, CancellationToken cancellationToken = default) { @@ -380,7 +380,7 @@ public virtual Response GetEventHubsSchemaGroup(st /// An object representing collection of EventHubsApplicationGroupResources and their operations over a EventHubsApplicationGroupResource. public virtual EventHubsApplicationGroupCollection GetEventHubsApplicationGroups() { - return GetCachedClient(Client => new EventHubsApplicationGroupCollection(Client, Id)); + return GetCachedClient(client => new EventHubsApplicationGroupCollection(client, Id)); } /// @@ -398,8 +398,8 @@ public virtual EventHubsApplicationGroupCollection GetEventHubsApplicationGroups /// /// The Application Group name. /// The cancellation token to use. - /// 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> GetEventHubsApplicationGroupAsync(string applicationGroupName, CancellationToken cancellationToken = default) { @@ -421,8 +421,8 @@ public virtual async Task> GetEventH /// /// The Application Group name. /// The cancellation token to use. - /// 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 GetEventHubsApplicationGroup(string applicationGroupName, CancellationToken cancellationToken = default) { diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsArmClientMockingExtension.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsArmClientMockingExtension.cs new file mode 100644 index 000000000000..1cea1825bb1e --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsArmClientMockingExtension.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EventHubs; + +namespace Azure.ResourceManager.EventHubs.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class EventHubsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EventHubsArmClientMockingExtension() + { + } + + /// 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 EventHubsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal EventHubsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsClusterResource GetEventHubsClusterResource(ResourceIdentifier id) + { + EventHubsClusterResource.ValidateResourceId(id); + return new EventHubsClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsNamespaceResource GetEventHubsNamespaceResource(ResourceIdentifier id) + { + EventHubsNamespaceResource.ValidateResourceId(id); + return new EventHubsNamespaceResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsNetworkRuleSetResource GetEventHubsNetworkRuleSetResource(ResourceIdentifier id) + { + EventHubsNetworkRuleSetResource.ValidateResourceId(id); + return new EventHubsNetworkRuleSetResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsNamespaceAuthorizationRuleResource GetEventHubsNamespaceAuthorizationRuleResource(ResourceIdentifier id) + { + EventHubsNamespaceAuthorizationRuleResource.ValidateResourceId(id); + return new EventHubsNamespaceAuthorizationRuleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsDisasterRecoveryAuthorizationRuleResource GetEventHubsDisasterRecoveryAuthorizationRuleResource(ResourceIdentifier id) + { + EventHubsDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); + return new EventHubsDisasterRecoveryAuthorizationRuleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubAuthorizationRuleResource GetEventHubAuthorizationRuleResource(ResourceIdentifier id) + { + EventHubAuthorizationRuleResource.ValidateResourceId(id); + return new EventHubAuthorizationRuleResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsPrivateEndpointConnectionResource GetEventHubsPrivateEndpointConnectionResource(ResourceIdentifier id) + { + EventHubsPrivateEndpointConnectionResource.ValidateResourceId(id); + return new EventHubsPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsDisasterRecoveryResource GetEventHubsDisasterRecoveryResource(ResourceIdentifier id) + { + EventHubsDisasterRecoveryResource.ValidateResourceId(id); + return new EventHubsDisasterRecoveryResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubResource GetEventHubResource(ResourceIdentifier id) + { + EventHubResource.ValidateResourceId(id); + return new EventHubResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsConsumerGroupResource GetEventHubsConsumerGroupResource(ResourceIdentifier id) + { + EventHubsConsumerGroupResource.ValidateResourceId(id); + return new EventHubsConsumerGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsSchemaGroupResource GetEventHubsSchemaGroupResource(ResourceIdentifier id) + { + EventHubsSchemaGroupResource.ValidateResourceId(id); + return new EventHubsSchemaGroupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EventHubsApplicationGroupResource GetEventHubsApplicationGroupResource(ResourceIdentifier id) + { + EventHubsApplicationGroupResource.ValidateResourceId(id); + return new EventHubsApplicationGroupResource(Client, id); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs index 66b92243844b..9484d3c18935 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.EventHubs.Mocking; using Azure.ResourceManager.EventHubs.Models; using Azure.ResourceManager.Resources; @@ -19,271 +20,225 @@ namespace Azure.ResourceManager.EventHubs /// A class to add extension methods to Azure.ResourceManager.EventHubs. public static partial class EventHubsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static EventHubsArmClientMockingExtension GetEventHubsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new EventHubsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static EventHubsResourceGroupMockingExtension GetEventHubsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new EventHubsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static EventHubsSubscriptionMockingExtension GetEventHubsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new EventHubsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region EventHubsClusterResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsClusterResource GetEventHubsClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsClusterResource.ValidateResourceId(id); - return new EventHubsClusterResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsClusterResource(id); } - #endregion - #region EventHubsNamespaceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsNamespaceResource GetEventHubsNamespaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsNamespaceResource.ValidateResourceId(id); - return new EventHubsNamespaceResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsNamespaceResource(id); } - #endregion - #region EventHubsNetworkRuleSetResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsNetworkRuleSetResource GetEventHubsNetworkRuleSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsNetworkRuleSetResource.ValidateResourceId(id); - return new EventHubsNetworkRuleSetResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsNetworkRuleSetResource(id); } - #endregion - #region EventHubsNamespaceAuthorizationRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsNamespaceAuthorizationRuleResource GetEventHubsNamespaceAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsNamespaceAuthorizationRuleResource.ValidateResourceId(id); - return new EventHubsNamespaceAuthorizationRuleResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsNamespaceAuthorizationRuleResource(id); } - #endregion - #region EventHubsDisasterRecoveryAuthorizationRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsDisasterRecoveryAuthorizationRuleResource GetEventHubsDisasterRecoveryAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); - return new EventHubsDisasterRecoveryAuthorizationRuleResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsDisasterRecoveryAuthorizationRuleResource(id); } - #endregion - #region EventHubAuthorizationRuleResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubAuthorizationRuleResource GetEventHubAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubAuthorizationRuleResource.ValidateResourceId(id); - return new EventHubAuthorizationRuleResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubAuthorizationRuleResource(id); } - #endregion - #region EventHubsPrivateEndpointConnectionResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsPrivateEndpointConnectionResource GetEventHubsPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsPrivateEndpointConnectionResource.ValidateResourceId(id); - return new EventHubsPrivateEndpointConnectionResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsPrivateEndpointConnectionResource(id); } - #endregion - #region EventHubsDisasterRecoveryResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsDisasterRecoveryResource GetEventHubsDisasterRecoveryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsDisasterRecoveryResource.ValidateResourceId(id); - return new EventHubsDisasterRecoveryResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsDisasterRecoveryResource(id); } - #endregion - #region EventHubResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubResource GetEventHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubResource.ValidateResourceId(id); - return new EventHubResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubResource(id); } - #endregion - #region EventHubsConsumerGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsConsumerGroupResource GetEventHubsConsumerGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsConsumerGroupResource.ValidateResourceId(id); - return new EventHubsConsumerGroupResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsConsumerGroupResource(id); } - #endregion - #region EventHubsSchemaGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsSchemaGroupResource GetEventHubsSchemaGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsSchemaGroupResource.ValidateResourceId(id); - return new EventHubsSchemaGroupResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsSchemaGroupResource(id); } - #endregion - #region EventHubsApplicationGroupResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EventHubsApplicationGroupResource GetEventHubsApplicationGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EventHubsApplicationGroupResource.ValidateResourceId(id); - return new EventHubsApplicationGroupResource(client, id); - } - ); + return GetEventHubsArmClientMockingExtension(client).GetEventHubsApplicationGroupResource(id); } - #endregion - /// Gets a collection of EventHubsClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of EventHubsClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EventHubsClusterResources and their operations over a EventHubsClusterResource. public static EventHubsClusterCollection GetEventHubsClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEventHubsClusters(); + return GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsClusters(); } /// @@ -298,16 +253,20 @@ public static EventHubsClusterCollection GetEventHubsClusters(this ResourceGroup /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Event Hubs Cluster. /// The cancellation token to use. - /// 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 static async Task> GetEventHubsClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEventHubsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -322,24 +281,34 @@ public static async Task> GetEventHubsCluster /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Event Hubs Cluster. /// The cancellation token to use. - /// 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 static Response GetEventHubsCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEventHubsClusters().Get(clusterName, cancellationToken); + return GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsCluster(clusterName, cancellationToken); } - /// Gets a collection of EventHubsNamespaceResources in the ResourceGroupResource. + /// + /// Gets a collection of EventHubsNamespaceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EventHubsNamespaceResources and their operations over a EventHubsNamespaceResource. public static EventHubsNamespaceCollection GetEventHubsNamespaces(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEventHubsNamespaces(); + return GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsNamespaces(); } /// @@ -354,16 +323,20 @@ public static EventHubsNamespaceCollection GetEventHubsNamespaces(this ResourceG /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace name. /// The cancellation token to use. - /// 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 static async Task> GetEventHubsNamespaceAsync(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEventHubsNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + return await GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsNamespaceAsync(namespaceName, cancellationToken).ConfigureAwait(false); } /// @@ -378,16 +351,20 @@ public static async Task> GetEventHubsNames /// Namespaces_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Namespace name. /// The cancellation token to use. - /// 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 static Response GetEventHubsNamespace(this ResourceGroupResource resourceGroupResource, string namespaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEventHubsNamespaces().Get(namespaceName, cancellationToken); + return GetEventHubsResourceGroupMockingExtension(resourceGroupResource).GetEventHubsNamespace(namespaceName, cancellationToken); } /// @@ -402,13 +379,17 @@ public static Response GetEventHubsNamespace(this Re /// Clusters_ListAvailableClusterRegion /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableClusterRegionClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterRegionClustersAsync(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterRegionClustersAsync(cancellationToken); } /// @@ -423,13 +404,17 @@ public static AsyncPageable GetAvailableClusterRegionClustersA /// Clusters_ListAvailableClusterRegion /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableClusterRegionClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterRegionClusters(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterRegionClusters(cancellationToken); } /// @@ -444,13 +429,17 @@ public static Pageable GetAvailableClusterRegionClusters(this /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventHubsClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventHubsClustersAsync(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetEventHubsClustersAsync(cancellationToken); } /// @@ -465,13 +454,17 @@ public static AsyncPageable GetEventHubsClustersAsync( /// Clusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventHubsClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventHubsClusters(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetEventHubsClusters(cancellationToken); } /// @@ -486,13 +479,17 @@ public static Pageable GetEventHubsClusters(this Subsc /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEventHubsNamespacesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventHubsNamespacesAsync(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetEventHubsNamespacesAsync(cancellationToken); } /// @@ -507,13 +504,17 @@ public static AsyncPageable GetEventHubsNamespacesAs /// Namespaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEventHubsNamespaces(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEventHubsNamespaces(cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).GetEventHubsNamespaces(cancellationToken); } /// @@ -528,6 +529,10 @@ public static Pageable GetEventHubsNamespaces(this S /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the given Namespace name. @@ -535,9 +540,7 @@ public static Pageable GetEventHubsNamespaces(this S /// is null. public static async Task> CheckEventHubsNamespaceNameAvailabilityAsync(this SubscriptionResource subscriptionResource, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckEventHubsNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetEventHubsSubscriptionMockingExtension(subscriptionResource).CheckEventHubsNamespaceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -552,6 +555,10 @@ public static async Task> CheckEventHu /// Namespaces_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters to check availability of the given Namespace name. @@ -559,9 +566,7 @@ public static async Task> CheckEventHu /// is null. public static Response CheckEventHubsNamespaceNameAvailability(this SubscriptionResource subscriptionResource, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckEventHubsNamespaceNameAvailability(content, cancellationToken); + return GetEventHubsSubscriptionMockingExtension(subscriptionResource).CheckEventHubsNamespaceNameAvailability(content, cancellationToken); } } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsResourceGroupMockingExtension.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..3dca2051918f --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.EventHubs; + +namespace Azure.ResourceManager.EventHubs.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class EventHubsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected EventHubsResourceGroupMockingExtension() + { + } + + /// 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 EventHubsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of EventHubsClusterResources in the ResourceGroupResource. + /// An object representing collection of EventHubsClusterResources and their operations over a EventHubsClusterResource. + public virtual EventHubsClusterCollection GetEventHubsClusters() + { + return GetCachedClient(client => new EventHubsClusterCollection(client, Id)); + } + + /// + /// Gets the resource description of the specified Event Hubs Cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the Event Hubs Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventHubsClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetEventHubsClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the resource description of the specified Event Hubs Cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the Event Hubs Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventHubsCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetEventHubsClusters().Get(clusterName, cancellationToken); + } + + /// Gets a collection of EventHubsNamespaceResources in the ResourceGroupResource. + /// An object representing collection of EventHubsNamespaceResources and their operations over a EventHubsNamespaceResource. + public virtual EventHubsNamespaceCollection GetEventHubsNamespaces() + { + return GetCachedClient(client => new EventHubsNamespaceCollection(client, Id)); + } + + /// + /// Gets the description of the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The Namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEventHubsNamespaceAsync(string namespaceName, CancellationToken cancellationToken = default) + { + return await GetEventHubsNamespaces().GetAsync(namespaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the description of the specified namespace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} + /// + /// + /// Operation Id + /// Namespaces_Get + /// + /// + /// + /// The Namespace name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEventHubsNamespace(string namespaceName, CancellationToken cancellationToken = default) + { + return GetEventHubsNamespaces().Get(namespaceName, cancellationToken); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsSubscriptionMockingExtension.cs similarity index 87% rename from sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsSubscriptionMockingExtension.cs index 0ba36a4962e6..7f03000afa27 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.EventHubs; using Azure.ResourceManager.EventHubs.Models; -namespace Azure.ResourceManager.EventHubs +namespace Azure.ResourceManager.EventHubs.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class EventHubsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _eventHubsClusterClustersClientDiagnostics; private ClustersRestOperations _eventHubsClusterClustersRestClient; private ClientDiagnostics _eventHubsNamespaceNamespacesClientDiagnostics; private NamespacesRestOperations _eventHubsNamespaceNamespacesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected EventHubsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal EventHubsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) public virtual AsyncPageable GetAvailableClusterRegionClustersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsClusterClustersRestClient.CreateListAvailableClusterRegionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AvailableCluster.DeserializeAvailableCluster, EventHubsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterRegionClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, AvailableCluster.DeserializeAvailableCluster, EventHubsClusterClustersClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetAvailableClusterRegionClusters", "value", null, cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual AsyncPageable GetAvailableClusterRegionClusters public virtual Pageable GetAvailableClusterRegionClusters(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsClusterClustersRestClient.CreateListAvailableClusterRegionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AvailableCluster.DeserializeAvailableCluster, EventHubsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterRegionClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, AvailableCluster.DeserializeAvailableCluster, EventHubsClusterClustersClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetAvailableClusterRegionClusters", "value", null, cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual AsyncPageable GetEventHubsClustersAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventHubsClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventHubsClusterResource(Client, EventHubsClusterData.DeserializeEventHubsClusterData(e)), EventHubsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventHubsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventHubsClusterResource(Client, EventHubsClusterData.DeserializeEventHubsClusterData(e)), EventHubsClusterClustersClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetEventHubsClusters", "value", "nextLink", cancellationToken); } /// @@ -131,7 +132,7 @@ public virtual Pageable GetEventHubsClusters(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsClusterClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventHubsClusterClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventHubsClusterResource(Client, EventHubsClusterData.DeserializeEventHubsClusterData(e)), EventHubsClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventHubsClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventHubsClusterResource(Client, EventHubsClusterData.DeserializeEventHubsClusterData(e)), EventHubsClusterClustersClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetEventHubsClusters", "value", "nextLink", cancellationToken); } /// @@ -153,7 +154,7 @@ public virtual AsyncPageable GetEventHubsNamespacesA { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventHubsNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventHubsNamespaceResource(Client, EventHubsNamespaceData.DeserializeEventHubsNamespaceData(e)), EventHubsNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventHubsNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventHubsNamespaceResource(Client, EventHubsNamespaceData.DeserializeEventHubsNamespaceData(e)), EventHubsNamespaceNamespacesClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetEventHubsNamespaces", "value", "nextLink", cancellationToken); } /// @@ -175,7 +176,7 @@ public virtual Pageable GetEventHubsNamespaces(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => EventHubsNamespaceNamespacesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EventHubsNamespaceNamespacesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventHubsNamespaceResource(Client, EventHubsNamespaceData.DeserializeEventHubsNamespaceData(e)), EventHubsNamespaceNamespacesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEventHubsNamespaces", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventHubsNamespaceResource(Client, EventHubsNamespaceData.DeserializeEventHubsNamespaceData(e)), EventHubsNamespaceNamespacesClientDiagnostics, Pipeline, "EventHubsSubscriptionMockingExtension.GetEventHubsNamespaces", "value", "nextLink", cancellationToken); } /// @@ -193,9 +194,12 @@ public virtual Pageable GetEventHubsNamespaces(Cance /// /// Parameters to check availability of the given Namespace name. /// The cancellation token to use. + /// is null. public virtual async Task> CheckEventHubsNamespaceNameAvailabilityAsync(EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = EventHubsNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckEventHubsNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = EventHubsNamespaceNamespacesClientDiagnostics.CreateScope("EventHubsSubscriptionMockingExtension.CheckEventHubsNamespaceNameAvailability"); scope.Start(); try { @@ -224,9 +228,12 @@ public virtual async Task> CheckEventH /// /// Parameters to check availability of the given Namespace name. /// The cancellation token to use. + /// is null. public virtual Response CheckEventHubsNamespaceNameAvailability(EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = EventHubsNamespaceNamespacesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckEventHubsNamespaceNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = EventHubsNamespaceNamespacesClientDiagnostics.CreateScope("EventHubsSubscriptionMockingExtension.CheckEventHubsNamespaceNameAvailability"); scope.Start(); try { diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ca3dbc786f76..000000000000 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.EventHubs -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of EventHubsClusterResources in the ResourceGroupResource. - /// An object representing collection of EventHubsClusterResources and their operations over a EventHubsClusterResource. - public virtual EventHubsClusterCollection GetEventHubsClusters() - { - return GetCachedClient(Client => new EventHubsClusterCollection(Client, Id)); - } - - /// Gets a collection of EventHubsNamespaceResources in the ResourceGroupResource. - /// An object representing collection of EventHubsNamespaceResources and their operations over a EventHubsNamespaceResource. - public virtual EventHubsNamespaceCollection GetEventHubsNamespaces() - { - return GetCachedClient(Client => new EventHubsNamespaceCollection(Client, Id)); - } - } -} diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsArmClientMockingExtension.cs b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsArmClientMockingExtension.cs new file mode 100644 index 000000000000..74c4735473c1 --- /dev/null +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ExtendedLocations; + +namespace Azure.ResourceManager.ExtendedLocations.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ExtendedLocationsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ExtendedLocationsArmClientMockingExtension() + { + } + + /// 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 ExtendedLocationsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ExtendedLocationsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CustomLocationResource GetCustomLocationResource(ResourceIdentifier id) + { + CustomLocationResource.ValidateResourceId(id); + return new CustomLocationResource(Client, id); + } + } +} diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsExtensions.cs b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsExtensions.cs index f0c7bb85ca4e..2cb3fadc7f22 100644 --- a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsExtensions.cs +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ExtendedLocations.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ExtendedLocations @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.ExtendedLocations /// A class to add extension methods to Azure.ResourceManager.ExtendedLocations. public static partial class ExtendedLocationsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ExtendedLocationsArmClientMockingExtension GetExtendedLocationsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ExtendedLocationsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ExtendedLocationsResourceGroupMockingExtension GetExtendedLocationsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ExtendedLocationsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ExtendedLocationsSubscriptionMockingExtension GetExtendedLocationsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ExtendedLocationsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CustomLocationResource /// /// 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. /// Returns a object. public static CustomLocationResource GetCustomLocationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CustomLocationResource.ValidateResourceId(id); - return new CustomLocationResource(client, id); - } - ); + return GetExtendedLocationsArmClientMockingExtension(client).GetCustomLocationResource(id); } - #endregion - /// Gets a collection of CustomLocationResources in the ResourceGroupResource. + /// + /// Gets a collection of CustomLocationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CustomLocationResources and their operations over a CustomLocationResource. public static CustomLocationCollection GetCustomLocations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCustomLocations(); + return GetExtendedLocationsResourceGroupMockingExtension(resourceGroupResource).GetCustomLocations(); } /// @@ -88,16 +76,20 @@ public static CustomLocationCollection GetCustomLocations(this ResourceGroupReso /// CustomLocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Custom Locations name. /// The cancellation token to use. - /// 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 static async Task> GetCustomLocationAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCustomLocations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetExtendedLocationsResourceGroupMockingExtension(resourceGroupResource).GetCustomLocationAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetCustomLocationAsyn /// CustomLocations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Custom Locations name. /// The cancellation token to use. - /// 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 static Response GetCustomLocation(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCustomLocations().Get(resourceName, cancellationToken); + return GetExtendedLocationsResourceGroupMockingExtension(resourceGroupResource).GetCustomLocation(resourceName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetCustomLocation(this ResourceGr /// CustomLocations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCustomLocationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomLocationsAsync(cancellationToken); + return GetExtendedLocationsSubscriptionMockingExtension(subscriptionResource).GetCustomLocationsAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetCustomLocationsAsync(this /// CustomLocations_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCustomLocations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCustomLocations(cancellationToken); + return GetExtendedLocationsSubscriptionMockingExtension(subscriptionResource).GetCustomLocations(cancellationToken); } } } diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsResourceGroupMockingExtension.cs b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..5a8c7d089410 --- /dev/null +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ExtendedLocations; + +namespace Azure.ResourceManager.ExtendedLocations.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ExtendedLocationsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ExtendedLocationsResourceGroupMockingExtension() + { + } + + /// 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 ExtendedLocationsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CustomLocationResources in the ResourceGroupResource. + /// An object representing collection of CustomLocationResources and their operations over a CustomLocationResource. + public virtual CustomLocationCollection GetCustomLocations() + { + return GetCachedClient(client => new CustomLocationCollection(client, Id)); + } + + /// + /// Gets the details of the customLocation with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName} + /// + /// + /// Operation Id + /// CustomLocations_Get + /// + /// + /// + /// Custom Locations name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCustomLocationAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetCustomLocations().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the customLocation with a specified resource group and name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName} + /// + /// + /// Operation Id + /// CustomLocations_Get + /// + /// + /// + /// Custom Locations name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCustomLocation(string resourceName, CancellationToken cancellationToken = default) + { + return GetCustomLocations().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsSubscriptionMockingExtension.cs similarity index 84% rename from sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsSubscriptionMockingExtension.cs index 027f90c17868..6ec5d7c3277d 100644 --- a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ExtendedLocationsSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ExtendedLocations; -namespace Azure.ResourceManager.ExtendedLocations +namespace Azure.ResourceManager.ExtendedLocations.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ExtendedLocationsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _customLocationClientDiagnostics; private CustomLocationsRestOperations _customLocationRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ExtendedLocationsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ExtendedLocationsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetCustomLocationsAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomLocationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomLocationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomLocationResource(Client, CustomLocationData.DeserializeCustomLocationData(e)), CustomLocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomLocationResource(Client, CustomLocationData.DeserializeCustomLocationData(e)), CustomLocationClientDiagnostics, Pipeline, "ExtendedLocationsSubscriptionMockingExtension.GetCustomLocations", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetCustomLocations(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => CustomLocationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomLocationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomLocationResource(Client, CustomLocationData.DeserializeCustomLocationData(e)), CustomLocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomLocations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomLocationResource(Client, CustomLocationData.DeserializeCustomLocationData(e)), CustomLocationClientDiagnostics, Pipeline, "ExtendedLocationsSubscriptionMockingExtension.GetCustomLocations", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 1dbf526f1307..000000000000 --- a/sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ExtendedLocations -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CustomLocationResources in the ResourceGroupResource. - /// An object representing collection of CustomLocationResources and their operations over a CustomLocationResource. - public virtual CustomLocationCollection GetCustomLocations() - { - return GetCachedClient(Client => new CustomLocationCollection(Client, Id)); - } - } -} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs index ceb62d0e77e1..8384ceb12efb 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerServiceFleetMemberResources and their operations over a ContainerServiceFleetMemberResource. public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMembers() { - return GetCachedClient(Client => new ContainerServiceFleetMemberCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceFleetMemberCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMem /// /// The name of the Fleet member resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetContainerServiceFleetMemberAsync(string fleetMemberName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCont /// /// The name of the Fleet member resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetContainerServiceFleetMember(string fleetMemberName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetContainerService /// An object representing collection of ContainerServiceFleetUpdateRunResources and their operations over a ContainerServiceFleetUpdateRunResource. public virtual ContainerServiceFleetUpdateRunCollection GetContainerServiceFleetUpdateRuns() { - return GetCachedClient(Client => new ContainerServiceFleetUpdateRunCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceFleetUpdateRunCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual ContainerServiceFleetUpdateRunCollection GetContainerServiceFleet /// /// The name of the UpdateRun resource. /// The cancellation token to use. - /// 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> GetContainerServiceFleetUpdateRunAsync(string updateRunName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetC /// /// The name of the UpdateRun resource. /// The cancellation token to use. - /// 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 GetContainerServiceFleetUpdateRun(string updateRunName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetContainerServ /// An object representing collection of FleetUpdateStrategyResources and their operations over a FleetUpdateStrategyResource. public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() { - return GetCachedClient(Client => new FleetUpdateStrategyCollection(Client, Id)); + return GetCachedClient(client => new FleetUpdateStrategyCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() /// /// The name of the UpdateStrategy resource. /// The cancellation token to use. - /// 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> GetFleetUpdateStrategyAsync(string updateStrategyName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetFleetUpdateS /// /// The name of the UpdateStrategy resource. /// The cancellation token to use. - /// 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 GetFleetUpdateStrategy(string updateStrategyName, CancellationToken cancellationToken = default) { diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetArmClientMockingExtension.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetArmClientMockingExtension.cs new file mode 100644 index 000000000000..f1517a9771ad --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet; + +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ContainerServiceFleetArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerServiceFleetArmClientMockingExtension() + { + } + + /// 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 ContainerServiceFleetArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ContainerServiceFleetArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerServiceFleetResource GetContainerServiceFleetResource(ResourceIdentifier id) + { + ContainerServiceFleetResource.ValidateResourceId(id); + return new ContainerServiceFleetResource(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 ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(ResourceIdentifier id) + { + ContainerServiceFleetMemberResource.ValidateResourceId(id); + return new ContainerServiceFleetMemberResource(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 ContainerServiceFleetUpdateRunResource GetContainerServiceFleetUpdateRunResource(ResourceIdentifier id) + { + ContainerServiceFleetUpdateRunResource.ValidateResourceId(id); + return new ContainerServiceFleetUpdateRunResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetUpdateStrategyResource GetFleetUpdateStrategyResource(ResourceIdentifier id) + { + FleetUpdateStrategyResource.ValidateResourceId(id); + return new FleetUpdateStrategyResource(Client, id); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs index 8646973c2d1d..f482bd65890f 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerServiceFleet @@ -18,119 +19,97 @@ namespace Azure.ResourceManager.ContainerServiceFleet /// A class to add extension methods to Azure.ResourceManager.ContainerServiceFleet. public static partial class ContainerServiceFleetExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ContainerServiceFleetArmClientMockingExtension GetContainerServiceFleetArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ContainerServiceFleetArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ContainerServiceFleetResourceGroupMockingExtension GetContainerServiceFleetResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ContainerServiceFleetResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ContainerServiceFleetSubscriptionMockingExtension GetContainerServiceFleetSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ContainerServiceFleetSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ContainerServiceFleetResource /// /// 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. /// Returns a object. public static ContainerServiceFleetResource GetContainerServiceFleetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceFleetResource.ValidateResourceId(id); - return new ContainerServiceFleetResource(client, id); - } - ); + return GetContainerServiceFleetArmClientMockingExtension(client).GetContainerServiceFleetResource(id); } - #endregion - #region ContainerServiceFleetMemberResource /// /// 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. /// Returns a object. public static ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceFleetMemberResource.ValidateResourceId(id); - return new ContainerServiceFleetMemberResource(client, id); - } - ); + return GetContainerServiceFleetArmClientMockingExtension(client).GetContainerServiceFleetMemberResource(id); } - #endregion - #region ContainerServiceFleetUpdateRunResource /// /// 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. /// Returns a object. public static ContainerServiceFleetUpdateRunResource GetContainerServiceFleetUpdateRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceFleetUpdateRunResource.ValidateResourceId(id); - return new ContainerServiceFleetUpdateRunResource(client, id); - } - ); + return GetContainerServiceFleetArmClientMockingExtension(client).GetContainerServiceFleetUpdateRunResource(id); } - #endregion - #region FleetUpdateStrategyResource /// /// 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. /// Returns a object. public static FleetUpdateStrategyResource GetFleetUpdateStrategyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FleetUpdateStrategyResource.ValidateResourceId(id); - return new FleetUpdateStrategyResource(client, id); - } - ); + return GetContainerServiceFleetArmClientMockingExtension(client).GetFleetUpdateStrategyResource(id); } - #endregion - /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. public static ContainerServiceFleetCollection GetContainerServiceFleets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerServiceFleets(); + return GetContainerServiceFleetResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleets(); } /// @@ -145,16 +124,20 @@ public static ContainerServiceFleetCollection GetContainerServiceFleets(this Res /// Fleets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Fleet resource. /// The cancellation token to use. - /// 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 static async Task> GetContainerServiceFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerServiceFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + return await GetContainerServiceFleetResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// @@ -169,16 +152,20 @@ public static async Task> GetContainerSe /// Fleets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Fleet resource. /// The cancellation token to use. - /// 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 static Response GetContainerServiceFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerServiceFleets().Get(fleetName, cancellationToken); + return GetContainerServiceFleetResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleet(fleetName, cancellationToken); } /// @@ -193,13 +180,17 @@ public static Response GetContainerServiceFleet(t /// Fleets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerServiceFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceFleetsAsync(cancellationToken); + return GetContainerServiceFleetSubscriptionMockingExtension(subscriptionResource).GetContainerServiceFleetsAsync(cancellationToken); } /// @@ -214,13 +205,17 @@ public static AsyncPageable GetContainerServiceFl /// Fleets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerServiceFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceFleets(cancellationToken); + return GetContainerServiceFleetSubscriptionMockingExtension(subscriptionResource).GetContainerServiceFleets(cancellationToken); } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetResourceGroupMockingExtension.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..34e7cfb6c990 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet; + +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ContainerServiceFleetResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerServiceFleetResourceGroupMockingExtension() + { + } + + /// 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 ContainerServiceFleetResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. + public virtual ContainerServiceFleetCollection GetContainerServiceFleets() + { + return GetCachedClient(client => new ContainerServiceFleetCollection(client, Id)); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerServiceFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetContainerServiceFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerServiceFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetContainerServiceFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetSubscriptionMockingExtension.cs similarity index 84% rename from sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetSubscriptionMockingExtension.cs index 895769b4d08d..47ae20cb0a26 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerServiceFleet; -namespace Azure.ResourceManager.ContainerServiceFleet +namespace Azure.ResourceManager.ContainerServiceFleet.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ContainerServiceFleetSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _containerServiceFleetFleetsClientDiagnostics; private FleetsRestOperations _containerServiceFleetFleetsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ContainerServiceFleetSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ContainerServiceFleetSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetContainerServiceF { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceFleets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "ContainerServiceFleetSubscriptionMockingExtension.GetContainerServiceFleets", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetContainerServiceFleets { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceFleets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "ContainerServiceFleetSubscriptionMockingExtension.GetContainerServiceFleets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 69e7e4226b64..000000000000 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerServiceFleet -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. - /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. - public virtual ContainerServiceFleetCollection GetContainerServiceFleets() - { - return GetCachedClient(Client => new ContainerServiceFleetCollection(Client, Id)); - } - } -} diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayArmClientMockingExtension.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayArmClientMockingExtension.cs new file mode 100644 index 000000000000..172c4d6ec34e --- /dev/null +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.FluidRelay; + +namespace Azure.ResourceManager.FluidRelay.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class FluidRelayArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected FluidRelayArmClientMockingExtension() + { + } + + /// 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 FluidRelayArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal FluidRelayArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FluidRelayServerResource GetFluidRelayServerResource(ResourceIdentifier id) + { + FluidRelayServerResource.ValidateResourceId(id); + return new FluidRelayServerResource(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 FluidRelayContainerResource GetFluidRelayContainerResource(ResourceIdentifier id) + { + FluidRelayContainerResource.ValidateResourceId(id); + return new FluidRelayContainerResource(Client, id); + } + } +} diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayExtensions.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayExtensions.cs index 343eff2ad9c3..22d9b8d36347 100644 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayExtensions.cs +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.FluidRelay.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.FluidRelay @@ -18,81 +19,65 @@ namespace Azure.ResourceManager.FluidRelay /// A class to add extension methods to Azure.ResourceManager.FluidRelay. public static partial class FluidRelayExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static FluidRelayArmClientMockingExtension GetFluidRelayArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new FluidRelayArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static FluidRelayResourceGroupMockingExtension GetFluidRelayResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new FluidRelayResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static FluidRelaySubscriptionMockingExtension GetFluidRelaySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new FluidRelaySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region FluidRelayServerResource /// /// 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. /// Returns a object. public static FluidRelayServerResource GetFluidRelayServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FluidRelayServerResource.ValidateResourceId(id); - return new FluidRelayServerResource(client, id); - } - ); + return GetFluidRelayArmClientMockingExtension(client).GetFluidRelayServerResource(id); } - #endregion - #region FluidRelayContainerResource /// /// 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. /// Returns a object. public static FluidRelayContainerResource GetFluidRelayContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FluidRelayContainerResource.ValidateResourceId(id); - return new FluidRelayContainerResource(client, id); - } - ); + return GetFluidRelayArmClientMockingExtension(client).GetFluidRelayContainerResource(id); } - #endregion - /// Gets a collection of FluidRelayServerResources in the ResourceGroupResource. + /// + /// Gets a collection of FluidRelayServerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FluidRelayServerResources and their operations over a FluidRelayServerResource. public static FluidRelayServerCollection GetFluidRelayServers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFluidRelayServers(); + return GetFluidRelayResourceGroupMockingExtension(resourceGroupResource).GetFluidRelayServers(); } /// @@ -107,16 +92,20 @@ public static FluidRelayServerCollection GetFluidRelayServers(this ResourceGroup /// FluidRelayServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Fluid Relay server resource name. /// The cancellation token to use. - /// 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 static async Task> GetFluidRelayServerAsync(this ResourceGroupResource resourceGroupResource, string fluidRelayServerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFluidRelayServers().GetAsync(fluidRelayServerName, cancellationToken).ConfigureAwait(false); + return await GetFluidRelayResourceGroupMockingExtension(resourceGroupResource).GetFluidRelayServerAsync(fluidRelayServerName, cancellationToken).ConfigureAwait(false); } /// @@ -131,16 +120,20 @@ public static async Task> GetFluidRelayServer /// FluidRelayServers_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Fluid Relay server resource name. /// The cancellation token to use. - /// 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 static Response GetFluidRelayServer(this ResourceGroupResource resourceGroupResource, string fluidRelayServerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFluidRelayServers().Get(fluidRelayServerName, cancellationToken); + return GetFluidRelayResourceGroupMockingExtension(resourceGroupResource).GetFluidRelayServer(fluidRelayServerName, cancellationToken); } /// @@ -155,13 +148,17 @@ public static Response GetFluidRelayServer(this Resour /// FluidRelayServers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFluidRelayServersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFluidRelayServersAsync(cancellationToken); + return GetFluidRelaySubscriptionMockingExtension(subscriptionResource).GetFluidRelayServersAsync(cancellationToken); } /// @@ -176,13 +173,17 @@ public static AsyncPageable GetFluidRelayServersAsync( /// FluidRelayServers_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFluidRelayServers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFluidRelayServers(cancellationToken); + return GetFluidRelaySubscriptionMockingExtension(subscriptionResource).GetFluidRelayServers(cancellationToken); } } } diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayResourceGroupMockingExtension.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..a756d0a1f964 --- /dev/null +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelayResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.FluidRelay; + +namespace Azure.ResourceManager.FluidRelay.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class FluidRelayResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected FluidRelayResourceGroupMockingExtension() + { + } + + /// 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 FluidRelayResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FluidRelayServerResources in the ResourceGroupResource. + /// An object representing collection of FluidRelayServerResources and their operations over a FluidRelayServerResource. + public virtual FluidRelayServerCollection GetFluidRelayServers() + { + return GetCachedClient(client => new FluidRelayServerCollection(client, Id)); + } + + /// + /// Get a Fluid Relay server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.FluidRelay/fluidRelayServers/{fluidRelayServerName} + /// + /// + /// Operation Id + /// FluidRelayServers_Get + /// + /// + /// + /// The Fluid Relay server resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFluidRelayServerAsync(string fluidRelayServerName, CancellationToken cancellationToken = default) + { + return await GetFluidRelayServers().GetAsync(fluidRelayServerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Fluid Relay server. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.FluidRelay/fluidRelayServers/{fluidRelayServerName} + /// + /// + /// Operation Id + /// FluidRelayServers_Get + /// + /// + /// + /// The Fluid Relay server resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFluidRelayServer(string fluidRelayServerName, CancellationToken cancellationToken = default) + { + return GetFluidRelayServers().Get(fluidRelayServerName, cancellationToken); + } + } +} diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelaySubscriptionMockingExtension.cs similarity index 84% rename from sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelaySubscriptionMockingExtension.cs index 815c8c1ec332..535e56a864be 100644 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/FluidRelaySubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.FluidRelay; -namespace Azure.ResourceManager.FluidRelay +namespace Azure.ResourceManager.FluidRelay.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class FluidRelaySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _fluidRelayServerClientDiagnostics; private FluidRelayServersRestOperations _fluidRelayServerRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected FluidRelaySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FluidRelaySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetFluidRelayServersAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => FluidRelayServerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FluidRelayServerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FluidRelayServerResource(Client, FluidRelayServerData.DeserializeFluidRelayServerData(e)), FluidRelayServerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFluidRelayServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FluidRelayServerResource(Client, FluidRelayServerData.DeserializeFluidRelayServerData(e)), FluidRelayServerClientDiagnostics, Pipeline, "FluidRelaySubscriptionMockingExtension.GetFluidRelayServers", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetFluidRelayServers(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => FluidRelayServerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FluidRelayServerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FluidRelayServerResource(Client, FluidRelayServerData.DeserializeFluidRelayServerData(e)), FluidRelayServerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFluidRelayServers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FluidRelayServerResource(Client, FluidRelayServerData.DeserializeFluidRelayServerData(e)), FluidRelayServerClientDiagnostics, Pipeline, "FluidRelaySubscriptionMockingExtension.GetFluidRelayServers", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 20bea3de437b..000000000000 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.FluidRelay -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of FluidRelayServerResources in the ResourceGroupResource. - /// An object representing collection of FluidRelayServerResources and their operations over a FluidRelayServerResource. - public virtual FluidRelayServerCollection GetFluidRelayServers() - { - return GetCachedClient(Client => new FluidRelayServerCollection(Client, Id)); - } - } -} diff --git a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/FluidRelayServerResource.cs b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/FluidRelayServerResource.cs index 388c6d3408e2..74842746216a 100644 --- a/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/FluidRelayServerResource.cs +++ b/sdk/fluidrelay/Azure.ResourceManager.FluidRelay/src/Generated/FluidRelayServerResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FluidRelayContainerResources and their operations over a FluidRelayContainerResource. public virtual FluidRelayContainerCollection GetFluidRelayContainers() { - return GetCachedClient(Client => new FluidRelayContainerCollection(Client, Id)); + return GetCachedClient(client => new FluidRelayContainerCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual FluidRelayContainerCollection GetFluidRelayContainers() /// /// The Fluid Relay container resource name. /// The cancellation token to use. - /// 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> GetFluidRelayContainerAsync(string fluidRelayContainerName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetFluidRelayCo /// /// The Fluid Relay container resource name. /// The cancellation token to use. - /// 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 GetFluidRelayContainer(string fluidRelayContainerName, CancellationToken cancellationToken = default) { diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorArmClientMockingExtension.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorArmClientMockingExtension.cs new file mode 100644 index 000000000000..05f6f6708c0e --- /dev/null +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.FrontDoor; + +namespace Azure.ResourceManager.FrontDoor.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class FrontDoorArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected FrontDoorArmClientMockingExtension() + { + } + + /// 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 FrontDoorArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal FrontDoorArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FrontDoorWebApplicationFirewallPolicyResource GetFrontDoorWebApplicationFirewallPolicyResource(ResourceIdentifier id) + { + FrontDoorWebApplicationFirewallPolicyResource.ValidateResourceId(id); + return new FrontDoorWebApplicationFirewallPolicyResource(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 FrontDoorResource GetFrontDoorResource(ResourceIdentifier id) + { + FrontDoorResource.ValidateResourceId(id); + return new FrontDoorResource(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 FrontendEndpointResource GetFrontendEndpointResource(ResourceIdentifier id) + { + FrontendEndpointResource.ValidateResourceId(id); + return new FrontendEndpointResource(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 FrontDoorRulesEngineResource GetFrontDoorRulesEngineResource(ResourceIdentifier id) + { + FrontDoorRulesEngineResource.ValidateResourceId(id); + return new FrontDoorRulesEngineResource(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 FrontDoorNetworkExperimentProfileResource GetFrontDoorNetworkExperimentProfileResource(ResourceIdentifier id) + { + FrontDoorNetworkExperimentProfileResource.ValidateResourceId(id); + return new FrontDoorNetworkExperimentProfileResource(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 FrontDoorExperimentResource GetFrontDoorExperimentResource(ResourceIdentifier id) + { + FrontDoorExperimentResource.ValidateResourceId(id); + return new FrontDoorExperimentResource(Client, id); + } + } +} diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorExtensions.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorExtensions.cs index 55a339a698f2..8bd77e2f5e42 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorExtensions.cs +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.FrontDoor.Mocking; using Azure.ResourceManager.FrontDoor.Models; using Azure.ResourceManager.Resources; @@ -19,173 +20,134 @@ namespace Azure.ResourceManager.FrontDoor /// A class to add extension methods to Azure.ResourceManager.FrontDoor. public static partial class FrontDoorExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static FrontDoorArmClientMockingExtension GetFrontDoorArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new FrontDoorArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static FrontDoorResourceGroupMockingExtension GetFrontDoorResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new FrontDoorResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static FrontDoorSubscriptionMockingExtension GetFrontDoorSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new FrontDoorSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static FrontDoorTenantMockingExtension GetFrontDoorTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new FrontDoorTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region FrontDoorWebApplicationFirewallPolicyResource /// /// 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. /// Returns a object. public static FrontDoorWebApplicationFirewallPolicyResource GetFrontDoorWebApplicationFirewallPolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorWebApplicationFirewallPolicyResource.ValidateResourceId(id); - return new FrontDoorWebApplicationFirewallPolicyResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontDoorWebApplicationFirewallPolicyResource(id); } - #endregion - #region FrontDoorResource /// /// 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. /// Returns a object. public static FrontDoorResource GetFrontDoorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorResource.ValidateResourceId(id); - return new FrontDoorResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontDoorResource(id); } - #endregion - #region FrontendEndpointResource /// /// 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. /// Returns a object. public static FrontendEndpointResource GetFrontendEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontendEndpointResource.ValidateResourceId(id); - return new FrontendEndpointResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontendEndpointResource(id); } - #endregion - #region FrontDoorRulesEngineResource /// /// 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. /// Returns a object. public static FrontDoorRulesEngineResource GetFrontDoorRulesEngineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorRulesEngineResource.ValidateResourceId(id); - return new FrontDoorRulesEngineResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontDoorRulesEngineResource(id); } - #endregion - #region FrontDoorNetworkExperimentProfileResource /// /// 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. /// Returns a object. public static FrontDoorNetworkExperimentProfileResource GetFrontDoorNetworkExperimentProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorNetworkExperimentProfileResource.ValidateResourceId(id); - return new FrontDoorNetworkExperimentProfileResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontDoorNetworkExperimentProfileResource(id); } - #endregion - #region FrontDoorExperimentResource /// /// 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. /// Returns a object. public static FrontDoorExperimentResource GetFrontDoorExperimentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - FrontDoorExperimentResource.ValidateResourceId(id); - return new FrontDoorExperimentResource(client, id); - } - ); + return GetFrontDoorArmClientMockingExtension(client).GetFrontDoorExperimentResource(id); } - #endregion - /// Gets a collection of FrontDoorWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Gets a collection of FrontDoorWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FrontDoorWebApplicationFirewallPolicyResources and their operations over a FrontDoorWebApplicationFirewallPolicyResource. public static FrontDoorWebApplicationFirewallPolicyCollection GetFrontDoorWebApplicationFirewallPolicies(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFrontDoorWebApplicationFirewallPolicies(); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorWebApplicationFirewallPolicies(); } /// @@ -200,16 +162,20 @@ public static FrontDoorWebApplicationFirewallPolicyCollection GetFrontDoorWebApp /// Policies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Web Application Firewall Policy. /// The cancellation token to use. - /// 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 static async Task> GetFrontDoorWebApplicationFirewallPolicyAsync(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFrontDoorWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + return await GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorWebApplicationFirewallPolicyAsync(policyName, cancellationToken).ConfigureAwait(false); } /// @@ -224,24 +190,34 @@ public static async Task /// Policies_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Web Application Firewall Policy. /// The cancellation token to use. - /// 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 static Response GetFrontDoorWebApplicationFirewallPolicy(this ResourceGroupResource resourceGroupResource, string policyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFrontDoorWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorWebApplicationFirewallPolicy(policyName, cancellationToken); } - /// Gets a collection of FrontDoorResources in the ResourceGroupResource. + /// + /// Gets a collection of FrontDoorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FrontDoorResources and their operations over a FrontDoorResource. public static FrontDoorCollection GetFrontDoors(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFrontDoors(); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoors(); } /// @@ -256,16 +232,20 @@ public static FrontDoorCollection GetFrontDoors(this ResourceGroupResource resou /// FrontDoors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Front Door which is globally unique. /// The cancellation token to use. - /// 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 static async Task> GetFrontDoorAsync(this ResourceGroupResource resourceGroupResource, string frontDoorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFrontDoors().GetAsync(frontDoorName, cancellationToken).ConfigureAwait(false); + return await GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorAsync(frontDoorName, cancellationToken).ConfigureAwait(false); } /// @@ -280,24 +260,34 @@ public static async Task> GetFrontDoorAsync(this Res /// FrontDoors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Front Door which is globally unique. /// The cancellation token to use. - /// 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 static Response GetFrontDoor(this ResourceGroupResource resourceGroupResource, string frontDoorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFrontDoors().Get(frontDoorName, cancellationToken); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoor(frontDoorName, cancellationToken); } - /// Gets a collection of FrontDoorNetworkExperimentProfileResources in the ResourceGroupResource. + /// + /// Gets a collection of FrontDoorNetworkExperimentProfileResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of FrontDoorNetworkExperimentProfileResources and their operations over a FrontDoorNetworkExperimentProfileResource. public static FrontDoorNetworkExperimentProfileCollection GetFrontDoorNetworkExperimentProfiles(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFrontDoorNetworkExperimentProfiles(); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorNetworkExperimentProfiles(); } /// @@ -312,16 +302,20 @@ public static FrontDoorNetworkExperimentProfileCollection GetFrontDoorNetworkExp /// NetworkExperimentProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Profile identifier associated with the Tenant and Partner. /// The cancellation token to use. - /// 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 static async Task> GetFrontDoorNetworkExperimentProfileAsync(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetFrontDoorNetworkExperimentProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + return await GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorNetworkExperimentProfileAsync(profileName, cancellationToken).ConfigureAwait(false); } /// @@ -336,16 +330,20 @@ public static async Task> Ge /// NetworkExperimentProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Profile identifier associated with the Tenant and Partner. /// The cancellation token to use. - /// 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 static Response GetFrontDoorNetworkExperimentProfile(this ResourceGroupResource resourceGroupResource, string profileName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetFrontDoorNetworkExperimentProfiles().Get(profileName, cancellationToken); + return GetFrontDoorResourceGroupMockingExtension(resourceGroupResource).GetFrontDoorNetworkExperimentProfile(profileName, cancellationToken); } /// @@ -360,13 +358,17 @@ public static Response GetFrontDoorNe /// ManagedRuleSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedRuleSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedRuleSetsAsync(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetManagedRuleSetsAsync(cancellationToken); } /// @@ -381,13 +383,17 @@ public static AsyncPageable GetManagedRuleSetsAsync(th /// ManagedRuleSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedRuleSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedRuleSets(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetManagedRuleSets(cancellationToken); } /// @@ -402,6 +408,10 @@ public static Pageable GetManagedRuleSets(this Subscri /// FrontDoorNameAvailabilityWithSubscription_Check /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -409,9 +419,7 @@ public static Pageable GetManagedRuleSets(this Subscri /// is null. public static async Task> CheckFrontDoorNameAvailabilityAsync(this SubscriptionResource subscriptionResource, FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckFrontDoorNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetFrontDoorSubscriptionMockingExtension(subscriptionResource).CheckFrontDoorNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -426,6 +434,10 @@ public static async Task> CheckFrontDo /// FrontDoorNameAvailabilityWithSubscription_Check /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -433,9 +445,7 @@ public static async Task> CheckFrontDo /// is null. public static Response CheckFrontDoorNameAvailability(this SubscriptionResource subscriptionResource, FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckFrontDoorNameAvailability(content, cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).CheckFrontDoorNameAvailability(content, cancellationToken); } /// @@ -450,13 +460,17 @@ public static Response CheckFrontDoorNameAvaila /// FrontDoors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFrontDoorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFrontDoorsAsync(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetFrontDoorsAsync(cancellationToken); } /// @@ -471,13 +485,17 @@ public static AsyncPageable GetFrontDoorsAsync(this Subscript /// FrontDoors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFrontDoors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFrontDoors(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetFrontDoors(cancellationToken); } /// @@ -492,13 +510,17 @@ public static Pageable GetFrontDoors(this SubscriptionResourc /// NetworkExperimentProfiles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetFrontDoorNetworkExperimentProfilesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFrontDoorNetworkExperimentProfilesAsync(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetFrontDoorNetworkExperimentProfilesAsync(cancellationToken); } /// @@ -513,13 +535,17 @@ public static AsyncPageable GetFrontD /// NetworkExperimentProfiles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetFrontDoorNetworkExperimentProfiles(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFrontDoorNetworkExperimentProfiles(cancellationToken); + return GetFrontDoorSubscriptionMockingExtension(subscriptionResource).GetFrontDoorNetworkExperimentProfiles(cancellationToken); } /// @@ -534,6 +560,10 @@ public static Pageable GetFrontDoorNe /// FrontDoorNameAvailability_Check /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -541,9 +571,7 @@ public static Pageable GetFrontDoorNe /// is null. public static async Task> CheckFrontDoorNameAvailabilityAsync(this TenantResource tenantResource, FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckFrontDoorNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetFrontDoorTenantMockingExtension(tenantResource).CheckFrontDoorNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -558,6 +586,10 @@ public static async Task> CheckFrontDo /// FrontDoorNameAvailability_Check /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Input to check. @@ -565,9 +597,7 @@ public static async Task> CheckFrontDo /// is null. public static Response CheckFrontDoorNameAvailability(this TenantResource tenantResource, FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CheckFrontDoorNameAvailability(content, cancellationToken); + return GetFrontDoorTenantMockingExtension(tenantResource).CheckFrontDoorNameAvailability(content, cancellationToken); } } } diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorResourceGroupMockingExtension.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..85d71112291e --- /dev/null +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorResourceGroupMockingExtension.cs @@ -0,0 +1,198 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.FrontDoor; + +namespace Azure.ResourceManager.FrontDoor.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class FrontDoorResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected FrontDoorResourceGroupMockingExtension() + { + } + + /// 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 FrontDoorResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FrontDoorWebApplicationFirewallPolicyResources in the ResourceGroupResource. + /// An object representing collection of FrontDoorWebApplicationFirewallPolicyResources and their operations over a FrontDoorWebApplicationFirewallPolicyResource. + public virtual FrontDoorWebApplicationFirewallPolicyCollection GetFrontDoorWebApplicationFirewallPolicies() + { + return GetCachedClient(client => new FrontDoorWebApplicationFirewallPolicyCollection(client, Id)); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// Policies_Get + /// + /// + /// + /// The name of the Web Application Firewall Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFrontDoorWebApplicationFirewallPolicyAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetFrontDoorWebApplicationFirewallPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve protection policy with specified name within a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName} + /// + /// + /// Operation Id + /// Policies_Get + /// + /// + /// + /// The name of the Web Application Firewall Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFrontDoorWebApplicationFirewallPolicy(string policyName, CancellationToken cancellationToken = default) + { + return GetFrontDoorWebApplicationFirewallPolicies().Get(policyName, cancellationToken); + } + + /// Gets a collection of FrontDoorResources in the ResourceGroupResource. + /// An object representing collection of FrontDoorResources and their operations over a FrontDoorResource. + public virtual FrontDoorCollection GetFrontDoors() + { + return GetCachedClient(client => new FrontDoorCollection(client, Id)); + } + + /// + /// Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName} + /// + /// + /// Operation Id + /// FrontDoors_Get + /// + /// + /// + /// Name of the Front Door which is globally unique. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFrontDoorAsync(string frontDoorName, CancellationToken cancellationToken = default) + { + return await GetFrontDoors().GetAsync(frontDoorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Front Door with the specified Front Door name under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName} + /// + /// + /// Operation Id + /// FrontDoors_Get + /// + /// + /// + /// Name of the Front Door which is globally unique. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFrontDoor(string frontDoorName, CancellationToken cancellationToken = default) + { + return GetFrontDoors().Get(frontDoorName, cancellationToken); + } + + /// Gets a collection of FrontDoorNetworkExperimentProfileResources in the ResourceGroupResource. + /// An object representing collection of FrontDoorNetworkExperimentProfileResources and their operations over a FrontDoorNetworkExperimentProfileResource. + public virtual FrontDoorNetworkExperimentProfileCollection GetFrontDoorNetworkExperimentProfiles() + { + return GetCachedClient(client => new FrontDoorNetworkExperimentProfileCollection(client, Id)); + } + + /// + /// Gets an NetworkExperiment Profile by ProfileName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName} + /// + /// + /// Operation Id + /// NetworkExperimentProfiles_Get + /// + /// + /// + /// The Profile identifier associated with the Tenant and Partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFrontDoorNetworkExperimentProfileAsync(string profileName, CancellationToken cancellationToken = default) + { + return await GetFrontDoorNetworkExperimentProfiles().GetAsync(profileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an NetworkExperiment Profile by ProfileName + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName} + /// + /// + /// Operation Id + /// NetworkExperimentProfiles_Get + /// + /// + /// + /// The Profile identifier associated with the Tenant and Partner. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFrontDoorNetworkExperimentProfile(string profileName, CancellationToken cancellationToken = default) + { + return GetFrontDoorNetworkExperimentProfiles().Get(profileName, cancellationToken); + } + } +} diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorSubscriptionMockingExtension.cs similarity index 89% rename from sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorSubscriptionMockingExtension.cs index c23042d4004d..e28fdaa214a6 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.FrontDoor; using Azure.ResourceManager.FrontDoor.Models; -namespace Azure.ResourceManager.FrontDoor +namespace Azure.ResourceManager.FrontDoor.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class FrontDoorSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _managedRuleSetsClientDiagnostics; private ManagedRuleSetsRestOperations _managedRuleSetsRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _frontDoorNetworkExperimentProfileNetworkExperimentProfilesClientDiagnostics; private NetworkExperimentProfilesRestOperations _frontDoorNetworkExperimentProfileNetworkExperimentProfilesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected FrontDoorSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FrontDoorSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -75,7 +76,7 @@ public virtual AsyncPageable GetManagedRuleSetsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedRuleSetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedRuleSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedRuleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetManagedRuleSets", "value", "nextLink", cancellationToken); } /// @@ -97,7 +98,7 @@ public virtual Pageable GetManagedRuleSets(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedRuleSetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedRuleSetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedRuleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ManagedRuleSetDefinition.DeserializeManagedRuleSetDefinition, ManagedRuleSetsClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetManagedRuleSets", "value", "nextLink", cancellationToken); } /// @@ -115,9 +116,12 @@ public virtual Pageable GetManagedRuleSets(Cancellatio /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckFrontDoorNameAvailabilityAsync(FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = FrontDoorNameAvailabilityWithSubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckFrontDoorNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FrontDoorNameAvailabilityWithSubscriptionClientDiagnostics.CreateScope("FrontDoorSubscriptionMockingExtension.CheckFrontDoorNameAvailability"); scope.Start(); try { @@ -146,9 +150,12 @@ public virtual async Task> CheckFrontD /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response CheckFrontDoorNameAvailability(FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = FrontDoorNameAvailabilityWithSubscriptionClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckFrontDoorNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FrontDoorNameAvailabilityWithSubscriptionClientDiagnostics.CreateScope("FrontDoorSubscriptionMockingExtension.CheckFrontDoorNameAvailability"); scope.Start(); try { @@ -181,7 +188,7 @@ public virtual AsyncPageable GetFrontDoorsAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => FrontDoorRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FrontDoorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FrontDoorResource(Client, FrontDoorData.DeserializeFrontDoorData(e)), FrontDoorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFrontDoors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FrontDoorResource(Client, FrontDoorData.DeserializeFrontDoorData(e)), FrontDoorClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetFrontDoors", "value", "nextLink", cancellationToken); } /// @@ -203,7 +210,7 @@ public virtual Pageable GetFrontDoors(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => FrontDoorRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FrontDoorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FrontDoorResource(Client, FrontDoorData.DeserializeFrontDoorData(e)), FrontDoorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFrontDoors", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FrontDoorResource(Client, FrontDoorData.DeserializeFrontDoorData(e)), FrontDoorClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetFrontDoors", "value", "nextLink", cancellationToken); } /// @@ -225,7 +232,7 @@ public virtual AsyncPageable GetFront { HttpMessage FirstPageRequest(int? pageSizeHint) => FrontDoorNetworkExperimentProfileNetworkExperimentProfilesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FrontDoorNetworkExperimentProfileNetworkExperimentProfilesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FrontDoorNetworkExperimentProfileResource(Client, FrontDoorNetworkExperimentProfileData.DeserializeFrontDoorNetworkExperimentProfileData(e)), FrontDoorNetworkExperimentProfileNetworkExperimentProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFrontDoorNetworkExperimentProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FrontDoorNetworkExperimentProfileResource(Client, FrontDoorNetworkExperimentProfileData.DeserializeFrontDoorNetworkExperimentProfileData(e)), FrontDoorNetworkExperimentProfileNetworkExperimentProfilesClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetFrontDoorNetworkExperimentProfiles", "value", "nextLink", cancellationToken); } /// @@ -247,7 +254,7 @@ public virtual Pageable GetFrontDoorN { HttpMessage FirstPageRequest(int? pageSizeHint) => FrontDoorNetworkExperimentProfileNetworkExperimentProfilesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FrontDoorNetworkExperimentProfileNetworkExperimentProfilesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FrontDoorNetworkExperimentProfileResource(Client, FrontDoorNetworkExperimentProfileData.DeserializeFrontDoorNetworkExperimentProfileData(e)), FrontDoorNetworkExperimentProfileNetworkExperimentProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFrontDoorNetworkExperimentProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FrontDoorNetworkExperimentProfileResource(Client, FrontDoorNetworkExperimentProfileData.DeserializeFrontDoorNetworkExperimentProfileData(e)), FrontDoorNetworkExperimentProfileNetworkExperimentProfilesClientDiagnostics, Pipeline, "FrontDoorSubscriptionMockingExtension.GetFrontDoorNetworkExperimentProfiles", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorTenantMockingExtension.cs similarity index 81% rename from sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorTenantMockingExtension.cs index 4d394d283000..245f2396c404 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/FrontDoorTenantMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.FrontDoor; using Azure.ResourceManager.FrontDoor.Models; -namespace Azure.ResourceManager.FrontDoor +namespace Azure.ResourceManager.FrontDoor.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class FrontDoorTenantMockingExtension : ArmResource { private ClientDiagnostics _frontDoorNameAvailabilityClientDiagnostics; private FrontDoorNameAvailabilityRestOperations _frontDoorNameAvailabilityRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected FrontDoorTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal FrontDoorTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,9 +59,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual async Task> CheckFrontDoorNameAvailabilityAsync(FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = FrontDoorNameAvailabilityClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckFrontDoorNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FrontDoorNameAvailabilityClientDiagnostics.CreateScope("FrontDoorTenantMockingExtension.CheckFrontDoorNameAvailability"); scope.Start(); try { @@ -89,9 +93,12 @@ public virtual async Task> CheckFrontD /// /// Input to check. /// The cancellation token to use. + /// is null. public virtual Response CheckFrontDoorNameAvailability(FrontDoorNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = FrontDoorNameAvailabilityClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckFrontDoorNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = FrontDoorNameAvailabilityClientDiagnostics.CreateScope("FrontDoorTenantMockingExtension.CheckFrontDoorNameAvailability"); scope.Start(); try { diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 85164d777de2..000000000000 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.FrontDoor -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of FrontDoorWebApplicationFirewallPolicyResources in the ResourceGroupResource. - /// An object representing collection of FrontDoorWebApplicationFirewallPolicyResources and their operations over a FrontDoorWebApplicationFirewallPolicyResource. - public virtual FrontDoorWebApplicationFirewallPolicyCollection GetFrontDoorWebApplicationFirewallPolicies() - { - return GetCachedClient(Client => new FrontDoorWebApplicationFirewallPolicyCollection(Client, Id)); - } - - /// Gets a collection of FrontDoorResources in the ResourceGroupResource. - /// An object representing collection of FrontDoorResources and their operations over a FrontDoorResource. - public virtual FrontDoorCollection GetFrontDoors() - { - return GetCachedClient(Client => new FrontDoorCollection(Client, Id)); - } - - /// Gets a collection of FrontDoorNetworkExperimentProfileResources in the ResourceGroupResource. - /// An object representing collection of FrontDoorNetworkExperimentProfileResources and their operations over a FrontDoorNetworkExperimentProfileResource. - public virtual FrontDoorNetworkExperimentProfileCollection GetFrontDoorNetworkExperimentProfiles() - { - return GetCachedClient(Client => new FrontDoorNetworkExperimentProfileCollection(Client, Id)); - } - } -} diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorNetworkExperimentProfileResource.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorNetworkExperimentProfileResource.cs index 533de717be63..236ef20e156b 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorNetworkExperimentProfileResource.cs +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorNetworkExperimentProfileResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontDoorExperimentResources and their operations over a FrontDoorExperimentResource. public virtual FrontDoorExperimentCollection GetFrontDoorExperiments() { - return GetCachedClient(Client => new FrontDoorExperimentCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorExperimentCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual FrontDoorExperimentCollection GetFrontDoorExperiments() /// /// The Experiment identifier associated with the Experiment. /// The cancellation token to use. - /// 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> GetFrontDoorExperimentAsync(string experimentName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task> GetFrontDoorExp /// /// The Experiment identifier associated with the Experiment. /// The cancellation token to use. - /// 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 GetFrontDoorExperiment(string experimentName, CancellationToken cancellationToken = default) { diff --git a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorResource.cs b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorResource.cs index f7a96247f987..a5aac7f8e68a 100644 --- a/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorResource.cs +++ b/sdk/frontdoor/Azure.ResourceManager.FrontDoor/src/Generated/FrontDoorResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of FrontendEndpointResources and their operations over a FrontendEndpointResource. public virtual FrontendEndpointCollection GetFrontendEndpoints() { - return GetCachedClient(Client => new FrontendEndpointCollection(Client, Id)); + return GetCachedClient(client => new FrontendEndpointCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual FrontendEndpointCollection GetFrontendEndpoints() /// /// Name of the Frontend endpoint which is unique within the Front Door. /// The cancellation token to use. - /// 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> GetFrontendEndpointAsync(string frontendEndpointName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetFrontendEndpoin /// /// Name of the Frontend endpoint which is unique within the Front Door. /// The cancellation token to use. - /// 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 GetFrontendEndpoint(string frontendEndpointName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetFrontendEndpoint(string fro /// An object representing collection of FrontDoorRulesEngineResources and their operations over a FrontDoorRulesEngineResource. public virtual FrontDoorRulesEngineCollection GetFrontDoorRulesEngines() { - return GetCachedClient(Client => new FrontDoorRulesEngineCollection(Client, Id)); + return GetCachedClient(client => new FrontDoorRulesEngineCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual FrontDoorRulesEngineCollection GetFrontDoorRulesEngines() /// /// Name of the Rules Engine which is unique within the Front Door. /// The cancellation token to use. - /// 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> GetFrontDoorRulesEngineAsync(string rulesEngineName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> GetFrontDoorRu /// /// Name of the Rules Engine which is unique within the Front Door. /// The cancellation token to use. - /// 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 GetFrontDoorRulesEngine(string rulesEngineName, CancellationToken cancellationToken = default) { diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaArmClientMockingExtension.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaArmClientMockingExtension.cs new file mode 100644 index 000000000000..5627cfc80ef2 --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Grafana; + +namespace Azure.ResourceManager.Grafana.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class GrafanaArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected GrafanaArmClientMockingExtension() + { + } + + /// 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 GrafanaArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal GrafanaArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ManagedGrafanaResource GetManagedGrafanaResource(ResourceIdentifier id) + { + ManagedGrafanaResource.ValidateResourceId(id); + return new ManagedGrafanaResource(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 GrafanaPrivateEndpointConnectionResource GetGrafanaPrivateEndpointConnectionResource(ResourceIdentifier id) + { + GrafanaPrivateEndpointConnectionResource.ValidateResourceId(id); + return new GrafanaPrivateEndpointConnectionResource(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 GrafanaPrivateLinkResource GetGrafanaPrivateLinkResource(ResourceIdentifier id) + { + GrafanaPrivateLinkResource.ValidateResourceId(id); + return new GrafanaPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs index 31bbc71412cf..da45b0c78f07 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Grafana.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Grafana @@ -18,100 +19,81 @@ namespace Azure.ResourceManager.Grafana /// A class to add extension methods to Azure.ResourceManager.Grafana. public static partial class GrafanaExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static GrafanaArmClientMockingExtension GetGrafanaArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new GrafanaArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static GrafanaResourceGroupMockingExtension GetGrafanaResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new GrafanaResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static GrafanaSubscriptionMockingExtension GetGrafanaSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new GrafanaSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ManagedGrafanaResource /// /// 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. /// Returns a object. public static ManagedGrafanaResource GetManagedGrafanaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedGrafanaResource.ValidateResourceId(id); - return new ManagedGrafanaResource(client, id); - } - ); + return GetGrafanaArmClientMockingExtension(client).GetManagedGrafanaResource(id); } - #endregion - #region GrafanaPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static GrafanaPrivateEndpointConnectionResource GetGrafanaPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GrafanaPrivateEndpointConnectionResource.ValidateResourceId(id); - return new GrafanaPrivateEndpointConnectionResource(client, id); - } - ); + return GetGrafanaArmClientMockingExtension(client).GetGrafanaPrivateEndpointConnectionResource(id); } - #endregion - #region GrafanaPrivateLinkResource /// /// 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. /// Returns a object. public static GrafanaPrivateLinkResource GetGrafanaPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GrafanaPrivateLinkResource.ValidateResourceId(id); - return new GrafanaPrivateLinkResource(client, id); - } - ); + return GetGrafanaArmClientMockingExtension(client).GetGrafanaPrivateLinkResource(id); } - #endregion - /// Gets a collection of ManagedGrafanaResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedGrafanaResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedGrafanaResources and their operations over a ManagedGrafanaResource. public static ManagedGrafanaCollection GetManagedGrafanas(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedGrafanas(); + return GetGrafanaResourceGroupMockingExtension(resourceGroupResource).GetManagedGrafanas(); } /// @@ -126,16 +108,20 @@ public static ManagedGrafanaCollection GetManagedGrafanas(this ResourceGroupReso /// Grafana_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workspace name of Azure Managed Grafana. /// The cancellation token to use. - /// 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 static async Task> GetManagedGrafanaAsync(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedGrafanas().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + return await GetGrafanaResourceGroupMockingExtension(resourceGroupResource).GetManagedGrafanaAsync(workspaceName, cancellationToken).ConfigureAwait(false); } /// @@ -150,16 +136,20 @@ public static async Task> GetManagedGrafanaAsyn /// Grafana_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The workspace name of Azure Managed Grafana. /// The cancellation token to use. - /// 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 static Response GetManagedGrafana(this ResourceGroupResource resourceGroupResource, string workspaceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedGrafanas().Get(workspaceName, cancellationToken); + return GetGrafanaResourceGroupMockingExtension(resourceGroupResource).GetManagedGrafana(workspaceName, cancellationToken); } /// @@ -174,13 +164,17 @@ public static Response GetManagedGrafana(this ResourceGr /// Grafana_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedGrafanasAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedGrafanasAsync(cancellationToken); + return GetGrafanaSubscriptionMockingExtension(subscriptionResource).GetManagedGrafanasAsync(cancellationToken); } /// @@ -195,13 +189,17 @@ public static AsyncPageable GetManagedGrafanasAsync(this /// Grafana_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedGrafanas(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedGrafanas(cancellationToken); + return GetGrafanaSubscriptionMockingExtension(subscriptionResource).GetManagedGrafanas(cancellationToken); } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaResourceGroupMockingExtension.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f38e2cde826b --- /dev/null +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Grafana; + +namespace Azure.ResourceManager.Grafana.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class GrafanaResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected GrafanaResourceGroupMockingExtension() + { + } + + /// 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 GrafanaResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ManagedGrafanaResources in the ResourceGroupResource. + /// An object representing collection of ManagedGrafanaResources and their operations over a ManagedGrafanaResource. + public virtual ManagedGrafanaCollection GetManagedGrafanas() + { + return GetCachedClient(client => new ManagedGrafanaCollection(client, Id)); + } + + /// + /// Get the properties of a specific workspace for Grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName} + /// + /// + /// Operation Id + /// Grafana_Get + /// + /// + /// + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedGrafanaAsync(string workspaceName, CancellationToken cancellationToken = default) + { + return await GetManagedGrafanas().GetAsync(workspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a specific workspace for Grafana resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName} + /// + /// + /// Operation Id + /// Grafana_Get + /// + /// + /// + /// The workspace name of Azure Managed Grafana. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedGrafana(string workspaceName, CancellationToken cancellationToken = default) + { + return GetManagedGrafanas().Get(workspaceName, cancellationToken); + } + } +} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaSubscriptionMockingExtension.cs similarity index 86% rename from sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaSubscriptionMockingExtension.cs index ae9f0d11d0fd..ea223faaad03 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/GrafanaSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Grafana; -namespace Azure.ResourceManager.Grafana +namespace Azure.ResourceManager.Grafana.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class GrafanaSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _managedGrafanaGrafanaClientDiagnostics; private GrafanaRestOperations _managedGrafanaGrafanaRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected GrafanaSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal GrafanaSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetManagedGrafanasAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedGrafanaGrafanaRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedGrafanaGrafanaRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedGrafanaResource(Client, ManagedGrafanaData.DeserializeManagedGrafanaData(e)), ManagedGrafanaGrafanaClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedGrafanas", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedGrafanaResource(Client, ManagedGrafanaData.DeserializeManagedGrafanaData(e)), ManagedGrafanaGrafanaClientDiagnostics, Pipeline, "GrafanaSubscriptionMockingExtension.GetManagedGrafanas", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetManagedGrafanas(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedGrafanaGrafanaRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedGrafanaGrafanaRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedGrafanaResource(Client, ManagedGrafanaData.DeserializeManagedGrafanaData(e)), ManagedGrafanaGrafanaClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedGrafanas", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedGrafanaResource(Client, ManagedGrafanaData.DeserializeManagedGrafanaData(e)), ManagedGrafanaGrafanaClientDiagnostics, Pipeline, "GrafanaSubscriptionMockingExtension.GetManagedGrafanas", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d0e52b5e481a..000000000000 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Grafana -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ManagedGrafanaResources in the ResourceGroupResource. - /// An object representing collection of ManagedGrafanaResources and their operations over a ManagedGrafanaResource. - public virtual ManagedGrafanaCollection GetManagedGrafanas() - { - return GetCachedClient(Client => new ManagedGrafanaCollection(Client, Id)); - } - } -} diff --git a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs index 831be61daa7f..7b0c5875b2bd 100644 --- a/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs +++ b/sdk/grafana/Azure.ResourceManager.Grafana/src/Generated/ManagedGrafanaResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GrafanaPrivateEndpointConnectionResources and their operations over a GrafanaPrivateEndpointConnectionResource. public virtual GrafanaPrivateEndpointConnectionCollection GetGrafanaPrivateEndpointConnections() { - return GetCachedClient(Client => new GrafanaPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new GrafanaPrivateEndpointConnectionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual GrafanaPrivateEndpointConnectionCollection GetGrafanaPrivateEndpo /// /// The private endpoint connection name of Azure Managed Grafana. /// The cancellation token to use. - /// 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> GetGrafanaPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> Ge /// /// The private endpoint connection name of Azure Managed Grafana. /// The cancellation token to use. - /// 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 GetGrafanaPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetGrafanaPriv /// An object representing collection of GrafanaPrivateLinkResources and their operations over a GrafanaPrivateLinkResource. public virtual GrafanaPrivateLinkResourceCollection GetGrafanaPrivateLinkResources() { - return GetCachedClient(Client => new GrafanaPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new GrafanaPrivateLinkResourceCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual GrafanaPrivateLinkResourceCollection GetGrafanaPrivateLinkResourc /// /// The String to use. /// The cancellation token to use. - /// 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> GetGrafanaPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetGrafanaPrivat /// /// The String to use. /// The cancellation token to use. - /// 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 GetGrafanaPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesArmClientMockingExtension.cs b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesArmClientMockingExtension.cs new file mode 100644 index 000000000000..ecabe42d2ffe --- /dev/null +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.GraphServices; + +namespace Azure.ResourceManager.GraphServices.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class GraphServicesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected GraphServicesArmClientMockingExtension() + { + } + + /// 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 GraphServicesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal GraphServicesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual GraphServicesAccountResource GetGraphServicesAccountResource(ResourceIdentifier id) + { + GraphServicesAccountResource.ValidateResourceId(id); + return new GraphServicesAccountResource(Client, id); + } + } +} diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesExtensions.cs b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesExtensions.cs index 818cbb6b532f..ea9f1ff01e65 100644 --- a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesExtensions.cs +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.GraphServices.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.GraphServices @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.GraphServices /// A class to add extension methods to Azure.ResourceManager.GraphServices. public static partial class GraphServicesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static GraphServicesArmClientMockingExtension GetGraphServicesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new GraphServicesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static GraphServicesResourceGroupMockingExtension GetGraphServicesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new GraphServicesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static GraphServicesSubscriptionMockingExtension GetGraphServicesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new GraphServicesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region GraphServicesAccountResource /// /// 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. /// Returns a object. public static GraphServicesAccountResource GetGraphServicesAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GraphServicesAccountResource.ValidateResourceId(id); - return new GraphServicesAccountResource(client, id); - } - ); + return GetGraphServicesArmClientMockingExtension(client).GetGraphServicesAccountResource(id); } - #endregion - /// Gets a collection of GraphServicesAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of GraphServicesAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of GraphServicesAccountResources and their operations over a GraphServicesAccountResource. public static GraphServicesAccountResourceCollection GetGraphServicesAccountResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetGraphServicesAccountResources(); + return GetGraphServicesResourceGroupMockingExtension(resourceGroupResource).GetGraphServicesAccountResources(); } /// @@ -88,16 +76,20 @@ public static GraphServicesAccountResourceCollection GetGraphServicesAccountReso /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static async Task> GetGraphServicesAccountResourceAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetGraphServicesAccountResources().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetGraphServicesResourceGroupMockingExtension(resourceGroupResource).GetGraphServicesAccountResourceAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetGraphService /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the resource. /// The cancellation token to use. - /// 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 static Response GetGraphServicesAccountResource(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetGraphServicesAccountResources().Get(resourceName, cancellationToken); + return GetGraphServicesResourceGroupMockingExtension(resourceGroupResource).GetGraphServicesAccountResource(resourceName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetGraphServicesAccountReso /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetGraphServicesAccountResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGraphServicesAccountResourcesAsync(cancellationToken); + return GetGraphServicesSubscriptionMockingExtension(subscriptionResource).GetGraphServicesAccountResourcesAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetGraphServicesAccoun /// Accounts_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetGraphServicesAccountResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGraphServicesAccountResources(cancellationToken); + return GetGraphServicesSubscriptionMockingExtension(subscriptionResource).GetGraphServicesAccountResources(cancellationToken); } } } diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesResourceGroupMockingExtension.cs b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..d11d96961009 --- /dev/null +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.GraphServices; + +namespace Azure.ResourceManager.GraphServices.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class GraphServicesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected GraphServicesResourceGroupMockingExtension() + { + } + + /// 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 GraphServicesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GraphServicesAccountResources in the ResourceGroupResource. + /// An object representing collection of GraphServicesAccountResources and their operations over a GraphServicesAccountResource. + public virtual GraphServicesAccountResourceCollection GetGraphServicesAccountResources() + { + return GetCachedClient(client => new GraphServicesAccountResourceCollection(client, Id)); + } + + /// + /// Returns account resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGraphServicesAccountResourceAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetGraphServicesAccountResources().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns account resource for a given name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GraphServices/accounts/{resourceName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGraphServicesAccountResource(string resourceName, CancellationToken cancellationToken = default) + { + return GetGraphServicesAccountResources().Get(resourceName, cancellationToken); + } + } +} diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesSubscriptionMockingExtension.cs similarity index 85% rename from sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesSubscriptionMockingExtension.cs index a7de91f50a1b..4e647492ec25 100644 --- a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/GraphServicesSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.GraphServices; -namespace Azure.ResourceManager.GraphServices +namespace Azure.ResourceManager.GraphServices.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class GraphServicesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _graphServicesAccountResourceAccountsClientDiagnostics; private AccountsRestOperations _graphServicesAccountResourceAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected GraphServicesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal GraphServicesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetGraphServicesAccou { HttpMessage FirstPageRequest(int? pageSizeHint) => GraphServicesAccountResourceAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GraphServicesAccountResourceAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GraphServicesAccountResource(Client, GraphServicesAccountResourceData.DeserializeGraphServicesAccountResourceData(e)), GraphServicesAccountResourceAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGraphServicesAccountResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GraphServicesAccountResource(Client, GraphServicesAccountResourceData.DeserializeGraphServicesAccountResourceData(e)), GraphServicesAccountResourceAccountsClientDiagnostics, Pipeline, "GraphServicesSubscriptionMockingExtension.GetGraphServicesAccountResources", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetGraphServicesAccountRes { HttpMessage FirstPageRequest(int? pageSizeHint) => GraphServicesAccountResourceAccountsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GraphServicesAccountResourceAccountsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GraphServicesAccountResource(Client, GraphServicesAccountResourceData.DeserializeGraphServicesAccountResourceData(e)), GraphServicesAccountResourceAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGraphServicesAccountResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GraphServicesAccountResource(Client, GraphServicesAccountResourceData.DeserializeGraphServicesAccountResourceData(e)), GraphServicesAccountResourceAccountsClientDiagnostics, Pipeline, "GraphServicesSubscriptionMockingExtension.GetGraphServicesAccountResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 617b85b306ff..000000000000 --- a/sdk/graphservices/Azure.ResourceManager.GraphServices/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.GraphServices -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of GraphServicesAccountResources in the ResourceGroupResource. - /// An object representing collection of GraphServicesAccountResources and their operations over a GraphServicesAccountResource. - public virtual GraphServicesAccountResourceCollection GetGraphServicesAccountResources() - { - return GetCachedClient(Client => new GraphServicesAccountResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 4a1aacb3b9bc..000000000000 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.GuestConfiguration -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of GuestConfigurationVmAssignmentResources in the ArmResource. - /// An object representing collection of GuestConfigurationVmAssignmentResources and their operations over a GuestConfigurationVmAssignmentResource. - public virtual GuestConfigurationVmAssignmentCollection GetGuestConfigurationVmAssignments() - { - return GetCachedClient(Client => new GuestConfigurationVmAssignmentCollection(Client, Id)); - } - - /// Gets a collection of GuestConfigurationHcrpAssignmentResources in the ArmResource. - /// An object representing collection of GuestConfigurationHcrpAssignmentResources and their operations over a GuestConfigurationHcrpAssignmentResource. - public virtual GuestConfigurationHcrpAssignmentCollection GetGuestConfigurationHcrpAssignments() - { - return GetCachedClient(Client => new GuestConfigurationHcrpAssignmentCollection(Client, Id)); - } - - /// Gets a collection of GuestConfigurationVmssAssignmentResources in the ArmResource. - /// An object representing collection of GuestConfigurationVmssAssignmentResources and their operations over a GuestConfigurationVmssAssignmentResource. - public virtual GuestConfigurationVmssAssignmentCollection GetGuestConfigurationVmssAssignments() - { - return GetCachedClient(Client => new GuestConfigurationVmssAssignmentCollection(Client, Id)); - } - } -} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationArmClientMockingExtension.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationArmClientMockingExtension.cs new file mode 100644 index 000000000000..9b110f84c9f1 --- /dev/null +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationArmClientMockingExtension.cs @@ -0,0 +1,259 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.GuestConfiguration; + +namespace Azure.ResourceManager.GuestConfiguration.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class GuestConfigurationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected GuestConfigurationArmClientMockingExtension() + { + } + + /// 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 GuestConfigurationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal GuestConfigurationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GuestConfigurationVmAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of GuestConfigurationVmAssignmentResources and their operations over a GuestConfigurationVmAssignmentResource. + public virtual GuestConfigurationVmAssignmentCollection GetGuestConfigurationVmAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.Compute/virtualMachines", scope.ResourceType)); + } + return new GuestConfigurationVmAssignmentCollection(Client, scope); + } + + /// + /// Get information about a guest configuration assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName} + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGuestConfigurationVmAssignmentAsync(ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) + { + return await GetGuestConfigurationVmAssignments(scope).GetAsync(guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a guest configuration assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName} + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGuestConfigurationVmAssignment(ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) + { + return GetGuestConfigurationVmAssignments(scope).Get(guestConfigurationAssignmentName, cancellationToken); + } + + /// Gets a collection of GuestConfigurationHcrpAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of GuestConfigurationHcrpAssignmentResources and their operations over a GuestConfigurationHcrpAssignmentResource. + public virtual GuestConfigurationHcrpAssignmentCollection GetGuestConfigurationHcrpAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.HybridCompute/machines", scope.ResourceType)); + } + return new GuestConfigurationHcrpAssignmentCollection(Client, scope); + } + + /// + /// Get information about a guest configuration assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName} + /// + /// + /// Operation Id + /// GuestConfigurationHCRPAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGuestConfigurationHcrpAssignmentAsync(ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) + { + return await GetGuestConfigurationHcrpAssignments(scope).GetAsync(guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a guest configuration assignment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{guestConfigurationAssignmentName} + /// + /// + /// Operation Id + /// GuestConfigurationHCRPAssignments_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGuestConfigurationHcrpAssignment(ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) + { + return GetGuestConfigurationHcrpAssignments(scope).Get(guestConfigurationAssignmentName, cancellationToken); + } + + /// Gets a collection of GuestConfigurationVmssAssignmentResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of GuestConfigurationVmssAssignmentResources and their operations over a GuestConfigurationVmssAssignmentResource. + public virtual GuestConfigurationVmssAssignmentCollection GetGuestConfigurationVmssAssignments(ResourceIdentifier scope) + { + if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachineScaleSets")) + { + throw new ArgumentException(string.Format("Invalid resource type {0}, expected Microsoft.Compute/virtualMachineScaleSets", scope.ResourceType)); + } + return new GuestConfigurationVmssAssignmentCollection(Client, scope); + } + + /// + /// Get information about a guest configuration assignment for VMSS + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name} + /// + /// + /// Operation Id + /// GuestConfigurationAssignmentsVMSS_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGuestConfigurationVmssAssignmentAsync(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return await GetGuestConfigurationVmssAssignments(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get information about a guest configuration assignment for VMSS + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/{name} + /// + /// + /// Operation Id + /// GuestConfigurationAssignmentsVMSS_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// The guest configuration assignment name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGuestConfigurationVmssAssignment(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return GetGuestConfigurationVmssAssignments(scope).Get(name, 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 GuestConfigurationVmAssignmentResource GetGuestConfigurationVmAssignmentResource(ResourceIdentifier id) + { + GuestConfigurationVmAssignmentResource.ValidateResourceId(id); + return new GuestConfigurationVmAssignmentResource(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 GuestConfigurationHcrpAssignmentResource GetGuestConfigurationHcrpAssignmentResource(ResourceIdentifier id) + { + GuestConfigurationHcrpAssignmentResource.ValidateResourceId(id); + return new GuestConfigurationHcrpAssignmentResource(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 GuestConfigurationVmssAssignmentResource GetGuestConfigurationVmssAssignmentResource(ResourceIdentifier id) + { + GuestConfigurationVmssAssignmentResource.ValidateResourceId(id); + return new GuestConfigurationVmssAssignmentResource(Client, id); + } + } +} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationExtensions.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationExtensions.cs index d0b3856bb4c2..f16433886881 100644 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationExtensions.cs +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.GuestConfiguration.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.GuestConfiguration @@ -18,121 +19,34 @@ namespace Azure.ResourceManager.GuestConfiguration /// A class to add extension methods to Azure.ResourceManager.GuestConfiguration. public static partial class GuestConfigurationExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static GuestConfigurationArmClientMockingExtension GetGuestConfigurationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new GuestConfigurationArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static GuestConfigurationResourceGroupMockingExtension GetGuestConfigurationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new GuestConfigurationResourceGroupMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static GuestConfigurationSubscriptionMockingExtension GetGuestConfigurationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new GuestConfigurationSubscriptionMockingExtension(client, resource.Id)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region GuestConfigurationVmAssignmentResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static GuestConfigurationVmAssignmentResource GetGuestConfigurationVmAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - GuestConfigurationVmAssignmentResource.ValidateResourceId(id); - return new GuestConfigurationVmAssignmentResource(client, id); - } - ); - } - #endregion - - #region GuestConfigurationHcrpAssignmentResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static GuestConfigurationHcrpAssignmentResource GetGuestConfigurationHcrpAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - GuestConfigurationHcrpAssignmentResource.ValidateResourceId(id); - return new GuestConfigurationHcrpAssignmentResource(client, id); - } - ); - } - #endregion - - #region GuestConfigurationVmssAssignmentResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of GuestConfigurationVmAssignmentResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static GuestConfigurationVmssAssignmentResource GetGuestConfigurationVmssAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - GuestConfigurationVmssAssignmentResource.ValidateResourceId(id); - return new GuestConfigurationVmssAssignmentResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of GuestConfigurationVmAssignmentResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// An object representing collection of GuestConfigurationVmAssignmentResources and their operations over a GuestConfigurationVmAssignmentResource. public static GuestConfigurationVmAssignmentCollection GetGuestConfigurationVmAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetGuestConfigurationVmAssignments(); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmAssignments(scope); } /// @@ -147,21 +61,21 @@ public static GuestConfigurationVmAssignmentCollection GetGuestConfigurationVmAs /// GuestConfigurationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static async Task> GetGuestConfigurationVmAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return await client.GetGuestConfigurationVmAssignments(scope).GetAsync(guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmAssignmentAsync(scope, guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -176,34 +90,36 @@ public static async Task> GetGu /// GuestConfigurationAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachines. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static Response GetGuestConfigurationVmAssignment(this ArmClient client, ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachines", scope.ResourceType)); - } - return client.GetGuestConfigurationVmAssignments(scope).Get(guestConfigurationAssignmentName, cancellationToken); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmAssignment(scope, guestConfigurationAssignmentName, cancellationToken); } - /// Gets a collection of GuestConfigurationHcrpAssignmentResources in the ArmResource. + /// + /// Gets a collection of GuestConfigurationHcrpAssignmentResources 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. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// An object representing collection of GuestConfigurationHcrpAssignmentResources and their operations over a GuestConfigurationHcrpAssignmentResource. public static GuestConfigurationHcrpAssignmentCollection GetGuestConfigurationHcrpAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetGuestConfigurationHcrpAssignments(); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationHcrpAssignments(scope); } /// @@ -218,21 +134,21 @@ public static GuestConfigurationHcrpAssignmentCollection GetGuestConfigurationHc /// GuestConfigurationHCRPAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static async Task> GetGuestConfigurationHcrpAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return await client.GetGuestConfigurationHcrpAssignments(scope).GetAsync(guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); + return await GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationHcrpAssignmentAsync(scope, guestConfigurationAssignmentName, cancellationToken).ConfigureAwait(false); } /// @@ -247,34 +163,36 @@ public static async Task> Get /// GuestConfigurationHCRPAssignments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.HybridCompute/machines. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static Response GetGuestConfigurationHcrpAssignment(this ArmClient client, ResourceIdentifier scope, string guestConfigurationAssignmentName, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.HybridCompute/machines")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.HybridCompute/machines", scope.ResourceType)); - } - return client.GetGuestConfigurationHcrpAssignments(scope).Get(guestConfigurationAssignmentName, cancellationToken); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationHcrpAssignment(scope, guestConfigurationAssignmentName, cancellationToken); } - /// Gets a collection of GuestConfigurationVmssAssignmentResources in the ArmResource. + /// + /// Gets a collection of GuestConfigurationVmssAssignmentResources 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. Expected resource type includes the following: Microsoft.Compute/virtualMachineScaleSets. /// An object representing collection of GuestConfigurationVmssAssignmentResources and their operations over a GuestConfigurationVmssAssignmentResource. public static GuestConfigurationVmssAssignmentCollection GetGuestConfigurationVmssAssignments(this ArmClient client, ResourceIdentifier scope) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachineScaleSets")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachineScaleSets", scope.ResourceType)); - } - return GetArmResourceExtensionClient(client, scope).GetGuestConfigurationVmssAssignments(); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmssAssignments(scope); } /// @@ -289,21 +207,21 @@ public static GuestConfigurationVmssAssignmentCollection GetGuestConfigurationVm /// GuestConfigurationAssignmentsVMSS_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachineScaleSets. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static async Task> GetGuestConfigurationVmssAssignmentAsync(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachineScaleSets")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachineScaleSets", scope.ResourceType)); - } - return await client.GetGuestConfigurationVmssAssignments(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmssAssignmentAsync(scope, name, cancellationToken).ConfigureAwait(false); } /// @@ -318,21 +236,69 @@ public static async Task> Get /// GuestConfigurationAssignmentsVMSS_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. Expected resource type includes the following: Microsoft.Compute/virtualMachineScaleSets. /// The guest configuration assignment name. /// The cancellation token to use. - /// 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 static Response GetGuestConfigurationVmssAssignment(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - if (!scope.ResourceType.Equals("Microsoft.Compute/virtualMachineScaleSets")) - { - throw new ArgumentException(string.Format("Invalid resource type {0} expected Microsoft.Compute/virtualMachineScaleSets", scope.ResourceType)); - } - return client.GetGuestConfigurationVmssAssignments(scope).Get(name, cancellationToken); + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmssAssignment(scope, name, 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. + /// Returns a object. + public static GuestConfigurationVmAssignmentResource GetGuestConfigurationVmAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmAssignmentResource(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. + /// Returns a object. + public static GuestConfigurationHcrpAssignmentResource GetGuestConfigurationHcrpAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationHcrpAssignmentResource(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. + /// Returns a object. + public static GuestConfigurationVmssAssignmentResource GetGuestConfigurationVmssAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + return GetGuestConfigurationArmClientMockingExtension(client).GetGuestConfigurationVmssAssignmentResource(id); } } } diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationResourceGroupMockingExtension.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f5f6f91565ed --- /dev/null +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationResourceGroupMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.GuestConfiguration; + +namespace Azure.ResourceManager.GuestConfiguration.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class GuestConfigurationResourceGroupMockingExtension : ArmResource + { + private ClientDiagnostics _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics; + private GuestConfigurationAssignmentsRestOperations _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient; + + /// Initializes a new instance of the class for mocking. + protected GuestConfigurationResourceGroupMockingExtension() + { + } + + /// 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 GuestConfigurationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.GuestConfiguration", GuestConfigurationVmAssignmentResource.ResourceType.Namespace, Diagnostics); + private GuestConfigurationAssignmentsRestOperations GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient ??= new GuestConfigurationAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GuestConfigurationVmAssignmentResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List all guest configuration assignments for a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_RGList + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGuestConfigurationAssignmentsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient.CreateRGListRequest(Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GuestConfigurationVmAssignmentResource(Client, GuestConfigurationAssignmentData.DeserializeGuestConfigurationAssignmentData(e)), GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics, Pipeline, "GuestConfigurationResourceGroupMockingExtension.GetGuestConfigurationAssignments", "value", null, cancellationToken); + } + + /// + /// List all guest configuration assignments for a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_RGList + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGuestConfigurationAssignments(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient.CreateRGListRequest(Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GuestConfigurationVmAssignmentResource(Client, GuestConfigurationAssignmentData.DeserializeGuestConfigurationAssignmentData(e)), GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics, Pipeline, "GuestConfigurationResourceGroupMockingExtension.GetGuestConfigurationAssignments", "value", null, cancellationToken); + } + } +} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationSubscriptionMockingExtension.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationSubscriptionMockingExtension.cs new file mode 100644 index 000000000000..22e805189344 --- /dev/null +++ b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/GuestConfigurationSubscriptionMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.GuestConfiguration; + +namespace Azure.ResourceManager.GuestConfiguration.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class GuestConfigurationSubscriptionMockingExtension : ArmResource + { + private ClientDiagnostics _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics; + private GuestConfigurationAssignmentsRestOperations _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient; + + /// Initializes a new instance of the class for mocking. + protected GuestConfigurationSubscriptionMockingExtension() + { + } + + /// 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 GuestConfigurationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.GuestConfiguration", GuestConfigurationVmAssignmentResource.ResourceType.Namespace, Diagnostics); + private GuestConfigurationAssignmentsRestOperations GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient ??= new GuestConfigurationAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GuestConfigurationVmAssignmentResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List all guest configuration assignments for a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_SubscriptionList + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGuestConfigurationAssignmentsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient.CreateSubscriptionListRequest(Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GuestConfigurationVmAssignmentResource(Client, GuestConfigurationAssignmentData.DeserializeGuestConfigurationAssignmentData(e)), GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics, Pipeline, "GuestConfigurationSubscriptionMockingExtension.GetGuestConfigurationAssignments", "value", null, cancellationToken); + } + + /// + /// List all guest configuration assignments for a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments + /// + /// + /// Operation Id + /// GuestConfigurationAssignments_SubscriptionList + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGuestConfigurationAssignments(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient.CreateSubscriptionListRequest(Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GuestConfigurationVmAssignmentResource(Client, GuestConfigurationAssignmentData.DeserializeGuestConfigurationAssignmentData(e)), GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics, Pipeline, "GuestConfigurationSubscriptionMockingExtension.GetGuestConfigurationAssignments", "value", null, cancellationToken); + } + } +} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 9a7afd053dc7..000000000000 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.GuestConfiguration -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - private ClientDiagnostics _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics; - private GuestConfigurationAssignmentsRestOperations _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.GuestConfiguration", GuestConfigurationVmAssignmentResource.ResourceType.Namespace, Diagnostics); - private GuestConfigurationAssignmentsRestOperations GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient ??= new GuestConfigurationAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GuestConfigurationVmAssignmentResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - } -} diff --git a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs deleted file mode 100644 index 00789dcd9057..000000000000 --- a/sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.GuestConfiguration -{ - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource - { - private ClientDiagnostics _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics; - private GuestConfigurationAssignmentsRestOperations _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() - { - } - - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics GuestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.GuestConfiguration", GuestConfigurationVmAssignmentResource.ResourceType.Namespace, Diagnostics); - private GuestConfigurationAssignmentsRestOperations GuestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient => _guestConfigurationVmAssignmentGuestConfigurationAssignmentsRestClient ??= new GuestConfigurationAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GuestConfigurationVmAssignmentResource.ResourceType)); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - } -} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs index d6f900d7e4b6..a8d235a32ceb 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HardwareSecurityModulesPrivateEndpointConnectionResources and their operations over a HardwareSecurityModulesPrivateEndpointConnectionResource. public virtual HardwareSecurityModulesPrivateEndpointConnectionCollection GetHardwareSecurityModulesPrivateEndpointConnections() { - return GetCachedClient(Client => new HardwareSecurityModulesPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HardwareSecurityModulesPrivateEndpointConnectionCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual HardwareSecurityModulesPrivateEndpointConnectionCollection GetHar /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// 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> GetHardwareSecurityModulesPrivateEndpointConnectionAsync(string peConnectionName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// 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 GetHardwareSecurityModulesPrivateEndpointConnection(string peConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesArmClientMockingExtension.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesArmClientMockingExtension.cs new file mode 100644 index 000000000000..bb25ac02dbc1 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; + +namespace Azure.ResourceManager.HardwareSecurityModules.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HardwareSecurityModulesArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HardwareSecurityModulesArmClientMockingExtension() + { + } + + /// 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 HardwareSecurityModulesArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HardwareSecurityModulesArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CloudHsmClusterResource GetCloudHsmClusterResource(ResourceIdentifier id) + { + CloudHsmClusterResource.ValidateResourceId(id); + return new CloudHsmClusterResource(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 HardwareSecurityModulesPrivateEndpointConnectionResource GetHardwareSecurityModulesPrivateEndpointConnectionResource(ResourceIdentifier id) + { + HardwareSecurityModulesPrivateEndpointConnectionResource.ValidateResourceId(id); + return new HardwareSecurityModulesPrivateEndpointConnectionResource(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 DedicatedHsmResource GetDedicatedHsmResource(ResourceIdentifier id) + { + DedicatedHsmResource.ValidateResourceId(id); + return new DedicatedHsmResource(Client, id); + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs index 83f70412d38d..7da3b44b8020 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules @@ -18,100 +19,81 @@ namespace Azure.ResourceManager.HardwareSecurityModules /// A class to add extension methods to Azure.ResourceManager.HardwareSecurityModules. public static partial class HardwareSecurityModulesExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HardwareSecurityModulesArmClientMockingExtension GetHardwareSecurityModulesArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HardwareSecurityModulesArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HardwareSecurityModulesResourceGroupMockingExtension GetHardwareSecurityModulesResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HardwareSecurityModulesResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HardwareSecurityModulesSubscriptionMockingExtension GetHardwareSecurityModulesSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HardwareSecurityModulesSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CloudHsmClusterResource /// /// 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. /// Returns a object. public static CloudHsmClusterResource GetCloudHsmClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudHsmClusterResource.ValidateResourceId(id); - return new CloudHsmClusterResource(client, id); - } - ); + return GetHardwareSecurityModulesArmClientMockingExtension(client).GetCloudHsmClusterResource(id); } - #endregion - #region HardwareSecurityModulesPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HardwareSecurityModulesPrivateEndpointConnectionResource GetHardwareSecurityModulesPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HardwareSecurityModulesPrivateEndpointConnectionResource.ValidateResourceId(id); - return new HardwareSecurityModulesPrivateEndpointConnectionResource(client, id); - } - ); + return GetHardwareSecurityModulesArmClientMockingExtension(client).GetHardwareSecurityModulesPrivateEndpointConnectionResource(id); } - #endregion - #region DedicatedHsmResource /// /// 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. /// Returns a object. public static DedicatedHsmResource GetDedicatedHsmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DedicatedHsmResource.ValidateResourceId(id); - return new DedicatedHsmResource(client, id); - } - ); + return GetHardwareSecurityModulesArmClientMockingExtension(client).GetDedicatedHsmResource(id); } - #endregion - /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CloudHsmClusterResources and their operations over a CloudHsmClusterResource. public static CloudHsmClusterCollection GetCloudHsmClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCloudHsmClusters(); + return GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetCloudHsmClusters(); } /// @@ -126,16 +108,20 @@ public static CloudHsmClusterCollection GetCloudHsmClusters(this ResourceGroupRe /// CloudHsmClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 24 characters in length. /// The cancellation token to use. - /// 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 static async Task> GetCloudHsmClusterAsync(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCloudHsmClusters().GetAsync(cloudHsmClusterName, cancellationToken).ConfigureAwait(false); + return await GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetCloudHsmClusterAsync(cloudHsmClusterName, cancellationToken).ConfigureAwait(false); } /// @@ -150,24 +136,34 @@ public static async Task> GetCloudHsmClusterAs /// CloudHsmClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 24 characters in length. /// The cancellation token to use. - /// 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 static Response GetCloudHsmCluster(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCloudHsmClusters().Get(cloudHsmClusterName, cancellationToken); + return GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetCloudHsmCluster(cloudHsmClusterName, cancellationToken); } - /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. + /// + /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DedicatedHsmResources and their operations over a DedicatedHsmResource. public static DedicatedHsmCollection GetDedicatedHsms(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDedicatedHsms(); + return GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHsms(); } /// @@ -182,16 +178,20 @@ public static DedicatedHsmCollection GetDedicatedHsms(this ResourceGroupResource /// DedicatedHsm_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated HSM. /// The cancellation token to use. - /// 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 static async Task> GetDedicatedHsmAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDedicatedHsms().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHsmAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -206,16 +206,20 @@ public static async Task> GetDedicatedHsmAsync(th /// DedicatedHsm_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated HSM. /// The cancellation token to use. - /// 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 static Response GetDedicatedHsm(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDedicatedHsms().Get(name, cancellationToken); + return GetHardwareSecurityModulesResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHsm(name, cancellationToken); } /// @@ -230,6 +234,10 @@ public static Response GetDedicatedHsm(this ResourceGroupR /// CloudHsmClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The page-continuation token to use with a paged version of this API. @@ -237,7 +245,7 @@ public static Response GetDedicatedHsm(this ResourceGroupR /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCloudHsmClustersAsync(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudHsmClustersAsync(skiptoken, cancellationToken); + return GetHardwareSecurityModulesSubscriptionMockingExtension(subscriptionResource).GetCloudHsmClustersAsync(skiptoken, cancellationToken); } /// @@ -252,6 +260,10 @@ public static AsyncPageable GetCloudHsmClustersAsync(th /// CloudHsmClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The page-continuation token to use with a paged version of this API. @@ -259,7 +271,7 @@ public static AsyncPageable GetCloudHsmClustersAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCloudHsmClusters(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudHsmClusters(skiptoken, cancellationToken); + return GetHardwareSecurityModulesSubscriptionMockingExtension(subscriptionResource).GetCloudHsmClusters(skiptoken, cancellationToken); } /// @@ -274,6 +286,10 @@ public static Pageable GetCloudHsmClusters(this Subscri /// DedicatedHsm_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -281,7 +297,7 @@ public static Pageable GetCloudHsmClusters(this Subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDedicatedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedHsmsAsync(top, cancellationToken); + return GetHardwareSecurityModulesSubscriptionMockingExtension(subscriptionResource).GetDedicatedHsmsAsync(top, cancellationToken); } /// @@ -296,6 +312,10 @@ public static AsyncPageable GetDedicatedHsmsAsync(this Sub /// DedicatedHsm_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Maximum number of results to return. @@ -303,7 +323,7 @@ public static AsyncPageable GetDedicatedHsmsAsync(this Sub /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDedicatedHsms(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedHsms(top, cancellationToken); + return GetHardwareSecurityModulesSubscriptionMockingExtension(subscriptionResource).GetDedicatedHsms(top, cancellationToken); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesResourceGroupMockingExtension.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..67acb18b375d --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; + +namespace Azure.ResourceManager.HardwareSecurityModules.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HardwareSecurityModulesResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HardwareSecurityModulesResourceGroupMockingExtension() + { + } + + /// 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 HardwareSecurityModulesResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. + /// An object representing collection of CloudHsmClusterResources and their operations over a CloudHsmClusterResource. + public virtual CloudHsmClusterCollection GetCloudHsmClusters() + { + return GetCachedClient(client => new CloudHsmClusterCollection(client, Id)); + } + + /// + /// Gets the specified Cloud HSM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// + /// + /// Operation Id + /// CloudHsmClusters_Get + /// + /// + /// + /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 24 characters in length. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudHsmClusterAsync(string cloudHsmClusterName, CancellationToken cancellationToken = default) + { + return await GetCloudHsmClusters().GetAsync(cloudHsmClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Cloud HSM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// + /// + /// Operation Id + /// CloudHsmClusters_Get + /// + /// + /// + /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 24 characters in length. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudHsmCluster(string cloudHsmClusterName, CancellationToken cancellationToken = default) + { + return GetCloudHsmClusters().Get(cloudHsmClusterName, cancellationToken); + } + + /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. + /// An object representing collection of DedicatedHsmResources and their operations over a DedicatedHsmResource. + public virtual DedicatedHsmCollection GetDedicatedHsms() + { + return GetCachedClient(client => new DedicatedHsmCollection(client, Id)); + } + + /// + /// Gets the specified Azure dedicated HSM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// + /// + /// Operation Id + /// DedicatedHsm_Get + /// + /// + /// + /// The name of the dedicated HSM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDedicatedHsmAsync(string name, CancellationToken cancellationToken = default) + { + return await GetDedicatedHsms().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Azure dedicated HSM. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// + /// + /// Operation Id + /// DedicatedHsm_Get + /// + /// + /// + /// The name of the dedicated HSM. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDedicatedHsm(string name, CancellationToken cancellationToken = default) + { + return GetDedicatedHsms().Get(name, cancellationToken); + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesSubscriptionMockingExtension.cs similarity index 87% rename from sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesSubscriptionMockingExtension.cs index 616ea4d5fbc2..8ebb2fac197c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesSubscriptionMockingExtension.cs @@ -11,26 +11,27 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; -namespace Azure.ResourceManager.HardwareSecurityModules +namespace Azure.ResourceManager.HardwareSecurityModules.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HardwareSecurityModulesSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _cloudHsmClusterClientDiagnostics; private CloudHsmClustersRestOperations _cloudHsmClusterRestClient; private ClientDiagnostics _dedicatedHsmClientDiagnostics; private DedicatedHsmRestOperations _dedicatedHsmRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HardwareSecurityModulesSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HardwareSecurityModulesSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetCloudHsmClustersAsync(s { HttpMessage FirstPageRequest(int? pageSizeHint) => CloudHsmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudHsmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCloudHsmClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "HardwareSecurityModulesSubscriptionMockingExtension.GetCloudHsmClusters", "value", "nextLink", cancellationToken); } /// @@ -88,7 +89,7 @@ public virtual Pageable GetCloudHsmClusters(string skip { HttpMessage FirstPageRequest(int? pageSizeHint) => CloudHsmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudHsmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCloudHsmClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "HardwareSecurityModulesSubscriptionMockingExtension.GetCloudHsmClusters", "value", "nextLink", cancellationToken); } /// @@ -111,7 +112,7 @@ public virtual AsyncPageable GetDedicatedHsmsAsync(int? to { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "HardwareSecurityModulesSubscriptionMockingExtension.GetDedicatedHsms", "value", "nextLink", cancellationToken); } /// @@ -134,7 +135,7 @@ public virtual Pageable GetDedicatedHsms(int? top = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedHsms", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "HardwareSecurityModulesSubscriptionMockingExtension.GetDedicatedHsms", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d0c2f2a63ad1..000000000000 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HardwareSecurityModules -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. - /// An object representing collection of CloudHsmClusterResources and their operations over a CloudHsmClusterResource. - public virtual CloudHsmClusterCollection GetCloudHsmClusters() - { - return GetCachedClient(Client => new CloudHsmClusterCollection(Client, Id)); - } - - /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. - /// An object representing collection of DedicatedHsmResources and their operations over a DedicatedHsmResource. - public virtual DedicatedHsmCollection GetDedicatedHsms() - { - return GetCachedClient(Client => new DedicatedHsmCollection(Client, Id)); - } - } -} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersArmClientMockingExtension.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersArmClientMockingExtension.cs new file mode 100644 index 000000000000..1551549492eb --- /dev/null +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight.Containers; + +namespace Azure.ResourceManager.HDInsight.Containers.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HDInsightContainersArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HDInsightContainersArmClientMockingExtension() + { + } + + /// 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 HDInsightContainersArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HDInsightContainersArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HDInsightClusterPoolResource GetHDInsightClusterPoolResource(ResourceIdentifier id) + { + HDInsightClusterPoolResource.ValidateResourceId(id); + return new HDInsightClusterPoolResource(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 HDInsightClusterResource GetHDInsightClusterResource(ResourceIdentifier id) + { + HDInsightClusterResource.ValidateResourceId(id); + return new HDInsightClusterResource(Client, id); + } + } +} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersExtensions.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersExtensions.cs index c4b7b4dcb717..dadda10baa3a 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersExtensions.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight.Containers.Mocking; using Azure.ResourceManager.HDInsight.Containers.Models; using Azure.ResourceManager.Resources; @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.HDInsight.Containers /// A class to add extension methods to Azure.ResourceManager.HDInsight.Containers. public static partial class HDInsightContainersExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HDInsightContainersArmClientMockingExtension GetHDInsightContainersArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HDInsightContainersArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HDInsightContainersResourceGroupMockingExtension GetHDInsightContainersResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HDInsightContainersResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HDInsightContainersSubscriptionMockingExtension GetHDInsightContainersSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HDInsightContainersSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HDInsightClusterPoolResource /// /// 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. /// Returns a object. public static HDInsightClusterPoolResource GetHDInsightClusterPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightClusterPoolResource.ValidateResourceId(id); - return new HDInsightClusterPoolResource(client, id); - } - ); + return GetHDInsightContainersArmClientMockingExtension(client).GetHDInsightClusterPoolResource(id); } - #endregion - #region HDInsightClusterResource /// /// 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. /// Returns a object. public static HDInsightClusterResource GetHDInsightClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightClusterResource.ValidateResourceId(id); - return new HDInsightClusterResource(client, id); - } - ); + return GetHDInsightContainersArmClientMockingExtension(client).GetHDInsightClusterResource(id); } - #endregion - /// Gets a collection of HDInsightClusterPoolResources in the ResourceGroupResource. + /// + /// Gets a collection of HDInsightClusterPoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HDInsightClusterPoolResources and their operations over a HDInsightClusterPoolResource. public static HDInsightClusterPoolCollection GetHDInsightClusterPools(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHDInsightClusterPools(); + return GetHDInsightContainersResourceGroupMockingExtension(resourceGroupResource).GetHDInsightClusterPools(); } /// @@ -108,16 +93,20 @@ public static HDInsightClusterPoolCollection GetHDInsightClusterPools(this Resou /// ClusterPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster pool. /// The cancellation token to use. - /// 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 static async Task> GetHDInsightClusterPoolAsync(this ResourceGroupResource resourceGroupResource, string clusterPoolName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHDInsightClusterPools().GetAsync(clusterPoolName, cancellationToken).ConfigureAwait(false); + return await GetHDInsightContainersResourceGroupMockingExtension(resourceGroupResource).GetHDInsightClusterPoolAsync(clusterPoolName, cancellationToken).ConfigureAwait(false); } /// @@ -132,16 +121,20 @@ public static async Task> GetHDInsightClu /// ClusterPools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster pool. /// The cancellation token to use. - /// 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 static Response GetHDInsightClusterPool(this ResourceGroupResource resourceGroupResource, string clusterPoolName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHDInsightClusterPools().Get(clusterPoolName, cancellationToken); + return GetHDInsightContainersResourceGroupMockingExtension(resourceGroupResource).GetHDInsightClusterPool(clusterPoolName, cancellationToken); } /// @@ -156,13 +149,17 @@ public static Response GetHDInsightClusterPool(thi /// ClusterPools_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHDInsightClusterPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightClusterPoolsAsync(cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetHDInsightClusterPoolsAsync(cancellationToken); } /// @@ -177,13 +174,17 @@ public static AsyncPageable GetHDInsightClusterPoo /// ClusterPools_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHDInsightClusterPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightClusterPools(cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetHDInsightClusterPools(cancellationToken); } /// @@ -198,6 +199,10 @@ public static Pageable GetHDInsightClusterPools(th /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -206,9 +211,7 @@ public static Pageable GetHDInsightClusterPools(th /// is null. public static async Task> CheckHDInsightNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHDInsightNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).CheckHDInsightNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -223,6 +226,10 @@ public static async Task> CheckHDInsig /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -231,9 +238,7 @@ public static async Task> CheckHDInsig /// is null. public static Response CheckHDInsightNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHDInsightNameAvailability(location, content, cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).CheckHDInsightNameAvailability(location, content, cancellationToken); } /// @@ -248,6 +253,10 @@ public static Response CheckHDInsightNameAvaila /// AvailableClusterPoolVersions_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -255,7 +264,7 @@ public static Response CheckHDInsightNameAvaila /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableClusterPoolVersionsByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterPoolVersionsByLocationAsync(location, cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterPoolVersionsByLocationAsync(location, cancellationToken); } /// @@ -270,6 +279,10 @@ public static AsyncPageable GetAvailableClusterPoolVersionsB /// AvailableClusterPoolVersions_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -277,7 +290,7 @@ public static AsyncPageable GetAvailableClusterPoolVersionsB /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableClusterPoolVersionsByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterPoolVersionsByLocation(location, cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterPoolVersionsByLocation(location, cancellationToken); } /// @@ -292,6 +305,10 @@ public static Pageable GetAvailableClusterPoolVersionsByLoca /// AvailableClusterVersions_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -299,7 +316,7 @@ public static Pageable GetAvailableClusterPoolVersionsByLoca /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableClusterVersionsByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterVersionsByLocationAsync(location, cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterVersionsByLocationAsync(location, cancellationToken); } /// @@ -314,6 +331,10 @@ public static AsyncPageable GetAvailableClusterVersions /// AvailableClusterVersions_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Azure region. @@ -321,7 +342,7 @@ public static AsyncPageable GetAvailableClusterVersions /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableClusterVersionsByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableClusterVersionsByLocation(location, cancellationToken); + return GetHDInsightContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableClusterVersionsByLocation(location, cancellationToken); } } } diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersResourceGroupMockingExtension.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..fe332c62c6cb --- /dev/null +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight.Containers; + +namespace Azure.ResourceManager.HDInsight.Containers.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HDInsightContainersResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HDInsightContainersResourceGroupMockingExtension() + { + } + + /// 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 HDInsightContainersResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HDInsightClusterPoolResources in the ResourceGroupResource. + /// An object representing collection of HDInsightClusterPoolResources and their operations over a HDInsightClusterPoolResource. + public virtual HDInsightClusterPoolCollection GetHDInsightClusterPools() + { + return GetCachedClient(client => new HDInsightClusterPoolCollection(client, Id)); + } + + /// + /// Gets a cluster pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName} + /// + /// + /// Operation Id + /// ClusterPools_Get + /// + /// + /// + /// The name of the cluster pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHDInsightClusterPoolAsync(string clusterPoolName, CancellationToken cancellationToken = default) + { + return await GetHDInsightClusterPools().GetAsync(clusterPoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a cluster pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName} + /// + /// + /// Operation Id + /// ClusterPools_Get + /// + /// + /// + /// The name of the cluster pool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHDInsightClusterPool(string clusterPoolName, CancellationToken cancellationToken = default) + { + return GetHDInsightClusterPools().Get(clusterPoolName, cancellationToken); + } + } +} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersSubscriptionMockingExtension.cs similarity index 89% rename from sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersSubscriptionMockingExtension.cs index 2ad106dbe68d..d340bfc54787 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/HDInsightContainersSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight.Containers; using Azure.ResourceManager.HDInsight.Containers.Models; -namespace Azure.ResourceManager.HDInsight.Containers +namespace Azure.ResourceManager.HDInsight.Containers.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HDInsightContainersSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _hdInsightClusterPoolClusterPoolsClientDiagnostics; private ClusterPoolsRestOperations _hdInsightClusterPoolClusterPoolsRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _availableClusterVersionsClientDiagnostics; private AvailableClusterVersionsRestOperations _availableClusterVersionsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HDInsightContainersSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HDInsightContainersSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -75,7 +76,7 @@ public virtual AsyncPageable GetHDInsightClusterPo { HttpMessage FirstPageRequest(int? pageSizeHint) => HDInsightClusterPoolClusterPoolsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HDInsightClusterPoolClusterPoolsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterPoolResource(Client, HDInsightClusterPoolData.DeserializeHDInsightClusterPoolData(e)), HDInsightClusterPoolClusterPoolsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightClusterPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterPoolResource(Client, HDInsightClusterPoolData.DeserializeHDInsightClusterPoolData(e)), HDInsightClusterPoolClusterPoolsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetHDInsightClusterPools", "value", "nextLink", cancellationToken); } /// @@ -97,7 +98,7 @@ public virtual Pageable GetHDInsightClusterPools(C { HttpMessage FirstPageRequest(int? pageSizeHint) => HDInsightClusterPoolClusterPoolsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HDInsightClusterPoolClusterPoolsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterPoolResource(Client, HDInsightClusterPoolData.DeserializeHDInsightClusterPoolData(e)), HDInsightClusterPoolClusterPoolsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightClusterPools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterPoolResource(Client, HDInsightClusterPoolData.DeserializeHDInsightClusterPoolData(e)), HDInsightClusterPoolClusterPoolsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetHDInsightClusterPools", "value", "nextLink", cancellationToken); } /// @@ -116,9 +117,12 @@ public virtual Pageable GetHDInsightClusterPools(C /// The name of the Azure region. /// The name and type of the resource. /// The cancellation token to use. + /// is null. public virtual async Task> CheckHDInsightNameAvailabilityAsync(AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHDInsightNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightContainersSubscriptionMockingExtension.CheckHDInsightNameAvailability"); scope.Start(); try { @@ -148,9 +152,12 @@ public virtual async Task> CheckHDInsi /// The name of the Azure region. /// The name and type of the resource. /// The cancellation token to use. + /// is null. public virtual Response CheckHDInsightNameAvailability(AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHDInsightNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightContainersSubscriptionMockingExtension.CheckHDInsightNameAvailability"); scope.Start(); try { @@ -184,7 +191,7 @@ public virtual AsyncPageable GetAvailableClusterPoolVersions { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableClusterPoolVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableClusterPoolVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ClusterPoolVersion.DeserializeClusterPoolVersion, AvailableClusterPoolVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterPoolVersionsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ClusterPoolVersion.DeserializeClusterPoolVersion, AvailableClusterPoolVersionsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetAvailableClusterPoolVersionsByLocation", "value", "nextLink", cancellationToken); } /// @@ -207,7 +214,7 @@ public virtual Pageable GetAvailableClusterPoolVersionsByLoc { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableClusterPoolVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableClusterPoolVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ClusterPoolVersion.DeserializeClusterPoolVersion, AvailableClusterPoolVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterPoolVersionsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ClusterPoolVersion.DeserializeClusterPoolVersion, AvailableClusterPoolVersionsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetAvailableClusterPoolVersionsByLocation", "value", "nextLink", cancellationToken); } /// @@ -230,7 +237,7 @@ public virtual AsyncPageable GetAvailableClusterVersion { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableClusterVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableClusterVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, HDInsightClusterVersion.DeserializeHDInsightClusterVersion, AvailableClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterVersionsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, HDInsightClusterVersion.DeserializeHDInsightClusterVersion, AvailableClusterVersionsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetAvailableClusterVersionsByLocation", "value", "nextLink", cancellationToken); } /// @@ -253,7 +260,7 @@ public virtual Pageable GetAvailableClusterVersionsByLo { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableClusterVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableClusterVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, HDInsightClusterVersion.DeserializeHDInsightClusterVersion, AvailableClusterVersionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableClusterVersionsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, HDInsightClusterVersion.DeserializeHDInsightClusterVersion, AvailableClusterVersionsClientDiagnostics, Pipeline, "HDInsightContainersSubscriptionMockingExtension.GetAvailableClusterVersionsByLocation", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3eeaf0da54ea..000000000000 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HDInsight.Containers -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HDInsightClusterPoolResources in the ResourceGroupResource. - /// An object representing collection of HDInsightClusterPoolResources and their operations over a HDInsightClusterPoolResource. - public virtual HDInsightClusterPoolCollection GetHDInsightClusterPools() - { - return GetCachedClient(Client => new HDInsightClusterPoolCollection(Client, Id)); - } - } -} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/HDInsightClusterPoolResource.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/HDInsightClusterPoolResource.cs index fd1a76556a8e..12ef8c378540 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/HDInsightClusterPoolResource.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight.Containers/src/Generated/HDInsightClusterPoolResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HDInsightClusterResources and their operations over a HDInsightClusterResource. public virtual HDInsightClusterCollection GetHDInsightClusters() { - return GetCachedClient(Client => new HDInsightClusterCollection(Client, Id)); + return GetCachedClient(client => new HDInsightClusterCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HDInsightClusterCollection GetHDInsightClusters() /// /// The name of the HDInsight cluster. /// The cancellation token to use. - /// 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> GetHDInsightClusterAsync(string clusterName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetHDInsightCluste /// /// The name of the HDInsight cluster. /// The cancellation token to use. - /// 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 GetHDInsightCluster(string clusterName, CancellationToken cancellationToken = default) { diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightArmClientMockingExtension.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightArmClientMockingExtension.cs new file mode 100644 index 000000000000..20b89124f94c --- /dev/null +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight; + +namespace Azure.ResourceManager.HDInsight.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HDInsightArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HDInsightArmClientMockingExtension() + { + } + + /// 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 HDInsightArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HDInsightArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HDInsightApplicationResource GetHDInsightApplicationResource(ResourceIdentifier id) + { + HDInsightApplicationResource.ValidateResourceId(id); + return new HDInsightApplicationResource(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 HDInsightClusterResource GetHDInsightClusterResource(ResourceIdentifier id) + { + HDInsightClusterResource.ValidateResourceId(id); + return new HDInsightClusterResource(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 HDInsightPrivateEndpointConnectionResource GetHDInsightPrivateEndpointConnectionResource(ResourceIdentifier id) + { + HDInsightPrivateEndpointConnectionResource.ValidateResourceId(id); + return new HDInsightPrivateEndpointConnectionResource(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 HDInsightPrivateLinkResource GetHDInsightPrivateLinkResource(ResourceIdentifier id) + { + HDInsightPrivateLinkResource.ValidateResourceId(id); + return new HDInsightPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightExtensions.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightExtensions.cs index cd9ce4463aac..d1636ae7f0b4 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightExtensions.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight.Mocking; using Azure.ResourceManager.HDInsight.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.HDInsight /// A class to add extension methods to Azure.ResourceManager.HDInsight. public static partial class HDInsightExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HDInsightArmClientMockingExtension GetHDInsightArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HDInsightArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HDInsightResourceGroupMockingExtension GetHDInsightResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HDInsightResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HDInsightSubscriptionMockingExtension GetHDInsightSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HDInsightSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HDInsightApplicationResource /// /// 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. /// Returns a object. public static HDInsightApplicationResource GetHDInsightApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightApplicationResource.ValidateResourceId(id); - return new HDInsightApplicationResource(client, id); - } - ); + return GetHDInsightArmClientMockingExtension(client).GetHDInsightApplicationResource(id); } - #endregion - #region HDInsightClusterResource /// /// 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. /// Returns a object. public static HDInsightClusterResource GetHDInsightClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightClusterResource.ValidateResourceId(id); - return new HDInsightClusterResource(client, id); - } - ); + return GetHDInsightArmClientMockingExtension(client).GetHDInsightClusterResource(id); } - #endregion - #region HDInsightPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static HDInsightPrivateEndpointConnectionResource GetHDInsightPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightPrivateEndpointConnectionResource.ValidateResourceId(id); - return new HDInsightPrivateEndpointConnectionResource(client, id); - } - ); + return GetHDInsightArmClientMockingExtension(client).GetHDInsightPrivateEndpointConnectionResource(id); } - #endregion - #region HDInsightPrivateLinkResource /// /// 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. /// Returns a object. public static HDInsightPrivateLinkResource GetHDInsightPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HDInsightPrivateLinkResource.ValidateResourceId(id); - return new HDInsightPrivateLinkResource(client, id); - } - ); + return GetHDInsightArmClientMockingExtension(client).GetHDInsightPrivateLinkResource(id); } - #endregion - /// Gets a collection of HDInsightClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of HDInsightClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HDInsightClusterResources and their operations over a HDInsightClusterResource. public static HDInsightClusterCollection GetHDInsightClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHDInsightClusters(); + return GetHDInsightResourceGroupMockingExtension(resourceGroupResource).GetHDInsightClusters(); } /// @@ -146,16 +125,20 @@ public static HDInsightClusterCollection GetHDInsightClusters(this ResourceGroup /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetHDInsightClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHDInsightClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetHDInsightResourceGroupMockingExtension(resourceGroupResource).GetHDInsightClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetHDInsightCluster /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetHDInsightCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHDInsightClusters().Get(clusterName, cancellationToken); + return GetHDInsightResourceGroupMockingExtension(resourceGroupResource).GetHDInsightCluster(clusterName, cancellationToken); } /// @@ -194,13 +181,17 @@ public static Response GetHDInsightCluster(this Resour /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHDInsightClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightClustersAsync(cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightClustersAsync(cancellationToken); } /// @@ -215,13 +206,17 @@ public static AsyncPageable GetHDInsightClustersAsync( /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHDInsightClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightClusters(cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightClusters(cancellationToken); } /// @@ -236,13 +231,17 @@ public static Pageable GetHDInsightClusters(this Subsc /// Locations_GetCapabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. /// The cancellation token to use. public static async Task> GetHDInsightCapabilitiesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightCapabilitiesAsync(location, cancellationToken).ConfigureAwait(false); + return await GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightCapabilitiesAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -257,13 +256,17 @@ public static async Task> GetHDInsightCapa /// Locations_GetCapabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. /// The cancellation token to use. public static Response GetHDInsightCapabilities(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightCapabilities(location, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightCapabilities(location, cancellationToken); } /// @@ -278,6 +281,10 @@ public static Response GetHDInsightCapabilities(thi /// Locations_ListUsages /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -285,7 +292,7 @@ public static Response GetHDInsightCapabilities(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHDInsightUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightUsagesAsync(location, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightUsagesAsync(location, cancellationToken); } /// @@ -300,6 +307,10 @@ public static AsyncPageable GetHDInsightUsagesAsync(this Subscri /// Locations_ListUsages /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -307,7 +318,7 @@ public static AsyncPageable GetHDInsightUsagesAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHDInsightUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightUsages(location, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightUsages(location, cancellationToken); } /// @@ -322,13 +333,17 @@ public static Pageable GetHDInsightUsages(this SubscriptionResou /// Locations_ListBillingSpecs /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. /// The cancellation token to use. public static async Task> GetHDInsightBillingSpecsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightBillingSpecsAsync(location, cancellationToken).ConfigureAwait(false); + return await GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightBillingSpecsAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -343,13 +358,17 @@ public static async Task> GetHDInsight /// Locations_ListBillingSpecs /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. /// The cancellation token to use. public static Response GetHDInsightBillingSpecs(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHDInsightBillingSpecs(location, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).GetHDInsightBillingSpecs(location, cancellationToken); } /// @@ -364,6 +383,10 @@ public static Response GetHDInsightBillingSpecs /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -372,9 +395,7 @@ public static Response GetHDInsightBillingSpecs /// is null. public static async Task> CheckHDInsightNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHDInsightNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetHDInsightSubscriptionMockingExtension(subscriptionResource).CheckHDInsightNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -389,6 +410,10 @@ public static async Task> CheckHDInsig /// Locations_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -397,9 +422,7 @@ public static async Task> CheckHDInsig /// is null. public static Response CheckHDInsightNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckHDInsightNameAvailability(location, content, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).CheckHDInsightNameAvailability(location, content, cancellationToken); } /// @@ -414,6 +437,10 @@ public static Response CheckHDInsightNameAvaila /// Locations_ValidateClusterCreateRequest /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -422,9 +449,7 @@ public static Response CheckHDInsightNameAvaila /// is null. public static async Task> ValidateHDInsightClusterCreationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightClusterCreationValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateHDInsightClusterCreationAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetHDInsightSubscriptionMockingExtension(subscriptionResource).ValidateHDInsightClusterCreationAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -439,6 +464,10 @@ public static async Task> Valid /// Locations_ValidateClusterCreateRequest /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The Azure location (region) for which to make the request. @@ -447,9 +476,7 @@ public static async Task> Valid /// is null. public static Response ValidateHDInsightClusterCreation(this SubscriptionResource subscriptionResource, AzureLocation location, HDInsightClusterCreationValidateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateHDInsightClusterCreation(location, content, cancellationToken); + return GetHDInsightSubscriptionMockingExtension(subscriptionResource).ValidateHDInsightClusterCreation(location, content, cancellationToken); } } } diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightResourceGroupMockingExtension.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..1a1db79c98e1 --- /dev/null +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight; + +namespace Azure.ResourceManager.HDInsight.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HDInsightResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HDInsightResourceGroupMockingExtension() + { + } + + /// 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 HDInsightResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HDInsightClusterResources in the ResourceGroupResource. + /// An object representing collection of HDInsightClusterResources and their operations over a HDInsightClusterResource. + public virtual HDInsightClusterCollection GetHDInsightClusters() + { + return GetCachedClient(client => new HDInsightClusterCollection(client, Id)); + } + + /// + /// Gets the specified cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHDInsightClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetHDInsightClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHDInsightCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetHDInsightClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightSubscriptionMockingExtension.cs similarity index 88% rename from sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightSubscriptionMockingExtension.cs index a9fdaa7cfaa7..4ae8cd6d7b9c 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/HDInsightSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HDInsight; using Azure.ResourceManager.HDInsight.Models; -namespace Azure.ResourceManager.HDInsight +namespace Azure.ResourceManager.HDInsight.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HDInsightSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _hdInsightClusterClustersClientDiagnostics; private ClustersRestOperations _hdInsightClusterClustersRestClient; private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HDInsightSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HDInsightSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetHDInsightClustersAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => HDInsightClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HDInsightClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterResource(Client, HDInsightClusterData.DeserializeHDInsightClusterData(e)), HDInsightClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterResource(Client, HDInsightClusterData.DeserializeHDInsightClusterData(e)), HDInsightClusterClustersClientDiagnostics, Pipeline, "HDInsightSubscriptionMockingExtension.GetHDInsightClusters", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetHDInsightClusters(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => HDInsightClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HDInsightClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterResource(Client, HDInsightClusterData.DeserializeHDInsightClusterData(e)), HDInsightClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HDInsightClusterResource(Client, HDInsightClusterData.DeserializeHDInsightClusterData(e)), HDInsightClusterClustersClientDiagnostics, Pipeline, "HDInsightSubscriptionMockingExtension.GetHDInsightClusters", "value", "nextLink", cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual Pageable GetHDInsightClusters(Cancellat /// The cancellation token to use. public virtual async Task> GetHDInsightCapabilitiesAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHDInsightCapabilities"); + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.GetHDInsightCapabilities"); scope.Start(); try { @@ -140,7 +141,7 @@ public virtual async Task> GetHDInsightCap /// The cancellation token to use. public virtual Response GetHDInsightCapabilities(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHDInsightCapabilities"); + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.GetHDInsightCapabilities"); scope.Start(); try { @@ -173,7 +174,7 @@ public virtual Response GetHDInsightCapabilities(Az public virtual AsyncPageable GetHDInsightUsagesAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationsRestClient.CreateListUsagesRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, HDInsightUsage.DeserializeHDInsightUsage, LocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightUsages", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, HDInsightUsage.DeserializeHDInsightUsage, LocationsClientDiagnostics, Pipeline, "HDInsightSubscriptionMockingExtension.GetHDInsightUsages", "value", null, cancellationToken); } /// @@ -195,7 +196,7 @@ public virtual AsyncPageable GetHDInsightUsagesAsync(AzureLocati public virtual Pageable GetHDInsightUsages(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationsRestClient.CreateListUsagesRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, HDInsightUsage.DeserializeHDInsightUsage, LocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHDInsightUsages", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, HDInsightUsage.DeserializeHDInsightUsage, LocationsClientDiagnostics, Pipeline, "HDInsightSubscriptionMockingExtension.GetHDInsightUsages", "value", null, cancellationToken); } /// @@ -215,7 +216,7 @@ public virtual Pageable GetHDInsightUsages(AzureLocation locatio /// The cancellation token to use. public virtual async Task> GetHDInsightBillingSpecsAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHDInsightBillingSpecs"); + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.GetHDInsightBillingSpecs"); scope.Start(); try { @@ -246,7 +247,7 @@ public virtual async Task> GetHDInsigh /// The cancellation token to use. public virtual Response GetHDInsightBillingSpecs(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetHDInsightBillingSpecs"); + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.GetHDInsightBillingSpecs"); scope.Start(); try { @@ -276,9 +277,12 @@ public virtual Response GetHDInsightBillingSpec /// The Azure location (region) for which to make the request. /// The HDInsightNameAvailabilityContent to use. /// The cancellation token to use. + /// is null. public virtual async Task> CheckHDInsightNameAvailabilityAsync(AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHDInsightNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.CheckHDInsightNameAvailability"); scope.Start(); try { @@ -308,9 +312,12 @@ public virtual async Task> CheckHDInsi /// The Azure location (region) for which to make the request. /// The HDInsightNameAvailabilityContent to use. /// The cancellation token to use. + /// is null. public virtual Response CheckHDInsightNameAvailability(AzureLocation location, HDInsightNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckHDInsightNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.CheckHDInsightNameAvailability"); scope.Start(); try { @@ -340,9 +347,12 @@ public virtual Response CheckHDInsightNameAvail /// The Azure location (region) for which to make the request. /// The HDInsightClusterCreationValidateContent to use. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateHDInsightClusterCreationAsync(AzureLocation location, HDInsightClusterCreationValidateContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateHDInsightClusterCreation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.ValidateHDInsightClusterCreation"); scope.Start(); try { @@ -372,9 +382,12 @@ public virtual async Task> Vali /// The Azure location (region) for which to make the request. /// The HDInsightClusterCreationValidateContent to use. /// The cancellation token to use. + /// is null. public virtual Response ValidateHDInsightClusterCreation(AzureLocation location, HDInsightClusterCreationValidateContent content, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateHDInsightClusterCreation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LocationsClientDiagnostics.CreateScope("HDInsightSubscriptionMockingExtension.ValidateHDInsightClusterCreation"); scope.Start(); try { diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 1155b189ff6c..000000000000 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HDInsight -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HDInsightClusterResources in the ResourceGroupResource. - /// An object representing collection of HDInsightClusterResources and their operations over a HDInsightClusterResource. - public virtual HDInsightClusterCollection GetHDInsightClusters() - { - return GetCachedClient(Client => new HDInsightClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/HDInsightClusterResource.cs b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/HDInsightClusterResource.cs index bcfffb23d678..6c665ad24cdd 100644 --- a/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/HDInsightClusterResource.cs +++ b/sdk/hdinsight/Azure.ResourceManager.HDInsight/src/Generated/HDInsightClusterResource.cs @@ -114,7 +114,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HDInsightApplicationResources and their operations over a HDInsightApplicationResource. public virtual HDInsightApplicationCollection GetHDInsightApplications() { - return GetCachedClient(Client => new HDInsightApplicationCollection(Client, Id)); + return GetCachedClient(client => new HDInsightApplicationCollection(client, Id)); } /// @@ -132,8 +132,8 @@ public virtual HDInsightApplicationCollection GetHDInsightApplications() /// /// The constant value for the application name. /// The cancellation token to use. - /// 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> GetHDInsightApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { @@ -155,8 +155,8 @@ public virtual async Task> GetHDInsightAp /// /// The constant value for the application name. /// The cancellation token to use. - /// 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 GetHDInsightApplication(string applicationName, CancellationToken cancellationToken = default) { @@ -167,7 +167,7 @@ public virtual Response GetHDInsightApplication(st /// An object representing collection of HDInsightPrivateEndpointConnectionResources and their operations over a HDInsightPrivateEndpointConnectionResource. public virtual HDInsightPrivateEndpointConnectionCollection GetHDInsightPrivateEndpointConnections() { - return GetCachedClient(Client => new HDInsightPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new HDInsightPrivateEndpointConnectionCollection(client, Id)); } /// @@ -185,8 +185,8 @@ public virtual HDInsightPrivateEndpointConnectionCollection GetHDInsightPrivateE /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetHDInsightPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -208,8 +208,8 @@ public virtual async Task> /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetHDInsightPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -220,7 +220,7 @@ public virtual Response GetHDInsight /// An object representing collection of HDInsightPrivateLinkResources and their operations over a HDInsightPrivateLinkResource. public virtual HDInsightPrivateLinkResourceCollection GetHDInsightPrivateLinkResources() { - return GetCachedClient(Client => new HDInsightPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new HDInsightPrivateLinkResourceCollection(client, Id)); } /// @@ -238,8 +238,8 @@ public virtual HDInsightPrivateLinkResourceCollection GetHDInsightPrivateLinkRes /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetHDInsightPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -261,8 +261,8 @@ public virtual async Task> GetHDInsightPr /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetHDInsightPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotArmClientMockingExtension.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotArmClientMockingExtension.cs new file mode 100644 index 000000000000..bf0275dbdab1 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HealthBot; + +namespace Azure.ResourceManager.HealthBot.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class HealthBotArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HealthBotArmClientMockingExtension() + { + } + + /// 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 HealthBotArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal HealthBotArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HealthBotResource GetHealthBotResource(ResourceIdentifier id) + { + HealthBotResource.ValidateResourceId(id); + return new HealthBotResource(Client, id); + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs index e73640138de7..b2542c5a5292 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.HealthBot.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HealthBot @@ -18,62 +19,49 @@ namespace Azure.ResourceManager.HealthBot /// A class to add extension methods to Azure.ResourceManager.HealthBot. public static partial class HealthBotExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static HealthBotArmClientMockingExtension GetHealthBotArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new HealthBotArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static HealthBotResourceGroupMockingExtension GetHealthBotResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new HealthBotResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static HealthBotSubscriptionMockingExtension GetHealthBotSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new HealthBotSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HealthBotResource /// /// 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. /// Returns a object. public static HealthBotResource GetHealthBotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HealthBotResource.ValidateResourceId(id); - return new HealthBotResource(client, id); - } - ); + return GetHealthBotArmClientMockingExtension(client).GetHealthBotResource(id); } - #endregion - /// Gets a collection of HealthBotResources in the ResourceGroupResource. + /// + /// Gets a collection of HealthBotResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HealthBotResources and their operations over a HealthBotResource. public static HealthBotCollection GetHealthBots(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHealthBots(); + return GetHealthBotResourceGroupMockingExtension(resourceGroupResource).GetHealthBots(); } /// @@ -88,16 +76,20 @@ public static HealthBotCollection GetHealthBots(this ResourceGroupResource resou /// Bots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bot resource. /// The cancellation token to use. - /// 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 static async Task> GetHealthBotAsync(this ResourceGroupResource resourceGroupResource, string botName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHealthBots().GetAsync(botName, cancellationToken).ConfigureAwait(false); + return await GetHealthBotResourceGroupMockingExtension(resourceGroupResource).GetHealthBotAsync(botName, cancellationToken).ConfigureAwait(false); } /// @@ -112,16 +104,20 @@ public static async Task> GetHealthBotAsync(this Res /// Bots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Bot resource. /// The cancellation token to use. - /// 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 static Response GetHealthBot(this ResourceGroupResource resourceGroupResource, string botName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHealthBots().Get(botName, cancellationToken); + return GetHealthBotResourceGroupMockingExtension(resourceGroupResource).GetHealthBot(botName, cancellationToken); } /// @@ -136,13 +132,17 @@ public static Response GetHealthBot(this ResourceGroupResourc /// Bots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHealthBotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthBotsAsync(cancellationToken); + return GetHealthBotSubscriptionMockingExtension(subscriptionResource).GetHealthBotsAsync(cancellationToken); } /// @@ -157,13 +157,17 @@ public static AsyncPageable GetHealthBotsAsync(this Subscript /// Bots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHealthBots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHealthBots(cancellationToken); + return GetHealthBotSubscriptionMockingExtension(subscriptionResource).GetHealthBots(cancellationToken); } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotResourceGroupMockingExtension.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..4630ae7bb5f5 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HealthBot; + +namespace Azure.ResourceManager.HealthBot.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class HealthBotResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected HealthBotResourceGroupMockingExtension() + { + } + + /// 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 HealthBotResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HealthBotResources in the ResourceGroupResource. + /// An object representing collection of HealthBotResources and their operations over a HealthBotResource. + public virtual HealthBotCollection GetHealthBots() + { + return GetCachedClient(client => new HealthBotCollection(client, Id)); + } + + /// + /// Get a HealthBot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName} + /// + /// + /// Operation Id + /// Bots_Get + /// + /// + /// + /// The name of the Bot resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHealthBotAsync(string botName, CancellationToken cancellationToken = default) + { + return await GetHealthBots().GetAsync(botName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a HealthBot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName} + /// + /// + /// Operation Id + /// Bots_Get + /// + /// + /// + /// The name of the Bot resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHealthBot(string botName, CancellationToken cancellationToken = default) + { + return GetHealthBots().Get(botName, cancellationToken); + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotSubscriptionMockingExtension.cs similarity index 85% rename from sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotSubscriptionMockingExtension.cs index 08f6dc02f77f..3e0610903cc6 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.HealthBot; -namespace Azure.ResourceManager.HealthBot +namespace Azure.ResourceManager.HealthBot.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class HealthBotSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _healthBotBotsClientDiagnostics; private BotsRestOperations _healthBotBotsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected HealthBotSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HealthBotSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetHealthBotsAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotBotsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotBotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthBots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "HealthBotSubscriptionMockingExtension.GetHealthBots", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetHealthBots(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotBotsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotBotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHealthBots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "HealthBotSubscriptionMockingExtension.GetHealthBots", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index ac0fcbbffa60..000000000000 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.HealthBot -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HealthBotResources in the ResourceGroupResource. - /// An object representing collection of HealthBotResources and their operations over a HealthBotResource. - public virtual HealthBotCollection GetHealthBots() - { - return GetCachedClient(Client => new HealthBotCollection(Client, Id)); - } - } -} From b49ad6a0a568175e59a92e2245ef0ac0ea9172f7 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 18 Oct 2023 16:44:47 +0000 Subject: [PATCH 8/8] Update SDK codes co_da_1 --- .../Generated/CommunicationDomainResource.cs | 6 +- .../src/Generated/EmailServiceResource.cs | 6 +- .../CommunicationArmClientMockingExtension.cs | 87 + .../Extensions/CommunicationExtensions.cs | 185 +- ...municationResourceGroupMockingExtension.cs | 145 ++ ...municationSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../CapacityReservationGroupResource.cs | 6 +- .../src/Generated/CloudServiceResource.cs | 12 +- .../CommunityGalleryImageResource.cs | 6 +- .../src/Generated/CommunityGalleryResource.cs | 6 +- .../Generated/DedicatedHostGroupResource.cs | 6 +- .../src/Generated/DiskAccessResource.cs | 6 +- .../ComputeArmClientMockingExtension.cs | 543 ++++++ .../Generated/Extensions/ComputeExtensions.cs | 1585 ++++++++++------- .../ComputeResourceGroupMockingExtension.cs | 853 +++++++++ ...=> ComputeSubscriptionMockingExtension.cs} | 509 +++++- .../ResourceGroupResourceExtensionClient.cs | 139 -- .../Generated/GalleryApplicationResource.cs | 6 +- .../src/Generated/GalleryImageResource.cs | 6 +- .../src/Generated/GalleryResource.cs | 12 +- .../Generated/RestorePointGroupResource.cs | 6 +- .../src/Generated/RestorePointResource.cs | 6 +- .../Generated/SharedGalleryImageResource.cs | 6 +- .../src/Generated/SharedGalleryResource.cs | 6 +- .../src/Generated/VirtualMachineResource.cs | 12 +- .../VirtualMachineScaleSetResource.cs | 12 +- .../VirtualMachineScaleSetVmResource.cs | 12 +- ...identialLedgerArmClientMockingExtension.cs | 63 + .../ConfidentialLedgerExtensions.cs | 147 +- ...tialLedgerResourceGroupMockingExtension.cs | 145 ++ ...tialLedgerSubscriptionMockingExtension.cs} | 31 +- .../ResourceGroupResourceExtensionClient.cs | 48 - .../ConfluentArmClientMockingExtension.cs | 51 + .../Extensions/ConfluentExtensions.cs | 122 +- ...ConfluentResourceGroupMockingExtension.cs} | 75 +- ... ConfluentSubscriptionMockingExtension.cs} | 25 +- ...dVMwarevSphereArmClientMockingExtension.cs | 183 ++ .../ConnectedVMwarevSphereExtensions.cs | 489 +++-- ...arevSphereResourceGroupMockingExtension.cs | 463 +++++ ...arevSphereSubscriptionMockingExtension.cs} | 45 +- .../ResourceGroupResourceExtensionClient.cs | 90 - .../src/Generated/VCenterResource.cs | 6 +- .../src/Generated/VirtualMachineResource.cs | 18 +- ...> ConsumptionArmClientMockingExtension.cs} | 343 +++- .../Extensions/ConsumptionExtensions.cs | 525 +++--- ...umptionManagementGroupMockingExtension.cs} | 17 +- ...onsumptionSubscriptionMockingExtension.cs} | 17 +- ...s => ConsumptionTenantMockingExtension.cs} | 12 +- ...ontainerAppConnectedEnvironmentResource.cs | 18 +- .../src/Generated/ContainerAppJobResource.cs | 6 +- .../ContainerAppManagedEnvironmentResource.cs | 30 +- .../src/Generated/ContainerAppResource.cs | 30 +- .../Generated/ContainerAppRevisionResource.cs | 6 +- .../AppContainersArmClientMockingExtension.cs | 291 +++ .../Extensions/AppContainersExtensions.cs | 478 ++--- ...ContainersResourceGroupMockingExtension.cs | 251 +++ ...ContainersSubscriptionMockingExtension.cs} | 37 +- .../ResourceGroupResourceExtensionClient.cs | 62 - ...tainerInstanceArmClientMockingExtension.cs | 51 + .../Extensions/ContainerInstanceExtensions.cs | 134 +- ...rInstanceResourceGroupMockingExtension.cs} | 75 +- ...erInstanceSubscriptionMockingExtension.cs} | 29 +- .../Generated/ContainerRegistryResource.cs | 60 +- ...tainerRegistryArmClientMockingExtension.cs | 171 ++ .../Extensions/ContainerRegistryExtensions.cs | 226 ++- ...erRegistryResourceGroupMockingExtension.cs | 92 + ...erRegistrySubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../ContainerServiceFleetResource.cs | 6 +- .../ContainerServiceManagedClusterResource.cs | 24 +- ...ntainerServiceArmClientMockingExtension.cs | 183 ++ .../Extensions/ContainerServiceExtensions.cs | 349 ++-- ...nerServiceResourceGroupMockingExtension.cs | 251 +++ ...nerServiceSubscriptionMockingExtension.cs} | 40 +- .../ResourceGroupResourceExtensionClient.cs | 62 - .../src/Generated/CassandraClusterResource.cs | 12 +- .../Generated/CassandraKeyspaceResource.cs | 12 +- .../src/Generated/CosmosDBAccountResource.cs | 84 +- .../src/Generated/CosmosDBLocationResource.cs | 2 +- .../Generated/CosmosDBSqlContainerResource.cs | 18 +- .../Generated/CosmosDBSqlDatabaseResource.cs | 12 +- .../CosmosDBArmClientMockingExtension.cs | 531 ++++++ .../Extensions/CosmosDBExtensions.cs | 741 ++++---- .../CosmosDBResourceGroupMockingExtension.cs | 198 ++ ...> CosmosDBSubscriptionMockingExtension.cs} | 74 +- ...t.cs => CosmosDBTenantMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 55 - .../src/Generated/GremlinDatabaseResource.cs | 6 +- .../src/Generated/MongoClusterResource.cs | 6 +- .../src/Generated/MongoDBDatabaseResource.cs | 6 +- .../CosmosDBForPostgreSqlClusterResource.cs | 48 +- ...BForPostgreSqlArmClientMockingExtension.cs | 147 ++ .../CosmosDBForPostgreSqlExtensions.cs | 200 +-- ...PostgreSqlResourceGroupMockingExtension.cs | 92 + ...PostgreSqlSubscriptionMockingExtension.cs} | 27 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Extensions/ArmResourceExtensionClient.cs | 379 ---- ...CostManagementArmClientMockingExtension.cs | 679 +++++++ .../Extensions/CostManagementExtensions.cs | 804 +++++---- ...> CostManagementTenantMockingExtension.cs} | 375 +++- .../ConnectorResourceFormatResource.cs | 6 +- ...stomerInsightsArmClientMockingExtension.cs | 207 +++ .../Extensions/CustomerInsightsExtensions.cs | 249 ++- ...erInsightsResourceGroupMockingExtension.cs | 92 + ...erInsightsSubscriptionMockingExtension.cs} | 17 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/HubResource.cs | 72 +- .../DataBoxArmClientMockingExtension.cs | 51 + .../Generated/Extensions/DataBoxExtensions.cs | 176 +- ...> DataBoxResourceGroupMockingExtension.cs} | 93 +- ...=> DataBoxSubscriptionMockingExtension.cs} | 47 +- .../Generated/DataBoxEdgeDeviceResource.cs | 54 +- .../src/Generated/DataBoxEdgeRoleResource.cs | 6 +- .../DataBoxEdgeStorageAccountResource.cs | 6 +- .../DataBoxEdgeArmClientMockingExtension.cs | 231 +++ .../Extensions/DataBoxEdgeExtensions.cs | 287 ++- ...ataBoxEdgeResourceGroupMockingExtension.cs | 92 + ...ataBoxEdgeSubscriptionMockingExtension.cs} | 21 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../src/Generated/DatadogMonitorResource.cs | 12 +- .../DatadogArmClientMockingExtension.cs | 75 + .../Generated/Extensions/DatadogExtensions.cs | 130 +- .../DatadogResourceGroupMockingExtension.cs | 92 + ...=> DatadogSubscriptionMockingExtension.cs} | 25 +- .../ResourceGroupResourceExtensionClient.cs | 41 - ...ataFactoryManagedVirtualNetworkResource.cs | 6 +- .../src/Generated/DataFactoryResource.cs | 66 +- .../DataFactoryArmClientMockingExtension.cs | 195 ++ .../Extensions/DataFactoryExtensions.cs | 268 ++- ...ataFactoryResourceGroupMockingExtension.cs | 94 + ...ataFactorySubscriptionMockingExtension.cs} | 37 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../DataLakeAnalyticsAccountResource.cs | 24 +- ...lyticsStorageAccountInformationResource.cs | 6 +- ...aLakeAnalyticsArmClientMockingExtension.cs | 111 ++ .../Extensions/DataLakeAnalyticsExtensions.cs | 177 +- ...eAnalyticsResourceGroupMockingExtension.cs | 92 + ...eAnalyticsSubscriptionMockingExtension.cs} | 35 +- .../ResourceGroupResourceExtensionClient.cs | 41 - .../Generated/DataLakeStoreAccountResource.cs | 18 +- .../DataLakeStoreArmClientMockingExtension.cs | 87 + .../Extensions/DataLakeStoreExtensions.cs | 163 +- ...aLakeStoreResourceGroupMockingExtension.cs | 92 + ...aLakeStoreSubscriptionMockingExtension.cs} | 39 +- .../ResourceGroupResourceExtensionClient.cs | 41 - 146 files changed, 13078 insertions(+), 5505 deletions(-) create mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationArmClientMockingExtension.cs create mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationResourceGroupMockingExtension.cs rename sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CommunicationSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeArmClientMockingExtension.cs create mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeResourceGroupMockingExtension.cs rename sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ComputeSubscriptionMockingExtension.cs} (81%) delete mode 100644 sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerArmClientMockingExtension.cs create mode 100644 sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerResourceGroupMockingExtension.cs rename sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ConfidentialLedgerSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentArmClientMockingExtension.cs rename sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => ConfluentResourceGroupMockingExtension.cs} (54%) rename sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ConfluentSubscriptionMockingExtension.cs} (90%) create mode 100644 sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereArmClientMockingExtension.cs create mode 100644 sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereResourceGroupMockingExtension.cs rename sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ConnectedVMwarevSphereSubscriptionMockingExtension.cs} (90%) delete mode 100644 sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/{ArmResourceExtensionClient.cs => ConsumptionArmClientMockingExtension.cs} (61%) rename sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/{ManagementGroupResourceExtensionClient.cs => ConsumptionManagementGroupMockingExtension.cs} (88%) rename sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ConsumptionSubscriptionMockingExtension.cs} (89%) rename sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/{TenantResourceExtensionClient.cs => ConsumptionTenantMockingExtension.cs} (66%) create mode 100644 sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersArmClientMockingExtension.cs create mode 100644 sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersResourceGroupMockingExtension.cs rename sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => AppContainersSubscriptionMockingExtension.cs} (91%) delete mode 100644 sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceArmClientMockingExtension.cs rename sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => ContainerInstanceResourceGroupMockingExtension.cs} (59%) rename sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ContainerInstanceSubscriptionMockingExtension.cs} (88%) create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryArmClientMockingExtension.cs create mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryResourceGroupMockingExtension.cs rename sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ContainerRegistrySubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceArmClientMockingExtension.cs create mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceResourceGroupMockingExtension.cs rename sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => ContainerServiceSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBArmClientMockingExtension.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBResourceGroupMockingExtension.cs rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CosmosDBSubscriptionMockingExtension.cs} (80%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/{TenantResourceExtensionClient.cs => CosmosDBTenantMockingExtension.cs} (77%) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlArmClientMockingExtension.cs create mode 100644 sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlResourceGroupMockingExtension.cs rename sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CosmosDBForPostgreSqlSubscriptionMockingExtension.cs} (84%) delete mode 100644 sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs delete mode 100644 sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/ArmResourceExtensionClient.cs create mode 100644 sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementArmClientMockingExtension.cs rename sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/{TenantResourceExtensionClient.cs => CostManagementTenantMockingExtension.cs} (78%) create mode 100644 sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsArmClientMockingExtension.cs create mode 100644 sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsResourceGroupMockingExtension.cs rename sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => CustomerInsightsSubscriptionMockingExtension.cs} (83%) delete mode 100644 sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxArmClientMockingExtension.cs rename sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/{ResourceGroupResourceExtensionClient.cs => DataBoxResourceGroupMockingExtension.cs} (70%) rename sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataBoxSubscriptionMockingExtension.cs} (87%) create mode 100644 sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeArmClientMockingExtension.cs create mode 100644 sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeResourceGroupMockingExtension.cs rename sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataBoxEdgeSubscriptionMockingExtension.cs} (89%) delete mode 100644 sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogArmClientMockingExtension.cs create mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogResourceGroupMockingExtension.cs rename sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DatadogSubscriptionMockingExtension.cs} (92%) delete mode 100644 sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryArmClientMockingExtension.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryResourceGroupMockingExtension.cs rename sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataFactorySubscriptionMockingExtension.cs} (85%) delete mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsArmClientMockingExtension.cs create mode 100644 sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsResourceGroupMockingExtension.cs rename sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataLakeAnalyticsSubscriptionMockingExtension.cs} (87%) delete mode 100644 sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreArmClientMockingExtension.cs create mode 100644 sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreResourceGroupMockingExtension.cs rename sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/{SubscriptionResourceExtensionClient.cs => DataLakeStoreSubscriptionMockingExtension.cs} (88%) delete mode 100644 sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationDomainResource.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationDomainResource.cs index d48bd4688e1b..36b6fbf8ec3d 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationDomainResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/CommunicationDomainResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SenderUsernameResources and their operations over a SenderUsernameResource. public virtual SenderUsernameResourceCollection GetSenderUsernameResources() { - return GetCachedClient(Client => new SenderUsernameResourceCollection(Client, Id)); + return GetCachedClient(client => new SenderUsernameResourceCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual SenderUsernameResourceCollection GetSenderUsernameResources() /// /// The valid sender Username. /// The cancellation token to use. - /// 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> GetSenderUsernameResourceAsync(string senderUsername, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetSenderUsernameRes /// /// The valid sender Username. /// The cancellation token to use. - /// 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 GetSenderUsernameResource(string senderUsername, CancellationToken cancellationToken = default) { diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/EmailServiceResource.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/EmailServiceResource.cs index e15729698fd5..8470da6b4c6f 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/EmailServiceResource.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/EmailServiceResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CommunicationDomainResources and their operations over a CommunicationDomainResource. public virtual CommunicationDomainResourceCollection GetCommunicationDomainResources() { - return GetCachedClient(Client => new CommunicationDomainResourceCollection(Client, Id)); + return GetCachedClient(client => new CommunicationDomainResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CommunicationDomainResourceCollection GetCommunicationDomainResou /// /// The name of the Domains resource. /// The cancellation token to use. - /// 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> GetCommunicationDomainResourceAsync(string domainName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCommunicatio /// /// The name of the Domains resource. /// The cancellation token to use. - /// 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 GetCommunicationDomainResource(string domainName, CancellationToken cancellationToken = default) { diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationArmClientMockingExtension.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationArmClientMockingExtension.cs new file mode 100644 index 000000000000..2415b29ae617 --- /dev/null +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Communication; + +namespace Azure.ResourceManager.Communication.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CommunicationArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CommunicationArmClientMockingExtension() + { + } + + /// 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 CommunicationArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CommunicationArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CommunicationServiceResource GetCommunicationServiceResource(ResourceIdentifier id) + { + CommunicationServiceResource.ValidateResourceId(id); + return new CommunicationServiceResource(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 CommunicationDomainResource GetCommunicationDomainResource(ResourceIdentifier id) + { + CommunicationDomainResource.ValidateResourceId(id); + return new CommunicationDomainResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EmailServiceResource GetEmailServiceResource(ResourceIdentifier id) + { + EmailServiceResource.ValidateResourceId(id); + return new EmailServiceResource(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 SenderUsernameResource GetSenderUsernameResource(ResourceIdentifier id) + { + SenderUsernameResource.ValidateResourceId(id); + return new SenderUsernameResource(Client, id); + } + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationExtensions.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationExtensions.cs index 5d35a0e2ef53..35769c50025a 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationExtensions.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Communication.Mocking; using Azure.ResourceManager.Communication.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.Communication /// A class to add extension methods to Azure.ResourceManager.Communication. public static partial class CommunicationExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CommunicationArmClientMockingExtension GetCommunicationArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CommunicationArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CommunicationResourceGroupMockingExtension GetCommunicationResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CommunicationResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CommunicationSubscriptionMockingExtension GetCommunicationSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CommunicationSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CommunicationServiceResource /// /// 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. /// Returns a object. public static CommunicationServiceResource GetCommunicationServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommunicationServiceResource.ValidateResourceId(id); - return new CommunicationServiceResource(client, id); - } - ); + return GetCommunicationArmClientMockingExtension(client).GetCommunicationServiceResource(id); } - #endregion - #region CommunicationDomainResource /// /// 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. /// Returns a object. public static CommunicationDomainResource GetCommunicationDomainResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommunicationDomainResource.ValidateResourceId(id); - return new CommunicationDomainResource(client, id); - } - ); + return GetCommunicationArmClientMockingExtension(client).GetCommunicationDomainResource(id); } - #endregion - #region EmailServiceResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static EmailServiceResource GetEmailServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - EmailServiceResource.ValidateResourceId(id); - return new EmailServiceResource(client, id); - } - ); + return GetCommunicationArmClientMockingExtension(client).GetEmailServiceResource(id); } - #endregion - #region SenderUsernameResource /// /// 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. /// Returns a object. public static SenderUsernameResource GetSenderUsernameResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SenderUsernameResource.ValidateResourceId(id); - return new SenderUsernameResource(client, id); - } - ); + return GetCommunicationArmClientMockingExtension(client).GetSenderUsernameResource(id); } - #endregion - /// Gets a collection of CommunicationServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of CommunicationServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CommunicationServiceResources and their operations over a CommunicationServiceResource. public static CommunicationServiceResourceCollection GetCommunicationServiceResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCommunicationServiceResources(); + return GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetCommunicationServiceResources(); } /// @@ -146,16 +125,20 @@ public static CommunicationServiceResourceCollection GetCommunicationServiceReso /// CommunicationServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the CommunicationService resource. /// The cancellation token to use. - /// 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 static async Task> GetCommunicationServiceResourceAsync(this ResourceGroupResource resourceGroupResource, string communicationServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCommunicationServiceResources().GetAsync(communicationServiceName, cancellationToken).ConfigureAwait(false); + return await GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetCommunicationServiceResourceAsync(communicationServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -170,24 +153,34 @@ public static async Task> GetCommunicatio /// CommunicationServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the CommunicationService resource. /// The cancellation token to use. - /// 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 static Response GetCommunicationServiceResource(this ResourceGroupResource resourceGroupResource, string communicationServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCommunicationServiceResources().Get(communicationServiceName, cancellationToken); + return GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetCommunicationServiceResource(communicationServiceName, cancellationToken); } - /// Gets a collection of EmailServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of EmailServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of EmailServiceResources and their operations over a EmailServiceResource. public static EmailServiceResourceCollection GetEmailServiceResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetEmailServiceResources(); + return GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetEmailServiceResources(); } /// @@ -202,16 +195,20 @@ public static EmailServiceResourceCollection GetEmailServiceResources(this Resou /// EmailServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the EmailService resource. /// The cancellation token to use. - /// 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 static async Task> GetEmailServiceResourceAsync(this ResourceGroupResource resourceGroupResource, string emailServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEmailServiceResources().GetAsync(emailServiceName, cancellationToken).ConfigureAwait(false); + return await GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetEmailServiceResourceAsync(emailServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -226,16 +223,20 @@ public static async Task> GetEmailServiceResource /// EmailServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the EmailService resource. /// The cancellation token to use. - /// 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 static Response GetEmailServiceResource(this ResourceGroupResource resourceGroupResource, string emailServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEmailServiceResources().Get(emailServiceName, cancellationToken); + return GetCommunicationResourceGroupMockingExtension(resourceGroupResource).GetEmailServiceResource(emailServiceName, cancellationToken); } /// @@ -250,6 +251,10 @@ public static Response GetEmailServiceResource(this Resour /// CommunicationServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the operation. @@ -257,9 +262,7 @@ public static Response GetEmailServiceResource(this Resour /// is null. public static async Task> CheckCommunicationNameAvailabilityAsync(this SubscriptionResource subscriptionResource, CommunicationServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCommunicationNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCommunicationSubscriptionMockingExtension(subscriptionResource).CheckCommunicationNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -274,6 +277,10 @@ public static async Task> CheckCom /// CommunicationServices_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Parameters supplied to the operation. @@ -281,9 +288,7 @@ public static async Task> CheckCom /// is null. public static Response CheckCommunicationNameAvailability(this SubscriptionResource subscriptionResource, CommunicationServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCommunicationNameAvailability(content, cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).CheckCommunicationNameAvailability(content, cancellationToken); } /// @@ -298,13 +303,17 @@ public static Response CheckCommunicationNa /// CommunicationServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCommunicationServiceResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCommunicationServiceResourcesAsync(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetCommunicationServiceResourcesAsync(cancellationToken); } /// @@ -319,13 +328,17 @@ public static AsyncPageable GetCommunicationServic /// CommunicationServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCommunicationServiceResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCommunicationServiceResources(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetCommunicationServiceResources(cancellationToken); } /// @@ -340,13 +353,17 @@ public static Pageable GetCommunicationServiceReso /// EmailServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetEmailServiceResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEmailServiceResourcesAsync(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetEmailServiceResourcesAsync(cancellationToken); } /// @@ -361,13 +378,17 @@ public static AsyncPageable GetEmailServiceResourcesAsync( /// EmailServices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetEmailServiceResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetEmailServiceResources(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetEmailServiceResources(cancellationToken); } /// @@ -382,13 +403,17 @@ public static Pageable GetEmailServiceResources(this Subsc /// EmailServices_ListVerifiedExchangeOnlineDomains /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVerifiedExchangeOnlineDomainsEmailServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVerifiedExchangeOnlineDomainsEmailServicesAsync(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetVerifiedExchangeOnlineDomainsEmailServicesAsync(cancellationToken); } /// @@ -403,13 +428,17 @@ public static AsyncPageable GetVerifiedExchangeOnlineDomainsEmailService /// EmailServices_ListVerifiedExchangeOnlineDomains /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVerifiedExchangeOnlineDomainsEmailServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVerifiedExchangeOnlineDomainsEmailServices(cancellationToken); + return GetCommunicationSubscriptionMockingExtension(subscriptionResource).GetVerifiedExchangeOnlineDomainsEmailServices(cancellationToken); } } } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationResourceGroupMockingExtension.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..5e6eece547d8 --- /dev/null +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Communication; + +namespace Azure.ResourceManager.Communication.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CommunicationResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CommunicationResourceGroupMockingExtension() + { + } + + /// 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 CommunicationResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CommunicationServiceResources in the ResourceGroupResource. + /// An object representing collection of CommunicationServiceResources and their operations over a CommunicationServiceResource. + public virtual CommunicationServiceResourceCollection GetCommunicationServiceResources() + { + return GetCachedClient(client => new CommunicationServiceResourceCollection(client, Id)); + } + + /// + /// Get the CommunicationService and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName} + /// + /// + /// Operation Id + /// CommunicationServices_Get + /// + /// + /// + /// The name of the CommunicationService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCommunicationServiceResourceAsync(string communicationServiceName, CancellationToken cancellationToken = default) + { + return await GetCommunicationServiceResources().GetAsync(communicationServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the CommunicationService and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName} + /// + /// + /// Operation Id + /// CommunicationServices_Get + /// + /// + /// + /// The name of the CommunicationService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCommunicationServiceResource(string communicationServiceName, CancellationToken cancellationToken = default) + { + return GetCommunicationServiceResources().Get(communicationServiceName, cancellationToken); + } + + /// Gets a collection of EmailServiceResources in the ResourceGroupResource. + /// An object representing collection of EmailServiceResources and their operations over a EmailServiceResource. + public virtual EmailServiceResourceCollection GetEmailServiceResources() + { + return GetCachedClient(client => new EmailServiceResourceCollection(client, Id)); + } + + /// + /// Get the EmailService and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/emailServices/{emailServiceName} + /// + /// + /// Operation Id + /// EmailServices_Get + /// + /// + /// + /// The name of the EmailService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEmailServiceResourceAsync(string emailServiceName, CancellationToken cancellationToken = default) + { + return await GetEmailServiceResources().GetAsync(emailServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the EmailService and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/emailServices/{emailServiceName} + /// + /// + /// Operation Id + /// EmailServices_Get + /// + /// + /// + /// The name of the EmailService resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEmailServiceResource(string emailServiceName, CancellationToken cancellationToken = default) + { + return GetEmailServiceResources().Get(emailServiceName, cancellationToken); + } + } +} diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationSubscriptionMockingExtension.cs similarity index 87% rename from sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationSubscriptionMockingExtension.cs index 00e0cd5492fc..d99bbb25502e 100644 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/CommunicationSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Communication; using Azure.ResourceManager.Communication.Models; -namespace Azure.ResourceManager.Communication +namespace Azure.ResourceManager.Communication.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CommunicationSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _communicationServiceResourceCommunicationServicesClientDiagnostics; private CommunicationServicesRestOperations _communicationServiceResourceCommunicationServicesRestClient; private ClientDiagnostics _emailServiceResourceEmailServicesClientDiagnostics; private EmailServicesRestOperations _emailServiceResourceEmailServicesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CommunicationSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CommunicationSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,9 +64,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual async Task> CheckCommunicationNameAvailabilityAsync(CommunicationServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CommunicationServiceResourceCommunicationServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCommunicationNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CommunicationServiceResourceCommunicationServicesClientDiagnostics.CreateScope("CommunicationSubscriptionMockingExtension.CheckCommunicationNameAvailability"); scope.Start(); try { @@ -94,9 +98,12 @@ public virtual async Task> CheckCo /// /// Parameters supplied to the operation. /// The cancellation token to use. + /// is null. public virtual Response CheckCommunicationNameAvailability(CommunicationServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CommunicationServiceResourceCommunicationServicesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCommunicationNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CommunicationServiceResourceCommunicationServicesClientDiagnostics.CreateScope("CommunicationSubscriptionMockingExtension.CheckCommunicationNameAvailability"); scope.Start(); try { @@ -129,7 +136,7 @@ public virtual AsyncPageable GetCommunicationServi { HttpMessage FirstPageRequest(int? pageSizeHint) => CommunicationServiceResourceCommunicationServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CommunicationServiceResourceCommunicationServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunicationServiceResource(Client, CommunicationServiceResourceData.DeserializeCommunicationServiceResourceData(e)), CommunicationServiceResourceCommunicationServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCommunicationServiceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CommunicationServiceResource(Client, CommunicationServiceResourceData.DeserializeCommunicationServiceResourceData(e)), CommunicationServiceResourceCommunicationServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetCommunicationServiceResources", "value", "nextLink", cancellationToken); } /// @@ -151,7 +158,7 @@ public virtual Pageable GetCommunicationServiceRes { HttpMessage FirstPageRequest(int? pageSizeHint) => CommunicationServiceResourceCommunicationServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CommunicationServiceResourceCommunicationServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunicationServiceResource(Client, CommunicationServiceResourceData.DeserializeCommunicationServiceResourceData(e)), CommunicationServiceResourceCommunicationServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCommunicationServiceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CommunicationServiceResource(Client, CommunicationServiceResourceData.DeserializeCommunicationServiceResourceData(e)), CommunicationServiceResourceCommunicationServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetCommunicationServiceResources", "value", "nextLink", cancellationToken); } /// @@ -173,7 +180,7 @@ public virtual AsyncPageable GetEmailServiceResourcesAsync { HttpMessage FirstPageRequest(int? pageSizeHint) => EmailServiceResourceEmailServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EmailServiceResourceEmailServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmailServiceResource(Client, EmailServiceResourceData.DeserializeEmailServiceResourceData(e)), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEmailServiceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmailServiceResource(Client, EmailServiceResourceData.DeserializeEmailServiceResourceData(e)), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetEmailServiceResources", "value", "nextLink", cancellationToken); } /// @@ -195,7 +202,7 @@ public virtual Pageable GetEmailServiceResources(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => EmailServiceResourceEmailServicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EmailServiceResourceEmailServicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmailServiceResource(Client, EmailServiceResourceData.DeserializeEmailServiceResourceData(e)), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEmailServiceResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmailServiceResource(Client, EmailServiceResourceData.DeserializeEmailServiceResourceData(e)), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetEmailServiceResources", "value", "nextLink", cancellationToken); } /// @@ -216,7 +223,7 @@ public virtual Pageable GetEmailServiceResources(Cancellat public virtual AsyncPageable GetVerifiedExchangeOnlineDomainsEmailServicesAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EmailServiceResourceEmailServicesRestClient.CreateListVerifiedExchangeOnlineDomainsRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVerifiedExchangeOnlineDomainsEmailServices", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => e.GetString(), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetVerifiedExchangeOnlineDomainsEmailServices", "", null, cancellationToken); } /// @@ -237,7 +244,7 @@ public virtual AsyncPageable GetVerifiedExchangeOnlineDomainsEmailServic public virtual Pageable GetVerifiedExchangeOnlineDomainsEmailServices(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => EmailServiceResourceEmailServicesRestClient.CreateListVerifiedExchangeOnlineDomainsRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVerifiedExchangeOnlineDomainsEmailServices", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => e.GetString(), EmailServiceResourceEmailServicesClientDiagnostics, Pipeline, "CommunicationSubscriptionMockingExtension.GetVerifiedExchangeOnlineDomainsEmailServices", "", null, cancellationToken); } } } diff --git a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 868a4b8209e5..000000000000 --- a/sdk/communication/Azure.ResourceManager.Communication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Communication -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CommunicationServiceResources in the ResourceGroupResource. - /// An object representing collection of CommunicationServiceResources and their operations over a CommunicationServiceResource. - public virtual CommunicationServiceResourceCollection GetCommunicationServiceResources() - { - return GetCachedClient(Client => new CommunicationServiceResourceCollection(Client, Id)); - } - - /// Gets a collection of EmailServiceResources in the ResourceGroupResource. - /// An object representing collection of EmailServiceResources and their operations over a EmailServiceResource. - public virtual EmailServiceResourceCollection GetEmailServiceResources() - { - return GetCachedClient(Client => new EmailServiceResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs index b7dc98451718..8958fbb99b77 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CapacityReservationResources and their operations over a CapacityReservationResource. public virtual CapacityReservationCollection GetCapacityReservations() { - return GetCachedClient(Client => new CapacityReservationCollection(Client, Id)); + return GetCachedClient(client => new CapacityReservationCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual CapacityReservationCollection GetCapacityReservations() /// The name of the capacity reservation. /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. /// The cancellation token to use. - /// 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> GetCapacityReservationAsync(string capacityReservationName, CapacityReservationInstanceViewType? expand = null, CancellationToken cancellationToken = default) { @@ -136,8 +136,8 @@ public virtual async Task> GetCapacityRese /// The name of the capacity reservation. /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations. /// The cancellation token to use. - /// 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 GetCapacityReservation(string capacityReservationName, CapacityReservationInstanceViewType? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CloudServiceResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CloudServiceResource.cs index eadfaa08a881..892d6cc585d3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CloudServiceResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CloudServiceResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CloudServiceRoleInstanceResources and their operations over a CloudServiceRoleInstanceResource. public virtual CloudServiceRoleInstanceCollection GetCloudServiceRoleInstances() { - return GetCachedClient(Client => new CloudServiceRoleInstanceCollection(Client, Id)); + return GetCachedClient(client => new CloudServiceRoleInstanceCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual CloudServiceRoleInstanceCollection GetCloudServiceRoleInstances() /// Name of the role instance. /// The expand expression to apply to the operation. 'UserData' is not supported for cloud services. /// The cancellation token to use. - /// 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> GetCloudServiceRoleInstanceAsync(string roleInstanceName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { @@ -141,8 +141,8 @@ public virtual async Task> GetCloudSe /// Name of the role instance. /// The expand expression to apply to the operation. 'UserData' is not supported for cloud services. /// The cancellation token to use. - /// 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 GetCloudServiceRoleInstance(string roleInstanceName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { @@ -153,7 +153,7 @@ public virtual Response GetCloudServiceRoleIns /// An object representing collection of CloudServiceRoleResources and their operations over a CloudServiceRoleResource. public virtual CloudServiceRoleCollection GetCloudServiceRoles() { - return GetCachedClient(Client => new CloudServiceRoleCollection(Client, Id)); + return GetCachedClient(client => new CloudServiceRoleCollection(client, Id)); } /// @@ -171,8 +171,8 @@ public virtual CloudServiceRoleCollection GetCloudServiceRoles() /// /// Name of the role. /// The cancellation token to use. - /// 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> GetCloudServiceRoleAsync(string roleName, CancellationToken cancellationToken = default) { @@ -194,8 +194,8 @@ public virtual async Task> GetCloudServiceRol /// /// Name of the role. /// The cancellation token to use. - /// 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 GetCloudServiceRole(string roleName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryImageResource.cs index 2a4412fefbb3..d8a8c6471d7f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryImageResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CommunityGalleryImageVersionResources and their operations over a CommunityGalleryImageVersionResource. public virtual CommunityGalleryImageVersionCollection GetCommunityGalleryImageVersions() { - return GetCachedClient(Client => new CommunityGalleryImageVersionCollection(Client, Id)); + return GetCachedClient(client => new CommunityGalleryImageVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual CommunityGalleryImageVersionCollection GetCommunityGalleryImageVe /// /// The name of the community gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. /// The cancellation token to use. - /// 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> GetCommunityGalleryImageVersionAsync(string galleryImageVersionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetCom /// /// The name of the community gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. /// The cancellation token to use. - /// 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 GetCommunityGalleryImageVersion(string galleryImageVersionName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryResource.cs index 503e48fae160..9f653bd5b854 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CommunityGalleryResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CommunityGalleryImageResources and their operations over a CommunityGalleryImageResource. public virtual CommunityGalleryImageCollection GetCommunityGalleryImages() { - return GetCachedClient(Client => new CommunityGalleryImageCollection(Client, Id)); + return GetCachedClient(client => new CommunityGalleryImageCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual CommunityGalleryImageCollection GetCommunityGalleryImages() /// /// The name of the community gallery image definition. /// The cancellation token to use. - /// 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> GetCommunityGalleryImageAsync(string galleryImageName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetCommunityG /// /// The name of the community gallery image definition. /// The cancellation token to use. - /// 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 GetCommunityGalleryImage(string galleryImageName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs index d84d6bc3bc50..f00468ffed6b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DedicatedHostResources and their operations over a DedicatedHostResource. public virtual DedicatedHostCollection GetDedicatedHosts() { - return GetCachedClient(Client => new DedicatedHostCollection(Client, Id)); + return GetCachedClient(client => new DedicatedHostCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual DedicatedHostCollection GetDedicatedHosts() /// The name of the dedicated host. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated host. 'UserData' is not supported for dedicated host. /// The cancellation token to use. - /// 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> GetDedicatedHostAsync(string hostName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { @@ -136,8 +136,8 @@ public virtual async Task> GetDedicatedHostAsync /// The name of the dedicated host. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated host. 'UserData' is not supported for dedicated host. /// The cancellation token to use. - /// 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 GetDedicatedHost(string hostName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs index 780ccbd4f992..f88ffc27d44e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ComputePrivateEndpointConnectionResources and their operations over a ComputePrivateEndpointConnectionResource. public virtual ComputePrivateEndpointConnectionCollection GetComputePrivateEndpointConnections() { - return GetCachedClient(Client => new ComputePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ComputePrivateEndpointConnectionCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual ComputePrivateEndpointConnectionCollection GetComputePrivateEndpo /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetComputePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> Ge /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetComputePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeArmClientMockingExtension.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeArmClientMockingExtension.cs new file mode 100644 index 000000000000..53922321c26a --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeArmClientMockingExtension.cs @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Compute; + +namespace Azure.ResourceManager.Compute.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ComputeArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ComputeArmClientMockingExtension() + { + } + + /// 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 ComputeArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ComputeArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual VirtualMachineScaleSetResource GetVirtualMachineScaleSetResource(ResourceIdentifier id) + { + VirtualMachineScaleSetResource.ValidateResourceId(id); + return new VirtualMachineScaleSetResource(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 VirtualMachineScaleSetExtensionResource GetVirtualMachineScaleSetExtensionResource(ResourceIdentifier id) + { + VirtualMachineScaleSetExtensionResource.ValidateResourceId(id); + return new VirtualMachineScaleSetExtensionResource(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 VirtualMachineScaleSetRollingUpgradeResource GetVirtualMachineScaleSetRollingUpgradeResource(ResourceIdentifier id) + { + VirtualMachineScaleSetRollingUpgradeResource.ValidateResourceId(id); + return new VirtualMachineScaleSetRollingUpgradeResource(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 VirtualMachineScaleSetVmExtensionResource GetVirtualMachineScaleSetVmExtensionResource(ResourceIdentifier id) + { + VirtualMachineScaleSetVmExtensionResource.ValidateResourceId(id); + return new VirtualMachineScaleSetVmExtensionResource(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 VirtualMachineScaleSetVmResource GetVirtualMachineScaleSetVmResource(ResourceIdentifier id) + { + VirtualMachineScaleSetVmResource.ValidateResourceId(id); + return new VirtualMachineScaleSetVmResource(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 VirtualMachineExtensionResource GetVirtualMachineExtensionResource(ResourceIdentifier id) + { + VirtualMachineExtensionResource.ValidateResourceId(id); + return new VirtualMachineExtensionResource(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 VirtualMachineResource GetVirtualMachineResource(ResourceIdentifier id) + { + VirtualMachineResource.ValidateResourceId(id); + return new VirtualMachineResource(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 VirtualMachineExtensionImageResource GetVirtualMachineExtensionImageResource(ResourceIdentifier id) + { + VirtualMachineExtensionImageResource.ValidateResourceId(id); + return new VirtualMachineExtensionImageResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AvailabilitySetResource GetAvailabilitySetResource(ResourceIdentifier id) + { + AvailabilitySetResource.ValidateResourceId(id); + return new AvailabilitySetResource(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 ProximityPlacementGroupResource GetProximityPlacementGroupResource(ResourceIdentifier id) + { + ProximityPlacementGroupResource.ValidateResourceId(id); + return new ProximityPlacementGroupResource(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 DedicatedHostGroupResource GetDedicatedHostGroupResource(ResourceIdentifier id) + { + DedicatedHostGroupResource.ValidateResourceId(id); + return new DedicatedHostGroupResource(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 DedicatedHostResource GetDedicatedHostResource(ResourceIdentifier id) + { + DedicatedHostResource.ValidateResourceId(id); + return new DedicatedHostResource(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 SshPublicKeyResource GetSshPublicKeyResource(ResourceIdentifier id) + { + SshPublicKeyResource.ValidateResourceId(id); + return new SshPublicKeyResource(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 DiskImageResource GetDiskImageResource(ResourceIdentifier id) + { + DiskImageResource.ValidateResourceId(id); + return new DiskImageResource(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 RestorePointGroupResource GetRestorePointGroupResource(ResourceIdentifier id) + { + RestorePointGroupResource.ValidateResourceId(id); + return new RestorePointGroupResource(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 RestorePointResource GetRestorePointResource(ResourceIdentifier id) + { + RestorePointResource.ValidateResourceId(id); + return new RestorePointResource(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 CapacityReservationGroupResource GetCapacityReservationGroupResource(ResourceIdentifier id) + { + CapacityReservationGroupResource.ValidateResourceId(id); + return new CapacityReservationGroupResource(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 CapacityReservationResource GetCapacityReservationResource(ResourceIdentifier id) + { + CapacityReservationResource.ValidateResourceId(id); + return new CapacityReservationResource(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 VirtualMachineRunCommandResource GetVirtualMachineRunCommandResource(ResourceIdentifier id) + { + VirtualMachineRunCommandResource.ValidateResourceId(id); + return new VirtualMachineRunCommandResource(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 VirtualMachineScaleSetVmRunCommandResource GetVirtualMachineScaleSetVmRunCommandResource(ResourceIdentifier id) + { + VirtualMachineScaleSetVmRunCommandResource.ValidateResourceId(id); + return new VirtualMachineScaleSetVmRunCommandResource(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 ManagedDiskResource GetManagedDiskResource(ResourceIdentifier id) + { + ManagedDiskResource.ValidateResourceId(id); + return new ManagedDiskResource(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 DiskAccessResource GetDiskAccessResource(ResourceIdentifier id) + { + DiskAccessResource.ValidateResourceId(id); + return new DiskAccessResource(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 ComputePrivateEndpointConnectionResource GetComputePrivateEndpointConnectionResource(ResourceIdentifier id) + { + ComputePrivateEndpointConnectionResource.ValidateResourceId(id); + return new ComputePrivateEndpointConnectionResource(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 DiskEncryptionSetResource GetDiskEncryptionSetResource(ResourceIdentifier id) + { + DiskEncryptionSetResource.ValidateResourceId(id); + return new DiskEncryptionSetResource(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 DiskRestorePointResource GetDiskRestorePointResource(ResourceIdentifier id) + { + DiskRestorePointResource.ValidateResourceId(id); + return new DiskRestorePointResource(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 SnapshotResource GetSnapshotResource(ResourceIdentifier id) + { + SnapshotResource.ValidateResourceId(id); + return new SnapshotResource(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 GalleryResource GetGalleryResource(ResourceIdentifier id) + { + GalleryResource.ValidateResourceId(id); + return new GalleryResource(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 GalleryImageResource GetGalleryImageResource(ResourceIdentifier id) + { + GalleryImageResource.ValidateResourceId(id); + return new GalleryImageResource(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 GalleryImageVersionResource GetGalleryImageVersionResource(ResourceIdentifier id) + { + GalleryImageVersionResource.ValidateResourceId(id); + return new GalleryImageVersionResource(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 GalleryApplicationResource GetGalleryApplicationResource(ResourceIdentifier id) + { + GalleryApplicationResource.ValidateResourceId(id); + return new GalleryApplicationResource(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 GalleryApplicationVersionResource GetGalleryApplicationVersionResource(ResourceIdentifier id) + { + GalleryApplicationVersionResource.ValidateResourceId(id); + return new GalleryApplicationVersionResource(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 SharedGalleryResource GetSharedGalleryResource(ResourceIdentifier id) + { + SharedGalleryResource.ValidateResourceId(id); + return new SharedGalleryResource(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 SharedGalleryImageResource GetSharedGalleryImageResource(ResourceIdentifier id) + { + SharedGalleryImageResource.ValidateResourceId(id); + return new SharedGalleryImageResource(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 SharedGalleryImageVersionResource GetSharedGalleryImageVersionResource(ResourceIdentifier id) + { + SharedGalleryImageVersionResource.ValidateResourceId(id); + return new SharedGalleryImageVersionResource(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 CommunityGalleryResource GetCommunityGalleryResource(ResourceIdentifier id) + { + CommunityGalleryResource.ValidateResourceId(id); + return new CommunityGalleryResource(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 CommunityGalleryImageResource GetCommunityGalleryImageResource(ResourceIdentifier id) + { + CommunityGalleryImageResource.ValidateResourceId(id); + return new CommunityGalleryImageResource(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 CommunityGalleryImageVersionResource GetCommunityGalleryImageVersionResource(ResourceIdentifier id) + { + CommunityGalleryImageVersionResource.ValidateResourceId(id); + return new CommunityGalleryImageVersionResource(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 CloudServiceRoleInstanceResource GetCloudServiceRoleInstanceResource(ResourceIdentifier id) + { + CloudServiceRoleInstanceResource.ValidateResourceId(id); + return new CloudServiceRoleInstanceResource(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 CloudServiceRoleResource GetCloudServiceRoleResource(ResourceIdentifier id) + { + CloudServiceRoleResource.ValidateResourceId(id); + return new CloudServiceRoleResource(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 CloudServiceResource GetCloudServiceResource(ResourceIdentifier id) + { + CloudServiceResource.ValidateResourceId(id); + return new CloudServiceResource(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 CloudServiceOSVersionResource GetCloudServiceOSVersionResource(ResourceIdentifier id) + { + CloudServiceOSVersionResource.ValidateResourceId(id); + return new CloudServiceOSVersionResource(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 CloudServiceOSFamilyResource GetCloudServiceOSFamilyResource(ResourceIdentifier id) + { + CloudServiceOSFamilyResource.ValidateResourceId(id); + return new CloudServiceOSFamilyResource(Client, id); + } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs index 17853a10e7c1..5c6f574377f2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Compute.Mocking; using Azure.ResourceManager.Compute.Models; using Azure.ResourceManager.Resources; @@ -19,841 +20,705 @@ namespace Azure.ResourceManager.Compute /// A class to add extension methods to Azure.ResourceManager.Compute. public static partial class ComputeExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ComputeArmClientMockingExtension GetComputeArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ComputeArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ComputeResourceGroupMockingExtension GetComputeResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ComputeResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ComputeSubscriptionMockingExtension GetComputeSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ComputeSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region VirtualMachineScaleSetResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetResource GetVirtualMachineScaleSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetResource.ValidateResourceId(id); - return new VirtualMachineScaleSetResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetResource(id); } - #endregion - #region VirtualMachineScaleSetExtensionResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetExtensionResource GetVirtualMachineScaleSetExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetExtensionResource.ValidateResourceId(id); - return new VirtualMachineScaleSetExtensionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetExtensionResource(id); } - #endregion - #region VirtualMachineScaleSetRollingUpgradeResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetRollingUpgradeResource GetVirtualMachineScaleSetRollingUpgradeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetRollingUpgradeResource.ValidateResourceId(id); - return new VirtualMachineScaleSetRollingUpgradeResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetRollingUpgradeResource(id); } - #endregion - #region VirtualMachineScaleSetVmExtensionResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetVmExtensionResource GetVirtualMachineScaleSetVmExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetVmExtensionResource.ValidateResourceId(id); - return new VirtualMachineScaleSetVmExtensionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetVmExtensionResource(id); } - #endregion - #region VirtualMachineScaleSetVmResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetVmResource GetVirtualMachineScaleSetVmResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetVmResource.ValidateResourceId(id); - return new VirtualMachineScaleSetVmResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetVmResource(id); } - #endregion - #region VirtualMachineExtensionResource /// /// 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. /// Returns a object. public static VirtualMachineExtensionResource GetVirtualMachineExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineExtensionResource.ValidateResourceId(id); - return new VirtualMachineExtensionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineExtensionResource(id); } - #endregion - #region VirtualMachineResource /// /// 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. /// Returns a object. public static VirtualMachineResource GetVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineResource.ValidateResourceId(id); - return new VirtualMachineResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineResource(id); } - #endregion - #region VirtualMachineExtensionImageResource /// /// 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. /// Returns a object. public static VirtualMachineExtensionImageResource GetVirtualMachineExtensionImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineExtensionImageResource.ValidateResourceId(id); - return new VirtualMachineExtensionImageResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineExtensionImageResource(id); } - #endregion - #region AvailabilitySetResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AvailabilitySetResource GetAvailabilitySetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AvailabilitySetResource.ValidateResourceId(id); - return new AvailabilitySetResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetAvailabilitySetResource(id); } - #endregion - #region ProximityPlacementGroupResource /// /// 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. /// Returns a object. public static ProximityPlacementGroupResource GetProximityPlacementGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProximityPlacementGroupResource.ValidateResourceId(id); - return new ProximityPlacementGroupResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetProximityPlacementGroupResource(id); } - #endregion - #region DedicatedHostGroupResource /// /// 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. /// Returns a object. public static DedicatedHostGroupResource GetDedicatedHostGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DedicatedHostGroupResource.ValidateResourceId(id); - return new DedicatedHostGroupResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDedicatedHostGroupResource(id); } - #endregion - #region DedicatedHostResource /// /// 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. /// Returns a object. public static DedicatedHostResource GetDedicatedHostResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DedicatedHostResource.ValidateResourceId(id); - return new DedicatedHostResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDedicatedHostResource(id); } - #endregion - #region SshPublicKeyResource /// /// 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. /// Returns a object. public static SshPublicKeyResource GetSshPublicKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SshPublicKeyResource.ValidateResourceId(id); - return new SshPublicKeyResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetSshPublicKeyResource(id); } - #endregion - #region DiskImageResource /// /// 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. /// Returns a object. public static DiskImageResource GetDiskImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskImageResource.ValidateResourceId(id); - return new DiskImageResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDiskImageResource(id); } - #endregion - #region RestorePointGroupResource /// /// 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. /// Returns a object. public static RestorePointGroupResource GetRestorePointGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RestorePointGroupResource.ValidateResourceId(id); - return new RestorePointGroupResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetRestorePointGroupResource(id); } - #endregion - #region RestorePointResource /// /// 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. /// Returns a object. public static RestorePointResource GetRestorePointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RestorePointResource.ValidateResourceId(id); - return new RestorePointResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetRestorePointResource(id); } - #endregion - #region CapacityReservationGroupResource /// /// 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. /// Returns a object. public static CapacityReservationGroupResource GetCapacityReservationGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CapacityReservationGroupResource.ValidateResourceId(id); - return new CapacityReservationGroupResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCapacityReservationGroupResource(id); } - #endregion - #region CapacityReservationResource /// /// 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. /// Returns a object. public static CapacityReservationResource GetCapacityReservationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CapacityReservationResource.ValidateResourceId(id); - return new CapacityReservationResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCapacityReservationResource(id); } - #endregion - #region VirtualMachineRunCommandResource /// /// 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. /// Returns a object. public static VirtualMachineRunCommandResource GetVirtualMachineRunCommandResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineRunCommandResource.ValidateResourceId(id); - return new VirtualMachineRunCommandResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineRunCommandResource(id); } - #endregion - #region VirtualMachineScaleSetVmRunCommandResource /// /// 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. /// Returns a object. public static VirtualMachineScaleSetVmRunCommandResource GetVirtualMachineScaleSetVmRunCommandResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineScaleSetVmRunCommandResource.ValidateResourceId(id); - return new VirtualMachineScaleSetVmRunCommandResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetVirtualMachineScaleSetVmRunCommandResource(id); } - #endregion - #region ManagedDiskResource /// /// 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. /// Returns a object. public static ManagedDiskResource GetManagedDiskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedDiskResource.ValidateResourceId(id); - return new ManagedDiskResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetManagedDiskResource(id); } - #endregion - #region DiskAccessResource /// /// 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. /// Returns a object. public static DiskAccessResource GetDiskAccessResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskAccessResource.ValidateResourceId(id); - return new DiskAccessResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDiskAccessResource(id); } - #endregion - #region ComputePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ComputePrivateEndpointConnectionResource GetComputePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ComputePrivateEndpointConnectionResource.ValidateResourceId(id); - return new ComputePrivateEndpointConnectionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetComputePrivateEndpointConnectionResource(id); } - #endregion - #region DiskEncryptionSetResource /// /// 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. /// Returns a object. public static DiskEncryptionSetResource GetDiskEncryptionSetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskEncryptionSetResource.ValidateResourceId(id); - return new DiskEncryptionSetResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDiskEncryptionSetResource(id); } - #endregion - #region DiskRestorePointResource /// /// 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. /// Returns a object. public static DiskRestorePointResource GetDiskRestorePointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiskRestorePointResource.ValidateResourceId(id); - return new DiskRestorePointResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetDiskRestorePointResource(id); } - #endregion - #region SnapshotResource /// /// 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. /// Returns a object. public static SnapshotResource GetSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SnapshotResource.ValidateResourceId(id); - return new SnapshotResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetSnapshotResource(id); } - #endregion - #region GalleryResource /// /// 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. /// Returns a object. public static GalleryResource GetGalleryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GalleryResource.ValidateResourceId(id); - return new GalleryResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetGalleryResource(id); } - #endregion - #region GalleryImageResource /// /// 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. /// Returns a object. public static GalleryImageResource GetGalleryImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GalleryImageResource.ValidateResourceId(id); - return new GalleryImageResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetGalleryImageResource(id); } - #endregion - #region GalleryImageVersionResource /// /// 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. /// Returns a object. public static GalleryImageVersionResource GetGalleryImageVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GalleryImageVersionResource.ValidateResourceId(id); - return new GalleryImageVersionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetGalleryImageVersionResource(id); } - #endregion - #region GalleryApplicationResource /// /// 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. /// Returns a object. public static GalleryApplicationResource GetGalleryApplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GalleryApplicationResource.ValidateResourceId(id); - return new GalleryApplicationResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetGalleryApplicationResource(id); } - #endregion - #region GalleryApplicationVersionResource /// /// 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. /// Returns a object. public static GalleryApplicationVersionResource GetGalleryApplicationVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GalleryApplicationVersionResource.ValidateResourceId(id); - return new GalleryApplicationVersionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetGalleryApplicationVersionResource(id); } - #endregion - #region SharedGalleryResource /// /// 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. /// Returns a object. public static SharedGalleryResource GetSharedGalleryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SharedGalleryResource.ValidateResourceId(id); - return new SharedGalleryResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetSharedGalleryResource(id); } - #endregion - #region SharedGalleryImageResource /// /// 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. /// Returns a object. public static SharedGalleryImageResource GetSharedGalleryImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SharedGalleryImageResource.ValidateResourceId(id); - return new SharedGalleryImageResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetSharedGalleryImageResource(id); } - #endregion - #region SharedGalleryImageVersionResource /// /// 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. /// Returns a object. public static SharedGalleryImageVersionResource GetSharedGalleryImageVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - SharedGalleryImageVersionResource.ValidateResourceId(id); - return new SharedGalleryImageVersionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetSharedGalleryImageVersionResource(id); } - #endregion - #region CommunityGalleryResource /// /// 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. /// Returns a object. public static CommunityGalleryResource GetCommunityGalleryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommunityGalleryResource.ValidateResourceId(id); - return new CommunityGalleryResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCommunityGalleryResource(id); } - #endregion - #region CommunityGalleryImageResource /// /// 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. /// Returns a object. public static CommunityGalleryImageResource GetCommunityGalleryImageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommunityGalleryImageResource.ValidateResourceId(id); - return new CommunityGalleryImageResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCommunityGalleryImageResource(id); } - #endregion - #region CommunityGalleryImageVersionResource /// /// 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. /// Returns a object. public static CommunityGalleryImageVersionResource GetCommunityGalleryImageVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CommunityGalleryImageVersionResource.ValidateResourceId(id); - return new CommunityGalleryImageVersionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCommunityGalleryImageVersionResource(id); } - #endregion - #region CloudServiceRoleInstanceResource /// /// 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. /// Returns a object. public static CloudServiceRoleInstanceResource GetCloudServiceRoleInstanceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceRoleInstanceResource.ValidateResourceId(id); - return new CloudServiceRoleInstanceResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCloudServiceRoleInstanceResource(id); } - #endregion - #region CloudServiceRoleResource /// /// 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. /// Returns a object. public static CloudServiceRoleResource GetCloudServiceRoleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceRoleResource.ValidateResourceId(id); - return new CloudServiceRoleResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCloudServiceRoleResource(id); } - #endregion - #region CloudServiceResource /// /// 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. /// Returns a object. public static CloudServiceResource GetCloudServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceResource.ValidateResourceId(id); - return new CloudServiceResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCloudServiceResource(id); } - #endregion - #region CloudServiceOSVersionResource /// /// 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. /// Returns a object. public static CloudServiceOSVersionResource GetCloudServiceOSVersionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceOSVersionResource.ValidateResourceId(id); - return new CloudServiceOSVersionResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCloudServiceOSVersionResource(id); } - #endregion - #region CloudServiceOSFamilyResource /// /// 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. /// Returns a object. public static CloudServiceOSFamilyResource GetCloudServiceOSFamilyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CloudServiceOSFamilyResource.ValidateResourceId(id); - return new CloudServiceOSFamilyResource(client, id); - } - ); + return GetComputeArmClientMockingExtension(client).GetCloudServiceOSFamilyResource(id); } - #endregion - /// Gets a collection of VirtualMachineScaleSetResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualMachineScaleSetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualMachineScaleSetResources and their operations over a VirtualMachineScaleSetResource. public static VirtualMachineScaleSetCollection GetVirtualMachineScaleSets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualMachineScaleSets(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineScaleSets(); } /// @@ -868,17 +733,21 @@ public static VirtualMachineScaleSetCollection GetVirtualMachineScaleSets(this R /// VirtualMachineScaleSets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VM scale set. /// The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation. /// The cancellation token to use. - /// 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 static async Task> GetVirtualMachineScaleSetAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineScaleSetName, VirtualMachineScaleSetGetExpand? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualMachineScaleSets().GetAsync(virtualMachineScaleSetName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineScaleSetAsync(virtualMachineScaleSetName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -893,25 +762,35 @@ public static async Task> GetVirtualMac /// VirtualMachineScaleSets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the VM scale set. /// The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation. /// The cancellation token to use. - /// 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 static Response GetVirtualMachineScaleSet(this ResourceGroupResource resourceGroupResource, string virtualMachineScaleSetName, VirtualMachineScaleSetGetExpand? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualMachineScaleSets().Get(virtualMachineScaleSetName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineScaleSet(virtualMachineScaleSetName, expand, cancellationToken); } - /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualMachines(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachines(); } /// @@ -926,17 +805,21 @@ public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupReso /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual machine. /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. /// The cancellation token to use. - /// 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 static async Task> GetVirtualMachineAsync(this ResourceGroupResource resourceGroupResource, string vmName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualMachines().GetAsync(vmName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineAsync(vmName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -951,25 +834,35 @@ public static async Task> GetVirtualMachineAsyn /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the virtual machine. /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. /// The cancellation token to use. - /// 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 static Response GetVirtualMachine(this ResourceGroupResource resourceGroupResource, string vmName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualMachines().Get(vmName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachine(vmName, expand, cancellationToken); } - /// Gets a collection of AvailabilitySetResources in the ResourceGroupResource. + /// + /// Gets a collection of AvailabilitySetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AvailabilitySetResources and their operations over a AvailabilitySetResource. public static AvailabilitySetCollection GetAvailabilitySets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailabilitySets(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetAvailabilitySets(); } /// @@ -984,16 +877,20 @@ public static AvailabilitySetCollection GetAvailabilitySets(this ResourceGroupRe /// AvailabilitySets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the availability set. /// The cancellation token to use. - /// 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 static async Task> GetAvailabilitySetAsync(this ResourceGroupResource resourceGroupResource, string availabilitySetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAvailabilitySets().GetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetAvailabilitySetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); } /// @@ -1008,24 +905,34 @@ public static async Task> GetAvailabilitySetAs /// AvailabilitySets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the availability set. /// The cancellation token to use. - /// 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 static Response GetAvailabilitySet(this ResourceGroupResource resourceGroupResource, string availabilitySetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAvailabilitySets().Get(availabilitySetName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetAvailabilitySet(availabilitySetName, cancellationToken); } - /// Gets a collection of ProximityPlacementGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of ProximityPlacementGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ProximityPlacementGroupResources and their operations over a ProximityPlacementGroupResource. public static ProximityPlacementGroupCollection GetProximityPlacementGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetProximityPlacementGroups(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetProximityPlacementGroups(); } /// @@ -1040,17 +947,21 @@ public static ProximityPlacementGroupCollection GetProximityPlacementGroups(this /// ProximityPlacementGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the proximity placement group. /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. /// The cancellation token to use. - /// 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 static async Task> GetProximityPlacementGroupAsync(this ResourceGroupResource resourceGroupResource, string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetProximityPlacementGroups().GetAsync(proximityPlacementGroupName, includeColocationStatus, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetProximityPlacementGroupAsync(proximityPlacementGroupName, includeColocationStatus, cancellationToken).ConfigureAwait(false); } /// @@ -1065,25 +976,35 @@ public static async Task> GetProximity /// ProximityPlacementGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the proximity placement group. /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. /// The cancellation token to use. - /// 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 static Response GetProximityPlacementGroup(this ResourceGroupResource resourceGroupResource, string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetProximityPlacementGroups().Get(proximityPlacementGroupName, includeColocationStatus, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetProximityPlacementGroup(proximityPlacementGroupName, includeColocationStatus, cancellationToken); } - /// Gets a collection of DedicatedHostGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of DedicatedHostGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DedicatedHostGroupResources and their operations over a DedicatedHostGroupResource. public static DedicatedHostGroupCollection GetDedicatedHostGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDedicatedHostGroups(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHostGroups(); } /// @@ -1098,17 +1019,21 @@ public static DedicatedHostGroupCollection GetDedicatedHostGroups(this ResourceG /// DedicatedHostGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated host group. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. /// The cancellation token to use. - /// 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 static async Task> GetDedicatedHostGroupAsync(this ResourceGroupResource resourceGroupResource, string hostGroupName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDedicatedHostGroups().GetAsync(hostGroupName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHostGroupAsync(hostGroupName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1123,25 +1048,35 @@ public static async Task> GetDedicatedHostG /// DedicatedHostGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the dedicated host group. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. /// The cancellation token to use. - /// 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 static Response GetDedicatedHostGroup(this ResourceGroupResource resourceGroupResource, string hostGroupName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDedicatedHostGroups().Get(hostGroupName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDedicatedHostGroup(hostGroupName, expand, cancellationToken); } - /// Gets a collection of SshPublicKeyResources in the ResourceGroupResource. + /// + /// Gets a collection of SshPublicKeyResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SshPublicKeyResources and their operations over a SshPublicKeyResource. public static SshPublicKeyCollection GetSshPublicKeys(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSshPublicKeys(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSshPublicKeys(); } /// @@ -1156,16 +1091,20 @@ public static SshPublicKeyCollection GetSshPublicKeys(this ResourceGroupResource /// SshPublicKeys_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the SSH public key. /// The cancellation token to use. - /// 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 static async Task> GetSshPublicKeyAsync(this ResourceGroupResource resourceGroupResource, string sshPublicKeyName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSshPublicKeys().GetAsync(sshPublicKeyName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSshPublicKeyAsync(sshPublicKeyName, cancellationToken).ConfigureAwait(false); } /// @@ -1180,24 +1119,34 @@ public static async Task> GetSshPublicKeyAsync(th /// SshPublicKeys_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the SSH public key. /// The cancellation token to use. - /// 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 static Response GetSshPublicKey(this ResourceGroupResource resourceGroupResource, string sshPublicKeyName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSshPublicKeys().Get(sshPublicKeyName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSshPublicKey(sshPublicKeyName, cancellationToken); } - /// Gets a collection of DiskImageResources in the ResourceGroupResource. + /// + /// Gets a collection of DiskImageResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DiskImageResources and their operations over a DiskImageResource. public static DiskImageCollection GetDiskImages(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiskImages(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskImages(); } /// @@ -1212,17 +1161,21 @@ public static DiskImageCollection GetDiskImages(this ResourceGroupResource resou /// Images_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the image. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 static async Task> GetDiskImageAsync(this ResourceGroupResource resourceGroupResource, string imageName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDiskImages().GetAsync(imageName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskImageAsync(imageName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1237,25 +1190,35 @@ public static async Task> GetDiskImageAsync(this Res /// Images_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the image. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 static Response GetDiskImage(this ResourceGroupResource resourceGroupResource, string imageName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDiskImages().Get(imageName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskImage(imageName, expand, cancellationToken); } - /// Gets a collection of RestorePointGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of RestorePointGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of RestorePointGroupResources and their operations over a RestorePointGroupResource. public static RestorePointGroupCollection GetRestorePointGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRestorePointGroups(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetRestorePointGroups(); } /// @@ -1270,17 +1233,21 @@ public static RestorePointGroupCollection GetRestorePointGroups(this ResourceGro /// RestorePointCollections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the restore point collection. /// The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. /// The cancellation token to use. - /// 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 static async Task> GetRestorePointGroupAsync(this ResourceGroupResource resourceGroupResource, string restorePointGroupName, RestorePointGroupExpand? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetRestorePointGroups().GetAsync(restorePointGroupName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetRestorePointGroupAsync(restorePointGroupName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1295,25 +1262,35 @@ public static async Task> GetRestorePointGro /// RestorePointCollections_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the restore point collection. /// The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. /// The cancellation token to use. - /// 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 static Response GetRestorePointGroup(this ResourceGroupResource resourceGroupResource, string restorePointGroupName, RestorePointGroupExpand? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetRestorePointGroups().Get(restorePointGroupName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetRestorePointGroup(restorePointGroupName, expand, cancellationToken); } - /// Gets a collection of CapacityReservationGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of CapacityReservationGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CapacityReservationGroupResources and their operations over a CapacityReservationGroupResource. public static CapacityReservationGroupCollection GetCapacityReservationGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCapacityReservationGroups(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCapacityReservationGroups(); } /// @@ -1328,17 +1305,21 @@ public static CapacityReservationGroupCollection GetCapacityReservationGroups(th /// CapacityReservationGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the capacity reservation group. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. /// The cancellation token to use. - /// 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 static async Task> GetCapacityReservationGroupAsync(this ResourceGroupResource resourceGroupResource, string capacityReservationGroupName, CapacityReservationGroupInstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCapacityReservationGroups().GetAsync(capacityReservationGroupName, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCapacityReservationGroupAsync(capacityReservationGroupName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1353,25 +1334,35 @@ public static async Task> GetCapacity /// CapacityReservationGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the capacity reservation group. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. /// The cancellation token to use. - /// 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 static Response GetCapacityReservationGroup(this ResourceGroupResource resourceGroupResource, string capacityReservationGroupName, CapacityReservationGroupInstanceViewType? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCapacityReservationGroups().Get(capacityReservationGroupName, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCapacityReservationGroup(capacityReservationGroupName, expand, cancellationToken); } - /// Gets a collection of ManagedDiskResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedDiskResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedDiskResources and their operations over a ManagedDiskResource. public static ManagedDiskCollection GetManagedDisks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedDisks(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetManagedDisks(); } /// @@ -1386,16 +1377,20 @@ public static ManagedDiskCollection GetManagedDisks(this ResourceGroupResource r /// Disks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static async Task> GetManagedDiskAsync(this ResourceGroupResource resourceGroupResource, string diskName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedDisks().GetAsync(diskName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetManagedDiskAsync(diskName, cancellationToken).ConfigureAwait(false); } /// @@ -1410,24 +1405,34 @@ public static async Task> GetManagedDiskAsync(this /// Disks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static Response GetManagedDisk(this ResourceGroupResource resourceGroupResource, string diskName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedDisks().Get(diskName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetManagedDisk(diskName, cancellationToken); } - /// Gets a collection of DiskAccessResources in the ResourceGroupResource. + /// + /// Gets a collection of DiskAccessResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DiskAccessResources and their operations over a DiskAccessResource. public static DiskAccessCollection GetDiskAccesses(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiskAccesses(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskAccesses(); } /// @@ -1442,16 +1447,20 @@ public static DiskAccessCollection GetDiskAccesses(this ResourceGroupResource re /// DiskAccesses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static async Task> GetDiskAccessAsync(this ResourceGroupResource resourceGroupResource, string diskAccessName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDiskAccesses().GetAsync(diskAccessName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskAccessAsync(diskAccessName, cancellationToken).ConfigureAwait(false); } /// @@ -1466,24 +1475,34 @@ public static async Task> GetDiskAccessAsync(this R /// DiskAccesses_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static Response GetDiskAccess(this ResourceGroupResource resourceGroupResource, string diskAccessName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDiskAccesses().Get(diskAccessName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskAccess(diskAccessName, cancellationToken); } - /// Gets a collection of DiskEncryptionSetResources in the ResourceGroupResource. + /// + /// Gets a collection of DiskEncryptionSetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DiskEncryptionSetResources and their operations over a DiskEncryptionSetResource. public static DiskEncryptionSetCollection GetDiskEncryptionSets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDiskEncryptionSets(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskEncryptionSets(); } /// @@ -1498,16 +1517,20 @@ public static DiskEncryptionSetCollection GetDiskEncryptionSets(this ResourceGro /// DiskEncryptionSets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static async Task> GetDiskEncryptionSetAsync(this ResourceGroupResource resourceGroupResource, string diskEncryptionSetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDiskEncryptionSets().GetAsync(diskEncryptionSetName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskEncryptionSetAsync(diskEncryptionSetName, cancellationToken).ConfigureAwait(false); } /// @@ -1522,24 +1545,34 @@ public static async Task> GetDiskEncryptionS /// DiskEncryptionSets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. /// The cancellation token to use. - /// 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 static Response GetDiskEncryptionSet(this ResourceGroupResource resourceGroupResource, string diskEncryptionSetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDiskEncryptionSets().Get(diskEncryptionSetName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetDiskEncryptionSet(diskEncryptionSetName, cancellationToken); } - /// Gets a collection of SnapshotResources in the ResourceGroupResource. + /// + /// Gets a collection of SnapshotResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of SnapshotResources and their operations over a SnapshotResource. public static SnapshotCollection GetSnapshots(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetSnapshots(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSnapshots(); } /// @@ -1554,16 +1587,20 @@ public static SnapshotCollection GetSnapshots(this ResourceGroupResource resourc /// Snapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters. /// The cancellation token to use. - /// 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 static async Task> GetSnapshotAsync(this ResourceGroupResource resourceGroupResource, string snapshotName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetSnapshots().GetAsync(snapshotName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSnapshotAsync(snapshotName, cancellationToken).ConfigureAwait(false); } /// @@ -1578,24 +1615,34 @@ public static async Task> GetSnapshotAsync(this Resou /// Snapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters. /// The cancellation token to use. - /// 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 static Response GetSnapshot(this ResourceGroupResource resourceGroupResource, string snapshotName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetSnapshots().Get(snapshotName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetSnapshot(snapshotName, cancellationToken); } - /// Gets a collection of GalleryResources in the ResourceGroupResource. + /// + /// Gets a collection of GalleryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of GalleryResources and their operations over a GalleryResource. public static GalleryCollection GetGalleries(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetGalleries(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetGalleries(); } /// @@ -1610,18 +1657,22 @@ public static GalleryCollection GetGalleries(this ResourceGroupResource resource /// Galleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Shared Image Gallery. /// The select expression to apply on the operation. /// The expand query option to apply on the operation. /// The cancellation token to use. - /// 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 static async Task> GetGalleryAsync(this ResourceGroupResource resourceGroupResource, string galleryName, SelectPermission? select = null, GalleryExpand? expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetGalleries().GetAsync(galleryName, select, expand, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetGalleryAsync(galleryName, select, expand, cancellationToken).ConfigureAwait(false); } /// @@ -1636,26 +1687,36 @@ public static async Task> GetGalleryAsync(this Resourc /// Galleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Shared Image Gallery. /// The select expression to apply on the operation. /// The expand query option to apply on the operation. /// The cancellation token to use. - /// 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 static Response GetGallery(this ResourceGroupResource resourceGroupResource, string galleryName, SelectPermission? select = null, GalleryExpand? expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetGalleries().Get(galleryName, select, expand, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetGallery(galleryName, select, expand, cancellationToken); } - /// Gets a collection of CloudServiceResources in the ResourceGroupResource. + /// + /// Gets a collection of CloudServiceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CloudServiceResources and their operations over a CloudServiceResource. public static CloudServiceCollection GetCloudServices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCloudServices(); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCloudServices(); } /// @@ -1670,16 +1731,20 @@ public static CloudServiceCollection GetCloudServices(this ResourceGroupResource /// CloudServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cloud service. /// The cancellation token to use. - /// 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 static async Task> GetCloudServiceAsync(this ResourceGroupResource resourceGroupResource, string cloudServiceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCloudServices().GetAsync(cloudServiceName, cancellationToken).ConfigureAwait(false); + return await GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCloudServiceAsync(cloudServiceName, cancellationToken).ConfigureAwait(false); } /// @@ -1694,30 +1759,38 @@ public static async Task> GetCloudServiceAsync(th /// CloudServices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cloud service. /// The cancellation token to use. - /// 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 static Response GetCloudService(this ResourceGroupResource resourceGroupResource, string cloudServiceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCloudServices().Get(cloudServiceName, cancellationToken); + return GetComputeResourceGroupMockingExtension(resourceGroupResource).GetCloudService(cloudServiceName, cancellationToken); } - /// Gets a collection of VirtualMachineExtensionImageResources in the SubscriptionResource. + /// + /// Gets a collection of VirtualMachineExtensionImageResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// The name of a supported Azure region. /// The String to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of VirtualMachineExtensionImageResources and their operations over a VirtualMachineExtensionImageResource. public static VirtualMachineExtensionImageCollection GetVirtualMachineExtensionImages(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineExtensionImages(location, publisherName); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineExtensionImages(location, publisherName); } /// @@ -1732,6 +1805,10 @@ public static VirtualMachineExtensionImageCollection GetVirtualMachineExtensionI /// VirtualMachineExtensionImages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -1739,12 +1816,12 @@ public static VirtualMachineExtensionImageCollection GetVirtualMachineExtensionI /// The String to use. /// The String to use. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static async Task> GetVirtualMachineExtensionImageAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string type, string version, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetVirtualMachineExtensionImages(location, publisherName).GetAsync(type, version, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineExtensionImageAsync(location, publisherName, type, version, cancellationToken).ConfigureAwait(false); } /// @@ -1759,6 +1836,10 @@ public static async Task> GetVirt /// VirtualMachineExtensionImages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -1766,21 +1847,27 @@ public static async Task> GetVirt /// The String to use. /// The String to use. /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. /// , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public static Response GetVirtualMachineExtensionImage(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string type, string version, CancellationToken cancellationToken = default) { - return subscriptionResource.GetVirtualMachineExtensionImages(location, publisherName).Get(type, version, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineExtensionImage(location, publisherName, type, version, cancellationToken); } - /// Gets a collection of SharedGalleryResources in the SubscriptionResource. + /// + /// Gets a collection of SharedGalleryResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Resource location. /// An object representing collection of SharedGalleryResources and their operations over a SharedGalleryResource. public static SharedGalleryCollection GetSharedGalleries(this SubscriptionResource subscriptionResource, AzureLocation location) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSharedGalleries(location); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSharedGalleries(location); } /// @@ -1795,17 +1882,21 @@ public static SharedGalleryCollection GetSharedGalleries(this SubscriptionResour /// SharedGalleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The unique name of the Shared Gallery. /// The cancellation token to use. - /// 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 static async Task> GetSharedGalleryAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string galleryUniqueName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSharedGalleries(location).GetAsync(galleryUniqueName, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetSharedGalleryAsync(location, galleryUniqueName, cancellationToken).ConfigureAwait(false); } /// @@ -1820,25 +1911,35 @@ public static async Task> GetSharedGalleryAsync( /// SharedGalleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The unique name of the Shared Gallery. /// The cancellation token to use. - /// 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 static Response GetSharedGallery(this SubscriptionResource subscriptionResource, AzureLocation location, string galleryUniqueName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSharedGalleries(location).Get(galleryUniqueName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSharedGallery(location, galleryUniqueName, cancellationToken); } - /// Gets a collection of CommunityGalleryResources in the SubscriptionResource. + /// + /// Gets a collection of CommunityGalleryResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CommunityGalleryResources and their operations over a CommunityGalleryResource. public static CommunityGalleryCollection GetCommunityGalleries(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCommunityGalleries(); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCommunityGalleries(); } /// @@ -1853,17 +1954,21 @@ public static CommunityGalleryCollection GetCommunityGalleries(this Subscription /// CommunityGalleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The public name of the community gallery. /// The cancellation token to use. - /// 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 static async Task> GetCommunityGalleryAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publicGalleryName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetCommunityGalleries().GetAsync(location, publicGalleryName, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetCommunityGalleryAsync(location, publicGalleryName, cancellationToken).ConfigureAwait(false); } /// @@ -1878,26 +1983,36 @@ public static async Task> GetCommunityGallery /// CommunityGalleries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Resource location. /// The public name of the community gallery. /// The cancellation token to use. - /// 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 static Response GetCommunityGallery(this SubscriptionResource subscriptionResource, AzureLocation location, string publicGalleryName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCommunityGalleries().Get(location, publicGalleryName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCommunityGallery(location, publicGalleryName, cancellationToken); } - /// Gets a collection of CloudServiceOSVersionResources in the SubscriptionResource. + /// + /// Gets a collection of CloudServiceOSVersionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Name of the location that the OS versions pertain to. /// An object representing collection of CloudServiceOSVersionResources and their operations over a CloudServiceOSVersionResource. public static CloudServiceOSVersionCollection GetCloudServiceOSVersions(this SubscriptionResource subscriptionResource, AzureLocation location) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudServiceOSVersions(location); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSVersions(location); } /// @@ -1912,17 +2027,21 @@ public static CloudServiceOSVersionCollection GetCloudServiceOSVersions(this Sub /// CloudServiceOperatingSystems_GetOSVersion /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the location that the OS versions pertain to. /// Name of the OS version. /// The cancellation token to use. - /// 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 static async Task> GetCloudServiceOSVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string osVersionName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetCloudServiceOSVersions(location).GetAsync(osVersionName, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSVersionAsync(location, osVersionName, cancellationToken).ConfigureAwait(false); } /// @@ -1937,26 +2056,36 @@ public static async Task> GetCloudServic /// CloudServiceOperatingSystems_GetOSVersion /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the location that the OS versions pertain to. /// Name of the OS version. /// The cancellation token to use. - /// 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 static Response GetCloudServiceOSVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string osVersionName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCloudServiceOSVersions(location).Get(osVersionName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSVersion(location, osVersionName, cancellationToken); } - /// Gets a collection of CloudServiceOSFamilyResources in the SubscriptionResource. + /// + /// Gets a collection of CloudServiceOSFamilyResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// Name of the location that the OS families pertain to. /// An object representing collection of CloudServiceOSFamilyResources and their operations over a CloudServiceOSFamilyResource. public static CloudServiceOSFamilyCollection GetCloudServiceOSFamilies(this SubscriptionResource subscriptionResource, AzureLocation location) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudServiceOSFamilies(location); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSFamilies(location); } /// @@ -1971,17 +2100,21 @@ public static CloudServiceOSFamilyCollection GetCloudServiceOSFamilies(this Subs /// CloudServiceOperatingSystems_GetOSFamily /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the location that the OS families pertain to. /// Name of the OS family. /// The cancellation token to use. - /// 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 static async Task> GetCloudServiceOSFamilyAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string osFamilyName, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetCloudServiceOSFamilies(location).GetAsync(osFamilyName, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSFamilyAsync(location, osFamilyName, cancellationToken).ConfigureAwait(false); } /// @@ -1996,17 +2129,21 @@ public static async Task> GetCloudService /// CloudServiceOperatingSystems_GetOSFamily /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the location that the OS families pertain to. /// Name of the OS family. /// The cancellation token to use. - /// 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 static Response GetCloudServiceOSFamily(this SubscriptionResource subscriptionResource, AzureLocation location, string osFamilyName, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCloudServiceOSFamilies(location).Get(osFamilyName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServiceOSFamily(location, osFamilyName, cancellationToken); } /// @@ -2021,6 +2158,10 @@ public static Response GetCloudServiceOSFamily(thi /// Usage_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -2028,7 +2169,7 @@ public static Response GetCloudServiceOSFamily(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetUsagesAsync(location, cancellationToken); } /// @@ -2043,6 +2184,10 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// Usage_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which resource usage is queried. @@ -2050,7 +2195,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsages(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsages(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetUsages(location, cancellationToken); } /// @@ -2065,6 +2210,10 @@ public static Pageable GetUsages(this SubscriptionResource subscri /// VirtualMachineSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which virtual-machine-sizes is queried. @@ -2072,7 +2221,7 @@ public static Pageable GetUsages(this SubscriptionResource subscri /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineSizesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineSizesAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineSizesAsync(location, cancellationToken); } /// @@ -2087,6 +2236,10 @@ public static AsyncPageable GetVirtualMachineSizesAsync(this /// VirtualMachineSizes_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which virtual-machine-sizes is queried. @@ -2094,7 +2247,7 @@ public static AsyncPageable GetVirtualMachineSizesAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineSizes(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineSizes(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineSizes(location, cancellationToken); } /// @@ -2109,6 +2262,10 @@ public static Pageable GetVirtualMachineSizes(this Subscript /// VirtualMachineScaleSets_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which VM scale sets under the subscription are queried. @@ -2116,7 +2273,7 @@ public static Pageable GetVirtualMachineSizes(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineScaleSetsByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineScaleSetsByLocationAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineScaleSetsByLocationAsync(location, cancellationToken); } /// @@ -2131,6 +2288,10 @@ public static AsyncPageable GetVirtualMachineSca /// VirtualMachineScaleSets_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which VM scale sets under the subscription are queried. @@ -2138,7 +2299,7 @@ public static AsyncPageable GetVirtualMachineSca /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineScaleSetsByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineScaleSetsByLocation(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineScaleSetsByLocation(location, cancellationToken); } /// @@ -2153,13 +2314,17 @@ public static Pageable GetVirtualMachineScaleSet /// VirtualMachineScaleSets_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineScaleSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineScaleSetsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineScaleSetsAsync(cancellationToken); } /// @@ -2174,13 +2339,17 @@ public static AsyncPageable GetVirtualMachineSca /// VirtualMachineScaleSets_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineScaleSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineScaleSets(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineScaleSets(cancellationToken); } /// @@ -2195,6 +2364,10 @@ public static Pageable GetVirtualMachineScaleSet /// VirtualMachines_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which virtual machines under the subscription are queried. @@ -2202,7 +2375,7 @@ public static Pageable GetVirtualMachineScaleSet /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachinesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachinesByLocationAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachinesByLocationAsync(location, cancellationToken); } /// @@ -2217,6 +2390,10 @@ public static AsyncPageable GetVirtualMachinesByLocation /// VirtualMachines_ListByLocation /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location for which virtual machines under the subscription are queried. @@ -2224,7 +2401,7 @@ public static AsyncPageable GetVirtualMachinesByLocation /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachinesByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachinesByLocation(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachinesByLocation(location, cancellationToken); } /// @@ -2239,6 +2416,10 @@ public static Pageable GetVirtualMachinesByLocation(this /// VirtualMachines_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. @@ -2248,7 +2429,7 @@ public static Pageable GetVirtualMachinesByLocation(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachinesAsync(this SubscriptionResource subscriptionResource, string statusOnly = null, string filter = null, ExpandTypesForListVm? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachinesAsync(statusOnly, filter, expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachinesAsync(statusOnly, filter, expand, cancellationToken); } /// @@ -2263,6 +2444,10 @@ public static AsyncPageable GetVirtualMachinesAsync(this /// VirtualMachines_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. @@ -2272,7 +2457,7 @@ public static AsyncPageable GetVirtualMachinesAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachines(this SubscriptionResource subscriptionResource, string statusOnly = null, string filter = null, ExpandTypesForListVm? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachines(statusOnly, filter, expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachines(statusOnly, filter, expand, cancellationToken); } /// @@ -2287,6 +2472,10 @@ public static Pageable GetVirtualMachines(this Subscript /// VirtualMachineImages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2299,12 +2488,7 @@ public static Pageable GetVirtualMachines(this Subscript /// , , or is null. public static async Task> GetVirtualMachineImageAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - Argument.AssertNotNullOrEmpty(skus, nameof(skus)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageAsync(location, publisherName, offer, skus, version, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageAsync(location, publisherName, offer, skus, version, cancellationToken).ConfigureAwait(false); } /// @@ -2319,6 +2503,10 @@ public static async Task> GetVirtualMachineImageAs /// VirtualMachineImages_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2331,12 +2519,7 @@ public static async Task> GetVirtualMachineImageAs /// , , or is null. public static Response GetVirtualMachineImage(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - Argument.AssertNotNullOrEmpty(skus, nameof(skus)); - Argument.AssertNotNullOrEmpty(version, nameof(version)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImage(location, publisherName, offer, skus, version, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImage(location, publisherName, offer, skus, version, cancellationToken); } /// @@ -2351,6 +2534,10 @@ public static Response GetVirtualMachineImage(this Subscrip /// VirtualMachineImages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2359,9 +2546,7 @@ public static Response GetVirtualMachineImage(this Subscrip /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImagesAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesAsync(options, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesAsync(options, cancellationToken); } /// @@ -2376,6 +2561,10 @@ public static AsyncPageable GetVirtualMachineImagesAsyn /// VirtualMachineImages_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2384,9 +2573,7 @@ public static AsyncPageable GetVirtualMachineImagesAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImages(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImages(options, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImages(options, cancellationToken); } /// @@ -2401,6 +2588,10 @@ public static Pageable GetVirtualMachineImages(this Sub /// VirtualMachineImages_ListOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2411,9 +2602,7 @@ public static Pageable GetVirtualMachineImages(this Sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImageOffersAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageOffersAsync(location, publisherName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageOffersAsync(location, publisherName, cancellationToken); } /// @@ -2428,6 +2617,10 @@ public static AsyncPageable GetVirtualMachineImageOffer /// VirtualMachineImages_ListOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2438,9 +2631,7 @@ public static AsyncPageable GetVirtualMachineImageOffer /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImageOffers(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageOffers(location, publisherName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageOffers(location, publisherName, cancellationToken); } /// @@ -2455,6 +2646,10 @@ public static Pageable GetVirtualMachineImageOffers(thi /// VirtualMachineImages_ListPublishers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2462,7 +2657,7 @@ public static Pageable GetVirtualMachineImageOffers(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImagePublishersAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagePublishersAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagePublishersAsync(location, cancellationToken); } /// @@ -2477,6 +2672,10 @@ public static AsyncPageable GetVirtualMachineImagePubli /// VirtualMachineImages_ListPublishers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2484,7 +2683,7 @@ public static AsyncPageable GetVirtualMachineImagePubli /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImagePublishers(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagePublishers(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagePublishers(location, cancellationToken); } /// @@ -2499,6 +2698,10 @@ public static Pageable GetVirtualMachineImagePublishers /// VirtualMachineImages_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2510,10 +2713,7 @@ public static Pageable GetVirtualMachineImagePublishers /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImageSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string offer, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageSkusAsync(location, publisherName, offer, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageSkusAsync(location, publisherName, offer, cancellationToken); } /// @@ -2528,6 +2728,10 @@ public static AsyncPageable GetVirtualMachineImageSkusA /// VirtualMachineImages_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2539,10 +2743,7 @@ public static AsyncPageable GetVirtualMachineImageSkusA /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImageSkus(this SubscriptionResource subscriptionResource, AzureLocation location, string publisherName, string offer, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageSkus(location, publisherName, offer, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageSkus(location, publisherName, offer, cancellationToken); } /// @@ -2557,6 +2758,10 @@ public static Pageable GetVirtualMachineImageSkus(this /// VirtualMachineImages_ListByEdgeZone /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2567,9 +2772,7 @@ public static Pageable GetVirtualMachineImageSkus(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImagesByEdgeZoneAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesByEdgeZoneAsync(location, edgeZone, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesByEdgeZoneAsync(location, edgeZone, cancellationToken); } /// @@ -2584,6 +2787,10 @@ public static AsyncPageable GetVirtualMachineImagesByEd /// VirtualMachineImages_ListByEdgeZone /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2594,9 +2801,7 @@ public static AsyncPageable GetVirtualMachineImagesByEd /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImagesByEdgeZone(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesByEdgeZone(location, edgeZone, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesByEdgeZone(location, edgeZone, cancellationToken); } /// @@ -2611,6 +2816,10 @@ public static Pageable GetVirtualMachineImagesByEdgeZon /// VirtualMachineImagesEdgeZone_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2618,9 +2827,7 @@ public static Pageable GetVirtualMachineImagesByEdgeZon /// is null. public static async Task> GetVirtualMachineImagesEdgeZoneAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesEdgeZoneOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesEdgeZoneAsync(options, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesEdgeZoneAsync(options, cancellationToken).ConfigureAwait(false); } /// @@ -2635,6 +2842,10 @@ public static async Task> GetVirtualMachineImagesE /// VirtualMachineImagesEdgeZone_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2642,9 +2853,7 @@ public static async Task> GetVirtualMachineImagesE /// is null. public static Response GetVirtualMachineImagesEdgeZone(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesEdgeZoneOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesEdgeZone(options, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesEdgeZone(options, cancellationToken); } /// @@ -2659,6 +2868,10 @@ public static Response GetVirtualMachineImagesEdgeZone(this /// VirtualMachineImagesEdgeZone_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2667,9 +2880,7 @@ public static Response GetVirtualMachineImagesEdgeZone(this /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImagesEdgeZonesAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesEdgeZonesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesEdgeZonesAsync(options, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesEdgeZonesAsync(options, cancellationToken); } /// @@ -2684,6 +2895,10 @@ public static AsyncPageable GetVirtualMachineImagesEdge /// VirtualMachineImagesEdgeZone_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -2692,9 +2907,7 @@ public static AsyncPageable GetVirtualMachineImagesEdge /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImagesEdgeZones(this SubscriptionResource subscriptionResource, SubscriptionResourceGetVirtualMachineImagesEdgeZonesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImagesEdgeZones(options, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImagesEdgeZones(options, cancellationToken); } /// @@ -2709,6 +2922,10 @@ public static Pageable GetVirtualMachineImagesEdgeZones /// VirtualMachineImagesEdgeZone_ListOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2720,10 +2937,7 @@ public static Pageable GetVirtualMachineImagesEdgeZones /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetOffersVirtualMachineImagesEdgeZonesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, string publisherName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOffersVirtualMachineImagesEdgeZonesAsync(location, edgeZone, publisherName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetOffersVirtualMachineImagesEdgeZonesAsync(location, edgeZone, publisherName, cancellationToken); } /// @@ -2738,6 +2952,10 @@ public static AsyncPageable GetOffersVirtualMachineImag /// VirtualMachineImagesEdgeZone_ListOffers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2749,10 +2967,7 @@ public static AsyncPageable GetOffersVirtualMachineImag /// A collection of that may take multiple service requests to iterate over. public static Pageable GetOffersVirtualMachineImagesEdgeZones(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, string publisherName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetOffersVirtualMachineImagesEdgeZones(location, edgeZone, publisherName, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetOffersVirtualMachineImagesEdgeZones(location, edgeZone, publisherName, cancellationToken); } /// @@ -2767,6 +2982,10 @@ public static Pageable GetOffersVirtualMachineImagesEdg /// VirtualMachineImagesEdgeZone_ListPublishers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2777,9 +2996,7 @@ public static Pageable GetOffersVirtualMachineImagesEdg /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetPublishersVirtualMachineImagesEdgeZonesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublishersVirtualMachineImagesEdgeZonesAsync(location, edgeZone, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetPublishersVirtualMachineImagesEdgeZonesAsync(location, edgeZone, cancellationToken); } /// @@ -2794,6 +3011,10 @@ public static AsyncPageable GetPublishersVirtualMachine /// VirtualMachineImagesEdgeZone_ListPublishers /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2804,9 +3025,7 @@ public static AsyncPageable GetPublishersVirtualMachine /// A collection of that may take multiple service requests to iterate over. public static Pageable GetPublishersVirtualMachineImagesEdgeZones(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPublishersVirtualMachineImagesEdgeZones(location, edgeZone, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetPublishersVirtualMachineImagesEdgeZones(location, edgeZone, cancellationToken); } /// @@ -2821,6 +3040,10 @@ public static Pageable GetPublishersVirtualMachineImage /// VirtualMachineImagesEdgeZone_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2833,11 +3056,7 @@ public static Pageable GetPublishersVirtualMachineImage /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineImageEdgeZoneSkusAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageEdgeZoneSkusAsync(location, edgeZone, publisherName, offer, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageEdgeZoneSkusAsync(location, edgeZone, publisherName, offer, cancellationToken); } /// @@ -2852,6 +3071,10 @@ public static AsyncPageable GetVirtualMachineImageEdgeZ /// VirtualMachineImagesEdgeZone_ListSkus /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of a supported Azure region. @@ -2864,11 +3087,7 @@ public static AsyncPageable GetVirtualMachineImageEdgeZ /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineImageEdgeZoneSkus(this SubscriptionResource subscriptionResource, AzureLocation location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); - Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); - Argument.AssertNotNullOrEmpty(offer, nameof(offer)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineImageEdgeZoneSkus(location, edgeZone, publisherName, offer, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineImageEdgeZoneSkus(location, edgeZone, publisherName, offer, cancellationToken); } /// @@ -2883,6 +3102,10 @@ public static Pageable GetVirtualMachineImageEdgeZoneSk /// AvailabilitySets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The expand expression to apply to the operation. Allowed values are 'instanceView'. @@ -2890,7 +3113,7 @@ public static Pageable GetVirtualMachineImageEdgeZoneSk /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailabilitySetsAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailabilitySetsAsync(expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetAvailabilitySetsAsync(expand, cancellationToken); } /// @@ -2905,6 +3128,10 @@ public static AsyncPageable GetAvailabilitySetsAsync(th /// AvailabilitySets_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The expand expression to apply to the operation. Allowed values are 'instanceView'. @@ -2912,7 +3139,7 @@ public static AsyncPageable GetAvailabilitySetsAsync(th /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailabilitySets(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailabilitySets(expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetAvailabilitySets(expand, cancellationToken); } /// @@ -2927,13 +3154,17 @@ public static Pageable GetAvailabilitySets(this Subscri /// ProximityPlacementGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetProximityPlacementGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProximityPlacementGroupsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetProximityPlacementGroupsAsync(cancellationToken); } /// @@ -2948,13 +3179,17 @@ public static AsyncPageable GetProximityPlaceme /// ProximityPlacementGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetProximityPlacementGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetProximityPlacementGroups(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetProximityPlacementGroups(cancellationToken); } /// @@ -2969,13 +3204,17 @@ public static Pageable GetProximityPlacementGro /// DedicatedHostGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDedicatedHostGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedHostGroupsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDedicatedHostGroupsAsync(cancellationToken); } /// @@ -2990,13 +3229,17 @@ public static AsyncPageable GetDedicatedHostGroupsAs /// DedicatedHostGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDedicatedHostGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDedicatedHostGroups(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDedicatedHostGroups(cancellationToken); } /// @@ -3011,13 +3254,17 @@ public static Pageable GetDedicatedHostGroups(this S /// SshPublicKeys_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSshPublicKeysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSshPublicKeysAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSshPublicKeysAsync(cancellationToken); } /// @@ -3032,13 +3279,17 @@ public static AsyncPageable GetSshPublicKeysAsync(this Sub /// SshPublicKeys_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSshPublicKeys(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSshPublicKeys(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSshPublicKeys(cancellationToken); } /// @@ -3053,13 +3304,17 @@ public static Pageable GetSshPublicKeys(this SubscriptionR /// Images_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiskImagesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskImagesAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskImagesAsync(cancellationToken); } /// @@ -3074,13 +3329,17 @@ public static AsyncPageable GetDiskImagesAsync(this Subscript /// Images_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiskImages(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskImages(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskImages(cancellationToken); } /// @@ -3095,13 +3354,17 @@ public static Pageable GetDiskImages(this SubscriptionResourc /// RestorePointCollections_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRestorePointGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRestorePointGroupsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetRestorePointGroupsAsync(cancellationToken); } /// @@ -3116,13 +3379,17 @@ public static AsyncPageable GetRestorePointGroupsAsyn /// RestorePointCollections_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRestorePointGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRestorePointGroups(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetRestorePointGroups(cancellationToken); } /// @@ -3137,6 +3404,10 @@ public static Pageable GetRestorePointGroups(this Sub /// CapacityReservationGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. @@ -3144,7 +3415,7 @@ public static Pageable GetRestorePointGroups(this Sub /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCapacityReservationGroupsAsync(this SubscriptionResource subscriptionResource, CapacityReservationGroupGetExpand? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapacityReservationGroupsAsync(expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCapacityReservationGroupsAsync(expand, cancellationToken); } /// @@ -3159,6 +3430,10 @@ public static AsyncPageable GetCapacityReserva /// CapacityReservationGroups_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. @@ -3166,7 +3441,7 @@ public static AsyncPageable GetCapacityReserva /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCapacityReservationGroups(this SubscriptionResource subscriptionResource, CapacityReservationGroupGetExpand? expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapacityReservationGroups(expand, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCapacityReservationGroups(expand, cancellationToken); } /// @@ -3181,6 +3456,10 @@ public static Pageable GetCapacityReservationG /// LogAnalytics_ExportRequestRateByInterval /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -3190,9 +3469,7 @@ public static Pageable GetCapacityReservationG /// is null. public static async Task> ExportLogAnalyticsRequestRateByIntervalAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, RequestRateByIntervalContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ExportLogAnalyticsRequestRateByIntervalAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).ExportLogAnalyticsRequestRateByIntervalAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -3207,6 +3484,10 @@ public static async Task> ExportLogAnalyticsRequestRa /// LogAnalytics_ExportRequestRateByInterval /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -3216,9 +3497,7 @@ public static async Task> ExportLogAnalyticsRequestRa /// is null. public static ArmOperation ExportLogAnalyticsRequestRateByInterval(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, RequestRateByIntervalContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExportLogAnalyticsRequestRateByInterval(waitUntil, location, content, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).ExportLogAnalyticsRequestRateByInterval(waitUntil, location, content, cancellationToken); } /// @@ -3233,6 +3512,10 @@ public static ArmOperation ExportLogAnalyticsRequestRateByInterval /// LogAnalytics_ExportThrottledRequests /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -3242,9 +3525,7 @@ public static ArmOperation ExportLogAnalyticsRequestRateByInterval /// is null. public static async Task> ExportLogAnalyticsThrottledRequestsAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, ThrottledRequestsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ExportLogAnalyticsThrottledRequestsAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).ExportLogAnalyticsThrottledRequestsAsync(waitUntil, location, content, cancellationToken).ConfigureAwait(false); } /// @@ -3259,6 +3540,10 @@ public static async Task> ExportLogAnalyticsThrottled /// LogAnalytics_ExportThrottledRequests /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -3268,9 +3553,7 @@ public static async Task> ExportLogAnalyticsThrottled /// is null. public static ArmOperation ExportLogAnalyticsThrottledRequests(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, ThrottledRequestsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ExportLogAnalyticsThrottledRequests(waitUntil, location, content, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).ExportLogAnalyticsThrottledRequests(waitUntil, location, content, cancellationToken); } /// @@ -3285,6 +3568,10 @@ public static ArmOperation ExportLogAnalyticsThrottledRequests(thi /// VirtualMachineRunCommands_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which run commands is queried. @@ -3292,7 +3579,7 @@ public static ArmOperation ExportLogAnalyticsThrottledRequests(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineRunCommandsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineRunCommandsAsync(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineRunCommandsAsync(location, cancellationToken); } /// @@ -3307,6 +3594,10 @@ public static AsyncPageable GetVirtualMachineRunCommands /// VirtualMachineRunCommands_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which run commands is queried. @@ -3314,7 +3605,7 @@ public static AsyncPageable GetVirtualMachineRunCommands /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineRunCommands(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineRunCommands(location, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineRunCommands(location, cancellationToken); } /// @@ -3329,6 +3620,10 @@ public static Pageable GetVirtualMachineRunCommands(this /// VirtualMachineRunCommands_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which run commands is queried. @@ -3338,9 +3633,7 @@ public static Pageable GetVirtualMachineRunCommands(this /// is null. public static async Task> GetVirtualMachineRunCommandAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string commandId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineRunCommandAsync(location, commandId, cancellationToken).ConfigureAwait(false); + return await GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineRunCommandAsync(location, commandId, cancellationToken).ConfigureAwait(false); } /// @@ -3355,6 +3648,10 @@ public static async Task> GetVirtualMachineRunComma /// VirtualMachineRunCommands_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location upon which run commands is queried. @@ -3364,9 +3661,7 @@ public static async Task> GetVirtualMachineRunComma /// is null. public static Response GetVirtualMachineRunCommand(this SubscriptionResource subscriptionResource, AzureLocation location, string commandId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineRunCommand(location, commandId, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineRunCommand(location, commandId, cancellationToken); } /// @@ -3381,13 +3676,17 @@ public static Response GetVirtualMachineRunCommand(this Subs /// Disks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedDisksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedDisksAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetManagedDisksAsync(cancellationToken); } /// @@ -3402,13 +3701,17 @@ public static AsyncPageable GetManagedDisksAsync(this Subsc /// Disks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedDisks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedDisks(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetManagedDisks(cancellationToken); } /// @@ -3423,13 +3726,17 @@ public static Pageable GetManagedDisks(this SubscriptionRes /// DiskAccesses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiskAccessesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskAccessesAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskAccessesAsync(cancellationToken); } /// @@ -3444,13 +3751,17 @@ public static AsyncPageable GetDiskAccessesAsync(this Subscr /// DiskAccesses_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiskAccesses(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskAccesses(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskAccesses(cancellationToken); } /// @@ -3465,13 +3776,17 @@ public static Pageable GetDiskAccesses(this SubscriptionReso /// DiskEncryptionSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDiskEncryptionSetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskEncryptionSetsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskEncryptionSetsAsync(cancellationToken); } /// @@ -3486,13 +3801,17 @@ public static AsyncPageable GetDiskEncryptionSetsAsyn /// DiskEncryptionSets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDiskEncryptionSets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDiskEncryptionSets(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetDiskEncryptionSets(cancellationToken); } /// @@ -3507,13 +3826,17 @@ public static Pageable GetDiskEncryptionSets(this Sub /// Snapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetSnapshotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSnapshotsAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSnapshotsAsync(cancellationToken); } /// @@ -3528,13 +3851,17 @@ public static AsyncPageable GetSnapshotsAsync(this Subscriptio /// Snapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetSnapshots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetSnapshots(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetSnapshots(cancellationToken); } /// @@ -3549,6 +3876,10 @@ public static Pageable GetSnapshots(this SubscriptionResource /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. Only **location** filter is supported currently. @@ -3557,7 +3888,7 @@ public static Pageable GetSnapshots(this SubscriptionResource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetComputeResourceSkusAsync(this SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetComputeResourceSkusAsync(filter, includeExtendedLocations, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetComputeResourceSkusAsync(filter, includeExtendedLocations, cancellationToken); } /// @@ -3572,6 +3903,10 @@ public static AsyncPageable GetComputeResourceSkusAsync(this /// ResourceSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the operation. Only **location** filter is supported currently. @@ -3580,7 +3915,7 @@ public static AsyncPageable GetComputeResourceSkusAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetComputeResourceSkus(this SubscriptionResource subscriptionResource, string filter = null, string includeExtendedLocations = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetComputeResourceSkus(filter, includeExtendedLocations, cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetComputeResourceSkus(filter, includeExtendedLocations, cancellationToken); } /// @@ -3595,13 +3930,17 @@ public static Pageable GetComputeResourceSkus(this Subscript /// Galleries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetGalleriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGalleriesAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetGalleriesAsync(cancellationToken); } /// @@ -3616,13 +3955,17 @@ public static AsyncPageable GetGalleriesAsync(this Subscription /// Galleries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetGalleries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetGalleries(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetGalleries(cancellationToken); } /// @@ -3637,13 +3980,17 @@ public static Pageable GetGalleries(this SubscriptionResource s /// CloudServices_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCloudServicesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudServicesAsync(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServicesAsync(cancellationToken); } /// @@ -3658,13 +4005,17 @@ public static AsyncPageable GetCloudServicesAsync(this Sub /// CloudServices_ListAll /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCloudServices(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCloudServices(cancellationToken); + return GetComputeSubscriptionMockingExtension(subscriptionResource).GetCloudServices(cancellationToken); } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeResourceGroupMockingExtension.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f3e2f3aced13 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeResourceGroupMockingExtension.cs @@ -0,0 +1,853 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Compute; +using Azure.ResourceManager.Compute.Models; + +namespace Azure.ResourceManager.Compute.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ComputeResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ComputeResourceGroupMockingExtension() + { + } + + /// 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 ComputeResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of VirtualMachineScaleSetResources in the ResourceGroupResource. + /// An object representing collection of VirtualMachineScaleSetResources and their operations over a VirtualMachineScaleSetResource. + public virtual VirtualMachineScaleSetCollection GetVirtualMachineScaleSets() + { + return GetCachedClient(client => new VirtualMachineScaleSetCollection(client, Id)); + } + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName} + /// + /// + /// Operation Id + /// VirtualMachineScaleSets_Get + /// + /// + /// + /// The name of the VM scale set. + /// The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualMachineScaleSetAsync(string virtualMachineScaleSetName, VirtualMachineScaleSetGetExpand? expand = null, CancellationToken cancellationToken = default) + { + return await GetVirtualMachineScaleSets().GetAsync(virtualMachineScaleSetName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Display information about a virtual machine scale set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName} + /// + /// + /// Operation Id + /// VirtualMachineScaleSets_Get + /// + /// + /// + /// The name of the VM scale set. + /// The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was provided by the user during the VM scale set Create/Update operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualMachineScaleSet(string virtualMachineScaleSetName, VirtualMachineScaleSetGetExpand? expand = null, CancellationToken cancellationToken = default) + { + return GetVirtualMachineScaleSets().Get(virtualMachineScaleSetName, expand, cancellationToken); + } + + /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. + public virtual VirtualMachineCollection GetVirtualMachines() + { + return GetCachedClient(client => new VirtualMachineCollection(client, Id)); + } + + /// + /// Retrieves information about the model view or the instance view of a virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// The name of the virtual machine. + /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualMachineAsync(string vmName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return await GetVirtualMachines().GetAsync(vmName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about the model view or the instance view of a virtual machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// The name of the virtual machine. + /// The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual machine that is managed by the platform and can change outside of control plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user during the VM Create/Update operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualMachine(string vmName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return GetVirtualMachines().Get(vmName, expand, cancellationToken); + } + + /// Gets a collection of AvailabilitySetResources in the ResourceGroupResource. + /// An object representing collection of AvailabilitySetResources and their operations over a AvailabilitySetResource. + public virtual AvailabilitySetCollection GetAvailabilitySets() + { + return GetCachedClient(client => new AvailabilitySetCollection(client, Id)); + } + + /// + /// Retrieves information about an availability set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + /// + /// + /// Operation Id + /// AvailabilitySets_Get + /// + /// + /// + /// The name of the availability set. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAvailabilitySetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + { + return await GetAvailabilitySets().GetAsync(availabilitySetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about an availability set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + /// + /// + /// Operation Id + /// AvailabilitySets_Get + /// + /// + /// + /// The name of the availability set. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAvailabilitySet(string availabilitySetName, CancellationToken cancellationToken = default) + { + return GetAvailabilitySets().Get(availabilitySetName, cancellationToken); + } + + /// Gets a collection of ProximityPlacementGroupResources in the ResourceGroupResource. + /// An object representing collection of ProximityPlacementGroupResources and their operations over a ProximityPlacementGroupResource. + public virtual ProximityPlacementGroupCollection GetProximityPlacementGroups() + { + return GetCachedClient(client => new ProximityPlacementGroupCollection(client, Id)); + } + + /// + /// Retrieves information about a proximity placement group . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName} + /// + /// + /// Operation Id + /// ProximityPlacementGroups_Get + /// + /// + /// + /// The name of the proximity placement group. + /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProximityPlacementGroupAsync(string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) + { + return await GetProximityPlacementGroups().GetAsync(proximityPlacementGroupName, includeColocationStatus, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about a proximity placement group . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName} + /// + /// + /// Operation Id + /// ProximityPlacementGroups_Get + /// + /// + /// + /// The name of the proximity placement group. + /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProximityPlacementGroup(string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) + { + return GetProximityPlacementGroups().Get(proximityPlacementGroupName, includeColocationStatus, cancellationToken); + } + + /// Gets a collection of DedicatedHostGroupResources in the ResourceGroupResource. + /// An object representing collection of DedicatedHostGroupResources and their operations over a DedicatedHostGroupResource. + public virtual DedicatedHostGroupCollection GetDedicatedHostGroups() + { + return GetCachedClient(client => new DedicatedHostGroupCollection(client, Id)); + } + + /// + /// Retrieves information about a dedicated host group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName} + /// + /// + /// Operation Id + /// DedicatedHostGroups_Get + /// + /// + /// + /// The name of the dedicated host group. + /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDedicatedHostGroupAsync(string hostGroupName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return await GetDedicatedHostGroups().GetAsync(hostGroupName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about a dedicated host group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName} + /// + /// + /// Operation Id + /// DedicatedHostGroups_Get + /// + /// + /// + /// The name of the dedicated host group. + /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDedicatedHostGroup(string hostGroupName, InstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return GetDedicatedHostGroups().Get(hostGroupName, expand, cancellationToken); + } + + /// Gets a collection of SshPublicKeyResources in the ResourceGroupResource. + /// An object representing collection of SshPublicKeyResources and their operations over a SshPublicKeyResource. + public virtual SshPublicKeyCollection GetSshPublicKeys() + { + return GetCachedClient(client => new SshPublicKeyCollection(client, Id)); + } + + /// + /// Retrieves information about an SSH public key. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} + /// + /// + /// Operation Id + /// SshPublicKeys_Get + /// + /// + /// + /// The name of the SSH public key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSshPublicKeyAsync(string sshPublicKeyName, CancellationToken cancellationToken = default) + { + return await GetSshPublicKeys().GetAsync(sshPublicKeyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about an SSH public key. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} + /// + /// + /// Operation Id + /// SshPublicKeys_Get + /// + /// + /// + /// The name of the SSH public key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSshPublicKey(string sshPublicKeyName, CancellationToken cancellationToken = default) + { + return GetSshPublicKeys().Get(sshPublicKeyName, cancellationToken); + } + + /// Gets a collection of DiskImageResources in the ResourceGroupResource. + /// An object representing collection of DiskImageResources and their operations over a DiskImageResource. + public virtual DiskImageCollection GetDiskImages() + { + return GetCachedClient(client => new DiskImageCollection(client, Id)); + } + + /// + /// Gets an image. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName} + /// + /// + /// Operation Id + /// Images_Get + /// + /// + /// + /// The name of the image. + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiskImageAsync(string imageName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDiskImages().GetAsync(imageName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an image. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName} + /// + /// + /// Operation Id + /// Images_Get + /// + /// + /// + /// The name of the image. + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiskImage(string imageName, string expand = null, CancellationToken cancellationToken = default) + { + return GetDiskImages().Get(imageName, expand, cancellationToken); + } + + /// Gets a collection of RestorePointGroupResources in the ResourceGroupResource. + /// An object representing collection of RestorePointGroupResources and their operations over a RestorePointGroupResource. + public virtual RestorePointGroupCollection GetRestorePointGroups() + { + return GetCachedClient(client => new RestorePointGroupCollection(client, Id)); + } + + /// + /// The operation to get the restore point collection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName} + /// + /// + /// Operation Id + /// RestorePointCollections_Get + /// + /// + /// + /// The name of the restore point collection. + /// The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRestorePointGroupAsync(string restorePointGroupName, RestorePointGroupExpand? expand = null, CancellationToken cancellationToken = default) + { + return await GetRestorePointGroups().GetAsync(restorePointGroupName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation to get the restore point collection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName} + /// + /// + /// Operation Id + /// RestorePointCollections_Get + /// + /// + /// + /// The name of the restore point collection. + /// The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points in the restorePointCollection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRestorePointGroup(string restorePointGroupName, RestorePointGroupExpand? expand = null, CancellationToken cancellationToken = default) + { + return GetRestorePointGroups().Get(restorePointGroupName, expand, cancellationToken); + } + + /// Gets a collection of CapacityReservationGroupResources in the ResourceGroupResource. + /// An object representing collection of CapacityReservationGroupResources and their operations over a CapacityReservationGroupResource. + public virtual CapacityReservationGroupCollection GetCapacityReservationGroups() + { + return GetCachedClient(client => new CapacityReservationGroupCollection(client, Id)); + } + + /// + /// The operation that retrieves information about a capacity reservation group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName} + /// + /// + /// Operation Id + /// CapacityReservationGroups_Get + /// + /// + /// + /// The name of the capacity reservation group. + /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCapacityReservationGroupAsync(string capacityReservationGroupName, CapacityReservationGroupInstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return await GetCapacityReservationGroups().GetAsync(capacityReservationGroupName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation that retrieves information about a capacity reservation group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName} + /// + /// + /// Operation Id + /// CapacityReservationGroups_Get + /// + /// + /// + /// The name of the capacity reservation group. + /// The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCapacityReservationGroup(string capacityReservationGroupName, CapacityReservationGroupInstanceViewType? expand = null, CancellationToken cancellationToken = default) + { + return GetCapacityReservationGroups().Get(capacityReservationGroupName, expand, cancellationToken); + } + + /// Gets a collection of ManagedDiskResources in the ResourceGroupResource. + /// An object representing collection of ManagedDiskResources and their operations over a ManagedDiskResource. + public virtual ManagedDiskCollection GetManagedDisks() + { + return GetCachedClient(client => new ManagedDiskCollection(client, Id)); + } + + /// + /// Gets information about a disk. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName} + /// + /// + /// Operation Id + /// Disks_Get + /// + /// + /// + /// The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedDiskAsync(string diskName, CancellationToken cancellationToken = default) + { + return await GetManagedDisks().GetAsync(diskName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a disk. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName} + /// + /// + /// Operation Id + /// Disks_Get + /// + /// + /// + /// The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedDisk(string diskName, CancellationToken cancellationToken = default) + { + return GetManagedDisks().Get(diskName, cancellationToken); + } + + /// Gets a collection of DiskAccessResources in the ResourceGroupResource. + /// An object representing collection of DiskAccessResources and their operations over a DiskAccessResource. + public virtual DiskAccessCollection GetDiskAccesses() + { + return GetCachedClient(client => new DiskAccessCollection(client, Id)); + } + + /// + /// Gets information about a disk access resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName} + /// + /// + /// Operation Id + /// DiskAccesses_Get + /// + /// + /// + /// The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiskAccessAsync(string diskAccessName, CancellationToken cancellationToken = default) + { + return await GetDiskAccesses().GetAsync(diskAccessName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a disk access resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName} + /// + /// + /// Operation Id + /// DiskAccesses_Get + /// + /// + /// + /// The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiskAccess(string diskAccessName, CancellationToken cancellationToken = default) + { + return GetDiskAccesses().Get(diskAccessName, cancellationToken); + } + + /// Gets a collection of DiskEncryptionSetResources in the ResourceGroupResource. + /// An object representing collection of DiskEncryptionSetResources and their operations over a DiskEncryptionSetResource. + public virtual DiskEncryptionSetCollection GetDiskEncryptionSets() + { + return GetCachedClient(client => new DiskEncryptionSetCollection(client, Id)); + } + + /// + /// Gets information about a disk encryption set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName} + /// + /// + /// Operation Id + /// DiskEncryptionSets_Get + /// + /// + /// + /// The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDiskEncryptionSetAsync(string diskEncryptionSetName, CancellationToken cancellationToken = default) + { + return await GetDiskEncryptionSets().GetAsync(diskEncryptionSetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a disk encryption set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName} + /// + /// + /// Operation Id + /// DiskEncryptionSets_Get + /// + /// + /// + /// The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDiskEncryptionSet(string diskEncryptionSetName, CancellationToken cancellationToken = default) + { + return GetDiskEncryptionSets().Get(diskEncryptionSetName, cancellationToken); + } + + /// Gets a collection of SnapshotResources in the ResourceGroupResource. + /// An object representing collection of SnapshotResources and their operations over a SnapshotResource. + public virtual SnapshotCollection GetSnapshots() + { + return GetCachedClient(client => new SnapshotCollection(client, Id)); + } + + /// + /// Gets information about a snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// + /// The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSnapshotAsync(string snapshotName, CancellationToken cancellationToken = default) + { + return await GetSnapshots().GetAsync(snapshotName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// + /// The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSnapshot(string snapshotName, CancellationToken cancellationToken = default) + { + return GetSnapshots().Get(snapshotName, cancellationToken); + } + + /// Gets a collection of GalleryResources in the ResourceGroupResource. + /// An object representing collection of GalleryResources and their operations over a GalleryResource. + public virtual GalleryCollection GetGalleries() + { + return GetCachedClient(client => new GalleryCollection(client, Id)); + } + + /// + /// Retrieves information about a Shared Image Gallery. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName} + /// + /// + /// Operation Id + /// Galleries_Get + /// + /// + /// + /// The name of the Shared Image Gallery. + /// The select expression to apply on the operation. + /// The expand query option to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGalleryAsync(string galleryName, SelectPermission? select = null, GalleryExpand? expand = null, CancellationToken cancellationToken = default) + { + return await GetGalleries().GetAsync(galleryName, select, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about a Shared Image Gallery. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName} + /// + /// + /// Operation Id + /// Galleries_Get + /// + /// + /// + /// The name of the Shared Image Gallery. + /// The select expression to apply on the operation. + /// The expand query option to apply on the operation. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGallery(string galleryName, SelectPermission? select = null, GalleryExpand? expand = null, CancellationToken cancellationToken = default) + { + return GetGalleries().Get(galleryName, select, expand, cancellationToken); + } + + /// Gets a collection of CloudServiceResources in the ResourceGroupResource. + /// An object representing collection of CloudServiceResources and their operations over a CloudServiceResource. + public virtual CloudServiceCollection GetCloudServices() + { + return GetCachedClient(client => new CloudServiceCollection(client, Id)); + } + + /// + /// Display information about a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName} + /// + /// + /// Operation Id + /// CloudServices_Get + /// + /// + /// + /// Name of the cloud service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudServiceAsync(string cloudServiceName, CancellationToken cancellationToken = default) + { + return await GetCloudServices().GetAsync(cloudServiceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Display information about a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName} + /// + /// + /// Operation Id + /// CloudServices_Get + /// + /// + /// + /// Name of the cloud service. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudService(string cloudServiceName, CancellationToken cancellationToken = default) + { + return GetCloudServices().Get(cloudServiceName, cancellationToken); + } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeSubscriptionMockingExtension.cs similarity index 81% rename from sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeSubscriptionMockingExtension.cs index e4547c00bc68..c74d28ca6697 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Compute; using Azure.ResourceManager.Compute.Models; -namespace Azure.ResourceManager.Compute +namespace Azure.ResourceManager.Compute.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ComputeSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _usageClientDiagnostics; private UsageRestOperations _usageRestClient; @@ -65,15 +66,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _cloudServiceClientDiagnostics; private CloudServicesRestOperations _cloudServiceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ComputeSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ComputeSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -131,12 +132,66 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// Gets a collection of VirtualMachineExtensionImageResources in the SubscriptionResource. /// The name of a supported Azure region. /// The String to use. + /// is null. + /// is an empty string, and was expected to be non-empty. /// An object representing collection of VirtualMachineExtensionImageResources and their operations over a VirtualMachineExtensionImageResource. public virtual VirtualMachineExtensionImageCollection GetVirtualMachineExtensionImages(AzureLocation location, string publisherName) { return new VirtualMachineExtensionImageCollection(Client, Id, location, publisherName); } + /// + /// Gets a virtual machine extension image. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version} + /// + /// + /// Operation Id + /// VirtualMachineExtensionImages_Get + /// + /// + /// + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualMachineExtensionImageAsync(AzureLocation location, string publisherName, string type, string version, CancellationToken cancellationToken = default) + { + return await GetVirtualMachineExtensionImages(location, publisherName).GetAsync(type, version, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a virtual machine extension image. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version} + /// + /// + /// Operation Id + /// VirtualMachineExtensionImages_Get + /// + /// + /// + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualMachineExtensionImage(AzureLocation location, string publisherName, string type, string version, CancellationToken cancellationToken = default) + { + return GetVirtualMachineExtensionImages(location, publisherName).Get(type, version, cancellationToken); + } + /// Gets a collection of SharedGalleryResources in the SubscriptionResource. /// Resource location. /// An object representing collection of SharedGalleryResources and their operations over a SharedGalleryResource. @@ -145,11 +200,107 @@ public virtual SharedGalleryCollection GetSharedGalleries(AzureLocation location return new SharedGalleryCollection(Client, Id, location); } + /// + /// Get a shared gallery by subscription id or tenant id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName} + /// + /// + /// Operation Id + /// SharedGalleries_Get + /// + /// + /// + /// Resource location. + /// The unique name of the Shared Gallery. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSharedGalleryAsync(AzureLocation location, string galleryUniqueName, CancellationToken cancellationToken = default) + { + return await GetSharedGalleries(location).GetAsync(galleryUniqueName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a shared gallery by subscription id or tenant id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName} + /// + /// + /// Operation Id + /// SharedGalleries_Get + /// + /// + /// + /// Resource location. + /// The unique name of the Shared Gallery. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSharedGallery(AzureLocation location, string galleryUniqueName, CancellationToken cancellationToken = default) + { + return GetSharedGalleries(location).Get(galleryUniqueName, cancellationToken); + } + /// Gets a collection of CommunityGalleryResources in the SubscriptionResource. /// An object representing collection of CommunityGalleryResources and their operations over a CommunityGalleryResource. public virtual CommunityGalleryCollection GetCommunityGalleries() { - return GetCachedClient(Client => new CommunityGalleryCollection(Client, Id)); + return GetCachedClient(client => new CommunityGalleryCollection(client, Id)); + } + + /// + /// Get a community gallery by gallery public name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName} + /// + /// + /// Operation Id + /// CommunityGalleries_Get + /// + /// + /// + /// Resource location. + /// The public name of the community gallery. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCommunityGalleryAsync(AzureLocation location, string publicGalleryName, CancellationToken cancellationToken = default) + { + return await GetCommunityGalleries().GetAsync(location, publicGalleryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a community gallery by gallery public name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName} + /// + /// + /// Operation Id + /// CommunityGalleries_Get + /// + /// + /// + /// Resource location. + /// The public name of the community gallery. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCommunityGallery(AzureLocation location, string publicGalleryName, CancellationToken cancellationToken = default) + { + return GetCommunityGalleries().Get(location, publicGalleryName, cancellationToken); } /// Gets a collection of CloudServiceOSVersionResources in the SubscriptionResource. @@ -160,6 +311,54 @@ public virtual CloudServiceOSVersionCollection GetCloudServiceOSVersions(AzureLo return new CloudServiceOSVersionCollection(Client, Id, location); } + /// + /// Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName} + /// + /// + /// Operation Id + /// CloudServiceOperatingSystems_GetOSVersion + /// + /// + /// + /// Name of the location that the OS versions pertain to. + /// Name of the OS version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudServiceOSVersionAsync(AzureLocation location, string osVersionName, CancellationToken cancellationToken = default) + { + return await GetCloudServiceOSVersions(location).GetAsync(osVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName} + /// + /// + /// Operation Id + /// CloudServiceOperatingSystems_GetOSVersion + /// + /// + /// + /// Name of the location that the OS versions pertain to. + /// Name of the OS version. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudServiceOSVersion(AzureLocation location, string osVersionName, CancellationToken cancellationToken = default) + { + return GetCloudServiceOSVersions(location).Get(osVersionName, cancellationToken); + } + /// Gets a collection of CloudServiceOSFamilyResources in the SubscriptionResource. /// Name of the location that the OS families pertain to. /// An object representing collection of CloudServiceOSFamilyResources and their operations over a CloudServiceOSFamilyResource. @@ -168,6 +367,54 @@ public virtual CloudServiceOSFamilyCollection GetCloudServiceOSFamilies(AzureLoc return new CloudServiceOSFamilyCollection(Client, Id, location); } + /// + /// Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName} + /// + /// + /// Operation Id + /// CloudServiceOperatingSystems_GetOSFamily + /// + /// + /// + /// Name of the location that the OS families pertain to. + /// Name of the OS family. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudServiceOSFamilyAsync(AzureLocation location, string osFamilyName, CancellationToken cancellationToken = default) + { + return await GetCloudServiceOSFamilies(location).GetAsync(osFamilyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName} + /// + /// + /// Operation Id + /// CloudServiceOperatingSystems_GetOSFamily + /// + /// + /// + /// Name of the location that the OS families pertain to. + /// Name of the OS family. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudServiceOSFamily(AzureLocation location, string osFamilyName, CancellationToken cancellationToken = default) + { + return GetCloudServiceOSFamilies(location).Get(osFamilyName, cancellationToken); + } + /// /// Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. /// @@ -188,7 +435,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location { HttpMessage FirstPageRequest(int? pageSizeHint) => UsageRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ComputeUsage.DeserializeComputeUsage, UsageClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ComputeUsage.DeserializeComputeUsage, UsageClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -211,7 +458,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => UsageRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ComputeUsage.DeserializeComputeUsage, UsageClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ComputeUsage.DeserializeComputeUsage, UsageClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetUsages", "value", "nextLink", cancellationToken); } /// @@ -233,7 +480,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella public virtual AsyncPageable GetVirtualMachineSizesAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineSize.DeserializeVirtualMachineSize, VirtualMachineSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineSizes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineSize.DeserializeVirtualMachineSize, VirtualMachineSizesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineSizes", "value", null, cancellationToken); } /// @@ -255,7 +502,7 @@ public virtual AsyncPageable GetVirtualMachineSizesAsync(Azu public virtual Pageable GetVirtualMachineSizes(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineSize.DeserializeVirtualMachineSize, VirtualMachineSizesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineSizes", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineSize.DeserializeVirtualMachineSize, VirtualMachineSizesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineSizes", "value", null, cancellationToken); } /// @@ -278,7 +525,7 @@ public virtual AsyncPageable GetVirtualMachineSc { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineScaleSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineScaleSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineScaleSetsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineScaleSetsByLocation", "value", "nextLink", cancellationToken); } /// @@ -301,7 +548,7 @@ public virtual Pageable GetVirtualMachineScaleSe { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineScaleSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineScaleSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineScaleSetsByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineScaleSetsByLocation", "value", "nextLink", cancellationToken); } /// @@ -323,7 +570,7 @@ public virtual AsyncPageable GetVirtualMachineSc { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineScaleSetRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineScaleSetRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); } /// @@ -345,7 +592,7 @@ public virtual Pageable GetVirtualMachineScaleSe { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineScaleSetRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineScaleSetRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineScaleSetResource(Client, VirtualMachineScaleSetData.DeserializeVirtualMachineScaleSetData(e)), VirtualMachineScaleSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); } /// @@ -368,7 +615,7 @@ public virtual AsyncPageable GetVirtualMachinesByLocatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachinesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachinesByLocation", "value", "nextLink", cancellationToken); } /// @@ -391,7 +638,7 @@ public virtual Pageable GetVirtualMachinesByLocation(Azu { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListByLocationRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachinesByLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachinesByLocation", "value", "nextLink", cancellationToken); } /// @@ -416,7 +663,7 @@ public virtual AsyncPageable GetVirtualMachinesAsync(str { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListAllRequest(Id.SubscriptionId, statusOnly, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId, statusOnly, filter, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -441,7 +688,7 @@ public virtual Pageable GetVirtualMachines(string status { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListAllRequest(Id.SubscriptionId, statusOnly, filter, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId, statusOnly, filter, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -463,9 +710,16 @@ public virtual Pageable GetVirtualMachines(string status /// A valid image SKU. /// A valid image SKU version. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual async Task> GetVirtualMachineImageAsync(AzureLocation location, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineImagesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineImage"); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + Argument.AssertNotNullOrEmpty(skus, nameof(skus)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = VirtualMachineImagesClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineImage"); scope.Start(); try { @@ -498,9 +752,16 @@ public virtual async Task> GetVirtualMachineImageA /// A valid image SKU. /// A valid image SKU version. /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual Response GetVirtualMachineImage(AzureLocation location, string publisherName, string offer, string skus, string version, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineImagesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineImage"); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + Argument.AssertNotNullOrEmpty(skus, nameof(skus)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = VirtualMachineImagesClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineImage"); scope.Start(); try { @@ -529,11 +790,14 @@ public virtual Response GetVirtualMachineImage(AzureLocatio /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImagesAsync(SubscriptionResourceGetVirtualMachineImagesOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListRequest(Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImages", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImages", "", null, cancellationToken); } /// @@ -551,11 +815,14 @@ public virtual AsyncPageable GetVirtualMachineImagesAsy /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImages(SubscriptionResourceGetVirtualMachineImagesOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListRequest(Id.SubscriptionId, options.Location, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImages", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImages", "", null, cancellationToken); } /// @@ -574,11 +841,15 @@ public virtual Pageable GetVirtualMachineImages(Subscri /// The name of a supported Azure region. /// A valid image publisher. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImageOffersAsync(AzureLocation location, string publisherName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListOffersRequest(Id.SubscriptionId, location, publisherName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageOffers", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageOffers", "", null, cancellationToken); } /// @@ -597,11 +868,15 @@ public virtual AsyncPageable GetVirtualMachineImageOffe /// The name of a supported Azure region. /// A valid image publisher. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImageOffers(AzureLocation location, string publisherName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListOffersRequest(Id.SubscriptionId, location, publisherName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageOffers", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageOffers", "", null, cancellationToken); } /// @@ -623,7 +898,7 @@ public virtual Pageable GetVirtualMachineImageOffers(Az public virtual AsyncPageable GetVirtualMachineImagePublishersAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListPublishersRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagePublishers", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagePublishers", "", null, cancellationToken); } /// @@ -645,7 +920,7 @@ public virtual AsyncPageable GetVirtualMachineImagePubl public virtual Pageable GetVirtualMachineImagePublishers(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListPublishersRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagePublishers", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagePublishers", "", null, cancellationToken); } /// @@ -665,11 +940,16 @@ public virtual Pageable GetVirtualMachineImagePublisher /// A valid image publisher. /// A valid image publisher offer. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImageSkusAsync(AzureLocation location, string publisherName, string offer, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListSkusRequest(Id.SubscriptionId, location, publisherName, offer); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageSkus", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageSkus", "", null, cancellationToken); } /// @@ -689,11 +969,16 @@ public virtual AsyncPageable GetVirtualMachineImageSkus /// A valid image publisher. /// A valid image publisher offer. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImageSkus(AzureLocation location, string publisherName, string offer, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListSkusRequest(Id.SubscriptionId, location, publisherName, offer); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageSkus", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageSkus", "", null, cancellationToken); } /// @@ -712,11 +997,15 @@ public virtual Pageable GetVirtualMachineImageSkus(Azur /// The name of a supported Azure region. /// The name of the edge zone. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImagesByEdgeZoneAsync(AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListByEdgeZoneRequest(Id.SubscriptionId, location, edgeZone); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagesByEdgeZone", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagesByEdgeZone", "value", null, cancellationToken); } /// @@ -735,11 +1024,15 @@ public virtual AsyncPageable GetVirtualMachineImagesByE /// The name of a supported Azure region. /// The name of the edge zone. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImagesByEdgeZone(AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesRestClient.CreateListByEdgeZoneRequest(Id.SubscriptionId, location, edgeZone); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagesByEdgeZone", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagesByEdgeZone", "value", null, cancellationToken); } /// @@ -757,9 +1050,12 @@ public virtual Pageable GetVirtualMachineImagesByEdgeZo /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual async Task> GetVirtualMachineImagesEdgeZoneAsync(SubscriptionResourceGetVirtualMachineImagesEdgeZoneOptions options, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineImagesEdgeZoneClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineImagesEdgeZone"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = VirtualMachineImagesEdgeZoneClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineImagesEdgeZone"); scope.Start(); try { @@ -788,9 +1084,12 @@ public virtual async Task> GetVirtualMachineImages /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. public virtual Response GetVirtualMachineImagesEdgeZone(SubscriptionResourceGetVirtualMachineImagesEdgeZoneOptions options, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineImagesEdgeZoneClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineImagesEdgeZone"); + Argument.AssertNotNull(options, nameof(options)); + + using var scope = VirtualMachineImagesEdgeZoneClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineImagesEdgeZone"); scope.Start(); try { @@ -819,11 +1118,14 @@ public virtual Response GetVirtualMachineImagesEdgeZone(Sub /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImagesEdgeZonesAsync(SubscriptionResourceGetVirtualMachineImagesEdgeZonesOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListRequest(Id.SubscriptionId, options.Location, options.EdgeZone, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -841,11 +1143,14 @@ public virtual AsyncPageable GetVirtualMachineImagesEdg /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImagesEdgeZones(SubscriptionResourceGetVirtualMachineImagesEdgeZonesOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListRequest(Id.SubscriptionId, options.Location, options.EdgeZone, options.PublisherName, options.Offer, options.Skus, options.Expand, options.Top, options.Orderby); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -865,11 +1170,16 @@ public virtual Pageable GetVirtualMachineImagesEdgeZone /// The name of the edge zone. /// A valid image publisher. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetOffersVirtualMachineImagesEdgeZonesAsync(AzureLocation location, string edgeZone, string publisherName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListOffersRequest(Id.SubscriptionId, location, edgeZone, publisherName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOffersVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetOffersVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -889,11 +1199,16 @@ public virtual AsyncPageable GetOffersVirtualMachineIma /// The name of the edge zone. /// A valid image publisher. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetOffersVirtualMachineImagesEdgeZones(AzureLocation location, string edgeZone, string publisherName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListOffersRequest(Id.SubscriptionId, location, edgeZone, publisherName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetOffersVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetOffersVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -912,11 +1227,15 @@ public virtual Pageable GetOffersVirtualMachineImagesEd /// The name of a supported Azure region. /// The name of the edge zone. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetPublishersVirtualMachineImagesEdgeZonesAsync(AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListPublishersRequest(Id.SubscriptionId, location, edgeZone); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublishersVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetPublishersVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -935,11 +1254,15 @@ public virtual AsyncPageable GetPublishersVirtualMachin /// The name of a supported Azure region. /// The name of the edge zone. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetPublishersVirtualMachineImagesEdgeZones(AzureLocation location, string edgeZone, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListPublishersRequest(Id.SubscriptionId, location, edgeZone); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetPublishersVirtualMachineImagesEdgeZones", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetPublishersVirtualMachineImagesEdgeZones", "", null, cancellationToken); } /// @@ -960,11 +1283,17 @@ public virtual Pageable GetPublishersVirtualMachineImag /// A valid image publisher. /// A valid image publisher offer. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetVirtualMachineImageEdgeZoneSkusAsync(AzureLocation location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListSkusRequest(Id.SubscriptionId, location, edgeZone, publisherName, offer); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageEdgeZoneSkus", "", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageEdgeZoneSkus", "", null, cancellationToken); } /// @@ -985,11 +1314,17 @@ public virtual AsyncPageable GetVirtualMachineImageEdge /// A valid image publisher. /// A valid image publisher offer. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetVirtualMachineImageEdgeZoneSkus(AzureLocation location, string edgeZone, string publisherName, string offer, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(edgeZone, nameof(edgeZone)); + Argument.AssertNotNullOrEmpty(publisherName, nameof(publisherName)); + Argument.AssertNotNullOrEmpty(offer, nameof(offer)); + HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineImagesEdgeZoneRestClient.CreateListSkusRequest(Id.SubscriptionId, location, edgeZone, publisherName, offer); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineImageEdgeZoneSkus", "", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, VirtualMachineImageBase.DeserializeVirtualMachineImageBase, VirtualMachineImagesEdgeZoneClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineImageEdgeZoneSkus", "", null, cancellationToken); } /// @@ -1012,7 +1347,7 @@ public virtual AsyncPageable GetAvailabilitySetsAsync(s { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilitySetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilitySetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvailabilitySetResource(Client, AvailabilitySetData.DeserializeAvailabilitySetData(e)), AvailabilitySetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailabilitySets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AvailabilitySetResource(Client, AvailabilitySetData.DeserializeAvailabilitySetData(e)), AvailabilitySetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetAvailabilitySets", "value", "nextLink", cancellationToken); } /// @@ -1035,7 +1370,7 @@ public virtual Pageable GetAvailabilitySets(string expa { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailabilitySetRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailabilitySetRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvailabilitySetResource(Client, AvailabilitySetData.DeserializeAvailabilitySetData(e)), AvailabilitySetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailabilitySets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AvailabilitySetResource(Client, AvailabilitySetData.DeserializeAvailabilitySetData(e)), AvailabilitySetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetAvailabilitySets", "value", "nextLink", cancellationToken); } /// @@ -1057,7 +1392,7 @@ public virtual AsyncPageable GetProximityPlacem { HttpMessage FirstPageRequest(int? pageSizeHint) => ProximityPlacementGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProximityPlacementGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProximityPlacementGroupResource(Client, ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(e)), ProximityPlacementGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProximityPlacementGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProximityPlacementGroupResource(Client, ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(e)), ProximityPlacementGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetProximityPlacementGroups", "value", "nextLink", cancellationToken); } /// @@ -1079,7 +1414,7 @@ public virtual Pageable GetProximityPlacementGr { HttpMessage FirstPageRequest(int? pageSizeHint) => ProximityPlacementGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProximityPlacementGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProximityPlacementGroupResource(Client, ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(e)), ProximityPlacementGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProximityPlacementGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProximityPlacementGroupResource(Client, ProximityPlacementGroupData.DeserializeProximityPlacementGroupData(e)), ProximityPlacementGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetProximityPlacementGroups", "value", "nextLink", cancellationToken); } /// @@ -1101,7 +1436,7 @@ public virtual AsyncPageable GetDedicatedHostGroupsA { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHostGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHostGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHostGroupResource(Client, DedicatedHostGroupData.DeserializeDedicatedHostGroupData(e)), DedicatedHostGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedHostGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHostGroupResource(Client, DedicatedHostGroupData.DeserializeDedicatedHostGroupData(e)), DedicatedHostGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDedicatedHostGroups", "value", "nextLink", cancellationToken); } /// @@ -1123,7 +1458,7 @@ public virtual Pageable GetDedicatedHostGroups(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHostGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHostGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHostGroupResource(Client, DedicatedHostGroupData.DeserializeDedicatedHostGroupData(e)), DedicatedHostGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDedicatedHostGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHostGroupResource(Client, DedicatedHostGroupData.DeserializeDedicatedHostGroupData(e)), DedicatedHostGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDedicatedHostGroups", "value", "nextLink", cancellationToken); } /// @@ -1145,7 +1480,7 @@ public virtual AsyncPageable GetSshPublicKeysAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => SshPublicKeyRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SshPublicKeyRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SshPublicKeyResource(Client, SshPublicKeyData.DeserializeSshPublicKeyData(e)), SshPublicKeyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSshPublicKeys", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SshPublicKeyResource(Client, SshPublicKeyData.DeserializeSshPublicKeyData(e)), SshPublicKeyClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetSshPublicKeys", "value", "nextLink", cancellationToken); } /// @@ -1167,7 +1502,7 @@ public virtual Pageable GetSshPublicKeys(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => SshPublicKeyRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SshPublicKeyRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SshPublicKeyResource(Client, SshPublicKeyData.DeserializeSshPublicKeyData(e)), SshPublicKeyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSshPublicKeys", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SshPublicKeyResource(Client, SshPublicKeyData.DeserializeSshPublicKeyData(e)), SshPublicKeyClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetSshPublicKeys", "value", "nextLink", cancellationToken); } /// @@ -1189,7 +1524,7 @@ public virtual AsyncPageable GetDiskImagesAsync(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskImageImagesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskImageImagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskImageResource(Client, DiskImageData.DeserializeDiskImageData(e)), DiskImageImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskImages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskImageResource(Client, DiskImageData.DeserializeDiskImageData(e)), DiskImageImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskImages", "value", "nextLink", cancellationToken); } /// @@ -1211,7 +1546,7 @@ public virtual Pageable GetDiskImages(CancellationToken cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskImageImagesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskImageImagesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskImageResource(Client, DiskImageData.DeserializeDiskImageData(e)), DiskImageImagesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskImages", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskImageResource(Client, DiskImageData.DeserializeDiskImageData(e)), DiskImageImagesClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskImages", "value", "nextLink", cancellationToken); } /// @@ -1233,7 +1568,7 @@ public virtual AsyncPageable GetRestorePointGroupsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => RestorePointGroupRestorePointCollectionsRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RestorePointGroupRestorePointCollectionsRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RestorePointGroupResource(Client, RestorePointGroupData.DeserializeRestorePointGroupData(e)), RestorePointGroupRestorePointCollectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRestorePointGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RestorePointGroupResource(Client, RestorePointGroupData.DeserializeRestorePointGroupData(e)), RestorePointGroupRestorePointCollectionsClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetRestorePointGroups", "value", "nextLink", cancellationToken); } /// @@ -1255,7 +1590,7 @@ public virtual Pageable GetRestorePointGroups(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => RestorePointGroupRestorePointCollectionsRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => RestorePointGroupRestorePointCollectionsRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RestorePointGroupResource(Client, RestorePointGroupData.DeserializeRestorePointGroupData(e)), RestorePointGroupRestorePointCollectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRestorePointGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RestorePointGroupResource(Client, RestorePointGroupData.DeserializeRestorePointGroupData(e)), RestorePointGroupRestorePointCollectionsClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetRestorePointGroups", "value", "nextLink", cancellationToken); } /// @@ -1278,7 +1613,7 @@ public virtual AsyncPageable GetCapacityReserv { HttpMessage FirstPageRequest(int? pageSizeHint) => CapacityReservationGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CapacityReservationGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CapacityReservationGroupResource(Client, CapacityReservationGroupData.DeserializeCapacityReservationGroupData(e)), CapacityReservationGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCapacityReservationGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CapacityReservationGroupResource(Client, CapacityReservationGroupData.DeserializeCapacityReservationGroupData(e)), CapacityReservationGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetCapacityReservationGroups", "value", "nextLink", cancellationToken); } /// @@ -1301,7 +1636,7 @@ public virtual Pageable GetCapacityReservation { HttpMessage FirstPageRequest(int? pageSizeHint) => CapacityReservationGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CapacityReservationGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CapacityReservationGroupResource(Client, CapacityReservationGroupData.DeserializeCapacityReservationGroupData(e)), CapacityReservationGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCapacityReservationGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CapacityReservationGroupResource(Client, CapacityReservationGroupData.DeserializeCapacityReservationGroupData(e)), CapacityReservationGroupClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetCapacityReservationGroups", "value", "nextLink", cancellationToken); } /// @@ -1321,9 +1656,12 @@ public virtual Pageable GetCapacityReservation /// The location upon which virtual-machine-sizes is queried. /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. /// The cancellation token to use. + /// is null. public virtual async Task> ExportLogAnalyticsRequestRateByIntervalAsync(WaitUntil waitUntil, AzureLocation location, RequestRateByIntervalContent content, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExportLogAnalyticsRequestRateByInterval"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LogAnalyticsClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.ExportLogAnalyticsRequestRateByInterval"); scope.Start(); try { @@ -1357,9 +1695,12 @@ public virtual async Task> ExportLogAnalyticsRequestR /// The location upon which virtual-machine-sizes is queried. /// Parameters supplied to the LogAnalytics getRequestRateByInterval Api. /// The cancellation token to use. + /// is null. public virtual ArmOperation ExportLogAnalyticsRequestRateByInterval(WaitUntil waitUntil, AzureLocation location, RequestRateByIntervalContent content, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExportLogAnalyticsRequestRateByInterval"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LogAnalyticsClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.ExportLogAnalyticsRequestRateByInterval"); scope.Start(); try { @@ -1393,9 +1734,12 @@ public virtual ArmOperation ExportLogAnalyticsRequestRateByInterva /// The location upon which virtual-machine-sizes is queried. /// Parameters supplied to the LogAnalytics getThrottledRequests Api. /// The cancellation token to use. + /// is null. public virtual async Task> ExportLogAnalyticsThrottledRequestsAsync(WaitUntil waitUntil, AzureLocation location, ThrottledRequestsContent content, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExportLogAnalyticsThrottledRequests"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LogAnalyticsClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.ExportLogAnalyticsThrottledRequests"); scope.Start(); try { @@ -1429,9 +1773,12 @@ public virtual async Task> ExportLogAnalyticsThrottle /// The location upon which virtual-machine-sizes is queried. /// Parameters supplied to the LogAnalytics getThrottledRequests Api. /// The cancellation token to use. + /// is null. public virtual ArmOperation ExportLogAnalyticsThrottledRequests(WaitUntil waitUntil, AzureLocation location, ThrottledRequestsContent content, CancellationToken cancellationToken = default) { - using var scope = LogAnalyticsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ExportLogAnalyticsThrottledRequests"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = LogAnalyticsClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.ExportLogAnalyticsThrottledRequests"); scope.Start(); try { @@ -1468,7 +1815,7 @@ public virtual AsyncPageable GetVirtualMachineRunCommand { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RunCommandDocumentBase.DeserializeRunCommandDocumentBase, VirtualMachineRunCommandClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineRunCommands", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, RunCommandDocumentBase.DeserializeRunCommandDocumentBase, VirtualMachineRunCommandClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineRunCommands", "value", "nextLink", cancellationToken); } /// @@ -1491,7 +1838,7 @@ public virtual Pageable GetVirtualMachineRunCommands(Azu { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RunCommandDocumentBase.DeserializeRunCommandDocumentBase, VirtualMachineRunCommandClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineRunCommands", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, RunCommandDocumentBase.DeserializeRunCommandDocumentBase, VirtualMachineRunCommandClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetVirtualMachineRunCommands", "value", "nextLink", cancellationToken); } /// @@ -1510,9 +1857,13 @@ public virtual Pageable GetVirtualMachineRunCommands(Azu /// The location upon which run commands is queried. /// The command id. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> GetVirtualMachineRunCommandAsync(AzureLocation location, string commandId, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineRunCommandClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineRunCommand"); + Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); + + using var scope = VirtualMachineRunCommandClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineRunCommand"); scope.Start(); try { @@ -1542,9 +1893,13 @@ public virtual async Task> GetVirtualMachineRunComm /// The location upon which run commands is queried. /// The command id. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response GetVirtualMachineRunCommand(AzureLocation location, string commandId, CancellationToken cancellationToken = default) { - using var scope = VirtualMachineRunCommandClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetVirtualMachineRunCommand"); + Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); + + using var scope = VirtualMachineRunCommandClientDiagnostics.CreateScope("ComputeSubscriptionMockingExtension.GetVirtualMachineRunCommand"); scope.Start(); try { @@ -1577,7 +1932,7 @@ public virtual AsyncPageable GetManagedDisksAsync(Cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedDiskDisksRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedDiskDisksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedDiskResource(Client, ManagedDiskData.DeserializeManagedDiskData(e)), ManagedDiskDisksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedDisks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedDiskResource(Client, ManagedDiskData.DeserializeManagedDiskData(e)), ManagedDiskDisksClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetManagedDisks", "value", "nextLink", cancellationToken); } /// @@ -1599,7 +1954,7 @@ public virtual Pageable GetManagedDisks(CancellationToken c { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedDiskDisksRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedDiskDisksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedDiskResource(Client, ManagedDiskData.DeserializeManagedDiskData(e)), ManagedDiskDisksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedDisks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedDiskResource(Client, ManagedDiskData.DeserializeManagedDiskData(e)), ManagedDiskDisksClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetManagedDisks", "value", "nextLink", cancellationToken); } /// @@ -1621,7 +1976,7 @@ public virtual AsyncPageable GetDiskAccessesAsync(Cancellati { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskAccessRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskAccessRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskAccessResource(Client, DiskAccessData.DeserializeDiskAccessData(e)), DiskAccessClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskAccesses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskAccessResource(Client, DiskAccessData.DeserializeDiskAccessData(e)), DiskAccessClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskAccesses", "value", "nextLink", cancellationToken); } /// @@ -1643,7 +1998,7 @@ public virtual Pageable GetDiskAccesses(CancellationToken ca { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskAccessRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskAccessRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskAccessResource(Client, DiskAccessData.DeserializeDiskAccessData(e)), DiskAccessClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskAccesses", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskAccessResource(Client, DiskAccessData.DeserializeDiskAccessData(e)), DiskAccessClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskAccesses", "value", "nextLink", cancellationToken); } /// @@ -1665,7 +2020,7 @@ public virtual AsyncPageable GetDiskEncryptionSetsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskEncryptionSetRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskEncryptionSetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskEncryptionSetResource(Client, DiskEncryptionSetData.DeserializeDiskEncryptionSetData(e)), DiskEncryptionSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskEncryptionSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiskEncryptionSetResource(Client, DiskEncryptionSetData.DeserializeDiskEncryptionSetData(e)), DiskEncryptionSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskEncryptionSets", "value", "nextLink", cancellationToken); } /// @@ -1687,7 +2042,7 @@ public virtual Pageable GetDiskEncryptionSets(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => DiskEncryptionSetRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiskEncryptionSetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskEncryptionSetResource(Client, DiskEncryptionSetData.DeserializeDiskEncryptionSetData(e)), DiskEncryptionSetClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiskEncryptionSets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiskEncryptionSetResource(Client, DiskEncryptionSetData.DeserializeDiskEncryptionSetData(e)), DiskEncryptionSetClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetDiskEncryptionSets", "value", "nextLink", cancellationToken); } /// @@ -1709,7 +2064,7 @@ public virtual AsyncPageable GetSnapshotsAsync(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => SnapshotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SnapshotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SnapshotResource(Client, SnapshotData.DeserializeSnapshotData(e)), SnapshotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SnapshotResource(Client, SnapshotData.DeserializeSnapshotData(e)), SnapshotClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetSnapshots", "value", "nextLink", cancellationToken); } /// @@ -1731,7 +2086,7 @@ public virtual Pageable GetSnapshots(CancellationToken cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => SnapshotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SnapshotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SnapshotResource(Client, SnapshotData.DeserializeSnapshotData(e)), SnapshotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SnapshotResource(Client, SnapshotData.DeserializeSnapshotData(e)), SnapshotClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetSnapshots", "value", "nextLink", cancellationToken); } /// @@ -1755,7 +2110,7 @@ public virtual AsyncPageable GetComputeResourceSkusAsync(str { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId, filter, includeExtendedLocations); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter, includeExtendedLocations); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ComputeResourceSku.DeserializeComputeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetComputeResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ComputeResourceSku.DeserializeComputeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetComputeResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -1779,7 +2134,7 @@ public virtual Pageable GetComputeResourceSkus(string filter { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourceSkusRestClient.CreateListRequest(Id.SubscriptionId, filter, includeExtendedLocations); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourceSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter, includeExtendedLocations); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ComputeResourceSku.DeserializeComputeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetComputeResourceSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ComputeResourceSku.DeserializeComputeResourceSku, ResourceSkusClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetComputeResourceSkus", "value", "nextLink", cancellationToken); } /// @@ -1801,7 +2156,7 @@ public virtual AsyncPageable GetGalleriesAsync(CancellationToke { HttpMessage FirstPageRequest(int? pageSizeHint) => GalleryRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GalleryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GalleryResource(Client, GalleryData.DeserializeGalleryData(e)), GalleryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGalleries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GalleryResource(Client, GalleryData.DeserializeGalleryData(e)), GalleryClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetGalleries", "value", "nextLink", cancellationToken); } /// @@ -1823,7 +2178,7 @@ public virtual Pageable GetGalleries(CancellationToken cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => GalleryRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GalleryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GalleryResource(Client, GalleryData.DeserializeGalleryData(e)), GalleryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetGalleries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GalleryResource(Client, GalleryData.DeserializeGalleryData(e)), GalleryClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetGalleries", "value", "nextLink", cancellationToken); } /// @@ -1845,7 +2200,7 @@ public virtual AsyncPageable GetCloudServicesAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => CloudServiceRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudServiceRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudServiceResource(Client, CloudServiceData.DeserializeCloudServiceData(e)), CloudServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCloudServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudServiceResource(Client, CloudServiceData.DeserializeCloudServiceData(e)), CloudServiceClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetCloudServices", "value", "nextLink", cancellationToken); } /// @@ -1867,7 +2222,7 @@ public virtual Pageable GetCloudServices(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => CloudServiceRestClient.CreateListAllRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudServiceRestClient.CreateListAllNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudServiceResource(Client, CloudServiceData.DeserializeCloudServiceData(e)), CloudServiceClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCloudServices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudServiceResource(Client, CloudServiceData.DeserializeCloudServiceData(e)), CloudServiceClientDiagnostics, Pipeline, "ComputeSubscriptionMockingExtension.GetCloudServices", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 6b96a81aa94e..000000000000 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Compute -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of VirtualMachineScaleSetResources in the ResourceGroupResource. - /// An object representing collection of VirtualMachineScaleSetResources and their operations over a VirtualMachineScaleSetResource. - public virtual VirtualMachineScaleSetCollection GetVirtualMachineScaleSets() - { - return GetCachedClient(Client => new VirtualMachineScaleSetCollection(Client, Id)); - } - - /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. - /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. - public virtual VirtualMachineCollection GetVirtualMachines() - { - return GetCachedClient(Client => new VirtualMachineCollection(Client, Id)); - } - - /// Gets a collection of AvailabilitySetResources in the ResourceGroupResource. - /// An object representing collection of AvailabilitySetResources and their operations over a AvailabilitySetResource. - public virtual AvailabilitySetCollection GetAvailabilitySets() - { - return GetCachedClient(Client => new AvailabilitySetCollection(Client, Id)); - } - - /// Gets a collection of ProximityPlacementGroupResources in the ResourceGroupResource. - /// An object representing collection of ProximityPlacementGroupResources and their operations over a ProximityPlacementGroupResource. - public virtual ProximityPlacementGroupCollection GetProximityPlacementGroups() - { - return GetCachedClient(Client => new ProximityPlacementGroupCollection(Client, Id)); - } - - /// Gets a collection of DedicatedHostGroupResources in the ResourceGroupResource. - /// An object representing collection of DedicatedHostGroupResources and their operations over a DedicatedHostGroupResource. - public virtual DedicatedHostGroupCollection GetDedicatedHostGroups() - { - return GetCachedClient(Client => new DedicatedHostGroupCollection(Client, Id)); - } - - /// Gets a collection of SshPublicKeyResources in the ResourceGroupResource. - /// An object representing collection of SshPublicKeyResources and their operations over a SshPublicKeyResource. - public virtual SshPublicKeyCollection GetSshPublicKeys() - { - return GetCachedClient(Client => new SshPublicKeyCollection(Client, Id)); - } - - /// Gets a collection of DiskImageResources in the ResourceGroupResource. - /// An object representing collection of DiskImageResources and their operations over a DiskImageResource. - public virtual DiskImageCollection GetDiskImages() - { - return GetCachedClient(Client => new DiskImageCollection(Client, Id)); - } - - /// Gets a collection of RestorePointGroupResources in the ResourceGroupResource. - /// An object representing collection of RestorePointGroupResources and their operations over a RestorePointGroupResource. - public virtual RestorePointGroupCollection GetRestorePointGroups() - { - return GetCachedClient(Client => new RestorePointGroupCollection(Client, Id)); - } - - /// Gets a collection of CapacityReservationGroupResources in the ResourceGroupResource. - /// An object representing collection of CapacityReservationGroupResources and their operations over a CapacityReservationGroupResource. - public virtual CapacityReservationGroupCollection GetCapacityReservationGroups() - { - return GetCachedClient(Client => new CapacityReservationGroupCollection(Client, Id)); - } - - /// Gets a collection of ManagedDiskResources in the ResourceGroupResource. - /// An object representing collection of ManagedDiskResources and their operations over a ManagedDiskResource. - public virtual ManagedDiskCollection GetManagedDisks() - { - return GetCachedClient(Client => new ManagedDiskCollection(Client, Id)); - } - - /// Gets a collection of DiskAccessResources in the ResourceGroupResource. - /// An object representing collection of DiskAccessResources and their operations over a DiskAccessResource. - public virtual DiskAccessCollection GetDiskAccesses() - { - return GetCachedClient(Client => new DiskAccessCollection(Client, Id)); - } - - /// Gets a collection of DiskEncryptionSetResources in the ResourceGroupResource. - /// An object representing collection of DiskEncryptionSetResources and their operations over a DiskEncryptionSetResource. - public virtual DiskEncryptionSetCollection GetDiskEncryptionSets() - { - return GetCachedClient(Client => new DiskEncryptionSetCollection(Client, Id)); - } - - /// Gets a collection of SnapshotResources in the ResourceGroupResource. - /// An object representing collection of SnapshotResources and their operations over a SnapshotResource. - public virtual SnapshotCollection GetSnapshots() - { - return GetCachedClient(Client => new SnapshotCollection(Client, Id)); - } - - /// Gets a collection of GalleryResources in the ResourceGroupResource. - /// An object representing collection of GalleryResources and their operations over a GalleryResource. - public virtual GalleryCollection GetGalleries() - { - return GetCachedClient(Client => new GalleryCollection(Client, Id)); - } - - /// Gets a collection of CloudServiceResources in the ResourceGroupResource. - /// An object representing collection of CloudServiceResources and their operations over a CloudServiceResource. - public virtual CloudServiceCollection GetCloudServices() - { - return GetCachedClient(Client => new CloudServiceCollection(Client, Id)); - } - } -} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryApplicationResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryApplicationResource.cs index 2cf0bf47d710..185cb6068f85 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryApplicationResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryApplicationResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GalleryApplicationVersionResources and their operations over a GalleryApplicationVersionResource. public virtual GalleryApplicationVersionCollection GetGalleryApplicationVersions() { - return GetCachedClient(Client => new GalleryApplicationVersionCollection(Client, Id)); + return GetCachedClient(client => new GalleryApplicationVersionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual GalleryApplicationVersionCollection GetGalleryApplicationVersions /// The name of the gallery Application Version to be retrieved. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetGalleryApplicationVersionAsync(string galleryApplicationVersionName, ReplicationStatusType? expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetGaller /// The name of the gallery Application Version to be retrieved. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetGalleryApplicationVersion(string galleryApplicationVersionName, ReplicationStatusType? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryImageResource.cs index 05e09bca64dd..c30b8c26e115 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryImageResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GalleryImageVersionResources and their operations over a GalleryImageVersionResource. public virtual GalleryImageVersionCollection GetGalleryImageVersions() { - return GetCachedClient(Client => new GalleryImageVersionCollection(Client, Id)); + return GetCachedClient(client => new GalleryImageVersionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual GalleryImageVersionCollection GetGalleryImageVersions() /// The name of the gallery image version to be retrieved. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetGalleryImageVersionAsync(string galleryImageVersionName, ReplicationStatusType? expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetGalleryImage /// The name of the gallery image version to be retrieved. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetGalleryImageVersion(string galleryImageVersionName, ReplicationStatusType? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryResource.cs index fb762f4e5873..4a70ffbb5764 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/GalleryResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GalleryImageResources and their operations over a GalleryImageResource. public virtual GalleryImageCollection GetGalleryImages() { - return GetCachedClient(Client => new GalleryImageCollection(Client, Id)); + return GetCachedClient(client => new GalleryImageCollection(client, Id)); } /// @@ -115,8 +115,8 @@ public virtual GalleryImageCollection GetGalleryImages() /// /// The name of the gallery image definition to be retrieved. /// The cancellation token to use. - /// 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> GetGalleryImageAsync(string galleryImageName, CancellationToken cancellationToken = default) { @@ -138,8 +138,8 @@ public virtual async Task> GetGalleryImageAsync(s /// /// The name of the gallery image definition to be retrieved. /// The cancellation token to use. - /// 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 GetGalleryImage(string galleryImageName, CancellationToken cancellationToken = default) { @@ -150,7 +150,7 @@ public virtual Response GetGalleryImage(string galleryImag /// An object representing collection of GalleryApplicationResources and their operations over a GalleryApplicationResource. public virtual GalleryApplicationCollection GetGalleryApplications() { - return GetCachedClient(Client => new GalleryApplicationCollection(Client, Id)); + return GetCachedClient(client => new GalleryApplicationCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual GalleryApplicationCollection GetGalleryApplications() /// /// The name of the gallery Application Definition to be retrieved. /// The cancellation token to use. - /// 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> GetGalleryApplicationAsync(string galleryApplicationName, CancellationToken cancellationToken = default) { @@ -191,8 +191,8 @@ public virtual async Task> GetGalleryApplic /// /// The name of the gallery Application Definition to be retrieved. /// The cancellation token to use. - /// 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 GetGalleryApplication(string galleryApplicationName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs index 1de5f376d529..2a555a987d49 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RestorePointResources and their operations over a RestorePointResource. public virtual RestorePointCollection GetRestorePoints() { - return GetCachedClient(Client => new RestorePointCollection(Client, Id)); + return GetCachedClient(client => new RestorePointCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual RestorePointCollection GetRestorePoints() /// The name of the restore point. /// The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore point. /// The cancellation token to use. - /// 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> GetRestorePointAsync(string restorePointName, RestorePointExpand? expand = null, CancellationToken cancellationToken = default) { @@ -136,8 +136,8 @@ public virtual async Task> GetRestorePointAsync(s /// The name of the restore point. /// The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore point. /// The cancellation token to use. - /// 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 GetRestorePoint(string restorePointName, RestorePointExpand? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs index 508dbb47f693..da40d7e96478 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DiskRestorePointResources and their operations over a DiskRestorePointResource. public virtual DiskRestorePointCollection GetDiskRestorePoints() { - return GetCachedClient(Client => new DiskRestorePointCollection(Client, Id)); + return GetCachedClient(client => new DiskRestorePointCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual DiskRestorePointCollection GetDiskRestorePoints() /// /// The name of the disk restore point created. /// The cancellation token to use. - /// 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> GetDiskRestorePointAsync(string diskRestorePointName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetDiskRestorePoin /// /// The name of the disk restore point created. /// The cancellation token to use. - /// 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 GetDiskRestorePoint(string diskRestorePointName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryImageResource.cs index fe8a1321ad66..3caaec8bfb24 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryImageResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SharedGalleryImageVersionResources and their operations over a SharedGalleryImageVersionResource. public virtual SharedGalleryImageVersionCollection GetSharedGalleryImageVersions() { - return GetCachedClient(Client => new SharedGalleryImageVersionCollection(Client, Id)); + return GetCachedClient(client => new SharedGalleryImageVersionCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual SharedGalleryImageVersionCollection GetSharedGalleryImageVersions /// /// The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. /// The cancellation token to use. - /// 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> GetSharedGalleryImageVersionAsync(string galleryImageVersionName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetShared /// /// The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. /// The cancellation token to use. - /// 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 GetSharedGalleryImageVersion(string galleryImageVersionName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryResource.cs index d8b916ec9cfe..e79a879eeac8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SharedGalleryResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of SharedGalleryImageResources and their operations over a SharedGalleryImageResource. public virtual SharedGalleryImageCollection GetSharedGalleryImages() { - return GetCachedClient(Client => new SharedGalleryImageCollection(Client, Id)); + return GetCachedClient(client => new SharedGalleryImageCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual SharedGalleryImageCollection GetSharedGalleryImages() /// /// The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. /// The cancellation token to use. - /// 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> GetSharedGalleryImageAsync(string galleryImageName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> GetSharedGallery /// /// The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. /// The cancellation token to use. - /// 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 GetSharedGalleryImage(string galleryImageName, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs index 9dbd74a2499b..f7ff4fd6f0da 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualMachineExtensionResources and their operations over a VirtualMachineExtensionResource. public virtual VirtualMachineExtensionCollection GetVirtualMachineExtensions() { - return GetCachedClient(Client => new VirtualMachineExtensionCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineExtensionCollection(client, Id)); } /// @@ -113,8 +113,8 @@ public virtual VirtualMachineExtensionCollection GetVirtualMachineExtensions() /// The name of the virtual machine extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetVirtualMachineExtensionAsync(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetVirtualM /// The name of the virtual machine extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetVirtualMachineExtension(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetVirtualMachineExtens /// An object representing collection of VirtualMachineRunCommandResources and their operations over a VirtualMachineRunCommandResource. public virtual VirtualMachineRunCommandCollection GetVirtualMachineRunCommands() { - return GetCachedClient(Client => new VirtualMachineRunCommandCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineRunCommandCollection(client, Id)); } /// @@ -168,8 +168,8 @@ public virtual VirtualMachineRunCommandCollection GetVirtualMachineRunCommands() /// The name of the virtual machine run command. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetVirtualMachineRunCommandAsync(string runCommandName, string expand = null, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task> GetVirtual /// The name of the virtual machine run command. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetVirtualMachineRunCommand(string runCommandName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs index eb9c1861fb8e..b872509a6f58 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs @@ -99,7 +99,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualMachineScaleSetExtensionResources and their operations over a VirtualMachineScaleSetExtensionResource. public virtual VirtualMachineScaleSetExtensionCollection GetVirtualMachineScaleSetExtensions() { - return GetCachedClient(Client => new VirtualMachineScaleSetExtensionCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineScaleSetExtensionCollection(client, Id)); } /// @@ -118,8 +118,8 @@ public virtual VirtualMachineScaleSetExtensionCollection GetVirtualMachineScaleS /// The name of the VM scale set extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetVirtualMachineScaleSetExtensionAsync(string vmssExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -142,8 +142,8 @@ public virtual async Task> Get /// The name of the VM scale set extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetVirtualMachineScaleSetExtension(string vmssExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -161,7 +161,7 @@ public virtual VirtualMachineScaleSetRollingUpgradeResource GetVirtualMachineSca /// An object representing collection of VirtualMachineScaleSetVmResources and their operations over a VirtualMachineScaleSetVmResource. public virtual VirtualMachineScaleSetVmCollection GetVirtualMachineScaleSetVms() { - return GetCachedClient(Client => new VirtualMachineScaleSetVmCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineScaleSetVmCollection(client, Id)); } /// @@ -180,8 +180,8 @@ public virtual VirtualMachineScaleSetVmCollection GetVirtualMachineScaleSetVms() /// The instance ID of the virtual machine. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. /// The cancellation token to use. - /// 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> GetVirtualMachineScaleSetVmAsync(string instanceId, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetVirtual /// The instance ID of the virtual machine. /// The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. /// The cancellation token to use. - /// 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 GetVirtualMachineScaleSetVm(string instanceId, InstanceViewType? expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs index 58bdecf9c054..85de3de6b11f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of VirtualMachineScaleSetVmExtensionResources and their operations over a VirtualMachineScaleSetVmExtensionResource. public virtual VirtualMachineScaleSetVmExtensionCollection GetVirtualMachineScaleSetVmExtensions() { - return GetCachedClient(Client => new VirtualMachineScaleSetVmExtensionCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineScaleSetVmExtensionCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual VirtualMachineScaleSetVmExtensionCollection GetVirtualMachineScal /// The name of the virtual machine extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetVirtualMachineScaleSetVmExtensionAsync(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> G /// The name of the virtual machine extension. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetVirtualMachineScaleSetVmExtension(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { @@ -147,7 +147,7 @@ public virtual Response GetVirtualMac /// An object representing collection of VirtualMachineScaleSetVmRunCommandResources and their operations over a VirtualMachineScaleSetVmRunCommandResource. public virtual VirtualMachineScaleSetVmRunCommandCollection GetVirtualMachineScaleSetVmRunCommands() { - return GetCachedClient(Client => new VirtualMachineScaleSetVmRunCommandCollection(Client, Id)); + return GetCachedClient(client => new VirtualMachineScaleSetVmRunCommandCollection(client, Id)); } /// @@ -166,8 +166,8 @@ public virtual VirtualMachineScaleSetVmRunCommandCollection GetVirtualMachineSca /// The name of the virtual machine run command. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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> GetVirtualMachineScaleSetVmRunCommandAsync(string runCommandName, string expand = null, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> /// The name of the virtual machine run command. /// The expand expression to apply on the operation. /// The cancellation token to use. - /// 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 GetVirtualMachineScaleSetVmRunCommand(string runCommandName, string expand = null, CancellationToken cancellationToken = default) { diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerArmClientMockingExtension.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerArmClientMockingExtension.cs new file mode 100644 index 000000000000..b904e1a2386b --- /dev/null +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerArmClientMockingExtension.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ConfidentialLedger; + +namespace Azure.ResourceManager.ConfidentialLedger.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ConfidentialLedgerArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ConfidentialLedgerArmClientMockingExtension() + { + } + + /// 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 ConfidentialLedgerArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ConfidentialLedgerArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ConfidentialLedgerResource GetConfidentialLedgerResource(ResourceIdentifier id) + { + ConfidentialLedgerResource.ValidateResourceId(id); + return new ConfidentialLedgerResource(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 ManagedCcfResource GetManagedCcfResource(ResourceIdentifier id) + { + ManagedCcfResource.ValidateResourceId(id); + return new ManagedCcfResource(Client, id); + } + } +} diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs index acff73bfcdcd..7952a85af276 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ConfidentialLedger.Mocking; using Azure.ResourceManager.ConfidentialLedger.Models; using Azure.ResourceManager.Resources; @@ -19,81 +20,65 @@ namespace Azure.ResourceManager.ConfidentialLedger /// A class to add extension methods to Azure.ResourceManager.ConfidentialLedger. public static partial class ConfidentialLedgerExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ConfidentialLedgerArmClientMockingExtension GetConfidentialLedgerArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ConfidentialLedgerArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ConfidentialLedgerResourceGroupMockingExtension GetConfidentialLedgerResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ConfidentialLedgerResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ConfidentialLedgerSubscriptionMockingExtension GetConfidentialLedgerSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ConfidentialLedgerSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ConfidentialLedgerResource /// /// 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. /// Returns a object. public static ConfidentialLedgerResource GetConfidentialLedgerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConfidentialLedgerResource.ValidateResourceId(id); - return new ConfidentialLedgerResource(client, id); - } - ); + return GetConfidentialLedgerArmClientMockingExtension(client).GetConfidentialLedgerResource(id); } - #endregion - #region ManagedCcfResource /// /// 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. /// Returns a object. public static ManagedCcfResource GetManagedCcfResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedCcfResource.ValidateResourceId(id); - return new ManagedCcfResource(client, id); - } - ); + return GetConfidentialLedgerArmClientMockingExtension(client).GetManagedCcfResource(id); } - #endregion - /// Gets a collection of ConfidentialLedgerResources in the ResourceGroupResource. + /// + /// Gets a collection of ConfidentialLedgerResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ConfidentialLedgerResources and their operations over a ConfidentialLedgerResource. public static ConfidentialLedgerCollection GetConfidentialLedgers(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfidentialLedgers(); + return GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetConfidentialLedgers(); } /// @@ -108,16 +93,20 @@ public static ConfidentialLedgerCollection GetConfidentialLedgers(this ResourceG /// Ledger_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Confidential Ledger. /// The cancellation token to use. - /// 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 static async Task> GetConfidentialLedgerAsync(this ResourceGroupResource resourceGroupResource, string ledgerName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetConfidentialLedgers().GetAsync(ledgerName, cancellationToken).ConfigureAwait(false); + return await GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetConfidentialLedgerAsync(ledgerName, cancellationToken).ConfigureAwait(false); } /// @@ -132,24 +121,34 @@ public static async Task> GetConfidentialLe /// Ledger_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Confidential Ledger. /// The cancellation token to use. - /// 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 static Response GetConfidentialLedger(this ResourceGroupResource resourceGroupResource, string ledgerName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetConfidentialLedgers().Get(ledgerName, cancellationToken); + return GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetConfidentialLedger(ledgerName, cancellationToken); } - /// Gets a collection of ManagedCcfResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedCcfResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedCcfResources and their operations over a ManagedCcfResource. public static ManagedCcfCollection GetManagedCcfs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedCcfs(); + return GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetManagedCcfs(); } /// @@ -164,16 +163,20 @@ public static ManagedCcfCollection GetManagedCcfs(this ResourceGroupResource res /// ManagedCCF_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Managed CCF. /// The cancellation token to use. - /// 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 static async Task> GetManagedCcfAsync(this ResourceGroupResource resourceGroupResource, string appName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedCcfs().GetAsync(appName, cancellationToken).ConfigureAwait(false); + return await GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetManagedCcfAsync(appName, cancellationToken).ConfigureAwait(false); } /// @@ -188,16 +191,20 @@ public static async Task> GetManagedCcfAsync(this R /// ManagedCCF_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Managed CCF. /// The cancellation token to use. - /// 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 static Response GetManagedCcf(this ResourceGroupResource resourceGroupResource, string appName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedCcfs().Get(appName, cancellationToken); + return GetConfidentialLedgerResourceGroupMockingExtension(resourceGroupResource).GetManagedCcf(appName, cancellationToken); } /// @@ -212,6 +219,10 @@ public static Response GetManagedCcf(this ResourceGroupResou /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name availability request payload. @@ -219,9 +230,7 @@ public static Response GetManagedCcf(this ResourceGroupResou /// is null. public static async Task> CheckConfidentialLedgerNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ConfidentialLedgerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckConfidentialLedgerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).CheckConfidentialLedgerNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -236,6 +245,10 @@ public static async Task> Che /// CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name availability request payload. @@ -243,9 +256,7 @@ public static async Task> Che /// is null. public static Response CheckConfidentialLedgerNameAvailability(this SubscriptionResource subscriptionResource, ConfidentialLedgerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckConfidentialLedgerNameAvailability(content, cancellationToken); + return GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).CheckConfidentialLedgerNameAvailability(content, cancellationToken); } /// @@ -260,6 +271,10 @@ public static Response CheckConfidenti /// Ledger_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. @@ -267,7 +282,7 @@ public static Response CheckConfidenti /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfidentialLedgersAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfidentialLedgersAsync(filter, cancellationToken); + return GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).GetConfidentialLedgersAsync(filter, cancellationToken); } /// @@ -282,6 +297,10 @@ public static AsyncPageable GetConfidentialLedgersAs /// Ledger_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. @@ -289,7 +308,7 @@ public static AsyncPageable GetConfidentialLedgersAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfidentialLedgers(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfidentialLedgers(filter, cancellationToken); + return GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).GetConfidentialLedgers(filter, cancellationToken); } /// @@ -304,6 +323,10 @@ public static Pageable GetConfidentialLedgers(this S /// ManagedCCF_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. @@ -311,7 +334,7 @@ public static Pageable GetConfidentialLedgers(this S /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedCcfsAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedCcfsAsync(filter, cancellationToken); + return GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).GetManagedCcfsAsync(filter, cancellationToken); } /// @@ -326,6 +349,10 @@ public static AsyncPageable GetManagedCcfsAsync(this Subscri /// ManagedCCF_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. @@ -333,7 +360,7 @@ public static AsyncPageable GetManagedCcfsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedCcfs(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedCcfs(filter, cancellationToken); + return GetConfidentialLedgerSubscriptionMockingExtension(subscriptionResource).GetManagedCcfs(filter, cancellationToken); } } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerResourceGroupMockingExtension.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..c5536e40991c --- /dev/null +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerResourceGroupMockingExtension.cs @@ -0,0 +1,145 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ConfidentialLedger; + +namespace Azure.ResourceManager.ConfidentialLedger.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ConfidentialLedgerResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ConfidentialLedgerResourceGroupMockingExtension() + { + } + + /// 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 ConfidentialLedgerResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ConfidentialLedgerResources in the ResourceGroupResource. + /// An object representing collection of ConfidentialLedgerResources and their operations over a ConfidentialLedgerResource. + public virtual ConfidentialLedgerCollection GetConfidentialLedgers() + { + return GetCachedClient(client => new ConfidentialLedgerCollection(client, Id)); + } + + /// + /// Retrieves the properties of a Confidential Ledger. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName} + /// + /// + /// Operation Id + /// Ledger_Get + /// + /// + /// + /// Name of the Confidential Ledger. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConfidentialLedgerAsync(string ledgerName, CancellationToken cancellationToken = default) + { + return await GetConfidentialLedgers().GetAsync(ledgerName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of a Confidential Ledger. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName} + /// + /// + /// Operation Id + /// Ledger_Get + /// + /// + /// + /// Name of the Confidential Ledger. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConfidentialLedger(string ledgerName, CancellationToken cancellationToken = default) + { + return GetConfidentialLedgers().Get(ledgerName, cancellationToken); + } + + /// Gets a collection of ManagedCcfResources in the ResourceGroupResource. + /// An object representing collection of ManagedCcfResources and their operations over a ManagedCcfResource. + public virtual ManagedCcfCollection GetManagedCcfs() + { + return GetCachedClient(client => new ManagedCcfCollection(client, Id)); + } + + /// + /// Retrieves the properties of a Managed CCF app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName} + /// + /// + /// Operation Id + /// ManagedCCF_Get + /// + /// + /// + /// Name of the Managed CCF. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedCcfAsync(string appName, CancellationToken cancellationToken = default) + { + return await GetManagedCcfs().GetAsync(appName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of a Managed CCF app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName} + /// + /// + /// Operation Id + /// ManagedCCF_Get + /// + /// + /// + /// Name of the Managed CCF. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedCcf(string appName, CancellationToken cancellationToken = default) + { + return GetManagedCcfs().Get(appName, cancellationToken); + } + } +} diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerSubscriptionMockingExtension.cs similarity index 87% rename from sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerSubscriptionMockingExtension.cs index d0c451dbd52c..65f74f45bbde 100644 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ConfidentialLedgerSubscriptionMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ConfidentialLedger; using Azure.ResourceManager.ConfidentialLedger.Models; -namespace Azure.ResourceManager.ConfidentialLedger +namespace Azure.ResourceManager.ConfidentialLedger.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ConfidentialLedgerSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _defaultClientDiagnostics; private ConfidentialLedgerRestOperations _defaultRestClient; @@ -27,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _managedCcfManagedCcfClientDiagnostics; private ManagedCCFRestOperations _managedCcfManagedCcfRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConfidentialLedgerSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConfidentialLedgerSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,9 +68,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Name availability request payload. /// The cancellation token to use. + /// is null. public virtual async Task> CheckConfidentialLedgerNameAvailabilityAsync(ConfidentialLedgerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckConfidentialLedgerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ConfidentialLedgerSubscriptionMockingExtension.CheckConfidentialLedgerNameAvailability"); scope.Start(); try { @@ -98,9 +102,12 @@ public virtual async Task> Ch /// /// Name availability request payload. /// The cancellation token to use. + /// is null. public virtual Response CheckConfidentialLedgerNameAvailability(ConfidentialLedgerNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckConfidentialLedgerNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DefaultClientDiagnostics.CreateScope("ConfidentialLedgerSubscriptionMockingExtension.CheckConfidentialLedgerNameAvailability"); scope.Start(); try { @@ -134,7 +141,7 @@ public virtual AsyncPageable GetConfidentialLedgersA { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfidentialLedgerLedgerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfidentialLedgerLedgerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConfidentialLedgerResource(Client, ConfidentialLedgerData.DeserializeConfidentialLedgerData(e)), ConfidentialLedgerLedgerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfidentialLedgers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConfidentialLedgerResource(Client, ConfidentialLedgerData.DeserializeConfidentialLedgerData(e)), ConfidentialLedgerLedgerClientDiagnostics, Pipeline, "ConfidentialLedgerSubscriptionMockingExtension.GetConfidentialLedgers", "value", "nextLink", cancellationToken); } /// @@ -157,7 +164,7 @@ public virtual Pageable GetConfidentialLedgers(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfidentialLedgerLedgerRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfidentialLedgerLedgerRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConfidentialLedgerResource(Client, ConfidentialLedgerData.DeserializeConfidentialLedgerData(e)), ConfidentialLedgerLedgerClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfidentialLedgers", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConfidentialLedgerResource(Client, ConfidentialLedgerData.DeserializeConfidentialLedgerData(e)), ConfidentialLedgerLedgerClientDiagnostics, Pipeline, "ConfidentialLedgerSubscriptionMockingExtension.GetConfidentialLedgers", "value", "nextLink", cancellationToken); } /// @@ -180,7 +187,7 @@ public virtual AsyncPageable GetManagedCcfsAsync(string filt { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedCcfManagedCCFRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedCcfManagedCCFRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedCcfResource(Client, ManagedCcfData.DeserializeManagedCcfData(e)), ManagedCcfManagedCCFClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedCcfs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedCcfResource(Client, ManagedCcfData.DeserializeManagedCcfData(e)), ManagedCcfManagedCCFClientDiagnostics, Pipeline, "ConfidentialLedgerSubscriptionMockingExtension.GetManagedCcfs", "value", "nextLink", cancellationToken); } /// @@ -203,7 +210,7 @@ public virtual Pageable GetManagedCcfs(string filter = null, { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedCcfManagedCCFRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedCcfManagedCCFRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedCcfResource(Client, ManagedCcfData.DeserializeManagedCcfData(e)), ManagedCcfManagedCCFClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedCcfs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedCcfResource(Client, ManagedCcfData.DeserializeManagedCcfData(e)), ManagedCcfManagedCCFClientDiagnostics, Pipeline, "ConfidentialLedgerSubscriptionMockingExtension.GetManagedCcfs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 09ae729cb59b..000000000000 --- a/sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ConfidentialLedger -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ConfidentialLedgerResources in the ResourceGroupResource. - /// An object representing collection of ConfidentialLedgerResources and their operations over a ConfidentialLedgerResource. - public virtual ConfidentialLedgerCollection GetConfidentialLedgers() - { - return GetCachedClient(Client => new ConfidentialLedgerCollection(Client, Id)); - } - - /// Gets a collection of ManagedCcfResources in the ResourceGroupResource. - /// An object representing collection of ManagedCcfResources and their operations over a ManagedCcfResource. - public virtual ManagedCcfCollection GetManagedCcfs() - { - return GetCachedClient(Client => new ManagedCcfCollection(Client, Id)); - } - } -} diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentArmClientMockingExtension.cs b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentArmClientMockingExtension.cs new file mode 100644 index 000000000000..6a555814c328 --- /dev/null +++ b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Confluent; + +namespace Azure.ResourceManager.Confluent.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ConfluentArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ConfluentArmClientMockingExtension() + { + } + + /// 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 ConfluentArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ConfluentArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ConfluentOrganizationResource GetConfluentOrganizationResource(ResourceIdentifier id) + { + ConfluentOrganizationResource.ValidateResourceId(id); + return new ConfluentOrganizationResource(Client, id); + } + } +} diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentExtensions.cs b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentExtensions.cs index 4c9f0b3974b7..b34d0c7bc6b6 100644 --- a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentExtensions.cs +++ b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Confluent.Mocking; using Azure.ResourceManager.Confluent.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.Confluent /// A class to add extension methods to Azure.ResourceManager.Confluent. public static partial class ConfluentExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ConfluentArmClientMockingExtension GetConfluentArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ConfluentArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ConfluentResourceGroupMockingExtension GetConfluentResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ConfluentResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ConfluentSubscriptionMockingExtension GetConfluentSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ConfluentSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ConfluentOrganizationResource /// /// 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. /// Returns a object. public static ConfluentOrganizationResource GetConfluentOrganizationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConfluentOrganizationResource.ValidateResourceId(id); - return new ConfluentOrganizationResource(client, id); - } - ); + return GetConfluentArmClientMockingExtension(client).GetConfluentOrganizationResource(id); } - #endregion - /// Gets a collection of ConfluentOrganizationResources in the ResourceGroupResource. + /// + /// Gets a collection of ConfluentOrganizationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ConfluentOrganizationResources and their operations over a ConfluentOrganizationResource. public static ConfluentOrganizationCollection GetConfluentOrganizations(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetConfluentOrganizations(); + return GetConfluentResourceGroupMockingExtension(resourceGroupResource).GetConfluentOrganizations(); } /// @@ -89,16 +77,20 @@ public static ConfluentOrganizationCollection GetConfluentOrganizations(this Res /// Organization_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Organization resource name. /// The cancellation token to use. - /// 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 static async Task> GetConfluentOrganizationAsync(this ResourceGroupResource resourceGroupResource, string organizationName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetConfluentOrganizations().GetAsync(organizationName, cancellationToken).ConfigureAwait(false); + return await GetConfluentResourceGroupMockingExtension(resourceGroupResource).GetConfluentOrganizationAsync(organizationName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetConfluentOr /// Organization_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Organization resource name. /// The cancellation token to use. - /// 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 static Response GetConfluentOrganization(this ResourceGroupResource resourceGroupResource, string organizationName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetConfluentOrganizations().Get(organizationName, cancellationToken); + return GetConfluentResourceGroupMockingExtension(resourceGroupResource).GetConfluentOrganization(organizationName, cancellationToken); } /// @@ -137,6 +133,10 @@ public static Response GetConfluentOrganization(t /// Validations_ValidateOrganization /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Organization resource name. @@ -146,10 +146,7 @@ public static Response GetConfluentOrganization(t /// or is null. public static async Task> ValidateOrganizationAsync(this ResourceGroupResource resourceGroupResource, string organizationName, ConfluentOrganizationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); - Argument.AssertNotNull(data, nameof(data)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateOrganizationAsync(organizationName, data, cancellationToken).ConfigureAwait(false); + return await GetConfluentResourceGroupMockingExtension(resourceGroupResource).ValidateOrganizationAsync(organizationName, data, cancellationToken).ConfigureAwait(false); } /// @@ -164,6 +161,10 @@ public static async Task> ValidateOrgani /// Validations_ValidateOrganization /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Organization resource name. @@ -173,10 +174,7 @@ public static async Task> ValidateOrgani /// or is null. public static Response ValidateOrganization(this ResourceGroupResource resourceGroupResource, string organizationName, ConfluentOrganizationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); - Argument.AssertNotNull(data, nameof(data)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateOrganization(organizationName, data, cancellationToken); + return GetConfluentResourceGroupMockingExtension(resourceGroupResource).ValidateOrganization(organizationName, data, cancellationToken); } /// @@ -191,13 +189,17 @@ public static Response ValidateOrganization(this /// MarketplaceAgreements_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMarketplaceAgreementsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreementsAsync(cancellationToken); + return GetConfluentSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementsAsync(cancellationToken); } /// @@ -212,13 +214,17 @@ public static AsyncPageable GetMarketplaceAgreementsAsync(th /// MarketplaceAgreements_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMarketplaceAgreements(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreements(cancellationToken); + return GetConfluentSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreements(cancellationToken); } /// @@ -233,13 +239,17 @@ public static Pageable GetMarketplaceAgreements(this Subscri /// MarketplaceAgreements_Create /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Confluent Marketplace Agreement resource. /// The cancellation token to use. public static async Task> CreateMarketplaceAgreementAsync(this SubscriptionResource subscriptionResource, ConfluentAgreement body = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CreateMarketplaceAgreementAsync(body, cancellationToken).ConfigureAwait(false); + return await GetConfluentSubscriptionMockingExtension(subscriptionResource).CreateMarketplaceAgreementAsync(body, cancellationToken).ConfigureAwait(false); } /// @@ -254,13 +264,17 @@ public static async Task> CreateMarketplaceAgreemen /// MarketplaceAgreements_Create /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Confluent Marketplace Agreement resource. /// The cancellation token to use. public static Response CreateMarketplaceAgreement(this SubscriptionResource subscriptionResource, ConfluentAgreement body = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateMarketplaceAgreement(body, cancellationToken); + return GetConfluentSubscriptionMockingExtension(subscriptionResource).CreateMarketplaceAgreement(body, cancellationToken); } /// @@ -275,13 +289,17 @@ public static Response CreateMarketplaceAgreement(this Subsc /// Organization_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetConfluentOrganizationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfluentOrganizationsAsync(cancellationToken); + return GetConfluentSubscriptionMockingExtension(subscriptionResource).GetConfluentOrganizationsAsync(cancellationToken); } /// @@ -296,13 +314,17 @@ public static AsyncPageable GetConfluentOrganizat /// Organization_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetConfluentOrganizations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetConfluentOrganizations(cancellationToken); + return GetConfluentSubscriptionMockingExtension(subscriptionResource).GetConfluentOrganizations(cancellationToken); } } } diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentResourceGroupMockingExtension.cs similarity index 54% rename from sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentResourceGroupMockingExtension.cs index cfbed6988078..e0d52dbf5c72 100644 --- a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentResourceGroupMockingExtension.cs @@ -12,24 +12,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Confluent; -namespace Azure.ResourceManager.Confluent +namespace Azure.ResourceManager.Confluent.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class ConfluentResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _validationsClientDiagnostics; private ValidationsRestOperations _validationsRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConfluentResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConfluentResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +47,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ConfluentOrganizationResources and their operations over a ConfluentOrganizationResource. public virtual ConfluentOrganizationCollection GetConfluentOrganizations() { - return GetCachedClient(Client => new ConfluentOrganizationCollection(Client, Id)); + return GetCachedClient(client => new ConfluentOrganizationCollection(client, Id)); + } + + /// + /// Get the properties of a specific Organization resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName} + /// + /// + /// Operation Id + /// Organization_Get + /// + /// + /// + /// Organization resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConfluentOrganizationAsync(string organizationName, CancellationToken cancellationToken = default) + { + return await GetConfluentOrganizations().GetAsync(organizationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a specific Organization resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName} + /// + /// + /// Operation Id + /// Organization_Get + /// + /// + /// + /// Organization resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConfluentOrganization(string organizationName, CancellationToken cancellationToken = default) + { + return GetConfluentOrganizations().Get(organizationName, cancellationToken); } /// @@ -65,9 +112,14 @@ public virtual ConfluentOrganizationCollection GetConfluentOrganizations() /// Organization resource name. /// Organization resource model. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> ValidateOrganizationAsync(string organizationName, ConfluentOrganizationData data, CancellationToken cancellationToken = default) { - using var scope = ValidationsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateOrganization"); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ValidationsClientDiagnostics.CreateScope("ConfluentResourceGroupMockingExtension.ValidateOrganization"); scope.Start(); try { @@ -97,9 +149,14 @@ public virtual async Task> ValidateOrgan /// Organization resource name. /// Organization resource model. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response ValidateOrganization(string organizationName, ConfluentOrganizationData data, CancellationToken cancellationToken = default) { - using var scope = ValidationsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateOrganization"); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = ValidationsClientDiagnostics.CreateScope("ConfluentResourceGroupMockingExtension.ValidateOrganization"); scope.Start(); try { diff --git a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentSubscriptionMockingExtension.cs similarity index 90% rename from sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentSubscriptionMockingExtension.cs index d4cb9560bd9c..06781453a6f6 100644 --- a/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/confluent/Azure.ResourceManager.Confluent/src/Generated/Extensions/ConfluentSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Confluent; using Azure.ResourceManager.Confluent.Models; -namespace Azure.ResourceManager.Confluent +namespace Azure.ResourceManager.Confluent.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ConfluentSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _marketplaceAgreementsClientDiagnostics; private MarketplaceAgreementsRestOperations _marketplaceAgreementsRestClient; private ClientDiagnostics _confluentOrganizationOrganizationClientDiagnostics; private OrganizationRestOperations _confluentOrganizationOrganizationRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConfluentSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConfluentSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetMarketplaceAgreementsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfluentAgreement.DeserializeConfluentAgreement, MarketplaceAgreementsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConfluentAgreement.DeserializeConfluentAgreement, MarketplaceAgreementsClientDiagnostics, Pipeline, "ConfluentSubscriptionMockingExtension.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetMarketplaceAgreements(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfluentAgreement.DeserializeConfluentAgreement, MarketplaceAgreementsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConfluentAgreement.DeserializeConfluentAgreement, MarketplaceAgreementsClientDiagnostics, Pipeline, "ConfluentSubscriptionMockingExtension.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual Pageable GetMarketplaceAgreements(Cancellatio /// The cancellation token to use. public virtual async Task> CreateMarketplaceAgreementAsync(ConfluentAgreement body = null, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateMarketplaceAgreement"); + using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("ConfluentSubscriptionMockingExtension.CreateMarketplaceAgreement"); scope.Start(); try { @@ -140,7 +141,7 @@ public virtual async Task> CreateMarketplaceAgreeme /// The cancellation token to use. public virtual Response CreateMarketplaceAgreement(ConfluentAgreement body = null, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateMarketplaceAgreement"); + using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("ConfluentSubscriptionMockingExtension.CreateMarketplaceAgreement"); scope.Start(); try { @@ -173,7 +174,7 @@ public virtual AsyncPageable GetConfluentOrganiza { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfluentOrganizationOrganizationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfluentOrganizationOrganizationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConfluentOrganizationResource(Client, ConfluentOrganizationData.DeserializeConfluentOrganizationData(e)), ConfluentOrganizationOrganizationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfluentOrganizations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConfluentOrganizationResource(Client, ConfluentOrganizationData.DeserializeConfluentOrganizationData(e)), ConfluentOrganizationOrganizationClientDiagnostics, Pipeline, "ConfluentSubscriptionMockingExtension.GetConfluentOrganizations", "value", "nextLink", cancellationToken); } /// @@ -195,7 +196,7 @@ public virtual Pageable GetConfluentOrganizations { HttpMessage FirstPageRequest(int? pageSizeHint) => ConfluentOrganizationOrganizationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ConfluentOrganizationOrganizationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConfluentOrganizationResource(Client, ConfluentOrganizationData.DeserializeConfluentOrganizationData(e)), ConfluentOrganizationOrganizationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfluentOrganizations", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConfluentOrganizationResource(Client, ConfluentOrganizationData.DeserializeConfluentOrganizationData(e)), ConfluentOrganizationOrganizationClientDiagnostics, Pipeline, "ConfluentSubscriptionMockingExtension.GetConfluentOrganizations", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereArmClientMockingExtension.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereArmClientMockingExtension.cs new file mode 100644 index 000000000000..63da8c78eba1 --- /dev/null +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereArmClientMockingExtension.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ConnectedVMwarevSphere; + +namespace Azure.ResourceManager.ConnectedVMwarevSphere.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ConnectedVMwarevSphereArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ConnectedVMwarevSphereArmClientMockingExtension() + { + } + + /// 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 ConnectedVMwarevSphereArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ConnectedVMwarevSphereArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ResourcePoolResource GetResourcePoolResource(ResourceIdentifier id) + { + ResourcePoolResource.ValidateResourceId(id); + return new ResourcePoolResource(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 VMwareClusterResource GetVMwareClusterResource(ResourceIdentifier id) + { + VMwareClusterResource.ValidateResourceId(id); + return new VMwareClusterResource(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 VMwareHostResource GetVMwareHostResource(ResourceIdentifier id) + { + VMwareHostResource.ValidateResourceId(id); + return new VMwareHostResource(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 VMwareDatastoreResource GetVMwareDatastoreResource(ResourceIdentifier id) + { + VMwareDatastoreResource.ValidateResourceId(id); + return new VMwareDatastoreResource(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 VCenterResource GetVCenterResource(ResourceIdentifier id) + { + VCenterResource.ValidateResourceId(id); + return new VCenterResource(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 VirtualMachineResource GetVirtualMachineResource(ResourceIdentifier id) + { + VirtualMachineResource.ValidateResourceId(id); + return new VirtualMachineResource(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 VirtualMachineTemplateResource GetVirtualMachineTemplateResource(ResourceIdentifier id) + { + VirtualMachineTemplateResource.ValidateResourceId(id); + return new VirtualMachineTemplateResource(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 VirtualNetworkResource GetVirtualNetworkResource(ResourceIdentifier id) + { + VirtualNetworkResource.ValidateResourceId(id); + return new VirtualNetworkResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InventoryItemResource GetInventoryItemResource(ResourceIdentifier id) + { + InventoryItemResource.ValidateResourceId(id); + return new InventoryItemResource(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 HybridIdentityMetadataResource GetHybridIdentityMetadataResource(ResourceIdentifier id) + { + HybridIdentityMetadataResource.ValidateResourceId(id); + return new HybridIdentityMetadataResource(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 MachineExtensionResource GetMachineExtensionResource(ResourceIdentifier id) + { + MachineExtensionResource.ValidateResourceId(id); + return new MachineExtensionResource(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 GuestAgentResource GetGuestAgentResource(ResourceIdentifier id) + { + GuestAgentResource.ValidateResourceId(id); + return new GuestAgentResource(Client, id); + } + } +} diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereExtensions.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereExtensions.cs index a8e1c605b81d..05720598fd55 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereExtensions.cs +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ConnectedVMwarevSphere.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ConnectedVMwarevSphere @@ -18,271 +19,225 @@ namespace Azure.ResourceManager.ConnectedVMwarevSphere /// A class to add extension methods to Azure.ResourceManager.ConnectedVMwarevSphere. public static partial class ConnectedVMwarevSphereExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ConnectedVMwarevSphereArmClientMockingExtension GetConnectedVMwarevSphereArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ConnectedVMwarevSphereArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ConnectedVMwarevSphereResourceGroupMockingExtension GetConnectedVMwarevSphereResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ConnectedVMwarevSphereResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ConnectedVMwarevSphereSubscriptionMockingExtension GetConnectedVMwarevSphereSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ConnectedVMwarevSphereSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ResourcePoolResource /// /// 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. /// Returns a object. public static ResourcePoolResource GetResourcePoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ResourcePoolResource.ValidateResourceId(id); - return new ResourcePoolResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetResourcePoolResource(id); } - #endregion - #region VMwareClusterResource /// /// 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. /// Returns a object. public static VMwareClusterResource GetVMwareClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VMwareClusterResource.ValidateResourceId(id); - return new VMwareClusterResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVMwareClusterResource(id); } - #endregion - #region VMwareHostResource /// /// 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. /// Returns a object. public static VMwareHostResource GetVMwareHostResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VMwareHostResource.ValidateResourceId(id); - return new VMwareHostResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVMwareHostResource(id); } - #endregion - #region VMwareDatastoreResource /// /// 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. /// Returns a object. public static VMwareDatastoreResource GetVMwareDatastoreResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VMwareDatastoreResource.ValidateResourceId(id); - return new VMwareDatastoreResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVMwareDatastoreResource(id); } - #endregion - #region VCenterResource /// /// 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. /// Returns a object. public static VCenterResource GetVCenterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VCenterResource.ValidateResourceId(id); - return new VCenterResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVCenterResource(id); } - #endregion - #region VirtualMachineResource /// /// 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. /// Returns a object. public static VirtualMachineResource GetVirtualMachineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineResource.ValidateResourceId(id); - return new VirtualMachineResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVirtualMachineResource(id); } - #endregion - #region VirtualMachineTemplateResource /// /// 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. /// Returns a object. public static VirtualMachineTemplateResource GetVirtualMachineTemplateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualMachineTemplateResource.ValidateResourceId(id); - return new VirtualMachineTemplateResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVirtualMachineTemplateResource(id); } - #endregion - #region VirtualNetworkResource /// /// 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. /// Returns a object. public static VirtualNetworkResource GetVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - VirtualNetworkResource.ValidateResourceId(id); - return new VirtualNetworkResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetVirtualNetworkResource(id); } - #endregion - #region InventoryItemResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InventoryItemResource GetInventoryItemResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InventoryItemResource.ValidateResourceId(id); - return new InventoryItemResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetInventoryItemResource(id); } - #endregion - #region HybridIdentityMetadataResource /// /// 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. /// Returns a object. public static HybridIdentityMetadataResource GetHybridIdentityMetadataResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HybridIdentityMetadataResource.ValidateResourceId(id); - return new HybridIdentityMetadataResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetHybridIdentityMetadataResource(id); } - #endregion - #region MachineExtensionResource /// /// 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. /// Returns a object. public static MachineExtensionResource GetMachineExtensionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MachineExtensionResource.ValidateResourceId(id); - return new MachineExtensionResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetMachineExtensionResource(id); } - #endregion - #region GuestAgentResource /// /// 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. /// Returns a object. public static GuestAgentResource GetGuestAgentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GuestAgentResource.ValidateResourceId(id); - return new GuestAgentResource(client, id); - } - ); + return GetConnectedVMwarevSphereArmClientMockingExtension(client).GetGuestAgentResource(id); } - #endregion - /// Gets a collection of ResourcePoolResources in the ResourceGroupResource. + /// + /// Gets a collection of ResourcePoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ResourcePoolResources and their operations over a ResourcePoolResource. public static ResourcePoolCollection GetResourcePools(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetResourcePools(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetResourcePools(); } /// @@ -297,16 +252,20 @@ public static ResourcePoolCollection GetResourcePools(this ResourceGroupResource /// ResourcePools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the resourcePool. /// The cancellation token to use. - /// 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 static async Task> GetResourcePoolAsync(this ResourceGroupResource resourceGroupResource, string resourcePoolName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetResourcePools().GetAsync(resourcePoolName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetResourcePoolAsync(resourcePoolName, cancellationToken).ConfigureAwait(false); } /// @@ -321,24 +280,34 @@ public static async Task> GetResourcePoolAsync(th /// ResourcePools_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the resourcePool. /// The cancellation token to use. - /// 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 static Response GetResourcePool(this ResourceGroupResource resourceGroupResource, string resourcePoolName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetResourcePools().Get(resourcePoolName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetResourcePool(resourcePoolName, cancellationToken); } - /// Gets a collection of VMwareClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of VMwareClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VMwareClusterResources and their operations over a VMwareClusterResource. public static VMwareClusterCollection GetVMwareClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVMwareClusters(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareClusters(); } /// @@ -353,16 +322,20 @@ public static VMwareClusterCollection GetVMwareClusters(this ResourceGroupResour /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetVMwareClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVMwareClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -377,24 +350,34 @@ public static async Task> GetVMwareClusterAsync( /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the cluster. /// The cancellation token to use. - /// 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 static Response GetVMwareCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVMwareClusters().Get(clusterName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareCluster(clusterName, cancellationToken); } - /// Gets a collection of VMwareHostResources in the ResourceGroupResource. + /// + /// Gets a collection of VMwareHostResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VMwareHostResources and their operations over a VMwareHostResource. public static VMwareHostCollection GetVMwareHosts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVMwareHosts(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareHosts(); } /// @@ -409,16 +392,20 @@ public static VMwareHostCollection GetVMwareHosts(this ResourceGroupResource res /// Hosts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the host. /// The cancellation token to use. - /// 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 static async Task> GetVMwareHostAsync(this ResourceGroupResource resourceGroupResource, string hostName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVMwareHosts().GetAsync(hostName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareHostAsync(hostName, cancellationToken).ConfigureAwait(false); } /// @@ -433,24 +420,34 @@ public static async Task> GetVMwareHostAsync(this R /// Hosts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the host. /// The cancellation token to use. - /// 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 static Response GetVMwareHost(this ResourceGroupResource resourceGroupResource, string hostName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVMwareHosts().Get(hostName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareHost(hostName, cancellationToken); } - /// Gets a collection of VMwareDatastoreResources in the ResourceGroupResource. + /// + /// Gets a collection of VMwareDatastoreResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VMwareDatastoreResources and their operations over a VMwareDatastoreResource. public static VMwareDatastoreCollection GetVMwareDatastores(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVMwareDatastores(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareDatastores(); } /// @@ -465,16 +462,20 @@ public static VMwareDatastoreCollection GetVMwareDatastores(this ResourceGroupRe /// Datastores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the datastore. /// The cancellation token to use. - /// 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 static async Task> GetVMwareDatastoreAsync(this ResourceGroupResource resourceGroupResource, string datastoreName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVMwareDatastores().GetAsync(datastoreName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareDatastoreAsync(datastoreName, cancellationToken).ConfigureAwait(false); } /// @@ -489,24 +490,34 @@ public static async Task> GetVMwareDatastoreAs /// Datastores_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the datastore. /// The cancellation token to use. - /// 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 static Response GetVMwareDatastore(this ResourceGroupResource resourceGroupResource, string datastoreName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVMwareDatastores().Get(datastoreName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVMwareDatastore(datastoreName, cancellationToken); } - /// Gets a collection of VCenterResources in the ResourceGroupResource. + /// + /// Gets a collection of VCenterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VCenterResources and their operations over a VCenterResource. public static VCenterCollection GetVCenters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVCenters(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVCenters(); } /// @@ -521,16 +532,20 @@ public static VCenterCollection GetVCenters(this ResourceGroupResource resourceG /// VCenters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the vCenter. /// The cancellation token to use. - /// 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 static async Task> GetVCenterAsync(this ResourceGroupResource resourceGroupResource, string vcenterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVCenters().GetAsync(vcenterName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVCenterAsync(vcenterName, cancellationToken).ConfigureAwait(false); } /// @@ -545,24 +560,34 @@ public static async Task> GetVCenterAsync(this Resourc /// VCenters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the vCenter. /// The cancellation token to use. - /// 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 static Response GetVCenter(this ResourceGroupResource resourceGroupResource, string vcenterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVCenters().Get(vcenterName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVCenter(vcenterName, cancellationToken); } - /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualMachines(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachines(); } /// @@ -577,16 +602,20 @@ public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupReso /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual machine resource. /// The cancellation token to use. - /// 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 static async Task> GetVirtualMachineAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); } /// @@ -601,24 +630,34 @@ public static async Task> GetVirtualMachineAsyn /// VirtualMachines_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual machine resource. /// The cancellation token to use. - /// 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 static Response GetVirtualMachine(this ResourceGroupResource resourceGroupResource, string virtualMachineName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualMachines().Get(virtualMachineName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachine(virtualMachineName, cancellationToken); } - /// Gets a collection of VirtualMachineTemplateResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualMachineTemplateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualMachineTemplateResources and their operations over a VirtualMachineTemplateResource. public static VirtualMachineTemplateCollection GetVirtualMachineTemplates(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualMachineTemplates(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineTemplates(); } /// @@ -633,16 +672,20 @@ public static VirtualMachineTemplateCollection GetVirtualMachineTemplates(this R /// VirtualMachineTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual machine template resource. /// The cancellation token to use. - /// 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 static async Task> GetVirtualMachineTemplateAsync(this ResourceGroupResource resourceGroupResource, string virtualMachineTemplateName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualMachineTemplates().GetAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineTemplateAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); } /// @@ -657,24 +700,34 @@ public static async Task> GetVirtualMac /// VirtualMachineTemplates_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual machine template resource. /// The cancellation token to use. - /// 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 static Response GetVirtualMachineTemplate(this ResourceGroupResource resourceGroupResource, string virtualMachineTemplateName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualMachineTemplates().Get(virtualMachineTemplateName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualMachineTemplate(virtualMachineTemplateName, cancellationToken); } - /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// + /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. public static VirtualNetworkCollection GetVirtualNetworks(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVirtualNetworks(); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworks(); } /// @@ -689,16 +742,20 @@ public static VirtualNetworkCollection GetVirtualNetworks(this ResourceGroupReso /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual network resource. /// The cancellation token to use. - /// 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 static async Task> GetVirtualNetworkAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetVirtualNetworks().GetAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); + return await GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetworkAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); } /// @@ -713,16 +770,20 @@ public static async Task> GetVirtualNetworkAsyn /// VirtualNetworks_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the virtual network resource. /// The cancellation token to use. - /// 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 static Response GetVirtualNetwork(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetVirtualNetworks().Get(virtualNetworkName, cancellationToken); + return GetConnectedVMwarevSphereResourceGroupMockingExtension(resourceGroupResource).GetVirtualNetwork(virtualNetworkName, cancellationToken); } /// @@ -737,13 +798,17 @@ public static Response GetVirtualNetwork(this ResourceGr /// ResourcePools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetResourcePoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourcePoolsAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetResourcePoolsAsync(cancellationToken); } /// @@ -758,13 +823,17 @@ public static AsyncPageable GetResourcePoolsAsync(this Sub /// ResourcePools_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetResourcePools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetResourcePools(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetResourcePools(cancellationToken); } /// @@ -779,13 +848,17 @@ public static Pageable GetResourcePools(this SubscriptionR /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVMwareClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareClustersAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareClustersAsync(cancellationToken); } /// @@ -800,13 +873,17 @@ public static AsyncPageable GetVMwareClustersAsync(this S /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVMwareClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareClusters(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareClusters(cancellationToken); } /// @@ -821,13 +898,17 @@ public static Pageable GetVMwareClusters(this Subscriptio /// Hosts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVMwareHostsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareHostsAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareHostsAsync(cancellationToken); } /// @@ -842,13 +923,17 @@ public static AsyncPageable GetVMwareHostsAsync(this Subscri /// Hosts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVMwareHosts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareHosts(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareHosts(cancellationToken); } /// @@ -863,13 +948,17 @@ public static Pageable GetVMwareHosts(this SubscriptionResou /// Datastores_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVMwareDatastoresAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareDatastoresAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareDatastoresAsync(cancellationToken); } /// @@ -884,13 +973,17 @@ public static AsyncPageable GetVMwareDatastoresAsync(th /// Datastores_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVMwareDatastores(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVMwareDatastores(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVMwareDatastores(cancellationToken); } /// @@ -905,13 +998,17 @@ public static Pageable GetVMwareDatastores(this Subscri /// VCenters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVCentersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVCentersAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVCentersAsync(cancellationToken); } /// @@ -926,13 +1023,17 @@ public static AsyncPageable GetVCentersAsync(this SubscriptionR /// VCenters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVCenters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVCenters(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVCenters(cancellationToken); } /// @@ -947,13 +1048,17 @@ public static Pageable GetVCenters(this SubscriptionResource su /// VirtualMachines_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachinesAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualMachinesAsync(cancellationToken); } /// @@ -968,13 +1073,17 @@ public static AsyncPageable GetVirtualMachinesAsync(this /// VirtualMachines_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachines(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualMachines(cancellationToken); } /// @@ -989,13 +1098,17 @@ public static Pageable GetVirtualMachines(this Subscript /// VirtualMachineTemplates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualMachineTemplatesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineTemplatesAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineTemplatesAsync(cancellationToken); } /// @@ -1010,13 +1123,17 @@ public static AsyncPageable GetVirtualMachineTem /// VirtualMachineTemplates_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualMachineTemplates(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualMachineTemplates(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualMachineTemplates(cancellationToken); } /// @@ -1031,13 +1148,17 @@ public static Pageable GetVirtualMachineTemplate /// VirtualNetworks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetVirtualNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworksAsync(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworksAsync(cancellationToken); } /// @@ -1052,13 +1173,17 @@ public static AsyncPageable GetVirtualNetworksAsync(this /// VirtualNetworks_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetVirtualNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVirtualNetworks(cancellationToken); + return GetConnectedVMwarevSphereSubscriptionMockingExtension(subscriptionResource).GetVirtualNetworks(cancellationToken); } } } diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereResourceGroupMockingExtension.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..27f3163d7332 --- /dev/null +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereResourceGroupMockingExtension.cs @@ -0,0 +1,463 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ConnectedVMwarevSphere; + +namespace Azure.ResourceManager.ConnectedVMwarevSphere.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ConnectedVMwarevSphereResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ConnectedVMwarevSphereResourceGroupMockingExtension() + { + } + + /// 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 ConnectedVMwarevSphereResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ResourcePoolResources in the ResourceGroupResource. + /// An object representing collection of ResourcePoolResources and their operations over a ResourcePoolResource. + public virtual ResourcePoolCollection GetResourcePools() + { + return GetCachedClient(client => new ResourcePoolCollection(client, Id)); + } + + /// + /// Implements resourcePool GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName} + /// + /// + /// Operation Id + /// ResourcePools_Get + /// + /// + /// + /// Name of the resourcePool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetResourcePoolAsync(string resourcePoolName, CancellationToken cancellationToken = default) + { + return await GetResourcePools().GetAsync(resourcePoolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements resourcePool GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName} + /// + /// + /// Operation Id + /// ResourcePools_Get + /// + /// + /// + /// Name of the resourcePool. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetResourcePool(string resourcePoolName, CancellationToken cancellationToken = default) + { + return GetResourcePools().Get(resourcePoolName, cancellationToken); + } + + /// Gets a collection of VMwareClusterResources in the ResourceGroupResource. + /// An object representing collection of VMwareClusterResources and their operations over a VMwareClusterResource. + public virtual VMwareClusterCollection GetVMwareClusters() + { + return GetCachedClient(client => new VMwareClusterCollection(client, Id)); + } + + /// + /// Implements cluster GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// Name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVMwareClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetVMwareClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements cluster GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/clusters/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// Name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVMwareCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetVMwareClusters().Get(clusterName, cancellationToken); + } + + /// Gets a collection of VMwareHostResources in the ResourceGroupResource. + /// An object representing collection of VMwareHostResources and their operations over a VMwareHostResource. + public virtual VMwareHostCollection GetVMwareHosts() + { + return GetCachedClient(client => new VMwareHostCollection(client, Id)); + } + + /// + /// Implements host GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName} + /// + /// + /// Operation Id + /// Hosts_Get + /// + /// + /// + /// Name of the host. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVMwareHostAsync(string hostName, CancellationToken cancellationToken = default) + { + return await GetVMwareHosts().GetAsync(hostName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements host GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/hosts/{hostName} + /// + /// + /// Operation Id + /// Hosts_Get + /// + /// + /// + /// Name of the host. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVMwareHost(string hostName, CancellationToken cancellationToken = default) + { + return GetVMwareHosts().Get(hostName, cancellationToken); + } + + /// Gets a collection of VMwareDatastoreResources in the ResourceGroupResource. + /// An object representing collection of VMwareDatastoreResources and their operations over a VMwareDatastoreResource. + public virtual VMwareDatastoreCollection GetVMwareDatastores() + { + return GetCachedClient(client => new VMwareDatastoreCollection(client, Id)); + } + + /// + /// Implements datastore GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName} + /// + /// + /// Operation Id + /// Datastores_Get + /// + /// + /// + /// Name of the datastore. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVMwareDatastoreAsync(string datastoreName, CancellationToken cancellationToken = default) + { + return await GetVMwareDatastores().GetAsync(datastoreName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements datastore GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/datastores/{datastoreName} + /// + /// + /// Operation Id + /// Datastores_Get + /// + /// + /// + /// Name of the datastore. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVMwareDatastore(string datastoreName, CancellationToken cancellationToken = default) + { + return GetVMwareDatastores().Get(datastoreName, cancellationToken); + } + + /// Gets a collection of VCenterResources in the ResourceGroupResource. + /// An object representing collection of VCenterResources and their operations over a VCenterResource. + public virtual VCenterCollection GetVCenters() + { + return GetCachedClient(client => new VCenterCollection(client, Id)); + } + + /// + /// Implements vCenter GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName} + /// + /// + /// Operation Id + /// VCenters_Get + /// + /// + /// + /// Name of the vCenter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVCenterAsync(string vcenterName, CancellationToken cancellationToken = default) + { + return await GetVCenters().GetAsync(vcenterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements vCenter GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName} + /// + /// + /// Operation Id + /// VCenters_Get + /// + /// + /// + /// Name of the vCenter. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVCenter(string vcenterName, CancellationToken cancellationToken = default) + { + return GetVCenters().Get(vcenterName, cancellationToken); + } + + /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. + /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. + public virtual VirtualMachineCollection GetVirtualMachines() + { + return GetCachedClient(client => new VirtualMachineCollection(client, Id)); + } + + /// + /// Implements virtual machine GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// Name of the virtual machine resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualMachineAsync(string virtualMachineName, CancellationToken cancellationToken = default) + { + return await GetVirtualMachines().GetAsync(virtualMachineName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements virtual machine GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName} + /// + /// + /// Operation Id + /// VirtualMachines_Get + /// + /// + /// + /// Name of the virtual machine resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualMachine(string virtualMachineName, CancellationToken cancellationToken = default) + { + return GetVirtualMachines().Get(virtualMachineName, cancellationToken); + } + + /// Gets a collection of VirtualMachineTemplateResources in the ResourceGroupResource. + /// An object representing collection of VirtualMachineTemplateResources and their operations over a VirtualMachineTemplateResource. + public virtual VirtualMachineTemplateCollection GetVirtualMachineTemplates() + { + return GetCachedClient(client => new VirtualMachineTemplateCollection(client, Id)); + } + + /// + /// Implements virtual machine template GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName} + /// + /// + /// Operation Id + /// VirtualMachineTemplates_Get + /// + /// + /// + /// Name of the virtual machine template resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualMachineTemplateAsync(string virtualMachineTemplateName, CancellationToken cancellationToken = default) + { + return await GetVirtualMachineTemplates().GetAsync(virtualMachineTemplateName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements virtual machine template GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName} + /// + /// + /// Operation Id + /// VirtualMachineTemplates_Get + /// + /// + /// + /// Name of the virtual machine template resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualMachineTemplate(string virtualMachineTemplateName, CancellationToken cancellationToken = default) + { + return GetVirtualMachineTemplates().Get(virtualMachineTemplateName, cancellationToken); + } + + /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. + /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. + public virtual VirtualNetworkCollection GetVirtualNetworks() + { + return GetCachedClient(client => new VirtualNetworkCollection(client, Id)); + } + + /// + /// Implements virtual network GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// Name of the virtual network resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkAsync(string virtualNetworkName, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworks().GetAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Implements virtual network GET method. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName} + /// + /// + /// Operation Id + /// VirtualNetworks_Get + /// + /// + /// + /// Name of the virtual network resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetwork(string virtualNetworkName, CancellationToken cancellationToken = default) + { + return GetVirtualNetworks().Get(virtualNetworkName, cancellationToken); + } + } +} diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereSubscriptionMockingExtension.cs similarity index 90% rename from sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereSubscriptionMockingExtension.cs index d530956dd13c..b83983248ba8 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ConnectedVMwarevSphereSubscriptionMockingExtension.cs @@ -11,11 +11,12 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ConnectedVMwarevSphere; -namespace Azure.ResourceManager.ConnectedVMwarevSphere +namespace Azure.ResourceManager.ConnectedVMwarevSphere.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ConnectedVMwarevSphereSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _resourcePoolClientDiagnostics; private ResourcePoolsRestOperations _resourcePoolRestClient; @@ -34,15 +35,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _virtualNetworkClientDiagnostics; private VirtualNetworksRestOperations _virtualNetworkRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConnectedVMwarevSphereSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedVMwarevSphereSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -88,7 +89,7 @@ public virtual AsyncPageable GetResourcePoolsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourcePoolRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourcePoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourcePoolResource(Client, ResourcePoolData.DeserializeResourcePoolData(e)), ResourcePoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourcePools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourcePoolResource(Client, ResourcePoolData.DeserializeResourcePoolData(e)), ResourcePoolClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetResourcePools", "value", "nextLink", cancellationToken); } /// @@ -110,7 +111,7 @@ public virtual Pageable GetResourcePools(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => ResourcePoolRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ResourcePoolRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourcePoolResource(Client, ResourcePoolData.DeserializeResourcePoolData(e)), ResourcePoolClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetResourcePools", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourcePoolResource(Client, ResourcePoolData.DeserializeResourcePoolData(e)), ResourcePoolClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetResourcePools", "value", "nextLink", cancellationToken); } /// @@ -132,7 +133,7 @@ public virtual AsyncPageable GetVMwareClustersAsync(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareClusterResource(Client, VMwareClusterData.DeserializeVMwareClusterData(e)), VMwareClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareClusterResource(Client, VMwareClusterData.DeserializeVMwareClusterData(e)), VMwareClusterClustersClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareClusters", "value", "nextLink", cancellationToken); } /// @@ -154,7 +155,7 @@ public virtual Pageable GetVMwareClusters(CancellationTok { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareClusterResource(Client, VMwareClusterData.DeserializeVMwareClusterData(e)), VMwareClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareClusterResource(Client, VMwareClusterData.DeserializeVMwareClusterData(e)), VMwareClusterClustersClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareClusters", "value", "nextLink", cancellationToken); } /// @@ -176,7 +177,7 @@ public virtual AsyncPageable GetVMwareHostsAsync(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareHostHostsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareHostHostsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareHostResource(Client, VMwareHostData.DeserializeVMwareHostData(e)), VMwareHostHostsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareHosts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareHostResource(Client, VMwareHostData.DeserializeVMwareHostData(e)), VMwareHostHostsClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareHosts", "value", "nextLink", cancellationToken); } /// @@ -198,7 +199,7 @@ public virtual Pageable GetVMwareHosts(CancellationToken can { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareHostHostsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareHostHostsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareHostResource(Client, VMwareHostData.DeserializeVMwareHostData(e)), VMwareHostHostsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareHosts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareHostResource(Client, VMwareHostData.DeserializeVMwareHostData(e)), VMwareHostHostsClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareHosts", "value", "nextLink", cancellationToken); } /// @@ -220,7 +221,7 @@ public virtual AsyncPageable GetVMwareDatastoresAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareDatastoreDatastoresRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareDatastoreDatastoresRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareDatastoreResource(Client, VMwareDatastoreData.DeserializeVMwareDatastoreData(e)), VMwareDatastoreDatastoresClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareDatastores", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VMwareDatastoreResource(Client, VMwareDatastoreData.DeserializeVMwareDatastoreData(e)), VMwareDatastoreDatastoresClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareDatastores", "value", "nextLink", cancellationToken); } /// @@ -242,7 +243,7 @@ public virtual Pageable GetVMwareDatastores(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => VMwareDatastoreDatastoresRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VMwareDatastoreDatastoresRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareDatastoreResource(Client, VMwareDatastoreData.DeserializeVMwareDatastoreData(e)), VMwareDatastoreDatastoresClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVMwareDatastores", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VMwareDatastoreResource(Client, VMwareDatastoreData.DeserializeVMwareDatastoreData(e)), VMwareDatastoreDatastoresClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVMwareDatastores", "value", "nextLink", cancellationToken); } /// @@ -264,7 +265,7 @@ public virtual AsyncPageable GetVCentersAsync(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => VCenterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VCenterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VCenterResource(Client, VCenterData.DeserializeVCenterData(e)), VCenterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VCenterResource(Client, VCenterData.DeserializeVCenterData(e)), VCenterClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVCenters", "value", "nextLink", cancellationToken); } /// @@ -286,7 +287,7 @@ public virtual Pageable GetVCenters(CancellationToken cancellat { HttpMessage FirstPageRequest(int? pageSizeHint) => VCenterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VCenterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VCenterResource(Client, VCenterData.DeserializeVCenterData(e)), VCenterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVCenters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VCenterResource(Client, VCenterData.DeserializeVCenterData(e)), VCenterClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVCenters", "value", "nextLink", cancellationToken); } /// @@ -308,7 +309,7 @@ public virtual AsyncPageable GetVirtualMachinesAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -330,7 +331,7 @@ public virtual Pageable GetVirtualMachines(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachines", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineResource(Client, VirtualMachineData.DeserializeVirtualMachineData(e)), VirtualMachineClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualMachines", "value", "nextLink", cancellationToken); } /// @@ -352,7 +353,7 @@ public virtual AsyncPageable GetVirtualMachineTe { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineTemplateRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineTemplateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineTemplateResource(Client, VirtualMachineTemplateData.DeserializeVirtualMachineTemplateData(e)), VirtualMachineTemplateClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineTemplates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineTemplateResource(Client, VirtualMachineTemplateData.DeserializeVirtualMachineTemplateData(e)), VirtualMachineTemplateClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualMachineTemplates", "value", "nextLink", cancellationToken); } /// @@ -374,7 +375,7 @@ public virtual Pageable GetVirtualMachineTemplat { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualMachineTemplateRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualMachineTemplateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineTemplateResource(Client, VirtualMachineTemplateData.DeserializeVirtualMachineTemplateData(e)), VirtualMachineTemplateClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualMachineTemplates", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualMachineTemplateResource(Client, VirtualMachineTemplateData.DeserializeVirtualMachineTemplateData(e)), VirtualMachineTemplateClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualMachineTemplates", "value", "nextLink", cancellationToken); } /// @@ -396,7 +397,7 @@ public virtual AsyncPageable GetVirtualNetworksAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualNetworks", "value", "nextLink", cancellationToken); } /// @@ -418,7 +419,7 @@ public virtual Pageable GetVirtualNetworks(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => VirtualNetworkRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VirtualNetworkRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVirtualNetworks", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkResource(Client, VirtualNetworkData.DeserializeVirtualNetworkData(e)), VirtualNetworkClientDiagnostics, Pipeline, "ConnectedVMwarevSphereSubscriptionMockingExtension.GetVirtualNetworks", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3083e6dd87cf..000000000000 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ConnectedVMwarevSphere -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ResourcePoolResources in the ResourceGroupResource. - /// An object representing collection of ResourcePoolResources and their operations over a ResourcePoolResource. - public virtual ResourcePoolCollection GetResourcePools() - { - return GetCachedClient(Client => new ResourcePoolCollection(Client, Id)); - } - - /// Gets a collection of VMwareClusterResources in the ResourceGroupResource. - /// An object representing collection of VMwareClusterResources and their operations over a VMwareClusterResource. - public virtual VMwareClusterCollection GetVMwareClusters() - { - return GetCachedClient(Client => new VMwareClusterCollection(Client, Id)); - } - - /// Gets a collection of VMwareHostResources in the ResourceGroupResource. - /// An object representing collection of VMwareHostResources and their operations over a VMwareHostResource. - public virtual VMwareHostCollection GetVMwareHosts() - { - return GetCachedClient(Client => new VMwareHostCollection(Client, Id)); - } - - /// Gets a collection of VMwareDatastoreResources in the ResourceGroupResource. - /// An object representing collection of VMwareDatastoreResources and their operations over a VMwareDatastoreResource. - public virtual VMwareDatastoreCollection GetVMwareDatastores() - { - return GetCachedClient(Client => new VMwareDatastoreCollection(Client, Id)); - } - - /// Gets a collection of VCenterResources in the ResourceGroupResource. - /// An object representing collection of VCenterResources and their operations over a VCenterResource. - public virtual VCenterCollection GetVCenters() - { - return GetCachedClient(Client => new VCenterCollection(Client, Id)); - } - - /// Gets a collection of VirtualMachineResources in the ResourceGroupResource. - /// An object representing collection of VirtualMachineResources and their operations over a VirtualMachineResource. - public virtual VirtualMachineCollection GetVirtualMachines() - { - return GetCachedClient(Client => new VirtualMachineCollection(Client, Id)); - } - - /// Gets a collection of VirtualMachineTemplateResources in the ResourceGroupResource. - /// An object representing collection of VirtualMachineTemplateResources and their operations over a VirtualMachineTemplateResource. - public virtual VirtualMachineTemplateCollection GetVirtualMachineTemplates() - { - return GetCachedClient(Client => new VirtualMachineTemplateCollection(Client, Id)); - } - - /// Gets a collection of VirtualNetworkResources in the ResourceGroupResource. - /// An object representing collection of VirtualNetworkResources and their operations over a VirtualNetworkResource. - public virtual VirtualNetworkCollection GetVirtualNetworks() - { - return GetCachedClient(Client => new VirtualNetworkCollection(Client, Id)); - } - } -} diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VCenterResource.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VCenterResource.cs index 1fb819a4f4e2..e8d54d2b4fb5 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VCenterResource.cs +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VCenterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of InventoryItemResources and their operations over a InventoryItemResource. public virtual InventoryItemCollection GetInventoryItems() { - return GetCachedClient(Client => new InventoryItemCollection(Client, Id)); + return GetCachedClient(client => new InventoryItemCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual InventoryItemCollection GetInventoryItems() /// /// Name of the inventoryItem. /// The cancellation token to use. - /// 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> GetInventoryItemAsync(string inventoryItemName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetInventoryItemAsync /// /// Name of the inventoryItem. /// The cancellation token to use. - /// 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 GetInventoryItem(string inventoryItemName, CancellationToken cancellationToken = default) { diff --git a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VirtualMachineResource.cs b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VirtualMachineResource.cs index a872fc6c6743..d984702f0429 100644 --- a/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VirtualMachineResource.cs +++ b/sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/src/Generated/VirtualMachineResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of HybridIdentityMetadataResources and their operations over a HybridIdentityMetadataResource. public virtual HybridIdentityMetadataCollection GetAllHybridIdentityMetadata() { - return GetCachedClient(Client => new HybridIdentityMetadataCollection(Client, Id)); + return GetCachedClient(client => new HybridIdentityMetadataCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual HybridIdentityMetadataCollection GetAllHybridIdentityMetadata() /// /// Name of the HybridIdentityMetadata. /// The cancellation token to use. - /// 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> GetHybridIdentityMetadataAsync(string metadataName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetHybridIde /// /// Name of the HybridIdentityMetadata. /// The cancellation token to use. - /// 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 GetHybridIdentityMetadata(string metadataName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetHybridIdentityMetadat /// An object representing collection of MachineExtensionResources and their operations over a MachineExtensionResource. public virtual MachineExtensionCollection GetMachineExtensions() { - return GetCachedClient(Client => new MachineExtensionCollection(Client, Id)); + return GetCachedClient(client => new MachineExtensionCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual MachineExtensionCollection GetMachineExtensions() /// /// The name of the machine extension. /// The cancellation token to use. - /// 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> GetMachineExtensionAsync(string extensionName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetMachineExtensio /// /// The name of the machine extension. /// The cancellation token to use. - /// 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 GetMachineExtension(string extensionName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetMachineExtension(string ext /// An object representing collection of GuestAgentResources and their operations over a GuestAgentResource. public virtual GuestAgentCollection GetGuestAgents() { - return GetCachedClient(Client => new GuestAgentCollection(Client, Id)); + return GetCachedClient(client => new GuestAgentCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual GuestAgentCollection GetGuestAgents() /// /// Name of the GuestAgent. /// The cancellation token to use. - /// 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> GetGuestAgentAsync(string name, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task> GetGuestAgentAsync(strin /// /// Name of the GuestAgent. /// The cancellation token to use. - /// 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 GetGuestAgent(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionArmClientMockingExtension.cs similarity index 61% rename from sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ArmResourceExtensionClient.cs rename to sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionArmClientMockingExtension.cs index 1c9784822ec2..85e874ca87a0 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionArmClientMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Consumption; using Azure.ResourceManager.Consumption.Models; -namespace Azure.ResourceManager.Consumption +namespace Azure.ResourceManager.Consumption.Mocking { - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource + /// A class to add extension methods to ArmClient. + public partial class ConsumptionArmClientMockingExtension : ArmResource { private ClientDiagnostics _usageDetailsClientDiagnostics; private UsageDetailsRestOperations _usageDetailsRestClient; @@ -37,15 +38,19 @@ internal partial class ArmResourceExtensionClient : ArmResource private ClientDiagnostics _reservationRecommendationDetailsClientDiagnostics; private ReservationRecommendationDetailsRestOperations _reservationRecommendationDetailsRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConsumptionArmClientMockingExtension() { } - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConsumptionArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ConsumptionArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) { } @@ -72,11 +77,60 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ConsumptionBudgetResources in the ArmResource. + /// Gets a collection of ConsumptionBudgetResources in the ArmClient. + /// The scope that the resource will apply against. /// An object representing collection of ConsumptionBudgetResources and their operations over a ConsumptionBudgetResource. - public virtual ConsumptionBudgetCollection GetConsumptionBudgets() + public virtual ConsumptionBudgetCollection GetConsumptionBudgets(ResourceIdentifier scope) + { + return new ConsumptionBudgetCollection(Client, scope); + } + + /// + /// Gets the budget for the scope by budget name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Consumption/budgets/{budgetName} + /// + /// + /// Operation Id + /// Budgets_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Budget Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetConsumptionBudgetAsync(ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default) + { + return await GetConsumptionBudgets(scope).GetAsync(budgetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the budget for the scope by budget name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Consumption/budgets/{budgetName} + /// + /// + /// Operation Id + /// Budgets_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Budget Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetConsumptionBudget(ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default) { - return GetCachedClient(Client => new ConsumptionBudgetCollection(Client, Id)); + return GetConsumptionBudgets(scope).Get(budgetName, cancellationToken); } /// @@ -92,6 +146,7 @@ public virtual ConsumptionBudgetCollection GetConsumptionBudgets() /// /// /// + /// The scope to use. /// May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -99,11 +154,11 @@ public virtual ConsumptionBudgetCollection GetConsumptionBudgets() /// Allows to select different type of cost/usage records. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionUsageDetailsAsync(string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionUsageDetailsAsync(ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(Id, expand, filter, skipToken, top, metric); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, Id, expand, filter, skipToken, top, metric); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(scope, expand, filter, skipToken, top, metric); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, scope, expand, filter, skipToken, top, metric); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken); } /// @@ -119,6 +174,7 @@ public virtual AsyncPageable GetConsumptionUsageDetailsA /// /// /// + /// The scope to use. /// May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. /// May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @@ -126,11 +182,11 @@ public virtual AsyncPageable GetConsumptionUsageDetailsA /// Allows to select different type of cost/usage records. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionUsageDetails(string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionUsageDetails(ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(Id, expand, filter, skipToken, top, metric); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, Id, expand, filter, skipToken, top, metric); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(scope, expand, filter, skipToken, top, metric); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, scope, expand, filter, skipToken, top, metric); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken); } /// @@ -146,16 +202,17 @@ public virtual Pageable GetConsumptionUsageDetails(strin /// /// /// + /// The scope to use. /// May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. /// May be used to limit the number of results to the most recent N marketplaces. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionMarketPlacesAsync(string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionMarketPlacesAsync(ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(Id, filter, top, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, Id, filter, top, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(scope, filter, top, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, scope, filter, top, skipToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken); } /// @@ -171,16 +228,17 @@ public virtual AsyncPageable GetConsumptionMarketPlacesA /// /// /// + /// The scope to use. /// May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. /// May be used to limit the number of results to the most recent N marketplaces. /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionMarketPlaces(string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionMarketPlaces(ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(Id, filter, top, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, Id, filter, top, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(scope, filter, top, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, scope, filter, top, skipToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken); } /// @@ -196,19 +254,20 @@ public virtual Pageable GetConsumptionMarketPlaces(strin /// /// /// + /// The scope to use. /// The cancellation token to use. - public virtual async Task> GetConsumptionTagsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetConsumptionTagsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - using var scope = TagsClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetConsumptionTags"); - scope.Start(); + using var scope0 = TagsClientDiagnostics.CreateScope("ConsumptionArmClientMockingExtension.GetConsumptionTags"); + scope0.Start(); try { - var response = await TagsRestClient.GetAsync(Id, cancellationToken).ConfigureAwait(false); + var response = await TagsRestClient.GetAsync(scope, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -226,19 +285,20 @@ public virtual async Task> GetConsumptionTagsAsy /// /// /// + /// The scope to use. /// The cancellation token to use. - public virtual Response GetConsumptionTags(CancellationToken cancellationToken = default) + public virtual Response GetConsumptionTags(ResourceIdentifier scope, CancellationToken cancellationToken = default) { - using var scope = TagsClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetConsumptionTags"); - scope.Start(); + using var scope0 = TagsClientDiagnostics.CreateScope("ConsumptionArmClientMockingExtension.GetConsumptionTags"); + scope0.Start(); try { - var response = TagsRestClient.Get(Id, cancellationToken); + var response = TagsRestClient.Get(scope, cancellationToken); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -256,16 +316,17 @@ public virtual Response GetConsumptionTags(CancellationTo /// /// /// + /// The scope to use. /// Start date. /// End date. /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionChargesAsync(string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionChargesAsync(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(Id, startDate, endDate, filter, apply); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionCharges", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(scope, startDate, endDate, filter, apply); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionCharges", "value", null, cancellationToken); } /// @@ -281,16 +342,17 @@ public virtual AsyncPageable GetConsumptionChargesAsyn /// /// /// + /// The scope to use. /// Start date. /// End date. /// May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). /// May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionCharges(string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionCharges(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(Id, startDate, endDate, filter, apply); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionCharges", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(scope, startDate, endDate, filter, apply); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionCharges", "value", null, cancellationToken); } /// @@ -306,14 +368,18 @@ public virtual Pageable GetConsumptionCharges(string s /// /// /// + /// The scope to use. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionReservationsSummariesAsync(ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionReservationsSummariesAsync(ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(Id, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, Id, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(options, nameof(options)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken); } /// @@ -329,14 +395,18 @@ public virtual AsyncPageable GetConsumptionReserv /// /// /// + /// The scope to use. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionReservationsSummaries(ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionReservationsSummaries(ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(Id, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, Id, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(options, nameof(options)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken); } /// @@ -352,6 +422,7 @@ public virtual Pageable GetConsumptionReservation /// /// /// + /// The scope to use. /// Start date. Only applicable when querying with billing profile. /// End date. Only applicable when querying with billing profile. /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. @@ -359,11 +430,11 @@ public virtual Pageable GetConsumptionReservation /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionReservationsDetailsAsync(string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionReservationsDetailsAsync(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(Id, startDate, endDate, filter, reservationId, reservationOrderId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, Id, startDate, endDate, filter, reservationId, reservationOrderId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(scope, startDate, endDate, filter, reservationId, reservationOrderId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, scope, startDate, endDate, filter, reservationId, reservationOrderId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken); } /// @@ -379,6 +450,7 @@ public virtual AsyncPageable GetConsumptionReserva /// /// /// + /// The scope to use. /// Start date. Only applicable when querying with billing profile. /// End date. Only applicable when querying with billing profile. /// Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. @@ -386,11 +458,11 @@ public virtual AsyncPageable GetConsumptionReserva /// Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionReservationsDetails(string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionReservationsDetails(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(Id, startDate, endDate, filter, reservationId, reservationOrderId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, Id, startDate, endDate, filter, reservationId, reservationOrderId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(scope, startDate, endDate, filter, reservationId, reservationOrderId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, scope, startDate, endDate, filter, reservationId, reservationOrderId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken); } /// @@ -406,14 +478,15 @@ public virtual Pageable GetConsumptionReservations /// /// /// + /// The scope to use. /// May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConsumptionReservationRecommendationsAsync(string filter = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetConsumptionReservationRecommendationsAsync(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken); } /// @@ -429,14 +502,15 @@ public virtual AsyncPageable GetConsumptio /// /// /// + /// The scope to use. /// May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConsumptionReservationRecommendations(string filter = null, CancellationToken cancellationToken = default) + public virtual Pageable GetConsumptionReservationRecommendations(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(Id, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, Id, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(scope, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "ConsumptionArmClientMockingExtension.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken); } /// @@ -452,24 +526,29 @@ public virtual Pageable GetConsumptionRese /// /// /// + /// The scope to use. /// Scope of the reservation. /// Used to select the region the recommendation should be generated for. /// Specify length of reservation recommendation term. /// Filter the time period on which reservation recommendation results are based. /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). /// The cancellation token to use. - public virtual async Task> GetConsumptionReservationRecommendationDetailsAsync(ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) + /// or is null. + public virtual async Task> GetConsumptionReservationRecommendationDetailsAsync(ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) { - using var scope = ReservationRecommendationDetailsClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetConsumptionReservationRecommendationDetails"); - scope.Start(); + Argument.AssertNotNull(region, nameof(region)); + Argument.AssertNotNull(product, nameof(product)); + + using var scope0 = ReservationRecommendationDetailsClientDiagnostics.CreateScope("ConsumptionArmClientMockingExtension.GetConsumptionReservationRecommendationDetails"); + scope0.Start(); try { - var response = await ReservationRecommendationDetailsRestClient.GetAsync(Id, reservationScope, region, term, lookBackPeriod, product, cancellationToken).ConfigureAwait(false); + var response = await ReservationRecommendationDetailsRestClient.GetAsync(scope, reservationScope, region, term, lookBackPeriod, product, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } @@ -487,26 +566,138 @@ public virtual async Task> /// /// /// + /// The scope to use. /// Scope of the reservation. /// Used to select the region the recommendation should be generated for. /// Specify length of reservation recommendation term. /// Filter the time period on which reservation recommendation results are based. /// Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). /// The cancellation token to use. - public virtual Response GetConsumptionReservationRecommendationDetails(ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) + /// or is null. + public virtual Response GetConsumptionReservationRecommendationDetails(ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) { - using var scope = ReservationRecommendationDetailsClientDiagnostics.CreateScope("ArmResourceExtensionClient.GetConsumptionReservationRecommendationDetails"); - scope.Start(); + Argument.AssertNotNull(region, nameof(region)); + Argument.AssertNotNull(product, nameof(product)); + + using var scope0 = ReservationRecommendationDetailsClientDiagnostics.CreateScope("ConsumptionArmClientMockingExtension.GetConsumptionReservationRecommendationDetails"); + scope0.Start(); try { - var response = ReservationRecommendationDetailsRestClient.Get(Id, reservationScope, region, term, lookBackPeriod, product, cancellationToken); + var response = ReservationRecommendationDetailsRestClient.Get(scope, reservationScope, region, term, lookBackPeriod, product, cancellationToken); return response; } catch (Exception e) { - scope.Failed(e); + scope0.Failed(e); throw; } } + /// + /// 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 ConsumptionBudgetResource GetConsumptionBudgetResource(ResourceIdentifier id) + { + ConsumptionBudgetResource.ValidateResourceId(id); + return new ConsumptionBudgetResource(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 BillingAccountConsumptionResource GetBillingAccountConsumptionResource(ResourceIdentifier id) + { + BillingAccountConsumptionResource.ValidateResourceId(id); + return new BillingAccountConsumptionResource(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 BillingProfileConsumptionResource GetBillingProfileConsumptionResource(ResourceIdentifier id) + { + BillingProfileConsumptionResource.ValidateResourceId(id); + return new BillingProfileConsumptionResource(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 TenantBillingPeriodConsumptionResource GetTenantBillingPeriodConsumptionResource(ResourceIdentifier id) + { + TenantBillingPeriodConsumptionResource.ValidateResourceId(id); + return new TenantBillingPeriodConsumptionResource(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 SubscriptionBillingPeriodConsumptionResource GetSubscriptionBillingPeriodConsumptionResource(ResourceIdentifier id) + { + SubscriptionBillingPeriodConsumptionResource.ValidateResourceId(id); + return new SubscriptionBillingPeriodConsumptionResource(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 ManagementGroupBillingPeriodConsumptionResource GetManagementGroupBillingPeriodConsumptionResource(ResourceIdentifier id) + { + ManagementGroupBillingPeriodConsumptionResource.ValidateResourceId(id); + return new ManagementGroupBillingPeriodConsumptionResource(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 BillingCustomerConsumptionResource GetBillingCustomerConsumptionResource(ResourceIdentifier id) + { + BillingCustomerConsumptionResource.ValidateResourceId(id); + return new BillingCustomerConsumptionResource(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 ReservationConsumptionResource GetReservationConsumptionResource(ResourceIdentifier id) + { + ReservationConsumptionResource.ValidateResourceId(id); + return new ReservationConsumptionResource(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 ReservationOrderConsumptionResource GetReservationOrderConsumptionResource(ResourceIdentifier id) + { + ReservationOrderConsumptionResource.ValidateResourceId(id); + return new ReservationOrderConsumptionResource(Client, id); + } } } diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionExtensions.cs b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionExtensions.cs index bcda22d401c4..0426b3cf4225 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionExtensions.cs +++ b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Consumption.Mocking; using Azure.ResourceManager.Consumption.Models; using Azure.ResourceManager.ManagementGroups; using Azure.ResourceManager.Resources; @@ -20,247 +21,39 @@ namespace Azure.ResourceManager.Consumption /// A class to add extension methods to Azure.ResourceManager.Consumption. public static partial class ConsumptionExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static ConsumptionArmClientMockingExtension GetConsumptionArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ConsumptionArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ConsumptionManagementGroupMockingExtension GetConsumptionManagementGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ConsumptionManagementGroupMockingExtension(client, resource.Id)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmResource resource) + private static ConsumptionSubscriptionMockingExtension GetConsumptionSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new ManagementGroupResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ConsumptionSubscriptionMockingExtension(client, resource.Id)); } - private static ManagementGroupResourceExtensionClient GetManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ConsumptionTenantMockingExtension GetConsumptionTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ManagementGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ConsumptionTenantMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); - } - - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region ConsumptionBudgetResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ConsumptionBudgetResource GetConsumptionBudgetResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ConsumptionBudgetResource.ValidateResourceId(id); - return new ConsumptionBudgetResource(client, id); - } - ); - } - #endregion - - #region BillingAccountConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BillingAccountConsumptionResource GetBillingAccountConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BillingAccountConsumptionResource.ValidateResourceId(id); - return new BillingAccountConsumptionResource(client, id); - } - ); - } - #endregion - - #region BillingProfileConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BillingProfileConsumptionResource GetBillingProfileConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BillingProfileConsumptionResource.ValidateResourceId(id); - return new BillingProfileConsumptionResource(client, id); - } - ); - } - #endregion - - #region TenantBillingPeriodConsumptionResource /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantBillingPeriodConsumptionResource GetTenantBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantBillingPeriodConsumptionResource.ValidateResourceId(id); - return new TenantBillingPeriodConsumptionResource(client, id); - } - ); - } - #endregion - - #region SubscriptionBillingPeriodConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionBillingPeriodConsumptionResource GetSubscriptionBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SubscriptionBillingPeriodConsumptionResource.ValidateResourceId(id); - return new SubscriptionBillingPeriodConsumptionResource(client, id); - } - ); - } - #endregion - - #region ManagementGroupBillingPeriodConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ManagementGroupBillingPeriodConsumptionResource GetManagementGroupBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ManagementGroupBillingPeriodConsumptionResource.ValidateResourceId(id); - return new ManagementGroupBillingPeriodConsumptionResource(client, id); - } - ); - } - #endregion - - #region BillingCustomerConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static BillingCustomerConsumptionResource GetBillingCustomerConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - BillingCustomerConsumptionResource.ValidateResourceId(id); - return new BillingCustomerConsumptionResource(client, id); - } - ); - } - #endregion - - #region ReservationConsumptionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ReservationConsumptionResource GetReservationConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ReservationConsumptionResource.ValidateResourceId(id); - return new ReservationConsumptionResource(client, id); - } - ); - } - #endregion - - #region ReservationOrderConsumptionResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of ConsumptionBudgetResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ReservationOrderConsumptionResource GetReservationOrderConsumptionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ReservationOrderConsumptionResource.ValidateResourceId(id); - return new ReservationOrderConsumptionResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of ConsumptionBudgetResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of ConsumptionBudgetResources and their operations over a ConsumptionBudgetResource. public static ConsumptionBudgetCollection GetConsumptionBudgets(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionBudgets(); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionBudgets(scope); } /// @@ -275,17 +68,21 @@ public static ConsumptionBudgetCollection GetConsumptionBudgets(this ArmClient c /// Budgets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Budget Name. /// The cancellation token to use. - /// 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 static async Task> GetConsumptionBudgetAsync(this ArmClient client, ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default) { - return await client.GetConsumptionBudgets(scope).GetAsync(budgetName, cancellationToken).ConfigureAwait(false); + return await GetConsumptionArmClientMockingExtension(client).GetConsumptionBudgetAsync(scope, budgetName, cancellationToken).ConfigureAwait(false); } /// @@ -300,17 +97,21 @@ public static async Task> GetConsumptionBudg /// Budgets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Budget Name. /// The cancellation token to use. - /// 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 static Response GetConsumptionBudget(this ArmClient client, ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default) { - return client.GetConsumptionBudgets(scope).Get(budgetName, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionBudget(scope, budgetName, cancellationToken); } /// @@ -325,6 +126,10 @@ public static Response GetConsumptionBudget(this ArmC /// UsageDetails_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -336,7 +141,7 @@ public static Response GetConsumptionBudget(this ArmC /// The cancellation token to use. public static AsyncPageable GetConsumptionUsageDetailsAsync(this ArmClient client, ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionUsageDetailsAsync(expand, filter, skipToken, top, metric, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionUsageDetailsAsync(scope, expand, filter, skipToken, top, metric, cancellationToken); } /// @@ -351,6 +156,10 @@ public static AsyncPageable GetConsumptionUsageDetailsAs /// UsageDetails_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -362,7 +171,7 @@ public static AsyncPageable GetConsumptionUsageDetailsAs /// The cancellation token to use. public static Pageable GetConsumptionUsageDetails(this ArmClient client, ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionUsageDetails(expand, filter, skipToken, top, metric, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionUsageDetails(scope, expand, filter, skipToken, top, metric, cancellationToken); } /// @@ -377,6 +186,10 @@ public static Pageable GetConsumptionUsageDetails(this A /// Marketplaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -386,7 +199,7 @@ public static Pageable GetConsumptionUsageDetails(this A /// The cancellation token to use. public static AsyncPageable GetConsumptionMarketPlacesAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionMarketPlacesAsync(filter, top, skipToken, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionMarketPlacesAsync(scope, filter, top, skipToken, cancellationToken); } /// @@ -401,6 +214,10 @@ public static AsyncPageable GetConsumptionMarketPlacesAs /// Marketplaces_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -410,7 +227,7 @@ public static AsyncPageable GetConsumptionMarketPlacesAs /// The cancellation token to use. public static Pageable GetConsumptionMarketPlaces(this ArmClient client, ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionMarketPlaces(filter, top, skipToken, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionMarketPlaces(scope, filter, top, skipToken, cancellationToken); } /// @@ -425,13 +242,17 @@ public static Pageable GetConsumptionMarketPlaces(this A /// Tags_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static async Task> GetConsumptionTagsAsync(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return await GetArmResourceExtensionClient(client, scope).GetConsumptionTagsAsync(cancellationToken).ConfigureAwait(false); + return await GetConsumptionArmClientMockingExtension(client).GetConsumptionTagsAsync(scope, cancellationToken).ConfigureAwait(false); } /// @@ -446,13 +267,17 @@ public static async Task> GetConsumptionTagsAsyn /// Tags_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// The cancellation token to use. public static Response GetConsumptionTags(this ArmClient client, ResourceIdentifier scope, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionTags(cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionTags(scope, cancellationToken); } /// @@ -467,6 +292,10 @@ public static Response GetConsumptionTags(this ArmClient /// Charges_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -477,7 +306,7 @@ public static Response GetConsumptionTags(this ArmClient /// The cancellation token to use. public static AsyncPageable GetConsumptionChargesAsync(this ArmClient client, ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionChargesAsync(startDate, endDate, filter, apply, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionChargesAsync(scope, startDate, endDate, filter, apply, cancellationToken); } /// @@ -492,6 +321,10 @@ public static AsyncPageable GetConsumptionChargesAsync /// Charges_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -502,7 +335,7 @@ public static AsyncPageable GetConsumptionChargesAsync /// The cancellation token to use. public static Pageable GetConsumptionCharges(this ArmClient client, ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionCharges(startDate, endDate, filter, apply, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionCharges(scope, startDate, endDate, filter, apply, cancellationToken); } /// @@ -517,6 +350,10 @@ public static Pageable GetConsumptionCharges(this ArmC /// ReservationsSummaries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -525,9 +362,7 @@ public static Pageable GetConsumptionCharges(this ArmC /// is null. public static AsyncPageable GetConsumptionReservationsSummariesAsync(this ArmClient client, ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationsSummariesAsync(options, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationsSummariesAsync(scope, options, cancellationToken); } /// @@ -542,6 +377,10 @@ public static AsyncPageable GetConsumptionReserva /// ReservationsSummaries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -550,9 +389,7 @@ public static AsyncPageable GetConsumptionReserva /// is null. public static Pageable GetConsumptionReservationsSummaries(this ArmClient client, ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationsSummaries(options, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationsSummaries(scope, options, cancellationToken); } /// @@ -567,6 +404,10 @@ public static Pageable GetConsumptionReservations /// ReservationsDetails_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -578,7 +419,7 @@ public static Pageable GetConsumptionReservations /// The cancellation token to use. public static AsyncPageable GetConsumptionReservationsDetailsAsync(this ArmClient client, ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationsDetailsAsync(startDate, endDate, filter, reservationId, reservationOrderId, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationsDetailsAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId, cancellationToken); } /// @@ -593,6 +434,10 @@ public static AsyncPageable GetConsumptionReservat /// ReservationsDetails_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -604,7 +449,7 @@ public static AsyncPageable GetConsumptionReservat /// The cancellation token to use. public static Pageable GetConsumptionReservationsDetails(this ArmClient client, ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationsDetails(startDate, endDate, filter, reservationId, reservationOrderId, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationsDetails(scope, startDate, endDate, filter, reservationId, reservationOrderId, cancellationToken); } /// @@ -619,6 +464,10 @@ public static Pageable GetConsumptionReservationsD /// ReservationRecommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -626,7 +475,7 @@ public static Pageable GetConsumptionReservationsD /// The cancellation token to use. public static AsyncPageable GetConsumptionReservationRecommendationsAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationRecommendationsAsync(filter, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationRecommendationsAsync(scope, filter, cancellationToken); } /// @@ -641,6 +490,10 @@ public static AsyncPageable GetConsumption /// ReservationRecommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -648,7 +501,7 @@ public static AsyncPageable GetConsumption /// The cancellation token to use. public static Pageable GetConsumptionReservationRecommendations(this ArmClient client, ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationRecommendations(filter, cancellationToken); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationRecommendations(scope, filter, cancellationToken); } /// @@ -663,6 +516,10 @@ public static Pageable GetConsumptionReser /// ReservationRecommendationDetails_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -675,10 +532,7 @@ public static Pageable GetConsumptionReser /// or is null. public static async Task> GetConsumptionReservationRecommendationDetailsAsync(this ArmClient client, ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(region, nameof(region)); - Argument.AssertNotNull(product, nameof(product)); - - return await GetArmResourceExtensionClient(client, scope).GetConsumptionReservationRecommendationDetailsAsync(reservationScope, region, term, lookBackPeriod, product, cancellationToken).ConfigureAwait(false); + return await GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationRecommendationDetailsAsync(scope, reservationScope, region, term, lookBackPeriod, product, cancellationToken).ConfigureAwait(false); } /// @@ -693,6 +547,10 @@ public static async Task> /// ReservationRecommendationDetails_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -705,10 +563,151 @@ public static async Task> /// or is null. public static Response GetConsumptionReservationRecommendationDetails(this ArmClient client, ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(region, nameof(region)); - Argument.AssertNotNull(product, nameof(product)); + return GetConsumptionArmClientMockingExtension(client).GetConsumptionReservationRecommendationDetails(scope, reservationScope, region, term, lookBackPeriod, product, 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. + /// Returns a object. + public static ConsumptionBudgetResource GetConsumptionBudgetResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetConsumptionBudgetResource(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. + /// Returns a object. + public static BillingAccountConsumptionResource GetBillingAccountConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetBillingAccountConsumptionResource(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. + /// Returns a object. + public static BillingProfileConsumptionResource GetBillingProfileConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetBillingProfileConsumptionResource(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. + /// Returns a object. + public static TenantBillingPeriodConsumptionResource GetTenantBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetTenantBillingPeriodConsumptionResource(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. + /// Returns a object. + public static SubscriptionBillingPeriodConsumptionResource GetSubscriptionBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetSubscriptionBillingPeriodConsumptionResource(id); + } - return GetArmResourceExtensionClient(client, scope).GetConsumptionReservationRecommendationDetails(reservationScope, region, term, lookBackPeriod, product, 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. + /// Returns a object. + public static ManagementGroupBillingPeriodConsumptionResource GetManagementGroupBillingPeriodConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetManagementGroupBillingPeriodConsumptionResource(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. + /// Returns a object. + public static BillingCustomerConsumptionResource GetBillingCustomerConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetBillingCustomerConsumptionResource(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. + /// Returns a object. + public static ReservationConsumptionResource GetReservationConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetReservationConsumptionResource(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. + /// Returns a object. + public static ReservationOrderConsumptionResource GetReservationOrderConsumptionResource(this ArmClient client, ResourceIdentifier id) + { + return GetConsumptionArmClientMockingExtension(client).GetReservationOrderConsumptionResource(id); } /// @@ -723,13 +722,17 @@ public static Response GetConsumpti /// AggregatedCost_GetByManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). /// The cancellation token to use. public static async Task> GetAggregatedCostAsync(this ManagementGroupResource managementGroupResource, string filter = null, CancellationToken cancellationToken = default) { - return await GetManagementGroupResourceExtensionClient(managementGroupResource).GetAggregatedCostAsync(filter, cancellationToken).ConfigureAwait(false); + return await GetConsumptionManagementGroupMockingExtension(managementGroupResource).GetAggregatedCostAsync(filter, cancellationToken).ConfigureAwait(false); } /// @@ -744,13 +747,17 @@ public static async Task> GetAggregate /// AggregatedCost_GetByManagementGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). /// The cancellation token to use. public static Response GetAggregatedCost(this ManagementGroupResource managementGroupResource, string filter = null, CancellationToken cancellationToken = default) { - return GetManagementGroupResourceExtensionClient(managementGroupResource).GetAggregatedCost(filter, cancellationToken); + return GetConsumptionManagementGroupMockingExtension(managementGroupResource).GetAggregatedCost(filter, cancellationToken); } /// @@ -765,6 +772,10 @@ public static Response GetAggregatedCost(this M /// PriceSheet_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. @@ -773,7 +784,7 @@ public static Response GetAggregatedCost(this M /// The cancellation token to use. public static async Task> GetPriceSheetAsync(this SubscriptionResource subscriptionResource, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetPriceSheetAsync(expand, skipToken, top, cancellationToken).ConfigureAwait(false); + return await GetConsumptionSubscriptionMockingExtension(subscriptionResource).GetPriceSheetAsync(expand, skipToken, top, cancellationToken).ConfigureAwait(false); } /// @@ -788,6 +799,10 @@ public static async Task> GetPriceSheetAsync(this Sub /// PriceSheet_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. @@ -796,7 +811,7 @@ public static async Task> GetPriceSheetAsync(this Sub /// The cancellation token to use. public static Response GetPriceSheet(this SubscriptionResource subscriptionResource, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetPriceSheet(expand, skipToken, top, cancellationToken); + return GetConsumptionSubscriptionMockingExtension(subscriptionResource).GetPriceSheet(expand, skipToken, top, cancellationToken); } } } diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionManagementGroupMockingExtension.cs similarity index 88% rename from sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs rename to sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionManagementGroupMockingExtension.cs index 4edc6c3a5dbc..4c4875bec6c4 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ManagementGroupResourceExtensionClient.cs +++ b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionManagementGroupMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Consumption; using Azure.ResourceManager.Consumption.Models; -namespace Azure.ResourceManager.Consumption +namespace Azure.ResourceManager.Consumption.Mocking { /// A class to add extension methods to ManagementGroupResource. - internal partial class ManagementGroupResourceExtensionClient : ArmResource + public partial class ConsumptionManagementGroupMockingExtension : ArmResource { private ClientDiagnostics _aggregatedCostClientDiagnostics; private AggregatedCostRestOperations _aggregatedCostRestClient; - /// Initializes a new instance of the class for mocking. - protected ManagementGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConsumptionManagementGroupMockingExtension() { } - /// 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 ManagementGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConsumptionManagementGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> GetAggregatedCostAsync(string filter = null, CancellationToken cancellationToken = default) { - using var scope = AggregatedCostClientDiagnostics.CreateScope("ManagementGroupResourceExtensionClient.GetAggregatedCost"); + using var scope = AggregatedCostClientDiagnostics.CreateScope("ConsumptionManagementGroupMockingExtension.GetAggregatedCost"); scope.Start(); try { @@ -91,7 +92,7 @@ public virtual async Task> GetAggregat /// The cancellation token to use. public virtual Response GetAggregatedCost(string filter = null, CancellationToken cancellationToken = default) { - using var scope = AggregatedCostClientDiagnostics.CreateScope("ManagementGroupResourceExtensionClient.GetAggregatedCost"); + using var scope = AggregatedCostClientDiagnostics.CreateScope("ConsumptionManagementGroupMockingExtension.GetAggregatedCost"); scope.Start(); try { diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionSubscriptionMockingExtension.cs similarity index 89% rename from sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionSubscriptionMockingExtension.cs index 5a5d7630ac7e..f1f5d2e3131a 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionSubscriptionMockingExtension.cs @@ -12,25 +12,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Consumption; using Azure.ResourceManager.Consumption.Models; -namespace Azure.ResourceManager.Consumption +namespace Azure.ResourceManager.Consumption.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ConsumptionSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _priceSheetClientDiagnostics; private PriceSheetRestOperations _priceSheetRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConsumptionSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConsumptionSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -62,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// The cancellation token to use. public virtual async Task> GetPriceSheetAsync(string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetPriceSheet"); + using var scope = PriceSheetClientDiagnostics.CreateScope("ConsumptionSubscriptionMockingExtension.GetPriceSheet"); scope.Start(); try { @@ -95,7 +96,7 @@ public virtual async Task> GetPriceSheetAsync(string /// The cancellation token to use. public virtual Response GetPriceSheet(string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetPriceSheet"); + using var scope = PriceSheetClientDiagnostics.CreateScope("ConsumptionSubscriptionMockingExtension.GetPriceSheet"); scope.Start(); try { diff --git a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionTenantMockingExtension.cs similarity index 66% rename from sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionTenantMockingExtension.cs index 6cad8c23f0ab..a68634931531 100644 --- a/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/consumption/Azure.ResourceManager.Consumption/src/Generated/Extensions/ConsumptionTenantMockingExtension.cs @@ -8,20 +8,20 @@ using Azure.Core; using Azure.ResourceManager; -namespace Azure.ResourceManager.Consumption +namespace Azure.ResourceManager.Consumption.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class ConsumptionTenantMockingExtension : ArmResource { - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ConsumptionTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConsumptionTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs index f839095b13ad..362437fccd9f 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerAppConnectedEnvironmentCertificateResources and their operations over a ContainerAppConnectedEnvironmentCertificateResource. public virtual ContainerAppConnectedEnvironmentCertificateCollection GetContainerAppConnectedEnvironmentCertificates() { - return GetCachedClient(Client => new ContainerAppConnectedEnvironmentCertificateCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppConnectedEnvironmentCertificateCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual ContainerAppConnectedEnvironmentCertificateCollection GetContaine /// /// Name of the Certificate. /// The cancellation token to use. - /// 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> GetContainerAppConnectedEnvironmentCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task /// Name of the Certificate. /// The cancellation token to use. - /// 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 GetContainerAppConnectedEnvironmentCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response Get /// An object representing collection of ContainerAppConnectedEnvironmentDaprComponentResources and their operations over a ContainerAppConnectedEnvironmentDaprComponentResource. public virtual ContainerAppConnectedEnvironmentDaprComponentCollection GetContainerAppConnectedEnvironmentDaprComponents() { - return GetCachedClient(Client => new ContainerAppConnectedEnvironmentDaprComponentCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppConnectedEnvironmentDaprComponentCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual ContainerAppConnectedEnvironmentDaprComponentCollection GetContai /// /// Name of the Dapr Component. /// The cancellation token to use. - /// 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> GetContainerAppConnectedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task /// Name of the Dapr Component. /// The cancellation token to use. - /// 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 GetContainerAppConnectedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response G /// An object representing collection of ContainerAppConnectedEnvironmentStorageResources and their operations over a ContainerAppConnectedEnvironmentStorageResource. public virtual ContainerAppConnectedEnvironmentStorageCollection GetContainerAppConnectedEnvironmentStorages() { - return GetCachedClient(Client => new ContainerAppConnectedEnvironmentStorageCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppConnectedEnvironmentStorageCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual ContainerAppConnectedEnvironmentStorageCollection GetContainerApp /// /// Name of the storage. /// The cancellation token to use. - /// 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> GetContainerAppConnectedEnvironmentStorageAsync(string storageName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task /// Name of the storage. /// The cancellation token to use. - /// 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 GetContainerAppConnectedEnvironmentStorage(string storageName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs index 72b75d9170bc..d80f7f2aeef0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerAppJobExecutionResources and their operations over a ContainerAppJobExecutionResource. public virtual ContainerAppJobExecutionCollection GetContainerAppJobExecutions() { - return GetCachedClient(Client => new ContainerAppJobExecutionCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppJobExecutionCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual ContainerAppJobExecutionCollection GetContainerAppJobExecutions() /// /// Job execution name. /// The cancellation token to use. - /// 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> GetContainerAppJobExecutionAsync(string jobExecutionName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetContain /// /// Job execution name. /// The cancellation token to use. - /// 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 GetContainerAppJobExecution(string jobExecutionName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs index 69508e54c373..783b0374700c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerAppManagedEnvironmentCertificateResources and their operations over a ContainerAppManagedEnvironmentCertificateResource. public virtual ContainerAppManagedEnvironmentCertificateCollection GetContainerAppManagedEnvironmentCertificates() { - return GetCachedClient(Client => new ContainerAppManagedEnvironmentCertificateCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppManagedEnvironmentCertificateCollection(client, Id)); } /// @@ -116,8 +116,8 @@ public virtual ContainerAppManagedEnvironmentCertificateCollection GetContainerA /// /// Name of the Certificate. /// The cancellation token to use. - /// 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> GetContainerAppManagedEnvironmentCertificateAsync(string certificateName, CancellationToken cancellationToken = default) { @@ -139,8 +139,8 @@ public virtual async Task /// Name of the Certificate. /// The cancellation token to use. - /// 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 GetContainerAppManagedEnvironmentCertificate(string certificateName, CancellationToken cancellationToken = default) { @@ -151,7 +151,7 @@ public virtual Response GetCo /// An object representing collection of ContainerAppManagedEnvironmentDaprComponentResources and their operations over a ContainerAppManagedEnvironmentDaprComponentResource. public virtual ContainerAppManagedEnvironmentDaprComponentCollection GetContainerAppManagedEnvironmentDaprComponents() { - return GetCachedClient(Client => new ContainerAppManagedEnvironmentDaprComponentCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppManagedEnvironmentDaprComponentCollection(client, Id)); } /// @@ -169,8 +169,8 @@ public virtual ContainerAppManagedEnvironmentDaprComponentCollection GetContaine /// /// Name of the Dapr Component. /// The cancellation token to use. - /// 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> GetContainerAppManagedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) { @@ -192,8 +192,8 @@ public virtual async Task /// Name of the Dapr Component. /// The cancellation token to use. - /// 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 GetContainerAppManagedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) { @@ -204,7 +204,7 @@ public virtual Response Get /// An object representing collection of ContainerAppManagedEnvironmentDetectorResources and their operations over a ContainerAppManagedEnvironmentDetectorResource. public virtual ContainerAppManagedEnvironmentDetectorCollection GetContainerAppManagedEnvironmentDetectors() { - return GetCachedClient(Client => new ContainerAppManagedEnvironmentDetectorCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppManagedEnvironmentDetectorCollection(client, Id)); } /// @@ -222,8 +222,8 @@ public virtual ContainerAppManagedEnvironmentDetectorCollection GetContainerAppM /// /// Name of the Managed Environment detector. /// The cancellation token to use. - /// 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> GetContainerAppManagedEnvironmentDetectorAsync(string detectorName, CancellationToken cancellationToken = default) { @@ -245,8 +245,8 @@ public virtual async Task /// Name of the Managed Environment detector. /// The cancellation token to use. - /// 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 GetContainerAppManagedEnvironmentDetector(string detectorName, CancellationToken cancellationToken = default) { @@ -264,7 +264,7 @@ public virtual ContainerAppManagedEnvironmentDetectorResourcePropertyResource Ge /// An object representing collection of ContainerAppManagedCertificateResources and their operations over a ContainerAppManagedCertificateResource. public virtual ContainerAppManagedCertificateCollection GetContainerAppManagedCertificates() { - return GetCachedClient(Client => new ContainerAppManagedCertificateCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppManagedCertificateCollection(client, Id)); } /// @@ -282,8 +282,8 @@ public virtual ContainerAppManagedCertificateCollection GetContainerAppManagedCe /// /// Name of the Managed Certificate. /// The cancellation token to use. - /// 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> GetContainerAppManagedCertificateAsync(string managedCertificateName, CancellationToken cancellationToken = default) { @@ -305,8 +305,8 @@ public virtual async Task> GetC /// /// Name of the Managed Certificate. /// The cancellation token to use. - /// 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 GetContainerAppManagedCertificate(string managedCertificateName, CancellationToken cancellationToken = default) { @@ -317,7 +317,7 @@ public virtual Response GetContainerAppM /// An object representing collection of ContainerAppManagedEnvironmentStorageResources and their operations over a ContainerAppManagedEnvironmentStorageResource. public virtual ContainerAppManagedEnvironmentStorageCollection GetContainerAppManagedEnvironmentStorages() { - return GetCachedClient(Client => new ContainerAppManagedEnvironmentStorageCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppManagedEnvironmentStorageCollection(client, Id)); } /// @@ -335,8 +335,8 @@ public virtual ContainerAppManagedEnvironmentStorageCollection GetContainerAppMa /// /// Name of the storage. /// The cancellation token to use. - /// 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> GetContainerAppManagedEnvironmentStorageAsync(string storageName, CancellationToken cancellationToken = default) { @@ -358,8 +358,8 @@ public virtual async Task /// Name of the storage. /// The cancellation token to use. - /// 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 GetContainerAppManagedEnvironmentStorage(string storageName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs index b26a11bf61b7..a23958deecd9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs @@ -94,7 +94,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerAppAuthConfigResources and their operations over a ContainerAppAuthConfigResource. public virtual ContainerAppAuthConfigCollection GetContainerAppAuthConfigs() { - return GetCachedClient(Client => new ContainerAppAuthConfigCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppAuthConfigCollection(client, Id)); } /// @@ -112,8 +112,8 @@ public virtual ContainerAppAuthConfigCollection GetContainerAppAuthConfigs() /// /// Name of the Container App AuthConfig. /// The cancellation token to use. - /// 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> GetContainerAppAuthConfigAsync(string authConfigName, CancellationToken cancellationToken = default) { @@ -135,8 +135,8 @@ public virtual async Task> GetContainer /// /// Name of the Container App AuthConfig. /// The cancellation token to use. - /// 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 GetContainerAppAuthConfig(string authConfigName, CancellationToken cancellationToken = default) { @@ -154,7 +154,7 @@ public virtual ContainerAppDetectorPropertyResource GetContainerAppDetectorPrope /// An object representing collection of ContainerAppRevisionResources and their operations over a ContainerAppRevisionResource. public virtual ContainerAppRevisionCollection GetContainerAppRevisions() { - return GetCachedClient(Client => new ContainerAppRevisionCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppRevisionCollection(client, Id)); } /// @@ -172,8 +172,8 @@ public virtual ContainerAppRevisionCollection GetContainerAppRevisions() /// /// Name of the Container App Revision. /// The cancellation token to use. - /// 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> GetContainerAppRevisionAsync(string revisionName, CancellationToken cancellationToken = default) { @@ -195,8 +195,8 @@ public virtual async Task> GetContainerAp /// /// Name of the Container App Revision. /// The cancellation token to use. - /// 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 GetContainerAppRevision(string revisionName, CancellationToken cancellationToken = default) { @@ -207,7 +207,7 @@ public virtual Response GetContainerAppRevision(st /// An object representing collection of ContainerAppDetectorPropertyRevisionResources and their operations over a ContainerAppDetectorPropertyRevisionResource. public virtual ContainerAppDetectorPropertyRevisionCollection GetContainerAppDetectorPropertyRevisions() { - return GetCachedClient(Client => new ContainerAppDetectorPropertyRevisionCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppDetectorPropertyRevisionCollection(client, Id)); } /// @@ -225,8 +225,8 @@ public virtual ContainerAppDetectorPropertyRevisionCollection GetContainerAppDet /// /// Name of the Container App Revision. /// The cancellation token to use. - /// 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> GetContainerAppDetectorPropertyRevisionAsync(string revisionName, CancellationToken cancellationToken = default) { @@ -248,8 +248,8 @@ public virtual async Task /// /// Name of the Container App Revision. /// The cancellation token to use. - /// 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 GetContainerAppDetectorPropertyRevision(string revisionName, CancellationToken cancellationToken = default) { @@ -260,7 +260,7 @@ public virtual Response GetContain /// An object representing collection of ContainerAppDetectorResources and their operations over a ContainerAppDetectorResource. public virtual ContainerAppDetectorCollection GetContainerAppDetectors() { - return GetCachedClient(Client => new ContainerAppDetectorCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppDetectorCollection(client, Id)); } /// @@ -278,8 +278,8 @@ public virtual ContainerAppDetectorCollection GetContainerAppDetectors() /// /// Name of the Container App Detector. /// The cancellation token to use. - /// 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> GetContainerAppDetectorAsync(string detectorName, CancellationToken cancellationToken = default) { @@ -301,8 +301,8 @@ public virtual async Task> GetContainerAp /// /// Name of the Container App Detector. /// The cancellation token to use. - /// 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 GetContainerAppDetector(string detectorName, CancellationToken cancellationToken = default) { @@ -313,7 +313,7 @@ public virtual Response GetContainerAppDetector(st /// An object representing collection of ContainerAppSourceControlResources and their operations over a ContainerAppSourceControlResource. public virtual ContainerAppSourceControlCollection GetContainerAppSourceControls() { - return GetCachedClient(Client => new ContainerAppSourceControlCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppSourceControlCollection(client, Id)); } /// @@ -331,8 +331,8 @@ public virtual ContainerAppSourceControlCollection GetContainerAppSourceControls /// /// Name of the Container App SourceControl. /// The cancellation token to use. - /// 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> GetContainerAppSourceControlAsync(string sourceControlName, CancellationToken cancellationToken = default) { @@ -354,8 +354,8 @@ public virtual async Task> GetContai /// /// Name of the Container App SourceControl. /// The cancellation token to use. - /// 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 GetContainerAppSourceControl(string sourceControlName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs index 315e5b9287fb..4339e4dfcd62 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerAppReplicaResources and their operations over a ContainerAppReplicaResource. public virtual ContainerAppReplicaCollection GetContainerAppReplicas() { - return GetCachedClient(Client => new ContainerAppReplicaCollection(Client, Id)); + return GetCachedClient(client => new ContainerAppReplicaCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ContainerAppReplicaCollection GetContainerAppReplicas() /// /// Name of the Container App Revision Replica. /// The cancellation token to use. - /// 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> GetContainerAppReplicaAsync(string replicaName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetContainerApp /// /// Name of the Container App Revision Replica. /// The cancellation token to use. - /// 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 GetContainerAppReplica(string replicaName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersArmClientMockingExtension.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersArmClientMockingExtension.cs new file mode 100644 index 000000000000..bb9a753963c7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersArmClientMockingExtension.cs @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppContainers; + +namespace Azure.ResourceManager.AppContainers.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class AppContainersArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppContainersArmClientMockingExtension() + { + } + + /// 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 AppContainersArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal AppContainersArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(ResourceIdentifier id) + { + ContainerAppAuthConfigResource.ValidateResourceId(id); + return new ContainerAppAuthConfigResource(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 ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(ResourceIdentifier id) + { + ContainerAppConnectedEnvironmentResource.ValidateResourceId(id); + return new ContainerAppConnectedEnvironmentResource(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 ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(ResourceIdentifier id) + { + ContainerAppConnectedEnvironmentCertificateResource.ValidateResourceId(id); + return new ContainerAppConnectedEnvironmentCertificateResource(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 ContainerAppManagedEnvironmentCertificateResource GetContainerAppManagedEnvironmentCertificateResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentCertificateResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentCertificateResource(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 ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(ResourceIdentifier id) + { + ContainerAppConnectedEnvironmentDaprComponentResource.ValidateResourceId(id); + return new ContainerAppConnectedEnvironmentDaprComponentResource(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 ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentDaprComponentResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentDaprComponentResource(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 ContainerAppConnectedEnvironmentStorageResource GetContainerAppConnectedEnvironmentStorageResource(ResourceIdentifier id) + { + ContainerAppConnectedEnvironmentStorageResource.ValidateResourceId(id); + return new ContainerAppConnectedEnvironmentStorageResource(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 ContainerAppResource GetContainerAppResource(ResourceIdentifier id) + { + ContainerAppResource.ValidateResourceId(id); + return new ContainerAppResource(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 ContainerAppDetectorPropertyResource GetContainerAppDetectorPropertyResource(ResourceIdentifier id) + { + ContainerAppDetectorPropertyResource.ValidateResourceId(id); + return new ContainerAppDetectorPropertyResource(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 ContainerAppRevisionResource GetContainerAppRevisionResource(ResourceIdentifier id) + { + ContainerAppRevisionResource.ValidateResourceId(id); + return new ContainerAppRevisionResource(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 ContainerAppDetectorPropertyRevisionResource GetContainerAppDetectorPropertyRevisionResource(ResourceIdentifier id) + { + ContainerAppDetectorPropertyRevisionResource.ValidateResourceId(id); + return new ContainerAppDetectorPropertyRevisionResource(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 ContainerAppReplicaResource GetContainerAppReplicaResource(ResourceIdentifier id) + { + ContainerAppReplicaResource.ValidateResourceId(id); + return new ContainerAppReplicaResource(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 ContainerAppDetectorResource GetContainerAppDetectorResource(ResourceIdentifier id) + { + ContainerAppDetectorResource.ValidateResourceId(id); + return new ContainerAppDetectorResource(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 ContainerAppManagedEnvironmentDetectorResource GetContainerAppManagedEnvironmentDetectorResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentDetectorResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentDetectorResource(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 ContainerAppManagedEnvironmentDetectorResourcePropertyResource GetContainerAppManagedEnvironmentDetectorResourcePropertyResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentDetectorResourcePropertyResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentDetectorResourcePropertyResource(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 ContainerAppManagedEnvironmentResource GetContainerAppManagedEnvironmentResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentResource(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 ContainerAppJobResource GetContainerAppJobResource(ResourceIdentifier id) + { + ContainerAppJobResource.ValidateResourceId(id); + return new ContainerAppJobResource(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 ContainerAppJobExecutionResource GetContainerAppJobExecutionResource(ResourceIdentifier id) + { + ContainerAppJobExecutionResource.ValidateResourceId(id); + return new ContainerAppJobExecutionResource(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 ContainerAppManagedCertificateResource GetContainerAppManagedCertificateResource(ResourceIdentifier id) + { + ContainerAppManagedCertificateResource.ValidateResourceId(id); + return new ContainerAppManagedCertificateResource(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 ContainerAppManagedEnvironmentStorageResource GetContainerAppManagedEnvironmentStorageResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentStorageResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentStorageResource(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 ContainerAppSourceControlResource GetContainerAppSourceControlResource(ResourceIdentifier id) + { + ContainerAppSourceControlResource.ValidateResourceId(id); + return new ContainerAppSourceControlResource(Client, id); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs index d13aae243be1..d2ab01d84031 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.AppContainers.Mocking; using Azure.ResourceManager.AppContainers.Models; using Azure.ResourceManager.Resources; @@ -19,442 +20,369 @@ namespace Azure.ResourceManager.AppContainers /// A class to add extension methods to Azure.ResourceManager.AppContainers. public static partial class AppContainersExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static AppContainersArmClientMockingExtension GetAppContainersArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new AppContainersArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static AppContainersResourceGroupMockingExtension GetAppContainersResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new AppContainersResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static AppContainersSubscriptionMockingExtension GetAppContainersSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new AppContainersSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ContainerAppAuthConfigResource /// /// 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. /// Returns a object. public static ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppAuthConfigResource.ValidateResourceId(id); - return new ContainerAppAuthConfigResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppAuthConfigResource(id); } - #endregion - #region ContainerAppConnectedEnvironmentResource /// /// 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. /// Returns a object. public static ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppConnectedEnvironmentResource.ValidateResourceId(id); - return new ContainerAppConnectedEnvironmentResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppConnectedEnvironmentResource(id); } - #endregion - #region ContainerAppConnectedEnvironmentCertificateResource /// /// 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. /// Returns a object. public static ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppConnectedEnvironmentCertificateResource.ValidateResourceId(id); - return new ContainerAppConnectedEnvironmentCertificateResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppConnectedEnvironmentCertificateResource(id); } - #endregion - #region ContainerAppManagedEnvironmentCertificateResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentCertificateResource GetContainerAppManagedEnvironmentCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentCertificateResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentCertificateResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentCertificateResource(id); } - #endregion - #region ContainerAppConnectedEnvironmentDaprComponentResource /// /// 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. /// Returns a object. public static ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppConnectedEnvironmentDaprComponentResource.ValidateResourceId(id); - return new ContainerAppConnectedEnvironmentDaprComponentResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppConnectedEnvironmentDaprComponentResource(id); } - #endregion - #region ContainerAppManagedEnvironmentDaprComponentResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentDaprComponentResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentDaprComponentResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentDaprComponentResource(id); } - #endregion - #region ContainerAppConnectedEnvironmentStorageResource /// /// 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. /// Returns a object. public static ContainerAppConnectedEnvironmentStorageResource GetContainerAppConnectedEnvironmentStorageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppConnectedEnvironmentStorageResource.ValidateResourceId(id); - return new ContainerAppConnectedEnvironmentStorageResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppConnectedEnvironmentStorageResource(id); } - #endregion - #region ContainerAppResource /// /// 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. /// Returns a object. public static ContainerAppResource GetContainerAppResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppResource.ValidateResourceId(id); - return new ContainerAppResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppResource(id); } - #endregion - #region ContainerAppDetectorPropertyResource /// /// 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. /// Returns a object. public static ContainerAppDetectorPropertyResource GetContainerAppDetectorPropertyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppDetectorPropertyResource.ValidateResourceId(id); - return new ContainerAppDetectorPropertyResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppDetectorPropertyResource(id); } - #endregion - #region ContainerAppRevisionResource /// /// 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. /// Returns a object. public static ContainerAppRevisionResource GetContainerAppRevisionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppRevisionResource.ValidateResourceId(id); - return new ContainerAppRevisionResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppRevisionResource(id); } - #endregion - #region ContainerAppDetectorPropertyRevisionResource /// /// 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. /// Returns a object. public static ContainerAppDetectorPropertyRevisionResource GetContainerAppDetectorPropertyRevisionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppDetectorPropertyRevisionResource.ValidateResourceId(id); - return new ContainerAppDetectorPropertyRevisionResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppDetectorPropertyRevisionResource(id); } - #endregion - #region ContainerAppReplicaResource /// /// 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. /// Returns a object. public static ContainerAppReplicaResource GetContainerAppReplicaResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppReplicaResource.ValidateResourceId(id); - return new ContainerAppReplicaResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppReplicaResource(id); } - #endregion - #region ContainerAppDetectorResource /// /// 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. /// Returns a object. public static ContainerAppDetectorResource GetContainerAppDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppDetectorResource.ValidateResourceId(id); - return new ContainerAppDetectorResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppDetectorResource(id); } - #endregion - #region ContainerAppManagedEnvironmentDetectorResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentDetectorResource GetContainerAppManagedEnvironmentDetectorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentDetectorResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentDetectorResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentDetectorResource(id); } - #endregion - #region ContainerAppManagedEnvironmentDetectorResourcePropertyResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentDetectorResourcePropertyResource GetContainerAppManagedEnvironmentDetectorResourcePropertyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentDetectorResourcePropertyResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentDetectorResourcePropertyResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentDetectorResourcePropertyResource(id); } - #endregion - #region ContainerAppManagedEnvironmentResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentResource GetContainerAppManagedEnvironmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentResource(id); } - #endregion - #region ContainerAppJobResource /// /// 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. /// Returns a object. public static ContainerAppJobResource GetContainerAppJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppJobResource.ValidateResourceId(id); - return new ContainerAppJobResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppJobResource(id); } - #endregion - #region ContainerAppJobExecutionResource /// /// 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. /// Returns a object. public static ContainerAppJobExecutionResource GetContainerAppJobExecutionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppJobExecutionResource.ValidateResourceId(id); - return new ContainerAppJobExecutionResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppJobExecutionResource(id); } - #endregion - #region ContainerAppManagedCertificateResource /// /// 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. /// Returns a object. public static ContainerAppManagedCertificateResource GetContainerAppManagedCertificateResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedCertificateResource.ValidateResourceId(id); - return new ContainerAppManagedCertificateResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedCertificateResource(id); } - #endregion - #region ContainerAppManagedEnvironmentStorageResource /// /// 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. /// Returns a object. public static ContainerAppManagedEnvironmentStorageResource GetContainerAppManagedEnvironmentStorageResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppManagedEnvironmentStorageResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentStorageResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppManagedEnvironmentStorageResource(id); } - #endregion - #region ContainerAppSourceControlResource /// /// 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. /// Returns a object. public static ContainerAppSourceControlResource GetContainerAppSourceControlResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerAppSourceControlResource.ValidateResourceId(id); - return new ContainerAppSourceControlResource(client, id); - } - ); + return GetAppContainersArmClientMockingExtension(client).GetContainerAppSourceControlResource(id); } - #endregion - /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerAppConnectedEnvironmentResources and their operations over a ContainerAppConnectedEnvironmentResource. public static ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerAppConnectedEnvironments(); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppConnectedEnvironments(); } /// @@ -469,16 +397,20 @@ public static ContainerAppConnectedEnvironmentCollection GetContainerAppConnecte /// ConnectedEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the connectedEnvironment. /// The cancellation token to use. - /// 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 static async Task> GetContainerAppConnectedEnvironmentAsync(this ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerAppConnectedEnvironments().GetAsync(connectedEnvironmentName, cancellationToken).ConfigureAwait(false); + return await GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppConnectedEnvironmentAsync(connectedEnvironmentName, cancellationToken).ConfigureAwait(false); } /// @@ -493,24 +425,34 @@ public static async Task> Get /// ConnectedEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the connectedEnvironment. /// The cancellation token to use. - /// 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 static Response GetContainerAppConnectedEnvironment(this ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerAppConnectedEnvironments().Get(connectedEnvironmentName, cancellationToken); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppConnectedEnvironment(connectedEnvironmentName, cancellationToken); } - /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. public static ContainerAppCollection GetContainerApps(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerApps(); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerApps(); } /// @@ -525,16 +467,20 @@ public static ContainerAppCollection GetContainerApps(this ResourceGroupResource /// ContainerApps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Container App. /// The cancellation token to use. - /// 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 static async Task> GetContainerAppAsync(this ResourceGroupResource resourceGroupResource, string containerAppName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerApps().GetAsync(containerAppName, cancellationToken).ConfigureAwait(false); + return await GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppAsync(containerAppName, cancellationToken).ConfigureAwait(false); } /// @@ -549,24 +495,34 @@ public static async Task> GetContainerAppAsync(th /// ContainerApps_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Container App. /// The cancellation token to use. - /// 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 static Response GetContainerApp(this ResourceGroupResource resourceGroupResource, string containerAppName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerApps().Get(containerAppName, cancellationToken); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerApp(containerAppName, cancellationToken); } - /// Gets a collection of ContainerAppManagedEnvironmentResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerAppManagedEnvironmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerAppManagedEnvironmentResources and their operations over a ContainerAppManagedEnvironmentResource. public static ContainerAppManagedEnvironmentCollection GetContainerAppManagedEnvironments(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerAppManagedEnvironments(); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppManagedEnvironments(); } /// @@ -581,16 +537,20 @@ public static ContainerAppManagedEnvironmentCollection GetContainerAppManagedEnv /// ManagedEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Environment. /// The cancellation token to use. - /// 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 static async Task> GetContainerAppManagedEnvironmentAsync(this ResourceGroupResource resourceGroupResource, string environmentName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerAppManagedEnvironments().GetAsync(environmentName, cancellationToken).ConfigureAwait(false); + return await GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppManagedEnvironmentAsync(environmentName, cancellationToken).ConfigureAwait(false); } /// @@ -605,24 +565,34 @@ public static async Task> GetCo /// ManagedEnvironments_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Name of the Environment. /// The cancellation token to use. - /// 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 static Response GetContainerAppManagedEnvironment(this ResourceGroupResource resourceGroupResource, string environmentName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerAppManagedEnvironments().Get(environmentName, cancellationToken); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppManagedEnvironment(environmentName, cancellationToken); } - /// Gets a collection of ContainerAppJobResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerAppJobResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerAppJobResources and their operations over a ContainerAppJobResource. public static ContainerAppJobCollection GetContainerAppJobs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerAppJobs(); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppJobs(); } /// @@ -637,16 +607,20 @@ public static ContainerAppJobCollection GetContainerAppJobs(this ResourceGroupRe /// Jobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Job Name. /// The cancellation token to use. - /// 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 static async Task> GetContainerAppJobAsync(this ResourceGroupResource resourceGroupResource, string jobName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerAppJobs().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + return await GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppJobAsync(jobName, cancellationToken).ConfigureAwait(false); } /// @@ -661,16 +635,20 @@ public static async Task> GetContainerAppJobAs /// Jobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Job Name. /// The cancellation token to use. - /// 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 static Response GetContainerAppJob(this ResourceGroupResource resourceGroupResource, string jobName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerAppJobs().Get(jobName, cancellationToken); + return GetAppContainersResourceGroupMockingExtension(resourceGroupResource).GetContainerAppJob(jobName, cancellationToken); } /// @@ -685,6 +663,10 @@ public static Response GetContainerAppJob(this Resource /// AvailableWorkloadProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -692,7 +674,7 @@ public static Response GetContainerAppJob(this Resource /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableWorkloadProfilesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableWorkloadProfilesAsync(location, cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableWorkloadProfilesAsync(location, cancellationToken); } /// @@ -707,6 +689,10 @@ public static AsyncPageable GetAvailableWo /// AvailableWorkloadProfiles_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -714,7 +700,7 @@ public static AsyncPageable GetAvailableWo /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableWorkloadProfiles(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableWorkloadProfiles(location, cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetAvailableWorkloadProfiles(location, cancellationToken); } /// @@ -729,6 +715,10 @@ public static Pageable GetAvailableWorkloa /// BillingMeters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -736,7 +726,7 @@ public static Pageable GetAvailableWorkloa /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBillingMetersAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBillingMetersAsync(location, cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetBillingMetersAsync(location, cancellationToken); } /// @@ -751,6 +741,10 @@ public static AsyncPageable GetBillingMetersAsync(this /// BillingMeters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -758,7 +752,7 @@ public static AsyncPageable GetBillingMetersAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBillingMeters(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetBillingMeters(location, cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetBillingMeters(location, cancellationToken); } /// @@ -773,13 +767,17 @@ public static Pageable GetBillingMeters(this Subscript /// ConnectedEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerAppConnectedEnvironmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppConnectedEnvironmentsAsync(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppConnectedEnvironmentsAsync(cancellationToken); } /// @@ -794,13 +792,17 @@ public static AsyncPageable GetContain /// ConnectedEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerAppConnectedEnvironments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppConnectedEnvironments(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppConnectedEnvironments(cancellationToken); } /// @@ -815,13 +817,17 @@ public static Pageable GetContainerApp /// ContainerApps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerAppsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppsAsync(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppsAsync(cancellationToken); } /// @@ -836,13 +842,17 @@ public static AsyncPageable GetContainerAppsAsync(this Sub /// ContainerApps_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerApps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerApps(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerApps(cancellationToken); } /// @@ -857,13 +867,17 @@ public static Pageable GetContainerApps(this SubscriptionR /// Jobs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerAppJobsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppJobsAsync(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppJobsAsync(cancellationToken); } /// @@ -878,13 +892,17 @@ public static AsyncPageable GetContainerAppJobsAsync(th /// Jobs_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerAppJobs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppJobs(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppJobs(cancellationToken); } /// @@ -899,13 +917,17 @@ public static Pageable GetContainerAppJobs(this Subscri /// ManagedEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerAppManagedEnvironmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppManagedEnvironmentsAsync(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppManagedEnvironmentsAsync(cancellationToken); } /// @@ -920,13 +942,17 @@ public static AsyncPageable GetContainer /// ManagedEnvironments_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerAppManagedEnvironments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerAppManagedEnvironments(cancellationToken); + return GetAppContainersSubscriptionMockingExtension(subscriptionResource).GetContainerAppManagedEnvironments(cancellationToken); } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersResourceGroupMockingExtension.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..f363c188dde0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersResourceGroupMockingExtension.cs @@ -0,0 +1,251 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.AppContainers; + +namespace Azure.ResourceManager.AppContainers.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class AppContainersResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected AppContainersResourceGroupMockingExtension() + { + } + + /// 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 AppContainersResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppConnectedEnvironmentResources and their operations over a ContainerAppConnectedEnvironmentResource. + public virtual ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments() + { + return GetCachedClient(client => new ContainerAppConnectedEnvironmentCollection(client, Id)); + } + + /// + /// Get the properties of an connectedEnvironment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// + /// Name of the connectedEnvironment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppConnectedEnvironmentAsync(string connectedEnvironmentName, CancellationToken cancellationToken = default) + { + return await GetContainerAppConnectedEnvironments().GetAsync(connectedEnvironmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of an connectedEnvironment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// + /// Name of the connectedEnvironment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppConnectedEnvironment(string connectedEnvironmentName, CancellationToken cancellationToken = default) + { + return GetContainerAppConnectedEnvironments().Get(connectedEnvironmentName, cancellationToken); + } + + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. + public virtual ContainerAppCollection GetContainerApps() + { + return GetCachedClient(client => new ContainerAppCollection(client, Id)); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppAsync(string containerAppName, CancellationToken cancellationToken = default) + { + return await GetContainerApps().GetAsync(containerAppName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerApp(string containerAppName, CancellationToken cancellationToken = default) + { + return GetContainerApps().Get(containerAppName, cancellationToken); + } + + /// Gets a collection of ContainerAppManagedEnvironmentResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppManagedEnvironmentResources and their operations over a ContainerAppManagedEnvironmentResource. + public virtual ContainerAppManagedEnvironmentCollection GetContainerAppManagedEnvironments() + { + return GetCachedClient(client => new ContainerAppManagedEnvironmentCollection(client, Id)); + } + + /// + /// Get the properties of a Managed Environment used to host container apps. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName} + /// + /// + /// Operation Id + /// ManagedEnvironments_Get + /// + /// + /// + /// Name of the Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppManagedEnvironmentAsync(string environmentName, CancellationToken cancellationToken = default) + { + return await GetContainerAppManagedEnvironments().GetAsync(environmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Managed Environment used to host container apps. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName} + /// + /// + /// Operation Id + /// ManagedEnvironments_Get + /// + /// + /// + /// Name of the Environment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppManagedEnvironment(string environmentName, CancellationToken cancellationToken = default) + { + return GetContainerAppManagedEnvironments().Get(environmentName, cancellationToken); + } + + /// Gets a collection of ContainerAppJobResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppJobResources and their operations over a ContainerAppJobResource. + public virtual ContainerAppJobCollection GetContainerAppJobs() + { + return GetCachedClient(client => new ContainerAppJobCollection(client, Id)); + } + + /// + /// Get the properties of a Container Apps Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// + /// Job Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppJobAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetContainerAppJobs().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Container Apps Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// + /// Job Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppJob(string jobName, CancellationToken cancellationToken = default) + { + return GetContainerAppJobs().Get(jobName, cancellationToken); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersSubscriptionMockingExtension.cs similarity index 91% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersSubscriptionMockingExtension.cs index e81ae64ffb41..8032d035c675 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersSubscriptionMockingExtension.cs @@ -11,12 +11,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.AppContainers; using Azure.ResourceManager.AppContainers.Models; -namespace Azure.ResourceManager.AppContainers +namespace Azure.ResourceManager.AppContainers.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class AppContainersSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _availableWorkloadProfilesClientDiagnostics; private AvailableWorkloadProfilesRestOperations _availableWorkloadProfilesRestClient; @@ -31,15 +32,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _containerAppManagedEnvironmentManagedEnvironmentsClientDiagnostics; private ManagedEnvironmentsRestOperations _containerAppManagedEnvironmentManagedEnvironmentsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected AppContainersSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AppContainersSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -82,7 +83,7 @@ public virtual AsyncPageable GetAvailableW { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableWorkloadProfilesRestClient.CreateGetRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableWorkloadProfilesRestClient.CreateGetNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerAppAvailableWorkloadProfile.DeserializeContainerAppAvailableWorkloadProfile, AvailableWorkloadProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableWorkloadProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerAppAvailableWorkloadProfile.DeserializeContainerAppAvailableWorkloadProfile, AvailableWorkloadProfilesClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetAvailableWorkloadProfiles", "value", "nextLink", cancellationToken); } /// @@ -105,7 +106,7 @@ public virtual Pageable GetAvailableWorklo { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableWorkloadProfilesRestClient.CreateGetRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableWorkloadProfilesRestClient.CreateGetNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerAppAvailableWorkloadProfile.DeserializeContainerAppAvailableWorkloadProfile, AvailableWorkloadProfilesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableWorkloadProfiles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerAppAvailableWorkloadProfile.DeserializeContainerAppAvailableWorkloadProfile, AvailableWorkloadProfilesClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetAvailableWorkloadProfiles", "value", "nextLink", cancellationToken); } /// @@ -127,7 +128,7 @@ public virtual Pageable GetAvailableWorklo public virtual AsyncPageable GetBillingMetersAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => BillingMetersRestClient.CreateGetRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerAppBillingMeter.DeserializeContainerAppBillingMeter, BillingMetersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBillingMeters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerAppBillingMeter.DeserializeContainerAppBillingMeter, BillingMetersClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetBillingMeters", "value", null, cancellationToken); } /// @@ -149,7 +150,7 @@ public virtual AsyncPageable GetBillingMetersAsync(Azu public virtual Pageable GetBillingMeters(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => BillingMetersRestClient.CreateGetRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ContainerAppBillingMeter.DeserializeContainerAppBillingMeter, BillingMetersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetBillingMeters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ContainerAppBillingMeter.DeserializeContainerAppBillingMeter, BillingMetersClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetBillingMeters", "value", null, cancellationToken); } /// @@ -171,7 +172,7 @@ public virtual AsyncPageable GetContai { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppConnectedEnvironmentConnectedEnvironmentsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppConnectedEnvironmentConnectedEnvironmentsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentResource(Client, ContainerAppConnectedEnvironmentData.DeserializeContainerAppConnectedEnvironmentData(e)), ContainerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppConnectedEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentResource(Client, ContainerAppConnectedEnvironmentData.DeserializeContainerAppConnectedEnvironmentData(e)), ContainerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppConnectedEnvironments", "value", "nextLink", cancellationToken); } /// @@ -193,7 +194,7 @@ public virtual Pageable GetContainerAp { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppConnectedEnvironmentConnectedEnvironmentsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppConnectedEnvironmentConnectedEnvironmentsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentResource(Client, ContainerAppConnectedEnvironmentData.DeserializeContainerAppConnectedEnvironmentData(e)), ContainerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppConnectedEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentResource(Client, ContainerAppConnectedEnvironmentData.DeserializeContainerAppConnectedEnvironmentData(e)), ContainerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppConnectedEnvironments", "value", "nextLink", cancellationToken); } /// @@ -215,7 +216,7 @@ public virtual AsyncPageable GetContainerAppsAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerApps", "value", "nextLink", cancellationToken); } /// @@ -237,7 +238,7 @@ public virtual Pageable GetContainerApps(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerApps", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerApps", "value", "nextLink", cancellationToken); } /// @@ -259,7 +260,7 @@ public virtual AsyncPageable GetContainerAppJobsAsync(C { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppJobJobsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppJobJobsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppJobResource(Client, ContainerAppJobData.DeserializeContainerAppJobData(e)), ContainerAppJobJobsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppJobResource(Client, ContainerAppJobData.DeserializeContainerAppJobData(e)), ContainerAppJobJobsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppJobs", "value", "nextLink", cancellationToken); } /// @@ -281,7 +282,7 @@ public virtual Pageable GetContainerAppJobs(Cancellatio { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppJobJobsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppJobJobsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppJobResource(Client, ContainerAppJobData.DeserializeContainerAppJobData(e)), ContainerAppJobJobsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppJobResource(Client, ContainerAppJobData.DeserializeContainerAppJobData(e)), ContainerAppJobJobsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppJobs", "value", "nextLink", cancellationToken); } /// @@ -303,7 +304,7 @@ public virtual AsyncPageable GetContaine { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppManagedEnvironmentManagedEnvironmentsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppManagedEnvironmentManagedEnvironmentsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppManagedEnvironmentResource(Client, ContainerAppManagedEnvironmentData.DeserializeContainerAppManagedEnvironmentData(e)), ContainerAppManagedEnvironmentManagedEnvironmentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppManagedEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppManagedEnvironmentResource(Client, ContainerAppManagedEnvironmentData.DeserializeContainerAppManagedEnvironmentData(e)), ContainerAppManagedEnvironmentManagedEnvironmentsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppManagedEnvironments", "value", "nextLink", cancellationToken); } /// @@ -325,7 +326,7 @@ public virtual Pageable GetContainerAppM { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppManagedEnvironmentManagedEnvironmentsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppManagedEnvironmentManagedEnvironmentsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppManagedEnvironmentResource(Client, ContainerAppManagedEnvironmentData.DeserializeContainerAppManagedEnvironmentData(e)), ContainerAppManagedEnvironmentManagedEnvironmentsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerAppManagedEnvironments", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppManagedEnvironmentResource(Client, ContainerAppManagedEnvironmentData.DeserializeContainerAppManagedEnvironmentData(e)), ContainerAppManagedEnvironmentManagedEnvironmentsClientDiagnostics, Pipeline, "AppContainersSubscriptionMockingExtension.GetContainerAppManagedEnvironments", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 58a4ecb3e499..000000000000 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.AppContainers -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. - /// An object representing collection of ContainerAppConnectedEnvironmentResources and their operations over a ContainerAppConnectedEnvironmentResource. - public virtual ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments() - { - return GetCachedClient(Client => new ContainerAppConnectedEnvironmentCollection(Client, Id)); - } - - /// Gets a collection of ContainerAppResources in the ResourceGroupResource. - /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. - public virtual ContainerAppCollection GetContainerApps() - { - return GetCachedClient(Client => new ContainerAppCollection(Client, Id)); - } - - /// Gets a collection of ContainerAppManagedEnvironmentResources in the ResourceGroupResource. - /// An object representing collection of ContainerAppManagedEnvironmentResources and their operations over a ContainerAppManagedEnvironmentResource. - public virtual ContainerAppManagedEnvironmentCollection GetContainerAppManagedEnvironments() - { - return GetCachedClient(Client => new ContainerAppManagedEnvironmentCollection(Client, Id)); - } - - /// Gets a collection of ContainerAppJobResources in the ResourceGroupResource. - /// An object representing collection of ContainerAppJobResources and their operations over a ContainerAppJobResource. - public virtual ContainerAppJobCollection GetContainerAppJobs() - { - return GetCachedClient(Client => new ContainerAppJobCollection(Client, Id)); - } - } -} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceArmClientMockingExtension.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceArmClientMockingExtension.cs new file mode 100644 index 000000000000..ce091ff5cbe6 --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerInstance; + +namespace Azure.ResourceManager.ContainerInstance.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ContainerInstanceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerInstanceArmClientMockingExtension() + { + } + + /// 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 ContainerInstanceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ContainerInstanceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerGroupResource GetContainerGroupResource(ResourceIdentifier id) + { + ContainerGroupResource.ValidateResourceId(id); + return new ContainerGroupResource(Client, id); + } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs index d7f98c32b253..d1f6da36b609 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerInstance.Mocking; using Azure.ResourceManager.ContainerInstance.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.ContainerInstance /// A class to add extension methods to Azure.ResourceManager.ContainerInstance. public static partial class ContainerInstanceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ContainerInstanceArmClientMockingExtension GetContainerInstanceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ContainerInstanceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ContainerInstanceResourceGroupMockingExtension GetContainerInstanceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ContainerInstanceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ContainerInstanceSubscriptionMockingExtension GetContainerInstanceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ContainerInstanceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ContainerGroupResource /// /// 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. /// Returns a object. public static ContainerGroupResource GetContainerGroupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerGroupResource.ValidateResourceId(id); - return new ContainerGroupResource(client, id); - } - ); + return GetContainerInstanceArmClientMockingExtension(client).GetContainerGroupResource(id); } - #endregion - /// Gets a collection of ContainerGroupResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerGroupResources and their operations over a ContainerGroupResource. public static ContainerGroupCollection GetContainerGroups(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerGroups(); + return GetContainerInstanceResourceGroupMockingExtension(resourceGroupResource).GetContainerGroups(); } /// @@ -89,16 +77,20 @@ public static ContainerGroupCollection GetContainerGroups(this ResourceGroupReso /// ContainerGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the container group. /// The cancellation token to use. - /// 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 static async Task> GetContainerGroupAsync(this ResourceGroupResource resourceGroupResource, string containerGroupName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerGroups().GetAsync(containerGroupName, cancellationToken).ConfigureAwait(false); + return await GetContainerInstanceResourceGroupMockingExtension(resourceGroupResource).GetContainerGroupAsync(containerGroupName, cancellationToken).ConfigureAwait(false); } /// @@ -113,16 +105,20 @@ public static async Task> GetContainerGroupAsyn /// ContainerGroups_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the container group. /// The cancellation token to use. - /// 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 static Response GetContainerGroup(this ResourceGroupResource resourceGroupResource, string containerGroupName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerGroups().Get(containerGroupName, cancellationToken); + return GetContainerInstanceResourceGroupMockingExtension(resourceGroupResource).GetContainerGroup(containerGroupName, cancellationToken); } /// @@ -137,6 +133,10 @@ public static Response GetContainerGroup(this ResourceGr /// SubnetServiceAssociationLink_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -147,10 +147,7 @@ public static Response GetContainerGroup(this ResourceGr /// or is null. public static async Task DeleteSubnetServiceAssociationLinkAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); - Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteSubnetServiceAssociationLinkAsync(waitUntil, virtualNetworkName, subnetName, cancellationToken).ConfigureAwait(false); + return await GetContainerInstanceResourceGroupMockingExtension(resourceGroupResource).DeleteSubnetServiceAssociationLinkAsync(waitUntil, virtualNetworkName, subnetName, cancellationToken).ConfigureAwait(false); } /// @@ -165,6 +162,10 @@ public static async Task DeleteSubnetServiceAssociationLinkAsync(t /// SubnetServiceAssociationLink_Delete /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -175,10 +176,7 @@ public static async Task DeleteSubnetServiceAssociationLinkAsync(t /// or is null. public static ArmOperation DeleteSubnetServiceAssociationLink(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); - Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeleteSubnetServiceAssociationLink(waitUntil, virtualNetworkName, subnetName, cancellationToken); + return GetContainerInstanceResourceGroupMockingExtension(resourceGroupResource).DeleteSubnetServiceAssociationLink(waitUntil, virtualNetworkName, subnetName, cancellationToken); } /// @@ -193,13 +191,17 @@ public static ArmOperation DeleteSubnetServiceAssociationLink(this ResourceGroup /// ContainerGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerGroupsAsync(cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetContainerGroupsAsync(cancellationToken); } /// @@ -214,13 +216,17 @@ public static AsyncPageable GetContainerGroupsAsync(this /// ContainerGroups_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerGroups(cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetContainerGroups(cancellationToken); } /// @@ -235,6 +241,10 @@ public static Pageable GetContainerGroups(this Subscript /// Location_ListUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -242,7 +252,7 @@ public static Pageable GetContainerGroups(this Subscript /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesWithLocationAsync(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetUsagesWithLocationAsync(location, cancellationToken); } /// @@ -257,6 +267,10 @@ public static AsyncPageable GetUsagesWithLocationAsync(t /// Location_ListUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -264,7 +278,7 @@ public static AsyncPageable GetUsagesWithLocationAsync(t /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsagesWithLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesWithLocation(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetUsagesWithLocation(location, cancellationToken); } /// @@ -279,6 +293,10 @@ public static Pageable GetUsagesWithLocation(this Subscr /// Location_ListCachedImages /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -286,7 +304,7 @@ public static Pageable GetUsagesWithLocation(this Subscr /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCachedImagesWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCachedImagesWithLocationAsync(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetCachedImagesWithLocationAsync(location, cancellationToken); } /// @@ -301,6 +319,10 @@ public static AsyncPageable GetCachedImagesWithLocationAsync(this /// Location_ListCachedImages /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -308,7 +330,7 @@ public static AsyncPageable GetCachedImagesWithLocationAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCachedImagesWithLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCachedImagesWithLocation(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetCachedImagesWithLocation(location, cancellationToken); } /// @@ -323,6 +345,10 @@ public static Pageable GetCachedImagesWithLocation(this Subscripti /// Location_ListCapabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -330,7 +356,7 @@ public static Pageable GetCachedImagesWithLocation(this Subscripti /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCapabilitiesWithLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilitiesWithLocationAsync(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetCapabilitiesWithLocationAsync(location, cancellationToken); } /// @@ -345,6 +371,10 @@ public static AsyncPageable GetCapabilitiesWithLocationAs /// Location_ListCapabilities /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The identifier for the physical azure location. @@ -352,7 +382,7 @@ public static AsyncPageable GetCapabilitiesWithLocationAs /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCapabilitiesWithLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilitiesWithLocation(location, cancellationToken); + return GetContainerInstanceSubscriptionMockingExtension(subscriptionResource).GetCapabilitiesWithLocation(location, cancellationToken); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceResourceGroupMockingExtension.cs similarity index 59% rename from sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceResourceGroupMockingExtension.cs index 84866a644970..d5dd99a9468b 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceResourceGroupMockingExtension.cs @@ -12,24 +12,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerInstance; -namespace Azure.ResourceManager.ContainerInstance +namespace Azure.ResourceManager.ContainerInstance.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class ContainerInstanceResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _subnetServiceAssociationLinkClientDiagnostics; private SubnetServiceAssociationLinkRestOperations _subnetServiceAssociationLinkRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ContainerInstanceResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ContainerInstanceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -46,7 +47,53 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of ContainerGroupResources and their operations over a ContainerGroupResource. public virtual ContainerGroupCollection GetContainerGroups() { - return GetCachedClient(Client => new ContainerGroupCollection(Client, Id)); + return GetCachedClient(client => new ContainerGroupCollection(client, Id)); + } + + /// + /// Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName} + /// + /// + /// Operation Id + /// ContainerGroups_Get + /// + /// + /// + /// The name of the container group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerGroupAsync(string containerGroupName, CancellationToken cancellationToken = default) + { + return await GetContainerGroups().GetAsync(containerGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName} + /// + /// + /// Operation Id + /// ContainerGroups_Get + /// + /// + /// + /// The name of the container group. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerGroup(string containerGroupName, CancellationToken cancellationToken = default) + { + return GetContainerGroups().Get(containerGroupName, cancellationToken); } /// @@ -66,9 +113,14 @@ public virtual ContainerGroupCollection GetContainerGroups() /// The name of the virtual network. /// The name of the subnet. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task DeleteSubnetServiceAssociationLinkAsync(WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) { - using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteSubnetServiceAssociationLink"); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ContainerInstanceResourceGroupMockingExtension.DeleteSubnetServiceAssociationLink"); scope.Start(); try { @@ -102,9 +154,14 @@ public virtual async Task DeleteSubnetServiceAssociationLinkAsync( /// The name of the virtual network. /// The name of the subnet. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation DeleteSubnetServiceAssociationLink(WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) { - using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteSubnetServiceAssociationLink"); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ContainerInstanceResourceGroupMockingExtension.DeleteSubnetServiceAssociationLink"); scope.Start(); try { diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceSubscriptionMockingExtension.cs similarity index 88% rename from sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceSubscriptionMockingExtension.cs index 7f606abe1019..fcfa9a9b1f12 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceSubscriptionMockingExtension.cs @@ -11,27 +11,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerInstance; using Azure.ResourceManager.ContainerInstance.Models; -namespace Azure.ResourceManager.ContainerInstance +namespace Azure.ResourceManager.ContainerInstance.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ContainerInstanceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _containerGroupClientDiagnostics; private ContainerGroupsRestOperations _containerGroupRestClient; private ClientDiagnostics _locationClientDiagnostics; private LocationRestOperations _locationRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ContainerInstanceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ContainerInstanceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetContainerGroupsAsync(Can { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerGroupRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerGroupResource(Client, ContainerGroupData.DeserializeContainerGroupData(e)), ContainerGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerGroupResource(Client, ContainerGroupData.DeserializeContainerGroupData(e)), ContainerGroupClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetContainerGroups", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetContainerGroups(CancellationT { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerGroupRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerGroupRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerGroupResource(Client, ContainerGroupData.DeserializeContainerGroupData(e)), ContainerGroupClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerGroups", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerGroupResource(Client, ContainerGroupData.DeserializeContainerGroupData(e)), ContainerGroupClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetContainerGroups", "value", "nextLink", cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual Pageable GetContainerGroups(CancellationT public virtual AsyncPageable GetUsagesWithLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListUsageRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerInstanceUsage.DeserializeContainerInstanceUsage, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesWithLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerInstanceUsage.DeserializeContainerInstanceUsage, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetUsagesWithLocation", "value", null, cancellationToken); } /// @@ -131,7 +132,7 @@ public virtual AsyncPageable GetUsagesWithLocationAsync( public virtual Pageable GetUsagesWithLocation(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListUsageRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ContainerInstanceUsage.DeserializeContainerInstanceUsage, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesWithLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ContainerInstanceUsage.DeserializeContainerInstanceUsage, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetUsagesWithLocation", "value", null, cancellationToken); } /// @@ -154,7 +155,7 @@ public virtual AsyncPageable GetCachedImagesWithLocationAsync(Azur { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListCachedImagesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListCachedImagesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CachedImages.DeserializeCachedImages, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCachedImagesWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CachedImages.DeserializeCachedImages, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetCachedImagesWithLocation", "value", "nextLink", cancellationToken); } /// @@ -177,7 +178,7 @@ public virtual Pageable GetCachedImagesWithLocation(AzureLocation { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListCachedImagesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListCachedImagesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CachedImages.DeserializeCachedImages, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCachedImagesWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CachedImages.DeserializeCachedImages, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetCachedImagesWithLocation", "value", "nextLink", cancellationToken); } /// @@ -200,7 +201,7 @@ public virtual AsyncPageable GetCapabilitiesWithLocationA { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListCapabilitiesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListCapabilitiesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerCapabilities.DeserializeContainerCapabilities, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCapabilitiesWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerCapabilities.DeserializeContainerCapabilities, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetCapabilitiesWithLocation", "value", "nextLink", cancellationToken); } /// @@ -223,7 +224,7 @@ public virtual Pageable GetCapabilitiesWithLocation(Azure { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationRestClient.CreateListCapabilitiesRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => LocationRestClient.CreateListCapabilitiesNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerCapabilities.DeserializeContainerCapabilities, LocationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCapabilitiesWithLocation", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerCapabilities.DeserializeContainerCapabilities, LocationClientDiagnostics, Pipeline, "ContainerInstanceSubscriptionMockingExtension.GetCapabilitiesWithLocation", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs index 0e90367aab1b..b4f8bd39fc23 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerRegistryPrivateLinkResources and their operations over a ContainerRegistryPrivateLinkResource. public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegistryPrivateLinkResources() { - return GetCachedClient(Client => new ContainerRegistryPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryPrivateLinkResourceCollection(client, Id)); } /// @@ -120,8 +120,8 @@ public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegist /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetContainerRegistryPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -143,8 +143,8 @@ public virtual async Task> GetCon /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetContainerRegistryPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -155,7 +155,7 @@ public virtual Response GetContainerRegist /// An object representing collection of ContainerRegistryPrivateEndpointConnectionResources and their operations over a ContainerRegistryPrivateEndpointConnectionResource. public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() { - return GetCachedClient(Client => new ContainerRegistryPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryPrivateEndpointConnectionCollection(client, Id)); } /// @@ -173,8 +173,8 @@ public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainer /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetContainerRegistryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -196,8 +196,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetContainerRegistryPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -208,7 +208,7 @@ public virtual Response GetC /// An object representing collection of ContainerRegistryReplicationResources and their operations over a ContainerRegistryReplicationResource. public virtual ContainerRegistryReplicationCollection GetContainerRegistryReplications() { - return GetCachedClient(Client => new ContainerRegistryReplicationCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryReplicationCollection(client, Id)); } /// @@ -226,8 +226,8 @@ public virtual ContainerRegistryReplicationCollection GetContainerRegistryReplic /// /// The name of the replication. /// The cancellation token to use. - /// 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> GetContainerRegistryReplicationAsync(string replicationName, CancellationToken cancellationToken = default) { @@ -249,8 +249,8 @@ public virtual async Task> GetCon /// /// The name of the replication. /// The cancellation token to use. - /// 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 GetContainerRegistryReplication(string replicationName, CancellationToken cancellationToken = default) { @@ -261,7 +261,7 @@ public virtual Response GetContainerRegist /// An object representing collection of ScopeMapResources and their operations over a ScopeMapResource. public virtual ScopeMapCollection GetScopeMaps() { - return GetCachedClient(Client => new ScopeMapCollection(Client, Id)); + return GetCachedClient(client => new ScopeMapCollection(client, Id)); } /// @@ -279,8 +279,8 @@ public virtual ScopeMapCollection GetScopeMaps() /// /// The name of the scope map. /// The cancellation token to use. - /// 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> GetScopeMapAsync(string scopeMapName, CancellationToken cancellationToken = default) { @@ -302,8 +302,8 @@ public virtual async Task> GetScopeMapAsync(string sc /// /// The name of the scope map. /// The cancellation token to use. - /// 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 GetScopeMap(string scopeMapName, CancellationToken cancellationToken = default) { @@ -314,7 +314,7 @@ public virtual Response GetScopeMap(string scopeMapName, Cance /// An object representing collection of ContainerRegistryTokenResources and their operations over a ContainerRegistryTokenResource. public virtual ContainerRegistryTokenCollection GetContainerRegistryTokens() { - return GetCachedClient(Client => new ContainerRegistryTokenCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryTokenCollection(client, Id)); } /// @@ -332,8 +332,8 @@ public virtual ContainerRegistryTokenCollection GetContainerRegistryTokens() /// /// The name of the token. /// The cancellation token to use. - /// 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> GetContainerRegistryTokenAsync(string tokenName, CancellationToken cancellationToken = default) { @@ -355,8 +355,8 @@ public virtual async Task> GetContainer /// /// The name of the token. /// The cancellation token to use. - /// 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 GetContainerRegistryToken(string tokenName, CancellationToken cancellationToken = default) { @@ -367,7 +367,7 @@ public virtual Response GetContainerRegistryToke /// An object representing collection of ContainerRegistryWebhookResources and their operations over a ContainerRegistryWebhookResource. public virtual ContainerRegistryWebhookCollection GetContainerRegistryWebhooks() { - return GetCachedClient(Client => new ContainerRegistryWebhookCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryWebhookCollection(client, Id)); } /// @@ -385,8 +385,8 @@ public virtual ContainerRegistryWebhookCollection GetContainerRegistryWebhooks() /// /// The name of the webhook. /// The cancellation token to use. - /// 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> GetContainerRegistryWebhookAsync(string webhookName, CancellationToken cancellationToken = default) { @@ -408,8 +408,8 @@ public virtual async Task> GetContain /// /// The name of the webhook. /// The cancellation token to use. - /// 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 GetContainerRegistryWebhook(string webhookName, CancellationToken cancellationToken = default) { @@ -420,7 +420,7 @@ public virtual Response GetContainerRegistryWe /// An object representing collection of ContainerRegistryAgentPoolResources and their operations over a ContainerRegistryAgentPoolResource. public virtual ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPools() { - return GetCachedClient(Client => new ContainerRegistryAgentPoolCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryAgentPoolCollection(client, Id)); } /// @@ -438,8 +438,8 @@ public virtual ContainerRegistryAgentPoolCollection GetContainerRegistryAgentPoo /// /// The name of the agent pool. /// The cancellation token to use. - /// 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> GetContainerRegistryAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) { @@ -461,8 +461,8 @@ public virtual async Task> GetConta /// /// The name of the agent pool. /// The cancellation token to use. - /// 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 GetContainerRegistryAgentPool(string agentPoolName, CancellationToken cancellationToken = default) { @@ -473,7 +473,7 @@ public virtual Response GetContainerRegistry /// An object representing collection of ContainerRegistryRunResources and their operations over a ContainerRegistryRunResource. public virtual ContainerRegistryRunCollection GetContainerRegistryRuns() { - return GetCachedClient(Client => new ContainerRegistryRunCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryRunCollection(client, Id)); } /// @@ -491,8 +491,8 @@ public virtual ContainerRegistryRunCollection GetContainerRegistryRuns() /// /// The run ID. /// The cancellation token to use. - /// 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> GetContainerRegistryRunAsync(string runId, CancellationToken cancellationToken = default) { @@ -514,8 +514,8 @@ public virtual async Task> GetContainerRe /// /// The run ID. /// The cancellation token to use. - /// 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 GetContainerRegistryRun(string runId, CancellationToken cancellationToken = default) { @@ -526,7 +526,7 @@ public virtual Response GetContainerRegistryRun(st /// An object representing collection of ContainerRegistryTaskRunResources and their operations over a ContainerRegistryTaskRunResource. public virtual ContainerRegistryTaskRunCollection GetContainerRegistryTaskRuns() { - return GetCachedClient(Client => new ContainerRegistryTaskRunCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryTaskRunCollection(client, Id)); } /// @@ -544,8 +544,8 @@ public virtual ContainerRegistryTaskRunCollection GetContainerRegistryTaskRuns() /// /// The name of the task run. /// The cancellation token to use. - /// 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> GetContainerRegistryTaskRunAsync(string taskRunName, CancellationToken cancellationToken = default) { @@ -567,8 +567,8 @@ public virtual async Task> GetContain /// /// The name of the task run. /// The cancellation token to use. - /// 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 GetContainerRegistryTaskRun(string taskRunName, CancellationToken cancellationToken = default) { @@ -579,7 +579,7 @@ public virtual Response GetContainerRegistryTa /// An object representing collection of ContainerRegistryTaskResources and their operations over a ContainerRegistryTaskResource. public virtual ContainerRegistryTaskCollection GetContainerRegistryTasks() { - return GetCachedClient(Client => new ContainerRegistryTaskCollection(Client, Id)); + return GetCachedClient(client => new ContainerRegistryTaskCollection(client, Id)); } /// @@ -597,8 +597,8 @@ public virtual ContainerRegistryTaskCollection GetContainerRegistryTasks() /// /// The name of the container registry task. /// The cancellation token to use. - /// 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> GetContainerRegistryTaskAsync(string taskName, CancellationToken cancellationToken = default) { @@ -620,8 +620,8 @@ public virtual async Task> GetContainerR /// /// The name of the container registry task. /// The cancellation token to use. - /// 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 GetContainerRegistryTask(string taskName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryArmClientMockingExtension.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryArmClientMockingExtension.cs new file mode 100644 index 000000000000..c8f8942cdf47 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryArmClientMockingExtension.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ContainerRegistryArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryArmClientMockingExtension() + { + } + + /// 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 ContainerRegistryArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ContainerRegistryArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerRegistryResource GetContainerRegistryResource(ResourceIdentifier id) + { + ContainerRegistryResource.ValidateResourceId(id); + return new ContainerRegistryResource(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 ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(ResourceIdentifier id) + { + ContainerRegistryPrivateLinkResource.ValidateResourceId(id); + return new ContainerRegistryPrivateLinkResource(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 ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(ResourceIdentifier id) + { + ContainerRegistryPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ContainerRegistryPrivateEndpointConnectionResource(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 ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(ResourceIdentifier id) + { + ContainerRegistryReplicationResource.ValidateResourceId(id); + return new ContainerRegistryReplicationResource(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 ScopeMapResource GetScopeMapResource(ResourceIdentifier id) + { + ScopeMapResource.ValidateResourceId(id); + return new ScopeMapResource(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 ContainerRegistryTokenResource GetContainerRegistryTokenResource(ResourceIdentifier id) + { + ContainerRegistryTokenResource.ValidateResourceId(id); + return new ContainerRegistryTokenResource(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 ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(ResourceIdentifier id) + { + ContainerRegistryWebhookResource.ValidateResourceId(id); + return new ContainerRegistryWebhookResource(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 ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(ResourceIdentifier id) + { + ContainerRegistryAgentPoolResource.ValidateResourceId(id); + return new ContainerRegistryAgentPoolResource(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 ContainerRegistryRunResource GetContainerRegistryRunResource(ResourceIdentifier id) + { + ContainerRegistryRunResource.ValidateResourceId(id); + return new ContainerRegistryRunResource(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 ContainerRegistryTaskRunResource GetContainerRegistryTaskRunResource(ResourceIdentifier id) + { + ContainerRegistryTaskRunResource.ValidateResourceId(id); + return new ContainerRegistryTaskRunResource(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 ContainerRegistryTaskResource GetContainerRegistryTaskResource(ResourceIdentifier id) + { + ContainerRegistryTaskResource.ValidateResourceId(id); + return new ContainerRegistryTaskResource(Client, id); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs index ffdba75144ee..355ef986b591 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry.Mocking; using Azure.ResourceManager.ContainerRegistry.Models; using Azure.ResourceManager.Resources; @@ -19,252 +20,209 @@ namespace Azure.ResourceManager.ContainerRegistry /// A class to add extension methods to Azure.ResourceManager.ContainerRegistry. public static partial class ContainerRegistryExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ContainerRegistryArmClientMockingExtension GetContainerRegistryArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ContainerRegistryArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ContainerRegistryResourceGroupMockingExtension GetContainerRegistryResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ContainerRegistryResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ContainerRegistrySubscriptionMockingExtension GetContainerRegistrySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ContainerRegistrySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region ContainerRegistryResource /// /// 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. /// Returns a object. public static ContainerRegistryResource GetContainerRegistryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryResource.ValidateResourceId(id); - return new ContainerRegistryResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryResource(id); } - #endregion - #region ContainerRegistryPrivateLinkResource /// /// 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. /// Returns a object. public static ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryPrivateLinkResource.ValidateResourceId(id); - return new ContainerRegistryPrivateLinkResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryPrivateLinkResource(id); } - #endregion - #region ContainerRegistryPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ContainerRegistryPrivateEndpointConnectionResource GetContainerRegistryPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryPrivateEndpointConnectionResource.ValidateResourceId(id); - return new ContainerRegistryPrivateEndpointConnectionResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryPrivateEndpointConnectionResource(id); } - #endregion - #region ContainerRegistryReplicationResource /// /// 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. /// Returns a object. public static ContainerRegistryReplicationResource GetContainerRegistryReplicationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryReplicationResource.ValidateResourceId(id); - return new ContainerRegistryReplicationResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryReplicationResource(id); } - #endregion - #region ScopeMapResource /// /// 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. /// Returns a object. public static ScopeMapResource GetScopeMapResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ScopeMapResource.ValidateResourceId(id); - return new ScopeMapResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetScopeMapResource(id); } - #endregion - #region ContainerRegistryTokenResource /// /// 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. /// Returns a object. public static ContainerRegistryTokenResource GetContainerRegistryTokenResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryTokenResource.ValidateResourceId(id); - return new ContainerRegistryTokenResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryTokenResource(id); } - #endregion - #region ContainerRegistryWebhookResource /// /// 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. /// Returns a object. public static ContainerRegistryWebhookResource GetContainerRegistryWebhookResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryWebhookResource.ValidateResourceId(id); - return new ContainerRegistryWebhookResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryWebhookResource(id); } - #endregion - #region ContainerRegistryAgentPoolResource /// /// 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. /// Returns a object. public static ContainerRegistryAgentPoolResource GetContainerRegistryAgentPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryAgentPoolResource.ValidateResourceId(id); - return new ContainerRegistryAgentPoolResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryAgentPoolResource(id); } - #endregion - #region ContainerRegistryRunResource /// /// 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. /// Returns a object. public static ContainerRegistryRunResource GetContainerRegistryRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryRunResource.ValidateResourceId(id); - return new ContainerRegistryRunResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryRunResource(id); } - #endregion - #region ContainerRegistryTaskRunResource /// /// 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. /// Returns a object. public static ContainerRegistryTaskRunResource GetContainerRegistryTaskRunResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryTaskRunResource.ValidateResourceId(id); - return new ContainerRegistryTaskRunResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryTaskRunResource(id); } - #endregion - #region ContainerRegistryTaskResource /// /// 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. /// Returns a object. public static ContainerRegistryTaskResource GetContainerRegistryTaskResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerRegistryTaskResource.ValidateResourceId(id); - return new ContainerRegistryTaskResource(client, id); - } - ); + return GetContainerRegistryArmClientMockingExtension(client).GetContainerRegistryTaskResource(id); } - #endregion - /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. public static ContainerRegistryCollection GetContainerRegistries(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerRegistries(); + return GetContainerRegistryResourceGroupMockingExtension(resourceGroupResource).GetContainerRegistries(); } /// @@ -279,16 +237,20 @@ public static ContainerRegistryCollection GetContainerRegistries(this ResourceGr /// Registries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the container registry. /// The cancellation token to use. - /// 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 static async Task> GetContainerRegistryAsync(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); + return await GetContainerRegistryResourceGroupMockingExtension(resourceGroupResource).GetContainerRegistryAsync(registryName, cancellationToken).ConfigureAwait(false); } /// @@ -303,16 +265,20 @@ public static async Task> GetContainerRegist /// Registries_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the container registry. /// The cancellation token to use. - /// 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 static Response GetContainerRegistry(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerRegistries().Get(registryName, cancellationToken); + return GetContainerRegistryResourceGroupMockingExtension(resourceGroupResource).GetContainerRegistry(registryName, cancellationToken); } /// @@ -327,6 +293,10 @@ public static Response GetContainerRegistry(this Reso /// Registries_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The object containing information for the availability request. @@ -334,9 +304,7 @@ public static Response GetContainerRegistry(this Reso /// is null. public static async Task> CheckContainerRegistryNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckContainerRegistryNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetContainerRegistrySubscriptionMockingExtension(subscriptionResource).CheckContainerRegistryNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -351,6 +319,10 @@ public static async Task> CheckCo /// Registries_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The object containing information for the availability request. @@ -358,9 +330,7 @@ public static async Task> CheckCo /// is null. public static Response CheckContainerRegistryNameAvailability(this SubscriptionResource subscriptionResource, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckContainerRegistryNameAvailability(content, cancellationToken); + return GetContainerRegistrySubscriptionMockingExtension(subscriptionResource).CheckContainerRegistryNameAvailability(content, cancellationToken); } /// @@ -375,13 +345,17 @@ public static Response CheckContainerRegis /// Registries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerRegistriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerRegistriesAsync(cancellationToken); + return GetContainerRegistrySubscriptionMockingExtension(subscriptionResource).GetContainerRegistriesAsync(cancellationToken); } /// @@ -396,13 +370,17 @@ public static AsyncPageable GetContainerRegistriesAsy /// Registries_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerRegistries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerRegistries(cancellationToken); + return GetContainerRegistrySubscriptionMockingExtension(subscriptionResource).GetContainerRegistries(cancellationToken); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryResourceGroupMockingExtension.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..b62d22fa6941 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ContainerRegistryResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerRegistryResourceGroupMockingExtension() + { + } + + /// 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 ContainerRegistryResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. + /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. + public virtual ContainerRegistryCollection GetContainerRegistries() + { + return GetCachedClient(client => new ContainerRegistryCollection(client, Id)); + } + + /// + /// Gets the properties of the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// + /// The name of the container registry. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerRegistryAsync(string registryName, CancellationToken cancellationToken = default) + { + return await GetContainerRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified container registry. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// + /// The name of the container registry. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerRegistry(string registryName, CancellationToken cancellationToken = default) + { + return GetContainerRegistries().Get(registryName, cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistrySubscriptionMockingExtension.cs similarity index 84% rename from sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistrySubscriptionMockingExtension.cs index 027fb12f1d78..33c8f0fb6ae3 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistrySubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry; using Azure.ResourceManager.ContainerRegistry.Models; -namespace Azure.ResourceManager.ContainerRegistry +namespace Azure.ResourceManager.ContainerRegistry.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ContainerRegistrySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _containerRegistryRegistriesClientDiagnostics; private RegistriesRestOperations _containerRegistryRegistriesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ContainerRegistrySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ContainerRegistrySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -59,9 +60,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// The object containing information for the availability request. /// The cancellation token to use. + /// is null. public virtual async Task> CheckContainerRegistryNameAvailabilityAsync(ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckContainerRegistryNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("ContainerRegistrySubscriptionMockingExtension.CheckContainerRegistryNameAvailability"); scope.Start(); try { @@ -90,9 +94,12 @@ public virtual async Task> CheckC /// /// The object containing information for the availability request. /// The cancellation token to use. + /// is null. public virtual Response CheckContainerRegistryNameAvailability(ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckContainerRegistryNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("ContainerRegistrySubscriptionMockingExtension.CheckContainerRegistryNameAvailability"); scope.Start(); try { @@ -125,7 +132,7 @@ public virtual AsyncPageable GetContainerRegistriesAs { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistrySubscriptionMockingExtension.GetContainerRegistries", "value", "nextLink", cancellationToken); } /// @@ -147,7 +154,7 @@ public virtual Pageable GetContainerRegistries(Cancel { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistrySubscriptionMockingExtension.GetContainerRegistries", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d33b5d4a11ee..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. - /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. - public virtual ContainerRegistryCollection GetContainerRegistries() - { - return GetCachedClient(Client => new ContainerRegistryCollection(Client, Id)); - } - } -} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceFleetResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceFleetResource.cs index 64b183413ec1..ac32b30c3dc9 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceFleetResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceFleetResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ContainerServiceFleetMemberResources and their operations over a ContainerServiceFleetMemberResource. public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMembers() { - return GetCachedClient(Client => new ContainerServiceFleetMemberCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceFleetMemberCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMem /// /// The name of the Fleet member resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetContainerServiceFleetMemberAsync(string fleetMemberName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCont /// /// The name of the Fleet member resource. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetContainerServiceFleetMember(string fleetMemberName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs index 14d1ee5b623c..8c04b3b25c7d 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs @@ -113,7 +113,7 @@ public virtual ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProf /// An object representing collection of ContainerServiceMaintenanceConfigurationResources and their operations over a ContainerServiceMaintenanceConfigurationResource. public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerServiceMaintenanceConfigurations() { - return GetCachedClient(Client => new ContainerServiceMaintenanceConfigurationCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceMaintenanceConfigurationCollection(client, Id)); } /// @@ -131,8 +131,8 @@ public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerSe /// /// The name of the maintenance configuration. /// The cancellation token to use. - /// 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> GetContainerServiceMaintenanceConfigurationAsync(string configName, CancellationToken cancellationToken = default) { @@ -154,8 +154,8 @@ public virtual async Task /// The name of the maintenance configuration. /// The cancellation token to use. - /// 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 GetContainerServiceMaintenanceConfiguration(string configName, CancellationToken cancellationToken = default) { @@ -166,7 +166,7 @@ public virtual Response GetCon /// An object representing collection of ContainerServiceAgentPoolResources and their operations over a ContainerServiceAgentPoolResource. public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools() { - return GetCachedClient(Client => new ContainerServiceAgentPoolCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceAgentPoolCollection(client, Id)); } /// @@ -184,8 +184,8 @@ public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools /// /// The name of the agent pool. /// The cancellation token to use. - /// 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> GetContainerServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default) { @@ -207,8 +207,8 @@ public virtual async Task> GetContai /// /// The name of the agent pool. /// The cancellation token to use. - /// 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 GetContainerServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default) { @@ -219,7 +219,7 @@ public virtual Response GetContainerServiceAg /// An object representing collection of ContainerServicePrivateEndpointConnectionResources and their operations over a ContainerServicePrivateEndpointConnectionResource. public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerServicePrivateEndpointConnections() { - return GetCachedClient(Client => new ContainerServicePrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new ContainerServicePrivateEndpointConnectionCollection(client, Id)); } /// @@ -237,8 +237,8 @@ public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerS /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetContainerServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -260,8 +260,8 @@ public virtual async Task /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetContainerServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -272,7 +272,7 @@ public virtual Response GetCo /// An object representing collection of ContainerServiceTrustedAccessRoleBindingResources and their operations over a ContainerServiceTrustedAccessRoleBindingResource. public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerServiceTrustedAccessRoleBindings() { - return GetCachedClient(Client => new ContainerServiceTrustedAccessRoleBindingCollection(Client, Id)); + return GetCachedClient(client => new ContainerServiceTrustedAccessRoleBindingCollection(client, Id)); } /// @@ -290,8 +290,8 @@ public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerSe /// /// The name of trusted access role binding. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetContainerServiceTrustedAccessRoleBindingAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) { @@ -313,8 +313,8 @@ public virtual async Task /// The name of trusted access role binding. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetContainerServiceTrustedAccessRoleBinding(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default) { diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceArmClientMockingExtension.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceArmClientMockingExtension.cs new file mode 100644 index 000000000000..987be6d70ed5 --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceArmClientMockingExtension.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService; + +namespace Azure.ResourceManager.ContainerService.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class ContainerServiceArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerServiceArmClientMockingExtension() + { + } + + /// 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 ContainerServiceArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal ContainerServiceArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OSOptionProfileResource GetOSOptionProfileResource(ResourceIdentifier id) + { + OSOptionProfileResource.ValidateResourceId(id); + return new OSOptionProfileResource(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 ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(ResourceIdentifier id) + { + ManagedClusterUpgradeProfileResource.ValidateResourceId(id); + return new ManagedClusterUpgradeProfileResource(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 ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(ResourceIdentifier id) + { + ContainerServiceManagedClusterResource.ValidateResourceId(id); + return new ContainerServiceManagedClusterResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(ResourceIdentifier id) + { + ContainerServiceMaintenanceConfigurationResource.ValidateResourceId(id); + return new ContainerServiceMaintenanceConfigurationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(ResourceIdentifier id) + { + ContainerServiceAgentPoolResource.ValidateResourceId(id); + return new ContainerServiceAgentPoolResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(ResourceIdentifier id) + { + AgentPoolUpgradeProfileResource.ValidateResourceId(id); + return new AgentPoolUpgradeProfileResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(ResourceIdentifier id) + { + ContainerServicePrivateEndpointConnectionResource.ValidateResourceId(id); + return new ContainerServicePrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AgentPoolSnapshotResource GetAgentPoolSnapshotResource(ResourceIdentifier id) + { + AgentPoolSnapshotResource.ValidateResourceId(id); + return new AgentPoolSnapshotResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ManagedClusterSnapshotResource GetManagedClusterSnapshotResource(ResourceIdentifier id) + { + ManagedClusterSnapshotResource.ValidateResourceId(id); + return new ManagedClusterSnapshotResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(ResourceIdentifier id) + { + ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); + return new ContainerServiceTrustedAccessRoleBindingResource(Client, id); + } + + /// + /// 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 ContainerServiceFleetResource GetContainerServiceFleetResource(ResourceIdentifier id) + { + ContainerServiceFleetResource.ValidateResourceId(id); + return new ContainerServiceFleetResource(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 ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(ResourceIdentifier id) + { + ContainerServiceFleetMemberResource.ValidateResourceId(id); + return new ContainerServiceFleetMemberResource(Client, id); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs index 134eff41d3c6..13b5794dfb76 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService.Mocking; using Azure.ResourceManager.ContainerService.Models; using Azure.ResourceManager.Resources; @@ -19,271 +20,225 @@ namespace Azure.ResourceManager.ContainerService /// A class to add extension methods to Azure.ResourceManager.ContainerService. public static partial class ContainerServiceExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static ContainerServiceArmClientMockingExtension GetContainerServiceArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new ContainerServiceArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static ContainerServiceResourceGroupMockingExtension GetContainerServiceResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new ContainerServiceResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static ContainerServiceSubscriptionMockingExtension GetContainerServiceSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new ContainerServiceSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region OSOptionProfileResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static OSOptionProfileResource GetOSOptionProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - OSOptionProfileResource.ValidateResourceId(id); - return new OSOptionProfileResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetOSOptionProfileResource(id); } - #endregion - #region ManagedClusterUpgradeProfileResource /// /// 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. /// Returns a object. public static ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedClusterUpgradeProfileResource.ValidateResourceId(id); - return new ManagedClusterUpgradeProfileResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetManagedClusterUpgradeProfileResource(id); } - #endregion - #region ContainerServiceManagedClusterResource /// /// 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. /// Returns a object. public static ContainerServiceManagedClusterResource GetContainerServiceManagedClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceManagedClusterResource.ValidateResourceId(id); - return new ContainerServiceManagedClusterResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceManagedClusterResource(id); } - #endregion - #region ContainerServiceMaintenanceConfigurationResource /// /// 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. /// Returns a object. public static ContainerServiceMaintenanceConfigurationResource GetContainerServiceMaintenanceConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceMaintenanceConfigurationResource.ValidateResourceId(id); - return new ContainerServiceMaintenanceConfigurationResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceMaintenanceConfigurationResource(id); } - #endregion - #region ContainerServiceAgentPoolResource /// /// 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. /// Returns a object. public static ContainerServiceAgentPoolResource GetContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceAgentPoolResource.ValidateResourceId(id); - return new ContainerServiceAgentPoolResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceAgentPoolResource(id); } - #endregion - #region AgentPoolUpgradeProfileResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AgentPoolUpgradeProfileResource.ValidateResourceId(id); - return new AgentPoolUpgradeProfileResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetAgentPoolUpgradeProfileResource(id); } - #endregion - #region ContainerServicePrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static ContainerServicePrivateEndpointConnectionResource GetContainerServicePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServicePrivateEndpointConnectionResource.ValidateResourceId(id); - return new ContainerServicePrivateEndpointConnectionResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServicePrivateEndpointConnectionResource(id); } - #endregion - #region AgentPoolSnapshotResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AgentPoolSnapshotResource GetAgentPoolSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AgentPoolSnapshotResource.ValidateResourceId(id); - return new AgentPoolSnapshotResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetAgentPoolSnapshotResource(id); } - #endregion - #region ManagedClusterSnapshotResource /// /// 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. /// Returns a object. public static ManagedClusterSnapshotResource GetManagedClusterSnapshotResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ManagedClusterSnapshotResource.ValidateResourceId(id); - return new ManagedClusterSnapshotResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetManagedClusterSnapshotResource(id); } - #endregion - #region ContainerServiceTrustedAccessRoleBindingResource /// /// 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. /// Returns a object. public static ContainerServiceTrustedAccessRoleBindingResource GetContainerServiceTrustedAccessRoleBindingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceTrustedAccessRoleBindingResource.ValidateResourceId(id); - return new ContainerServiceTrustedAccessRoleBindingResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceTrustedAccessRoleBindingResource(id); } - #endregion - #region ContainerServiceFleetResource /// /// 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. /// Returns a object. public static ContainerServiceFleetResource GetContainerServiceFleetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceFleetResource.ValidateResourceId(id); - return new ContainerServiceFleetResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceFleetResource(id); } - #endregion - #region ContainerServiceFleetMemberResource /// /// 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. /// Returns a object. public static ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ContainerServiceFleetMemberResource.ValidateResourceId(id); - return new ContainerServiceFleetMemberResource(client, id); - } - ); + return GetContainerServiceArmClientMockingExtension(client).GetContainerServiceFleetMemberResource(id); } - #endregion - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. public static ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerServiceManagedClusters(); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceManagedClusters(); } /// @@ -298,16 +253,20 @@ public static ContainerServiceManagedClusterCollection GetContainerServiceManage /// ManagedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static async Task> GetContainerServiceManagedClusterAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerServiceManagedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceManagedClusterAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -322,24 +281,34 @@ public static async Task> GetCo /// ManagedClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static Response GetContainerServiceManagedCluster(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerServiceManagedClusters().Get(resourceName, cancellationToken); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceManagedCluster(resourceName, cancellationToken); } - /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. + /// + /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAgentPoolSnapshots(); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetAgentPoolSnapshots(); } /// @@ -354,16 +323,20 @@ public static AgentPoolSnapshotCollection GetAgentPoolSnapshots(this ResourceGro /// Snapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static async Task> GetAgentPoolSnapshotAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetAgentPoolSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetAgentPoolSnapshotAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -378,24 +351,34 @@ public static async Task> GetAgentPoolSnapsh /// Snapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static Response GetAgentPoolSnapshot(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetAgentPoolSnapshots().Get(resourceName, cancellationToken); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetAgentPoolSnapshot(resourceName, cancellationToken); } - /// Gets a collection of ManagedClusterSnapshotResources in the ResourceGroupResource. + /// + /// Gets a collection of ManagedClusterSnapshotResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ManagedClusterSnapshotResources and their operations over a ManagedClusterSnapshotResource. public static ManagedClusterSnapshotCollection GetManagedClusterSnapshots(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetManagedClusterSnapshots(); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetManagedClusterSnapshots(); } /// @@ -410,16 +393,20 @@ public static ManagedClusterSnapshotCollection GetManagedClusterSnapshots(this R /// ManagedClusterSnapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static async Task> GetManagedClusterSnapshotAsync(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetManagedClusterSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + return await GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetManagedClusterSnapshotAsync(resourceName, cancellationToken).ConfigureAwait(false); } /// @@ -434,24 +421,34 @@ public static async Task> GetManagedClu /// ManagedClusterSnapshots_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the managed cluster resource. /// The cancellation token to use. - /// 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 static Response GetManagedClusterSnapshot(this ResourceGroupResource resourceGroupResource, string resourceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetManagedClusterSnapshots().Get(resourceName, cancellationToken); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetManagedClusterSnapshot(resourceName, cancellationToken); } - /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// + /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. public static ContainerServiceFleetCollection GetContainerServiceFleets(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetContainerServiceFleets(); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleets(); } /// @@ -466,16 +463,20 @@ public static ContainerServiceFleetCollection GetContainerServiceFleets(this Res /// Fleets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Fleet resource. /// The cancellation token to use. - /// 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 static async Task> GetContainerServiceFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetContainerServiceFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + return await GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); } /// @@ -490,16 +491,20 @@ public static async Task> GetContainerSe /// Fleets_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Fleet resource. /// The cancellation token to use. - /// 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 static Response GetContainerServiceFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetContainerServiceFleets().Get(fleetName, cancellationToken); + return GetContainerServiceResourceGroupMockingExtension(resourceGroupResource).GetContainerServiceFleet(fleetName, cancellationToken); } /// @@ -514,13 +519,17 @@ public static Response GetContainerServiceFleet(t /// ManagedClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerServiceManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceManagedClustersAsync(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetContainerServiceManagedClustersAsync(cancellationToken); } /// @@ -535,13 +544,17 @@ public static AsyncPageable GetContainer /// ManagedClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerServiceManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceManagedClusters(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetContainerServiceManagedClusters(cancellationToken); } /// @@ -556,13 +569,17 @@ public static Pageable GetContainerServi /// Snapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAgentPoolSnapshotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAgentPoolSnapshotsAsync(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetAgentPoolSnapshotsAsync(cancellationToken); } /// @@ -577,13 +594,17 @@ public static AsyncPageable GetAgentPoolSnapshotsAsyn /// Snapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAgentPoolSnapshots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAgentPoolSnapshots(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetAgentPoolSnapshots(cancellationToken); } /// @@ -598,13 +619,17 @@ public static Pageable GetAgentPoolSnapshots(this Sub /// ManagedClusterSnapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetManagedClusterSnapshotsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterSnapshotsAsync(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetManagedClusterSnapshotsAsync(cancellationToken); } /// @@ -619,13 +644,17 @@ public static AsyncPageable GetManagedClusterSna /// ManagedClusterSnapshots_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetManagedClusterSnapshots(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetManagedClusterSnapshots(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetManagedClusterSnapshots(cancellationToken); } /// @@ -640,6 +669,10 @@ public static Pageable GetManagedClusterSnapshot /// TrustedAccessRoles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -647,7 +680,7 @@ public static Pageable GetManagedClusterSnapshot /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetTrustedAccessRolesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrustedAccessRolesAsync(location, cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetTrustedAccessRolesAsync(location, cancellationToken); } /// @@ -662,6 +695,10 @@ public static AsyncPageable GetTrustedAccessR /// TrustedAccessRoles_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of Azure region. @@ -669,7 +706,7 @@ public static AsyncPageable GetTrustedAccessR /// A collection of that may take multiple service requests to iterate over. public static Pageable GetTrustedAccessRoles(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetTrustedAccessRoles(location, cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetTrustedAccessRoles(location, cancellationToken); } /// @@ -684,13 +721,17 @@ public static Pageable GetTrustedAccessRoles( /// Fleets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetContainerServiceFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceFleetsAsync(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetContainerServiceFleetsAsync(cancellationToken); } /// @@ -705,13 +746,17 @@ public static AsyncPageable GetContainerServiceFl /// Fleets_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetContainerServiceFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetContainerServiceFleets(cancellationToken); + return GetContainerServiceSubscriptionMockingExtension(subscriptionResource).GetContainerServiceFleets(cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceResourceGroupMockingExtension.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..18190f038ebe --- /dev/null +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceResourceGroupMockingExtension.cs @@ -0,0 +1,251 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService; + +namespace Azure.ResourceManager.ContainerService.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class ContainerServiceResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected ContainerServiceResourceGroupMockingExtension() + { + } + + /// 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 ContainerServiceResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. + /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. + public virtual ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters() + { + return GetCachedClient(client => new ContainerServiceManagedClusterCollection(client, Id)); + } + + /// + /// Gets a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerServiceManagedClusterAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetContainerServiceManagedClusters().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a managed cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusters_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerServiceManagedCluster(string resourceName, CancellationToken cancellationToken = default) + { + return GetContainerServiceManagedClusters().Get(resourceName, cancellationToken); + } + + /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. + /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. + public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() + { + return GetCachedClient(client => new AgentPoolSnapshotCollection(client, Id)); + } + + /// + /// Gets a snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAgentPoolSnapshotAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetAgentPoolSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName} + /// + /// + /// Operation Id + /// Snapshots_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAgentPoolSnapshot(string resourceName, CancellationToken cancellationToken = default) + { + return GetAgentPoolSnapshots().Get(resourceName, cancellationToken); + } + + /// Gets a collection of ManagedClusterSnapshotResources in the ResourceGroupResource. + /// An object representing collection of ManagedClusterSnapshotResources and their operations over a ManagedClusterSnapshotResource. + public virtual ManagedClusterSnapshotCollection GetManagedClusterSnapshots() + { + return GetCachedClient(client => new ManagedClusterSnapshotCollection(client, Id)); + } + + /// + /// Gets a managed cluster snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusterSnapshots_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedClusterSnapshotAsync(string resourceName, CancellationToken cancellationToken = default) + { + return await GetManagedClusterSnapshots().GetAsync(resourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a managed cluster snapshot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName} + /// + /// + /// Operation Id + /// ManagedClusterSnapshots_Get + /// + /// + /// + /// The name of the managed cluster resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedClusterSnapshot(string resourceName, CancellationToken cancellationToken = default) + { + return GetManagedClusterSnapshots().Get(resourceName, cancellationToken); + } + + /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. + /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. + public virtual ContainerServiceFleetCollection GetContainerServiceFleets() + { + return GetCachedClient(client => new ContainerServiceFleetCollection(client, Id)); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerServiceFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetContainerServiceFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// + /// The name of the Fleet resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerServiceFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetContainerServiceFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceSubscriptionMockingExtension.cs similarity index 88% rename from sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceSubscriptionMockingExtension.cs index 00ff449ba0c8..66b4b19eb001 100644 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ContainerServiceSubscriptionMockingExtension.cs @@ -11,12 +11,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ContainerService; using Azure.ResourceManager.ContainerService.Models; -namespace Azure.ResourceManager.ContainerService +namespace Azure.ResourceManager.ContainerService.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class ContainerServiceSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics; private ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient; @@ -29,15 +30,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _containerServiceFleetFleetsClientDiagnostics; private FleetsRestOperations _containerServiceFleetFleetsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected ContainerServiceSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ContainerServiceSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -58,6 +59,13 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets an object representing a OSOptionProfileResource along with the instance operations that can be performed on it in the SubscriptionResource. + /// Returns a object. + public virtual OSOptionProfileResource GetOSOptionProfile() + { + return new OSOptionProfileResource(Client, Id.AppendChildResource("osOptions", "default")); + } + /// /// Gets a list of managed clusters in the specified subscription. /// @@ -77,7 +85,7 @@ public virtual AsyncPageable GetContaine { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); } /// @@ -99,7 +107,7 @@ public virtual Pageable GetContainerServ { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceManagedClusterManagedClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), ContainerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetContainerServiceManagedClusters", "value", "nextLink", cancellationToken); } /// @@ -121,7 +129,7 @@ public virtual AsyncPageable GetAgentPoolSnapshotsAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); } /// @@ -143,7 +151,7 @@ public virtual Pageable GetAgentPoolSnapshots(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => AgentPoolSnapshotSnapshotsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AgentPoolSnapshotSnapshotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AgentPoolSnapshotResource(Client, AgentPoolSnapshotData.DeserializeAgentPoolSnapshotData(e)), AgentPoolSnapshotSnapshotsClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetAgentPoolSnapshots", "value", "nextLink", cancellationToken); } /// @@ -165,7 +173,7 @@ public virtual AsyncPageable GetManagedClusterSn { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterSnapshotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedClusterSnapshotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedClusterSnapshotResource(Client, ManagedClusterSnapshotData.DeserializeManagedClusterSnapshotData(e)), ManagedClusterSnapshotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedClusterSnapshotResource(Client, ManagedClusterSnapshotData.DeserializeManagedClusterSnapshotData(e)), ManagedClusterSnapshotClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetManagedClusterSnapshots", "value", "nextLink", cancellationToken); } /// @@ -187,7 +195,7 @@ public virtual Pageable GetManagedClusterSnapsho { HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterSnapshotRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedClusterSnapshotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedClusterSnapshotResource(Client, ManagedClusterSnapshotData.DeserializeManagedClusterSnapshotData(e)), ManagedClusterSnapshotClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetManagedClusterSnapshots", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedClusterSnapshotResource(Client, ManagedClusterSnapshotData.DeserializeManagedClusterSnapshotData(e)), ManagedClusterSnapshotClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetManagedClusterSnapshots", "value", "nextLink", cancellationToken); } /// @@ -210,7 +218,7 @@ public virtual AsyncPageable GetTrustedAccess { HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole, TrustedAccessRolesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole, TrustedAccessRolesClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); } /// @@ -233,7 +241,7 @@ public virtual Pageable GetTrustedAccessRoles { HttpMessage FirstPageRequest(int? pageSizeHint) => TrustedAccessRolesRestClient.CreateListRequest(Id.SubscriptionId, location); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TrustedAccessRolesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole, TrustedAccessRolesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerServiceTrustedAccessRole.DeserializeContainerServiceTrustedAccessRole, TrustedAccessRolesClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetTrustedAccessRoles", "value", "nextLink", cancellationToken); } /// @@ -255,7 +263,7 @@ public virtual AsyncPageable GetContainerServiceF { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceFleetFleetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceFleetFleetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceFleets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetContainerServiceFleets", "value", "nextLink", cancellationToken); } /// @@ -277,7 +285,7 @@ public virtual Pageable GetContainerServiceFleets { HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerServiceFleetFleetsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerServiceFleetFleetsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerServiceFleets", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceFleetResource(Client, ContainerServiceFleetData.DeserializeContainerServiceFleetData(e)), ContainerServiceFleetFleetsClientDiagnostics, Pipeline, "ContainerServiceSubscriptionMockingExtension.GetContainerServiceFleets", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 8ac7a7df2f7d..000000000000 --- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerService -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ContainerServiceManagedClusterResources in the ResourceGroupResource. - /// An object representing collection of ContainerServiceManagedClusterResources and their operations over a ContainerServiceManagedClusterResource. - public virtual ContainerServiceManagedClusterCollection GetContainerServiceManagedClusters() - { - return GetCachedClient(Client => new ContainerServiceManagedClusterCollection(Client, Id)); - } - - /// Gets a collection of AgentPoolSnapshotResources in the ResourceGroupResource. - /// An object representing collection of AgentPoolSnapshotResources and their operations over a AgentPoolSnapshotResource. - public virtual AgentPoolSnapshotCollection GetAgentPoolSnapshots() - { - return GetCachedClient(Client => new AgentPoolSnapshotCollection(Client, Id)); - } - - /// Gets a collection of ManagedClusterSnapshotResources in the ResourceGroupResource. - /// An object representing collection of ManagedClusterSnapshotResources and their operations over a ManagedClusterSnapshotResource. - public virtual ManagedClusterSnapshotCollection GetManagedClusterSnapshots() - { - return GetCachedClient(Client => new ManagedClusterSnapshotCollection(Client, Id)); - } - - /// Gets a collection of ContainerServiceFleetResources in the ResourceGroupResource. - /// An object representing collection of ContainerServiceFleetResources and their operations over a ContainerServiceFleetResource. - public virtual ContainerServiceFleetCollection GetContainerServiceFleets() - { - return GetCachedClient(Client => new ContainerServiceFleetCollection(Client, Id)); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs index 3c08d622e83c..9def9f93de8a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CassandraClusterBackupResources and their operations over a CassandraClusterBackupResource. public virtual CassandraClusterBackupResourceCollection GetCassandraClusterBackupResources() { - return GetCachedClient(Client => new CassandraClusterBackupResourceCollection(Client, Id)); + return GetCachedClient(client => new CassandraClusterBackupResourceCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CassandraClusterBackupResourceCollection GetCassandraClusterBacku /// /// Id of a restorable backup of a Cassandra cluster. /// The cancellation token to use. - /// 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> GetCassandraClusterBackupResourceAsync(string backupId, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCassandra /// /// Id of a restorable backup of a Cassandra cluster. /// The cancellation token to use. - /// 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 GetCassandraClusterBackupResource(string backupId, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetCassandraClusterBacku /// An object representing collection of CassandraDataCenterResources and their operations over a CassandraDataCenterResource. public virtual CassandraDataCenterCollection GetCassandraDataCenters() { - return GetCachedClient(Client => new CassandraDataCenterCollection(Client, Id)); + return GetCachedClient(client => new CassandraDataCenterCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual CassandraDataCenterCollection GetCassandraDataCenters() /// /// Data center name in a managed Cassandra cluster. /// The cancellation token to use. - /// 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> GetCassandraDataCenterAsync(string dataCenterName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> GetCassandraDat /// /// Data center name in a managed Cassandra cluster. /// The cancellation token to use. - /// 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 GetCassandraDataCenter(string dataCenterName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs index c21c4e04cd1d..524cf0dfeb48 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs @@ -99,7 +99,7 @@ public virtual CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceTh /// An object representing collection of CassandraTableResources and their operations over a CassandraTableResource. public virtual CassandraTableCollection GetCassandraTables() { - return GetCachedClient(Client => new CassandraTableCollection(Client, Id)); + return GetCachedClient(client => new CassandraTableCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual CassandraTableCollection GetCassandraTables() /// /// Cosmos DB table name. /// The cancellation token to use. - /// 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> GetCassandraTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetCassandraTableAsy /// /// Cosmos DB table name. /// The cancellation token to use. - /// 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 GetCassandraTable(string tableName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetCassandraTable(string tableNa /// An object representing collection of CassandraViewGetResultResources and their operations over a CassandraViewGetResultResource. public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() { - return GetCachedClient(Client => new CassandraViewGetResultCollection(Client, Id)); + return GetCachedClient(client => new CassandraViewGetResultCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() /// /// Cosmos DB view name. /// The cancellation token to use. - /// 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> GetCassandraViewGetResultAsync(string viewName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetCassandra /// /// Cosmos DB view name. /// The cancellation token to use. - /// 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 GetCassandraViewGetResult(string viewName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs index 3a1688bc2bb5..e3dab0eb0e13 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -138,7 +138,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of GraphResourceGetResultResources and their operations over a GraphResourceGetResultResource. public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() { - return GetCachedClient(Client => new GraphResourceGetResultCollection(Client, Id)); + return GetCachedClient(client => new GraphResourceGetResultCollection(client, Id)); } /// @@ -156,8 +156,8 @@ public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() /// /// Cosmos DB graph resource name. /// The cancellation token to use. - /// 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> GetGraphResourceGetResultAsync(string graphName, CancellationToken cancellationToken = default) { @@ -179,8 +179,8 @@ public virtual async Task> GetGraphReso /// /// Cosmos DB graph resource name. /// The cancellation token to use. - /// 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 GetGraphResourceGetResult(string graphName, CancellationToken cancellationToken = default) { @@ -191,7 +191,7 @@ public virtual Response GetGraphResourceGetResul /// An object representing collection of CosmosDBSqlDatabaseResources and their operations over a CosmosDBSqlDatabaseResource. public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() { - return GetCachedClient(Client => new CosmosDBSqlDatabaseCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlDatabaseCollection(client, Id)); } /// @@ -209,8 +209,8 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -232,8 +232,8 @@ public virtual async Task> GetCosmosDBSqlD /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -244,7 +244,7 @@ public virtual Response GetCosmosDBSqlDatabase(stri /// An object representing collection of CosmosDBSqlRoleDefinitionResources and their operations over a CosmosDBSqlRoleDefinitionResource. public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions() { - return GetCachedClient(Client => new CosmosDBSqlRoleDefinitionCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlRoleDefinitionCollection(client, Id)); } /// @@ -262,8 +262,8 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// The GUID for the Role Definition. /// The cancellation token to use. - /// 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> GetCosmosDBSqlRoleDefinitionAsync(string roleDefinitionId, CancellationToken cancellationToken = default) { @@ -285,8 +285,8 @@ public virtual async Task> GetCosmos /// /// The GUID for the Role Definition. /// The cancellation token to use. - /// 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 GetCosmosDBSqlRoleDefinition(string roleDefinitionId, CancellationToken cancellationToken = default) { @@ -297,7 +297,7 @@ public virtual Response GetCosmosDBSqlRoleDef /// An object representing collection of CosmosDBSqlRoleAssignmentResources and their operations over a CosmosDBSqlRoleAssignmentResource. public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments() { - return GetCachedClient(Client => new CosmosDBSqlRoleAssignmentCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlRoleAssignmentCollection(client, Id)); } /// @@ -315,8 +315,8 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// The GUID for the Role Assignment. /// The cancellation token to use. - /// 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> GetCosmosDBSqlRoleAssignmentAsync(string roleAssignmentId, CancellationToken cancellationToken = default) { @@ -338,8 +338,8 @@ public virtual async Task> GetCosmos /// /// The GUID for the Role Assignment. /// The cancellation token to use. - /// 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 GetCosmosDBSqlRoleAssignment(string roleAssignmentId, CancellationToken cancellationToken = default) { @@ -350,7 +350,7 @@ public virtual Response GetCosmosDBSqlRoleAss /// An object representing collection of MongoDBDatabaseResources and their operations over a MongoDBDatabaseResource. public virtual MongoDBDatabaseCollection GetMongoDBDatabases() { - return GetCachedClient(Client => new MongoDBDatabaseCollection(Client, Id)); + return GetCachedClient(client => new MongoDBDatabaseCollection(client, Id)); } /// @@ -368,8 +368,8 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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> GetMongoDBDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -391,8 +391,8 @@ public virtual async Task> GetMongoDBDatabaseA /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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 GetMongoDBDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -403,7 +403,7 @@ public virtual Response GetMongoDBDatabase(string datab /// An object representing collection of MongoDBRoleDefinitionResources and their operations over a MongoDBRoleDefinitionResource. public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() { - return GetCachedClient(Client => new MongoDBRoleDefinitionCollection(Client, Id)); + return GetCachedClient(client => new MongoDBRoleDefinitionCollection(client, Id)); } /// @@ -421,8 +421,8 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// The ID for the Role Definition {dbName.roleName}. /// The cancellation token to use. - /// 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> GetMongoDBRoleDefinitionAsync(string mongoRoleDefinitionId, CancellationToken cancellationToken = default) { @@ -444,8 +444,8 @@ public virtual async Task> GetMongoDBRol /// /// The ID for the Role Definition {dbName.roleName}. /// The cancellation token to use. - /// 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 GetMongoDBRoleDefinition(string mongoRoleDefinitionId, CancellationToken cancellationToken = default) { @@ -456,7 +456,7 @@ public virtual Response GetMongoDBRoleDefinition( /// An object representing collection of MongoDBUserDefinitionResources and their operations over a MongoDBUserDefinitionResource. public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() { - return GetCachedClient(Client => new MongoDBUserDefinitionCollection(Client, Id)); + return GetCachedClient(client => new MongoDBUserDefinitionCollection(client, Id)); } /// @@ -474,8 +474,8 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// The ID for the User Definition {dbName.userName}. /// The cancellation token to use. - /// 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> GetMongoDBUserDefinitionAsync(string mongoUserDefinitionId, CancellationToken cancellationToken = default) { @@ -497,8 +497,8 @@ public virtual async Task> GetMongoDBUse /// /// The ID for the User Definition {dbName.userName}. /// The cancellation token to use. - /// 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 GetMongoDBUserDefinition(string mongoUserDefinitionId, CancellationToken cancellationToken = default) { @@ -509,7 +509,7 @@ public virtual Response GetMongoDBUserDefinition( /// An object representing collection of CosmosDBTableResources and their operations over a CosmosDBTableResource. public virtual CosmosDBTableCollection GetCosmosDBTables() { - return GetCachedClient(Client => new CosmosDBTableCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBTableCollection(client, Id)); } /// @@ -527,8 +527,8 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// Cosmos DB table name. /// The cancellation token to use. - /// 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> GetCosmosDBTableAsync(string tableName, CancellationToken cancellationToken = default) { @@ -550,8 +550,8 @@ public virtual async Task> GetCosmosDBTableAsync /// /// Cosmos DB table name. /// The cancellation token to use. - /// 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 GetCosmosDBTable(string tableName, CancellationToken cancellationToken = default) { @@ -562,7 +562,7 @@ public virtual Response GetCosmosDBTable(string tableName /// An object representing collection of CassandraKeyspaceResources and their operations over a CassandraKeyspaceResource. public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() { - return GetCachedClient(Client => new CassandraKeyspaceCollection(Client, Id)); + return GetCachedClient(client => new CassandraKeyspaceCollection(client, Id)); } /// @@ -580,8 +580,8 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// Cosmos DB keyspace name. /// The cancellation token to use. - /// 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> GetCassandraKeyspaceAsync(string keyspaceName, CancellationToken cancellationToken = default) { @@ -603,8 +603,8 @@ public virtual async Task> GetCassandraKeysp /// /// Cosmos DB keyspace name. /// The cancellation token to use. - /// 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 GetCassandraKeyspace(string keyspaceName, CancellationToken cancellationToken = default) { @@ -615,7 +615,7 @@ public virtual Response GetCassandraKeyspace(string k /// An object representing collection of GremlinDatabaseResources and their operations over a GremlinDatabaseResource. public virtual GremlinDatabaseCollection GetGremlinDatabases() { - return GetCachedClient(Client => new GremlinDatabaseCollection(Client, Id)); + return GetCachedClient(client => new GremlinDatabaseCollection(client, Id)); } /// @@ -633,8 +633,8 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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> GetGremlinDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) { @@ -656,8 +656,8 @@ public virtual async Task> GetGremlinDatabaseA /// /// Cosmos DB database name. /// The cancellation token to use. - /// 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 GetGremlinDatabase(string databaseName, CancellationToken cancellationToken = default) { @@ -668,7 +668,7 @@ public virtual Response GetGremlinDatabase(string datab /// An object representing collection of DataTransferJobGetResultResources and their operations over a DataTransferJobGetResultResource. public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() { - return GetCachedClient(Client => new DataTransferJobGetResultCollection(Client, Id)); + return GetCachedClient(client => new DataTransferJobGetResultCollection(client, Id)); } /// @@ -686,8 +686,8 @@ public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() /// /// Name of the Data Transfer Job. /// The cancellation token to use. - /// 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> GetDataTransferJobGetResultAsync(string jobName, CancellationToken cancellationToken = default) { @@ -709,8 +709,8 @@ public virtual async Task> GetDataTra /// /// Name of the Data Transfer Job. /// The cancellation token to use. - /// 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 GetDataTransferJobGetResult(string jobName, CancellationToken cancellationToken = default) { @@ -721,7 +721,7 @@ public virtual Response GetDataTransferJobGetR /// An object representing collection of CosmosDBPrivateEndpointConnectionResources and their operations over a CosmosDBPrivateEndpointConnectionResource. public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEndpointConnections() { - return GetCachedClient(Client => new CosmosDBPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBPrivateEndpointConnectionCollection(client, Id)); } /// @@ -739,8 +739,8 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual async Task> GetCosmosDBPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -762,8 +762,8 @@ public virtual async Task> G /// /// The name of the private endpoint connection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] public virtual Response GetCosmosDBPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -774,7 +774,7 @@ public virtual Response GetCosmosDBPr /// An object representing collection of CosmosDBPrivateLinkResources and their operations over a CosmosDBPrivateLinkResource. public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResources() { - return GetCachedClient(Client => new CosmosDBPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBPrivateLinkResourceCollection(client, Id)); } /// @@ -792,8 +792,8 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetCosmosDBPrivateLinkResourceAsync(string groupName, CancellationToken cancellationToken = default) { @@ -815,8 +815,8 @@ public virtual async Task> GetCosmosDBPriv /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetCosmosDBPrivateLinkResource(string groupName, CancellationToken cancellationToken = default) { @@ -827,7 +827,7 @@ public virtual Response GetCosmosDBPrivateLinkResou /// An object representing collection of CosmosDBServiceResources and their operations over a CosmosDBServiceResource. public virtual CosmosDBServiceCollection GetCosmosDBServices() { - return GetCachedClient(Client => new CosmosDBServiceCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBServiceCollection(client, Id)); } /// @@ -845,8 +845,8 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// Cosmos DB service name. /// The cancellation token to use. - /// 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> GetCosmosDBServiceAsync(string serviceName, CancellationToken cancellationToken = default) { @@ -868,8 +868,8 @@ public virtual async Task> GetCosmosDBServiceA /// /// Cosmos DB service name. /// The cancellation token to use. - /// 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 GetCosmosDBService(string serviceName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index 7dd363e107a0..6ce8ce3f59fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of RestorableCosmosDBAccountResources and their operations over a RestorableCosmosDBAccountResource. public virtual RestorableCosmosDBAccountCollection GetRestorableCosmosDBAccounts() { - return GetCachedClient(Client => new RestorableCosmosDBAccountCollection(Client, Id)); + return GetCachedClient(client => new RestorableCosmosDBAccountCollection(client, Id)); } /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs index 9f0adfe24022..e465179ec895 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs @@ -99,7 +99,7 @@ public virtual CosmosDBSqlContainerThroughputSettingResource GetCosmosDBSqlConta /// An object representing collection of CosmosDBSqlStoredProcedureResources and their operations over a CosmosDBSqlStoredProcedureResource. public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedures() { - return GetCachedClient(Client => new CosmosDBSqlStoredProcedureCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlStoredProcedureCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedur /// /// Cosmos DB storedProcedure name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlStoredProcedureAsync(string storedProcedureName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetCosmo /// /// Cosmos DB storedProcedure name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlStoredProcedure(string storedProcedureName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetCosmosDBSqlStored /// An object representing collection of CosmosDBSqlUserDefinedFunctionResources and their operations over a CosmosDBSqlUserDefinedFunctionResource. public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefinedFunctions() { - return GetCachedClient(Client => new CosmosDBSqlUserDefinedFunctionCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlUserDefinedFunctionCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// Cosmos DB userDefinedFunction name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlUserDefinedFunctionAsync(string userDefinedFunctionName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetC /// /// Cosmos DB userDefinedFunction name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlUserDefinedFunction(string userDefinedFunctionName, CancellationToken cancellationToken = default) { @@ -205,7 +205,7 @@ public virtual Response GetCosmosDBSqlUs /// An object representing collection of CosmosDBSqlTriggerResources and their operations over a CosmosDBSqlTriggerResource. public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() { - return GetCachedClient(Client => new CosmosDBSqlTriggerCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlTriggerCollection(client, Id)); } /// @@ -223,8 +223,8 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// Cosmos DB trigger name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlTriggerAsync(string triggerName, CancellationToken cancellationToken = default) { @@ -246,8 +246,8 @@ public virtual async Task> GetCosmosDBSqlTr /// /// Cosmos DB trigger name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlTrigger(string triggerName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index 76c3613af7c8..5325c4b42841 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -99,7 +99,7 @@ public virtual CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDataba /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() { - return GetCachedClient(Client => new CosmosDBSqlClientEncryptionKeyCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncr /// /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetC /// /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { @@ -152,7 +152,7 @@ public virtual Response GetCosmosDBSqlCl /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() { - return GetCachedClient(Client => new CosmosDBSqlContainerCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); } /// @@ -170,8 +170,8 @@ public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() /// /// Cosmos DB container name. /// The cancellation token to use. - /// 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> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) { @@ -193,8 +193,8 @@ public virtual async Task> GetCosmosDBSql /// /// Cosmos DB container name. /// The cancellation token to use. - /// 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 GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBArmClientMockingExtension.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBArmClientMockingExtension.cs new file mode 100644 index 000000000000..4e82c899cefa --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBArmClientMockingExtension.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CosmosDBArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CosmosDBArmClientMockingExtension() + { + } + + /// 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 CosmosDBArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CosmosDBArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CosmosDBAccountResource GetCosmosDBAccountResource(ResourceIdentifier id) + { + CosmosDBAccountResource.ValidateResourceId(id); + return new CosmosDBAccountResource(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 GraphResourceGetResultResource GetGraphResourceGetResultResource(ResourceIdentifier id) + { + GraphResourceGetResultResource.ValidateResourceId(id); + return new GraphResourceGetResultResource(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 CosmosDBSqlDatabaseResource GetCosmosDBSqlDatabaseResource(ResourceIdentifier id) + { + CosmosDBSqlDatabaseResource.ValidateResourceId(id); + return new CosmosDBSqlDatabaseResource(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 CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDatabaseThroughputSettingResource(ResourceIdentifier id) + { + CosmosDBSqlDatabaseThroughputSettingResource.ValidateResourceId(id); + return new CosmosDBSqlDatabaseThroughputSettingResource(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 CosmosDBSqlContainerThroughputSettingResource GetCosmosDBSqlContainerThroughputSettingResource(ResourceIdentifier id) + { + CosmosDBSqlContainerThroughputSettingResource.ValidateResourceId(id); + return new CosmosDBSqlContainerThroughputSettingResource(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 MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(ResourceIdentifier id) + { + MongoDBDatabaseThroughputSettingResource.ValidateResourceId(id); + return new MongoDBDatabaseThroughputSettingResource(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 MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(ResourceIdentifier id) + { + MongoDBCollectionThroughputSettingResource.ValidateResourceId(id); + return new MongoDBCollectionThroughputSettingResource(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 CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(ResourceIdentifier id) + { + CosmosTableThroughputSettingResource.ValidateResourceId(id); + return new CosmosTableThroughputSettingResource(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 CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(ResourceIdentifier id) + { + CassandraKeyspaceThroughputSettingResource.ValidateResourceId(id); + return new CassandraKeyspaceThroughputSettingResource(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 CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(ResourceIdentifier id) + { + CassandraTableThroughputSettingResource.ValidateResourceId(id); + return new CassandraTableThroughputSettingResource(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 CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(ResourceIdentifier id) + { + CassandraViewThroughputSettingResource.ValidateResourceId(id); + return new CassandraViewThroughputSettingResource(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 GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(ResourceIdentifier id) + { + GremlinDatabaseThroughputSettingResource.ValidateResourceId(id); + return new GremlinDatabaseThroughputSettingResource(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 GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(ResourceIdentifier id) + { + GremlinGraphThroughputSettingResource.ValidateResourceId(id); + return new GremlinGraphThroughputSettingResource(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 CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) + { + CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); + return new CosmosDBSqlClientEncryptionKeyResource(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 CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(ResourceIdentifier id) + { + CosmosDBSqlContainerResource.ValidateResourceId(id); + return new CosmosDBSqlContainerResource(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 CosmosDBSqlStoredProcedureResource GetCosmosDBSqlStoredProcedureResource(ResourceIdentifier id) + { + CosmosDBSqlStoredProcedureResource.ValidateResourceId(id); + return new CosmosDBSqlStoredProcedureResource(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 CosmosDBSqlUserDefinedFunctionResource GetCosmosDBSqlUserDefinedFunctionResource(ResourceIdentifier id) + { + CosmosDBSqlUserDefinedFunctionResource.ValidateResourceId(id); + return new CosmosDBSqlUserDefinedFunctionResource(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 CosmosDBSqlTriggerResource GetCosmosDBSqlTriggerResource(ResourceIdentifier id) + { + CosmosDBSqlTriggerResource.ValidateResourceId(id); + return new CosmosDBSqlTriggerResource(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 CosmosDBSqlRoleDefinitionResource GetCosmosDBSqlRoleDefinitionResource(ResourceIdentifier id) + { + CosmosDBSqlRoleDefinitionResource.ValidateResourceId(id); + return new CosmosDBSqlRoleDefinitionResource(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 CosmosDBSqlRoleAssignmentResource GetCosmosDBSqlRoleAssignmentResource(ResourceIdentifier id) + { + CosmosDBSqlRoleAssignmentResource.ValidateResourceId(id); + return new CosmosDBSqlRoleAssignmentResource(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 MongoDBDatabaseResource GetMongoDBDatabaseResource(ResourceIdentifier id) + { + MongoDBDatabaseResource.ValidateResourceId(id); + return new MongoDBDatabaseResource(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 MongoDBCollectionResource GetMongoDBCollectionResource(ResourceIdentifier id) + { + MongoDBCollectionResource.ValidateResourceId(id); + return new MongoDBCollectionResource(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 MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(ResourceIdentifier id) + { + MongoDBRoleDefinitionResource.ValidateResourceId(id); + return new MongoDBRoleDefinitionResource(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 MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(ResourceIdentifier id) + { + MongoDBUserDefinitionResource.ValidateResourceId(id); + return new MongoDBUserDefinitionResource(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 CosmosDBTableResource GetCosmosDBTableResource(ResourceIdentifier id) + { + CosmosDBTableResource.ValidateResourceId(id); + return new CosmosDBTableResource(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 CassandraKeyspaceResource GetCassandraKeyspaceResource(ResourceIdentifier id) + { + CassandraKeyspaceResource.ValidateResourceId(id); + return new CassandraKeyspaceResource(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 CassandraTableResource GetCassandraTableResource(ResourceIdentifier id) + { + CassandraTableResource.ValidateResourceId(id); + return new CassandraTableResource(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 CassandraViewGetResultResource GetCassandraViewGetResultResource(ResourceIdentifier id) + { + CassandraViewGetResultResource.ValidateResourceId(id); + return new CassandraViewGetResultResource(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 GremlinDatabaseResource GetGremlinDatabaseResource(ResourceIdentifier id) + { + GremlinDatabaseResource.ValidateResourceId(id); + return new GremlinDatabaseResource(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 GremlinGraphResource GetGremlinGraphResource(ResourceIdentifier id) + { + GremlinGraphResource.ValidateResourceId(id); + return new GremlinGraphResource(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 CosmosDBLocationResource GetCosmosDBLocationResource(ResourceIdentifier id) + { + CosmosDBLocationResource.ValidateResourceId(id); + return new CosmosDBLocationResource(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 DataTransferJobGetResultResource GetDataTransferJobGetResultResource(ResourceIdentifier id) + { + DataTransferJobGetResultResource.ValidateResourceId(id); + return new DataTransferJobGetResultResource(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 CassandraClusterResource GetCassandraClusterResource(ResourceIdentifier id) + { + CassandraClusterResource.ValidateResourceId(id); + return new CassandraClusterResource(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 CassandraClusterBackupResource GetCassandraClusterBackupResource(ResourceIdentifier id) + { + CassandraClusterBackupResource.ValidateResourceId(id); + return new CassandraClusterBackupResource(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 CassandraDataCenterResource GetCassandraDataCenterResource(ResourceIdentifier id) + { + CassandraDataCenterResource.ValidateResourceId(id); + return new CassandraDataCenterResource(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 MongoClusterResource GetMongoClusterResource(ResourceIdentifier id) + { + MongoClusterResource.ValidateResourceId(id); + return new MongoClusterResource(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 CosmosDBFirewallRuleResource GetCosmosDBFirewallRuleResource(ResourceIdentifier id) + { + CosmosDBFirewallRuleResource.ValidateResourceId(id); + return new CosmosDBFirewallRuleResource(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 CosmosDBPrivateEndpointConnectionResource GetCosmosDBPrivateEndpointConnectionResource(ResourceIdentifier id) + { + CosmosDBPrivateEndpointConnectionResource.ValidateResourceId(id); + return new CosmosDBPrivateEndpointConnectionResource(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 CosmosDBPrivateLinkResource GetCosmosDBPrivateLinkResource(ResourceIdentifier id) + { + CosmosDBPrivateLinkResource.ValidateResourceId(id); + return new CosmosDBPrivateLinkResource(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 RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(ResourceIdentifier id) + { + RestorableCosmosDBAccountResource.ValidateResourceId(id); + return new RestorableCosmosDBAccountResource(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 CosmosDBServiceResource GetCosmosDBServiceResource(ResourceIdentifier id) + { + CosmosDBServiceResource.ValidateResourceId(id); + return new CosmosDBServiceResource(Client, id); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index b1a35e4957e0..60785fd14d75 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.CosmosDB @@ -18,838 +19,694 @@ namespace Azure.ResourceManager.CosmosDB /// A class to add extension methods to Azure.ResourceManager.CosmosDB. public static partial class CosmosDBExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CosmosDBArmClientMockingExtension GetCosmosDBArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CosmosDBArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CosmosDBResourceGroupMockingExtension GetCosmosDBResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CosmosDBResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CosmosDBSubscriptionMockingExtension GetCosmosDBSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CosmosDBSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CosmosDBTenantMockingExtension GetCosmosDBTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CosmosDBTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region CosmosDBAccountResource /// /// 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. /// Returns a object. public static CosmosDBAccountResource GetCosmosDBAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBAccountResource.ValidateResourceId(id); - return new CosmosDBAccountResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBAccountResource(id); } - #endregion - #region GraphResourceGetResultResource /// /// 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. /// Returns a object. public static GraphResourceGetResultResource GetGraphResourceGetResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GraphResourceGetResultResource.ValidateResourceId(id); - return new GraphResourceGetResultResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetGraphResourceGetResultResource(id); } - #endregion - #region CosmosDBSqlDatabaseResource /// /// 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. /// Returns a object. public static CosmosDBSqlDatabaseResource GetCosmosDBSqlDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlDatabaseResource.ValidateResourceId(id); - return new CosmosDBSqlDatabaseResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlDatabaseResource(id); } - #endregion - #region CosmosDBSqlDatabaseThroughputSettingResource /// /// 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. /// Returns a object. public static CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDatabaseThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlDatabaseThroughputSettingResource.ValidateResourceId(id); - return new CosmosDBSqlDatabaseThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlDatabaseThroughputSettingResource(id); } - #endregion - #region CosmosDBSqlContainerThroughputSettingResource /// /// 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. /// Returns a object. public static CosmosDBSqlContainerThroughputSettingResource GetCosmosDBSqlContainerThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlContainerThroughputSettingResource.ValidateResourceId(id); - return new CosmosDBSqlContainerThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlContainerThroughputSettingResource(id); } - #endregion - #region MongoDBDatabaseThroughputSettingResource /// /// 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. /// Returns a object. public static MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBDatabaseThroughputSettingResource.ValidateResourceId(id); - return new MongoDBDatabaseThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBDatabaseThroughputSettingResource(id); } - #endregion - #region MongoDBCollectionThroughputSettingResource /// /// 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. /// Returns a object. public static MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBCollectionThroughputSettingResource.ValidateResourceId(id); - return new MongoDBCollectionThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBCollectionThroughputSettingResource(id); } - #endregion - #region CosmosTableThroughputSettingResource /// /// 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. /// Returns a object. public static CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosTableThroughputSettingResource.ValidateResourceId(id); - return new CosmosTableThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosTableThroughputSettingResource(id); } - #endregion - #region CassandraKeyspaceThroughputSettingResource /// /// 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. /// Returns a object. public static CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraKeyspaceThroughputSettingResource.ValidateResourceId(id); - return new CassandraKeyspaceThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraKeyspaceThroughputSettingResource(id); } - #endregion - #region CassandraTableThroughputSettingResource /// /// 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. /// Returns a object. public static CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraTableThroughputSettingResource.ValidateResourceId(id); - return new CassandraTableThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraTableThroughputSettingResource(id); } - #endregion - #region CassandraViewThroughputSettingResource /// /// 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. /// Returns a object. public static CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraViewThroughputSettingResource.ValidateResourceId(id); - return new CassandraViewThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraViewThroughputSettingResource(id); } - #endregion - #region GremlinDatabaseThroughputSettingResource /// /// 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. /// Returns a object. public static GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GremlinDatabaseThroughputSettingResource.ValidateResourceId(id); - return new GremlinDatabaseThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetGremlinDatabaseThroughputSettingResource(id); } - #endregion - #region GremlinGraphThroughputSettingResource /// /// 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. /// Returns a object. public static GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GremlinGraphThroughputSettingResource.ValidateResourceId(id); - return new GremlinGraphThroughputSettingResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetGremlinGraphThroughputSettingResource(id); } - #endregion - #region CosmosDBSqlClientEncryptionKeyResource /// /// 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. /// Returns a object. public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); - return new CosmosDBSqlClientEncryptionKeyResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlClientEncryptionKeyResource(id); } - #endregion - #region CosmosDBSqlContainerResource /// /// 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. /// Returns a object. public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlContainerResource.ValidateResourceId(id); - return new CosmosDBSqlContainerResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlContainerResource(id); } - #endregion - #region CosmosDBSqlStoredProcedureResource /// /// 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. /// Returns a object. public static CosmosDBSqlStoredProcedureResource GetCosmosDBSqlStoredProcedureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlStoredProcedureResource.ValidateResourceId(id); - return new CosmosDBSqlStoredProcedureResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlStoredProcedureResource(id); } - #endregion - #region CosmosDBSqlUserDefinedFunctionResource /// /// 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. /// Returns a object. public static CosmosDBSqlUserDefinedFunctionResource GetCosmosDBSqlUserDefinedFunctionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlUserDefinedFunctionResource.ValidateResourceId(id); - return new CosmosDBSqlUserDefinedFunctionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlUserDefinedFunctionResource(id); } - #endregion - #region CosmosDBSqlTriggerResource /// /// 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. /// Returns a object. public static CosmosDBSqlTriggerResource GetCosmosDBSqlTriggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlTriggerResource.ValidateResourceId(id); - return new CosmosDBSqlTriggerResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlTriggerResource(id); } - #endregion - #region CosmosDBSqlRoleDefinitionResource /// /// 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. /// Returns a object. public static CosmosDBSqlRoleDefinitionResource GetCosmosDBSqlRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlRoleDefinitionResource.ValidateResourceId(id); - return new CosmosDBSqlRoleDefinitionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlRoleDefinitionResource(id); } - #endregion - #region CosmosDBSqlRoleAssignmentResource /// /// 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. /// Returns a object. public static CosmosDBSqlRoleAssignmentResource GetCosmosDBSqlRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBSqlRoleAssignmentResource.ValidateResourceId(id); - return new CosmosDBSqlRoleAssignmentResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBSqlRoleAssignmentResource(id); } - #endregion - #region MongoDBDatabaseResource /// /// 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. /// Returns a object. public static MongoDBDatabaseResource GetMongoDBDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBDatabaseResource.ValidateResourceId(id); - return new MongoDBDatabaseResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBDatabaseResource(id); } - #endregion - #region MongoDBCollectionResource /// /// 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. /// Returns a object. public static MongoDBCollectionResource GetMongoDBCollectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBCollectionResource.ValidateResourceId(id); - return new MongoDBCollectionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBCollectionResource(id); } - #endregion - #region MongoDBRoleDefinitionResource /// /// 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. /// Returns a object. public static MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBRoleDefinitionResource.ValidateResourceId(id); - return new MongoDBRoleDefinitionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBRoleDefinitionResource(id); } - #endregion - #region MongoDBUserDefinitionResource /// /// 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. /// Returns a object. public static MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoDBUserDefinitionResource.ValidateResourceId(id); - return new MongoDBUserDefinitionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoDBUserDefinitionResource(id); } - #endregion - #region CosmosDBTableResource /// /// 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. /// Returns a object. public static CosmosDBTableResource GetCosmosDBTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBTableResource.ValidateResourceId(id); - return new CosmosDBTableResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBTableResource(id); } - #endregion - #region CassandraKeyspaceResource /// /// 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. /// Returns a object. public static CassandraKeyspaceResource GetCassandraKeyspaceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraKeyspaceResource.ValidateResourceId(id); - return new CassandraKeyspaceResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraKeyspaceResource(id); } - #endregion - #region CassandraTableResource /// /// 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. /// Returns a object. public static CassandraTableResource GetCassandraTableResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraTableResource.ValidateResourceId(id); - return new CassandraTableResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraTableResource(id); } - #endregion - #region CassandraViewGetResultResource /// /// 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. /// Returns a object. public static CassandraViewGetResultResource GetCassandraViewGetResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraViewGetResultResource.ValidateResourceId(id); - return new CassandraViewGetResultResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraViewGetResultResource(id); } - #endregion - #region GremlinDatabaseResource /// /// 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. /// Returns a object. public static GremlinDatabaseResource GetGremlinDatabaseResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GremlinDatabaseResource.ValidateResourceId(id); - return new GremlinDatabaseResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetGremlinDatabaseResource(id); } - #endregion - #region GremlinGraphResource /// /// 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. /// Returns a object. public static GremlinGraphResource GetGremlinGraphResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - GremlinGraphResource.ValidateResourceId(id); - return new GremlinGraphResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetGremlinGraphResource(id); } - #endregion - #region CosmosDBLocationResource /// /// 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. /// Returns a object. public static CosmosDBLocationResource GetCosmosDBLocationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBLocationResource.ValidateResourceId(id); - return new CosmosDBLocationResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBLocationResource(id); } - #endregion - #region DataTransferJobGetResultResource /// /// 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. /// Returns a object. public static DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataTransferJobGetResultResource.ValidateResourceId(id); - return new DataTransferJobGetResultResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetDataTransferJobGetResultResource(id); } - #endregion - #region CassandraClusterResource /// /// 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. /// Returns a object. public static CassandraClusterResource GetCassandraClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraClusterResource.ValidateResourceId(id); - return new CassandraClusterResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraClusterResource(id); } - #endregion - #region CassandraClusterBackupResource /// /// 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. /// Returns a object. public static CassandraClusterBackupResource GetCassandraClusterBackupResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraClusterBackupResource.ValidateResourceId(id); - return new CassandraClusterBackupResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraClusterBackupResource(id); } - #endregion - #region CassandraDataCenterResource /// /// 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. /// Returns a object. public static CassandraDataCenterResource GetCassandraDataCenterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CassandraDataCenterResource.ValidateResourceId(id); - return new CassandraDataCenterResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCassandraDataCenterResource(id); } - #endregion - #region MongoClusterResource /// /// 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. /// Returns a object. public static MongoClusterResource GetMongoClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MongoClusterResource.ValidateResourceId(id); - return new MongoClusterResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetMongoClusterResource(id); } - #endregion - #region CosmosDBFirewallRuleResource /// /// 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. /// Returns a object. public static CosmosDBFirewallRuleResource GetCosmosDBFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBFirewallRuleResource.ValidateResourceId(id); - return new CosmosDBFirewallRuleResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBFirewallRuleResource(id); } - #endregion - #region CosmosDBPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static CosmosDBPrivateEndpointConnectionResource GetCosmosDBPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBPrivateEndpointConnectionResource.ValidateResourceId(id); - return new CosmosDBPrivateEndpointConnectionResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBPrivateEndpointConnectionResource(id); } - #endregion - #region CosmosDBPrivateLinkResource /// /// 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. /// Returns a object. public static CosmosDBPrivateLinkResource GetCosmosDBPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBPrivateLinkResource.ValidateResourceId(id); - return new CosmosDBPrivateLinkResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBPrivateLinkResource(id); } - #endregion - #region RestorableCosmosDBAccountResource /// /// 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. /// Returns a object. public static RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RestorableCosmosDBAccountResource.ValidateResourceId(id); - return new RestorableCosmosDBAccountResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetRestorableCosmosDBAccountResource(id); } - #endregion - #region CosmosDBServiceResource /// /// 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. /// Returns a object. public static CosmosDBServiceResource GetCosmosDBServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBServiceResource.ValidateResourceId(id); - return new CosmosDBServiceResource(client, id); - } - ); + return GetCosmosDBArmClientMockingExtension(client).GetCosmosDBServiceResource(id); } - #endregion - /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CosmosDBAccountResources and their operations over a CosmosDBAccountResource. public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCosmosDBAccounts(); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBAccounts(); } /// @@ -864,16 +721,20 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// DatabaseAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB database account name. /// The cancellation token to use. - /// 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 static async Task> GetCosmosDBAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCosmosDBAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -888,24 +749,34 @@ public static async Task> GetCosmosDBAccountAs /// DatabaseAccounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB database account name. /// The cancellation token to use. - /// 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 static Response GetCosmosDBAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCosmosDBAccounts().Get(accountName, cancellationToken); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBAccount(accountName, cancellationToken); } - /// Gets a collection of CassandraClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of CassandraClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CassandraClusterResources and their operations over a CassandraClusterResource. public static CassandraClusterCollection GetCassandraClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCassandraClusters(); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCassandraClusters(); } /// @@ -920,16 +791,20 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// CassandraClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Managed Cassandra cluster name. /// The cancellation token to use. - /// 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 static async Task> GetCassandraClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCassandraClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCassandraClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -944,24 +819,34 @@ public static async Task> GetCassandraCluster /// CassandraClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Managed Cassandra cluster name. /// The cancellation token to use. - /// 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 static Response GetCassandraCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCassandraClusters().Get(clusterName, cancellationToken); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetCassandraCluster(clusterName, cancellationToken); } - /// Gets a collection of MongoClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of MongoClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of MongoClusterResources and their operations over a MongoClusterResource. public static MongoClusterCollection GetMongoClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMongoClusters(); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetMongoClusters(); } /// @@ -976,16 +861,20 @@ public static MongoClusterCollection GetMongoClusters(this ResourceGroupResource /// MongoClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the mongo cluster. /// The cancellation token to use. - /// 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 static async Task> GetMongoClusterAsync(this ResourceGroupResource resourceGroupResource, string mongoClusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetMongoClusters().GetAsync(mongoClusterName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetMongoClusterAsync(mongoClusterName, cancellationToken).ConfigureAwait(false); } /// @@ -1000,24 +889,34 @@ public static async Task> GetMongoClusterAsync(th /// MongoClusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the mongo cluster. /// The cancellation token to use. - /// 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 static Response GetMongoCluster(this ResourceGroupResource resourceGroupResource, string mongoClusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetMongoClusters().Get(mongoClusterName, cancellationToken); + return GetCosmosDBResourceGroupMockingExtension(resourceGroupResource).GetMongoCluster(mongoClusterName, cancellationToken); } - /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. + /// + /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CosmosDBLocationResources and their operations over a CosmosDBLocationResource. public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionResource subscriptionResource) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCosmosDBLocations(); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCosmosDBLocations(); } /// @@ -1032,6 +931,10 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// Locations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -1039,7 +942,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR [ForwardsClientCalls] public static async Task> GetCosmosDBLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetCosmosDBLocations().GetAsync(location, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCosmosDBLocationAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -1054,6 +957,10 @@ public static async Task> GetCosmosDBLocation /// Locations_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -1061,7 +968,7 @@ public static async Task> GetCosmosDBLocation [ForwardsClientCalls] public static Response GetCosmosDBLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCosmosDBLocations().Get(location, cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCosmosDBLocation(location, cancellationToken); } /// @@ -1076,13 +983,17 @@ public static Response GetCosmosDBLocation(this Subscr /// DatabaseAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCosmosDBAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCosmosDBAccountsAsync(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCosmosDBAccountsAsync(cancellationToken); } /// @@ -1097,13 +1008,17 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// DatabaseAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCosmosDBAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCosmosDBAccounts(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCosmosDBAccounts(cancellationToken); } /// @@ -1118,13 +1033,17 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// CassandraClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCassandraClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCassandraClustersAsync(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCassandraClustersAsync(cancellationToken); } /// @@ -1139,13 +1058,17 @@ public static AsyncPageable GetCassandraClustersAsync( /// CassandraClusters_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCassandraClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCassandraClusters(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetCassandraClusters(cancellationToken); } /// @@ -1160,13 +1083,17 @@ public static Pageable GetCassandraClusters(this Subsc /// MongoClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMongoClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMongoClustersAsync(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetMongoClustersAsync(cancellationToken); } /// @@ -1181,13 +1108,17 @@ public static AsyncPageable GetMongoClustersAsync(this Sub /// MongoClusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMongoClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMongoClusters(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetMongoClusters(cancellationToken); } /// @@ -1202,13 +1133,17 @@ public static Pageable GetMongoClusters(this SubscriptionR /// RestorableDatabaseAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetRestorableCosmosDBAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRestorableCosmosDBAccountsAsync(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetRestorableCosmosDBAccountsAsync(cancellationToken); } /// @@ -1223,13 +1158,17 @@ public static AsyncPageable GetRestorableCosm /// RestorableDatabaseAccounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetRestorableCosmosDBAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRestorableCosmosDBAccounts(cancellationToken); + return GetCosmosDBSubscriptionMockingExtension(subscriptionResource).GetRestorableCosmosDBAccounts(cancellationToken); } /// @@ -1244,6 +1183,10 @@ public static Pageable GetRestorableCosmosDBA /// DatabaseAccounts_CheckNameExists /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB database account name. @@ -1252,9 +1195,7 @@ public static Pageable GetRestorableCosmosDBA /// is null. public static async Task> CheckNameExistsDatabaseAccountAsync(this TenantResource tenantResource, string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckNameExistsDatabaseAccountAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBTenantMockingExtension(tenantResource).CheckNameExistsDatabaseAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -1269,6 +1210,10 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// DatabaseAccounts_CheckNameExists /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Cosmos DB database account name. @@ -1277,9 +1222,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// is null. public static Response CheckNameExistsDatabaseAccount(this TenantResource tenantResource, string accountName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - return GetTenantResourceExtensionClient(tenantResource).CheckNameExistsDatabaseAccount(accountName, cancellationToken); + return GetCosmosDBTenantMockingExtension(tenantResource).CheckNameExistsDatabaseAccount(accountName, cancellationToken); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBResourceGroupMockingExtension.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..bbef04a8b785 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBResourceGroupMockingExtension.cs @@ -0,0 +1,198 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CosmosDBResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CosmosDBResourceGroupMockingExtension() + { + } + + /// 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 CosmosDBResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. + /// An object representing collection of CosmosDBAccountResources and their operations over a CosmosDBAccountResource. + public virtual CosmosDBAccountCollection GetCosmosDBAccounts() + { + return GetCachedClient(client => new CosmosDBAccountCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB database account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName} + /// + /// + /// Operation Id + /// DatabaseAccounts_Get + /// + /// + /// + /// Cosmos DB database account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCosmosDBAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetCosmosDBAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB database account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName} + /// + /// + /// Operation Id + /// DatabaseAccounts_Get + /// + /// + /// + /// Cosmos DB database account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCosmosDBAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetCosmosDBAccounts().Get(accountName, cancellationToken); + } + + /// Gets a collection of CassandraClusterResources in the ResourceGroupResource. + /// An object representing collection of CassandraClusterResources and their operations over a CassandraClusterResource. + public virtual CassandraClusterCollection GetCassandraClusters() + { + return GetCachedClient(client => new CassandraClusterCollection(client, Id)); + } + + /// + /// Get the properties of a managed Cassandra cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName} + /// + /// + /// Operation Id + /// CassandraClusters_Get + /// + /// + /// + /// Managed Cassandra cluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCassandraClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetCassandraClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a managed Cassandra cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName} + /// + /// + /// Operation Id + /// CassandraClusters_Get + /// + /// + /// + /// Managed Cassandra cluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCassandraCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetCassandraClusters().Get(clusterName, cancellationToken); + } + + /// Gets a collection of MongoClusterResources in the ResourceGroupResource. + /// An object representing collection of MongoClusterResources and their operations over a MongoClusterResource. + public virtual MongoClusterCollection GetMongoClusters() + { + return GetCachedClient(client => new MongoClusterCollection(client, Id)); + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMongoClusterAsync(string mongoClusterName, CancellationToken cancellationToken = default) + { + return await GetMongoClusters().GetAsync(mongoClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMongoCluster(string mongoClusterName, CancellationToken cancellationToken = default) + { + return GetMongoClusters().Get(mongoClusterName, cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBSubscriptionMockingExtension.cs similarity index 80% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBSubscriptionMockingExtension.cs index 045361201fde..2f0c6ae0fdb8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBSubscriptionMockingExtension.cs @@ -6,16 +6,18 @@ #nullable disable using System.Threading; +using System.Threading.Tasks; using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB; -namespace Azure.ResourceManager.CosmosDB +namespace Azure.ResourceManager.CosmosDB.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CosmosDBSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _cosmosDBAccountDatabaseAccountsClientDiagnostics; private DatabaseAccountsRestOperations _cosmosDBAccountDatabaseAccountsRestClient; @@ -26,15 +28,15 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private ClientDiagnostics _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics; private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CosmosDBSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CosmosDBSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -57,7 +59,49 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of CosmosDBLocationResources and their operations over a CosmosDBLocationResource. public virtual CosmosDBLocationCollection GetCosmosDBLocations() { - return GetCachedClient(Client => new CosmosDBLocationCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBLocationCollection(client, Id)); + } + + /// + /// Get the properties of an existing Cosmos DB location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location} + /// + /// + /// Operation Id + /// Locations_Get + /// + /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual async Task> GetCosmosDBLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + return await GetCosmosDBLocations().GetAsync(location, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of an existing Cosmos DB location + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location} + /// + /// + /// Operation Id + /// Locations_Get + /// + /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// The cancellation token to use. + [ForwardsClientCalls] + public virtual Response GetCosmosDBLocation(AzureLocation location, CancellationToken cancellationToken = default) + { + return GetCosmosDBLocations().Get(location, cancellationToken); } /// @@ -78,7 +122,7 @@ public virtual CosmosDBLocationCollection GetCosmosDBLocations() public virtual AsyncPageable GetCosmosDBAccountsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBAccountDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CosmosDBAccountResource(Client, CosmosDBAccountData.DeserializeCosmosDBAccountData(e)), CosmosDBAccountDatabaseAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCosmosDBAccounts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CosmosDBAccountResource(Client, CosmosDBAccountData.DeserializeCosmosDBAccountData(e)), CosmosDBAccountDatabaseAccountsClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetCosmosDBAccounts", "value", null, cancellationToken); } /// @@ -99,7 +143,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C public virtual Pageable GetCosmosDBAccounts(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBAccountDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CosmosDBAccountResource(Client, CosmosDBAccountData.DeserializeCosmosDBAccountData(e)), CosmosDBAccountDatabaseAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCosmosDBAccounts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CosmosDBAccountResource(Client, CosmosDBAccountData.DeserializeCosmosDBAccountData(e)), CosmosDBAccountDatabaseAccountsClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetCosmosDBAccounts", "value", null, cancellationToken); } /// @@ -120,7 +164,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio public virtual AsyncPageable GetCassandraClustersAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => CassandraClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraClusterResource(Client, CassandraClusterData.DeserializeCassandraClusterData(e)), CassandraClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCassandraClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraClusterResource(Client, CassandraClusterData.DeserializeCassandraClusterData(e)), CassandraClusterClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetCassandraClusters", "value", null, cancellationToken); } /// @@ -141,7 +185,7 @@ public virtual AsyncPageable GetCassandraClustersAsync public virtual Pageable GetCassandraClusters(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => CassandraClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraClusterResource(Client, CassandraClusterData.DeserializeCassandraClusterData(e)), CassandraClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCassandraClusters", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraClusterResource(Client, CassandraClusterData.DeserializeCassandraClusterData(e)), CassandraClusterClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetCassandraClusters", "value", null, cancellationToken); } /// @@ -163,7 +207,7 @@ public virtual AsyncPageable GetMongoClustersAsync(Cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => MongoClusterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MongoClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMongoClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetMongoClusters", "value", "nextLink", cancellationToken); } /// @@ -185,7 +229,7 @@ public virtual Pageable GetMongoClusters(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => MongoClusterRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MongoClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMongoClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetMongoClusters", "value", "nextLink", cancellationToken); } /// @@ -206,7 +250,7 @@ public virtual Pageable GetMongoClusters(CancellationToken public virtual AsyncPageable GetRestorableCosmosDBAccountsAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); } /// @@ -227,7 +271,7 @@ public virtual AsyncPageable GetRestorableCos public virtual Pageable GetRestorableCosmosDBAccounts(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "CosmosDBSubscriptionMockingExtension.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBTenantMockingExtension.cs similarity index 77% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBTenantMockingExtension.cs index 30e33cc48028..4186764df142 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBTenantMockingExtension.cs @@ -12,24 +12,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB; -namespace Azure.ResourceManager.CosmosDB +namespace Azure.ResourceManager.CosmosDB.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class CosmosDBTenantMockingExtension : ArmResource { private ClientDiagnostics _cosmosDBAccountDatabaseAccountsClientDiagnostics; private DatabaseAccountsRestOperations _cosmosDBAccountDatabaseAccountsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CosmosDBTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CosmosDBTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -57,9 +58,13 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// Cosmos DB database account name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual async Task> CheckNameExistsDatabaseAccountAsync(string accountName, CancellationToken cancellationToken = default) { - using var scope = CosmosDBAccountDatabaseAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckNameExistsDatabaseAccount"); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = CosmosDBAccountDatabaseAccountsClientDiagnostics.CreateScope("CosmosDBTenantMockingExtension.CheckNameExistsDatabaseAccount"); scope.Start(); try { @@ -88,9 +93,13 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// Cosmos DB database account name. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. public virtual Response CheckNameExistsDatabaseAccount(string accountName, CancellationToken cancellationToken = default) { - using var scope = CosmosDBAccountDatabaseAccountsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckNameExistsDatabaseAccount"); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var scope = CosmosDBAccountDatabaseAccountsClientDiagnostics.CreateScope("CosmosDBTenantMockingExtension.CheckNameExistsDatabaseAccount"); scope.Start(); try { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 16288351d958..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.CosmosDB -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. - /// An object representing collection of CosmosDBAccountResources and their operations over a CosmosDBAccountResource. - public virtual CosmosDBAccountCollection GetCosmosDBAccounts() - { - return GetCachedClient(Client => new CosmosDBAccountCollection(Client, Id)); - } - - /// Gets a collection of CassandraClusterResources in the ResourceGroupResource. - /// An object representing collection of CassandraClusterResources and their operations over a CassandraClusterResource. - public virtual CassandraClusterCollection GetCassandraClusters() - { - return GetCachedClient(Client => new CassandraClusterCollection(Client, Id)); - } - - /// Gets a collection of MongoClusterResources in the ResourceGroupResource. - /// An object representing collection of MongoClusterResources and their operations over a MongoClusterResource. - public virtual MongoClusterCollection GetMongoClusters() - { - return GetCachedClient(Client => new MongoClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs index 2bdd4c627dc8..678226732b76 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs @@ -99,7 +99,7 @@ public virtual GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroug /// An object representing collection of GremlinGraphResources and their operations over a GremlinGraphResource. public virtual GremlinGraphCollection GetGremlinGraphs() { - return GetCachedClient(Client => new GremlinGraphCollection(Client, Id)); + return GetCachedClient(client => new GremlinGraphCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual GremlinGraphCollection GetGremlinGraphs() /// /// Cosmos DB graph name. /// The cancellation token to use. - /// 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> GetGremlinGraphAsync(string graphName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// Cosmos DB graph name. /// The cancellation token to use. - /// 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 GetGremlinGraph(string graphName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs index 7bf5d3b850b6..0e59957f973b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CosmosDBFirewallRuleResources and their operations over a CosmosDBFirewallRuleResource. public virtual CosmosDBFirewallRuleCollection GetCosmosDBFirewallRules() { - return GetCachedClient(Client => new CosmosDBFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBFirewallRuleCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CosmosDBFirewallRuleCollection GetCosmosDBFirewallRules() /// /// The name of the mongo cluster firewall rule. /// The cancellation token to use. - /// 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> GetCosmosDBFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> GetCosmosDBFir /// /// The name of the mongo cluster firewall rule. /// The cancellation token to use. - /// 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 GetCosmosDBFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index adefa62d6d68..40ea72971a32 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -99,7 +99,7 @@ public virtual MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroug /// An object representing collection of MongoDBCollectionResources and their operations over a MongoDBCollectionResource. public virtual MongoDBCollectionCollection GetMongoDBCollections() { - return GetCachedClient(Client => new MongoDBCollectionCollection(Client, Id)); + return GetCachedClient(client => new MongoDBCollectionCollection(client, Id)); } /// @@ -117,8 +117,8 @@ public virtual MongoDBCollectionCollection GetMongoDBCollections() /// /// Cosmos DB collection name. /// The cancellation token to use. - /// 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> GetMongoDBCollectionAsync(string collectionName, CancellationToken cancellationToken = default) { @@ -140,8 +140,8 @@ public virtual async Task> GetMongoDBCollect /// /// Cosmos DB collection name. /// The cancellation token to use. - /// 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 GetMongoDBCollection(string collectionName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/CosmosDBForPostgreSqlClusterResource.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/CosmosDBForPostgreSqlClusterResource.cs index 6463b494de51..2eb00df7e43f 100644 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/CosmosDBForPostgreSqlClusterResource.cs +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/CosmosDBForPostgreSqlClusterResource.cs @@ -93,7 +93,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of CosmosDBForPostgreSqlClusterServerResources and their operations over a CosmosDBForPostgreSqlClusterServerResource. public virtual CosmosDBForPostgreSqlClusterServerCollection GetCosmosDBForPostgreSqlClusterServers() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlClusterServerCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlClusterServerCollection(client, Id)); } /// @@ -111,8 +111,8 @@ public virtual CosmosDBForPostgreSqlClusterServerCollection GetCosmosDBForPostgr /// /// The name of the server. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlClusterServerAsync(string serverName, CancellationToken cancellationToken = default) { @@ -134,8 +134,8 @@ public virtual async Task> /// /// The name of the server. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlClusterServer(string serverName, CancellationToken cancellationToken = default) { @@ -146,7 +146,7 @@ public virtual Response GetCosmosDBF /// An object representing collection of CosmosDBForPostgreSqlConfigurationResources and their operations over a CosmosDBForPostgreSqlConfigurationResource. public virtual CosmosDBForPostgreSqlConfigurationCollection GetCosmosDBForPostgreSqlConfigurations() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlConfigurationCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlConfigurationCollection(client, Id)); } /// @@ -164,8 +164,8 @@ public virtual CosmosDBForPostgreSqlConfigurationCollection GetCosmosDBForPostgr /// /// The name of the cluster configuration. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -187,8 +187,8 @@ public virtual async Task> /// /// The name of the cluster configuration. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -199,7 +199,7 @@ public virtual Response GetCosmosDBF /// An object representing collection of CosmosDBForPostgreSqlCoordinatorConfigurationResources and their operations over a CosmosDBForPostgreSqlCoordinatorConfigurationResource. public virtual CosmosDBForPostgreSqlCoordinatorConfigurationCollection GetCosmosDBForPostgreSqlCoordinatorConfigurations() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlCoordinatorConfigurationCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlCoordinatorConfigurationCollection(client, Id)); } /// @@ -217,8 +217,8 @@ public virtual CosmosDBForPostgreSqlCoordinatorConfigurationCollection GetCosmos /// /// The name of the cluster configuration. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlCoordinatorConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -240,8 +240,8 @@ public virtual async Task /// The name of the cluster configuration. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlCoordinatorConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -252,7 +252,7 @@ public virtual Response G /// An object representing collection of CosmosDBForPostgreSqlNodeConfigurationResources and their operations over a CosmosDBForPostgreSqlNodeConfigurationResource. public virtual CosmosDBForPostgreSqlNodeConfigurationCollection GetCosmosDBForPostgreSqlNodeConfigurations() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlNodeConfigurationCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlNodeConfigurationCollection(client, Id)); } /// @@ -270,8 +270,8 @@ public virtual CosmosDBForPostgreSqlNodeConfigurationCollection GetCosmosDBForPo /// /// The name of the cluster configuration. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlNodeConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -293,8 +293,8 @@ public virtual async Task /// The name of the cluster configuration. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlNodeConfiguration(string configurationName, CancellationToken cancellationToken = default) { @@ -305,7 +305,7 @@ public virtual Response GetCosmo /// An object representing collection of CosmosDBForPostgreSqlFirewallRuleResources and their operations over a CosmosDBForPostgreSqlFirewallRuleResource. public virtual CosmosDBForPostgreSqlFirewallRuleCollection GetCosmosDBForPostgreSqlFirewallRules() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlFirewallRuleCollection(client, Id)); } /// @@ -323,8 +323,8 @@ public virtual CosmosDBForPostgreSqlFirewallRuleCollection GetCosmosDBForPostgre /// /// The name of the cluster firewall rule. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -346,8 +346,8 @@ public virtual async Task> G /// /// The name of the cluster firewall rule. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -358,7 +358,7 @@ public virtual Response GetCosmosDBFo /// An object representing collection of CosmosDBForPostgreSqlRoleResources and their operations over a CosmosDBForPostgreSqlRoleResource. public virtual CosmosDBForPostgreSqlRoleCollection GetCosmosDBForPostgreSqlRoles() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlRoleCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlRoleCollection(client, Id)); } /// @@ -376,8 +376,8 @@ public virtual CosmosDBForPostgreSqlRoleCollection GetCosmosDBForPostgreSqlRoles /// /// The name of the cluster role. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlRoleAsync(string roleName, CancellationToken cancellationToken = default) { @@ -399,8 +399,8 @@ public virtual async Task> GetCosmos /// /// The name of the cluster role. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlRole(string roleName, CancellationToken cancellationToken = default) { @@ -411,7 +411,7 @@ public virtual Response GetCosmosDBForPostgre /// An object representing collection of CosmosDBForPostgreSqlPrivateEndpointConnectionResources and their operations over a CosmosDBForPostgreSqlPrivateEndpointConnectionResource. public virtual CosmosDBForPostgreSqlPrivateEndpointConnectionCollection GetCosmosDBForPostgreSqlPrivateEndpointConnections() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlPrivateEndpointConnectionCollection(client, Id)); } /// @@ -429,8 +429,8 @@ public virtual CosmosDBForPostgreSqlPrivateEndpointConnectionCollection GetCosmo /// /// The name of the private endpoint connection associated with the cluster. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -452,8 +452,8 @@ public virtual async Task /// The name of the private endpoint connection associated with the cluster. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { @@ -464,7 +464,7 @@ public virtual Response /// An object representing collection of CosmosDBForPostgreSqlPrivateLinkResources and their operations over a CosmosDBForPostgreSqlPrivateLinkResource. public virtual CosmosDBForPostgreSqlPrivateLinkResourceCollection GetCosmosDBForPostgreSqlPrivateLinkResources() { - return GetCachedClient(Client => new CosmosDBForPostgreSqlPrivateLinkResourceCollection(Client, Id)); + return GetCachedClient(client => new CosmosDBForPostgreSqlPrivateLinkResourceCollection(client, Id)); } /// @@ -482,8 +482,8 @@ public virtual CosmosDBForPostgreSqlPrivateLinkResourceCollection GetCosmosDBFor /// /// The name of the private link resource. /// The cancellation token to use. - /// 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> GetCosmosDBForPostgreSqlPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) { @@ -505,8 +505,8 @@ public virtual async Task> Ge /// /// The name of the private link resource. /// The cancellation token to use. - /// 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 GetCosmosDBForPostgreSqlPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) { diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlArmClientMockingExtension.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlArmClientMockingExtension.cs new file mode 100644 index 000000000000..a944959e0c6c --- /dev/null +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlArmClientMockingExtension.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDBForPostgreSql; + +namespace Azure.ResourceManager.CosmosDBForPostgreSql.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CosmosDBForPostgreSqlArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CosmosDBForPostgreSqlArmClientMockingExtension() + { + } + + /// 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 CosmosDBForPostgreSqlArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CosmosDBForPostgreSqlArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CosmosDBForPostgreSqlClusterResource GetCosmosDBForPostgreSqlClusterResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlClusterResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlClusterResource(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 CosmosDBForPostgreSqlClusterServerResource GetCosmosDBForPostgreSqlClusterServerResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlClusterServerResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlClusterServerResource(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 CosmosDBForPostgreSqlConfigurationResource GetCosmosDBForPostgreSqlConfigurationResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlConfigurationResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlConfigurationResource(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 CosmosDBForPostgreSqlCoordinatorConfigurationResource GetCosmosDBForPostgreSqlCoordinatorConfigurationResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlCoordinatorConfigurationResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlCoordinatorConfigurationResource(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 CosmosDBForPostgreSqlNodeConfigurationResource GetCosmosDBForPostgreSqlNodeConfigurationResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlNodeConfigurationResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlNodeConfigurationResource(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 CosmosDBForPostgreSqlFirewallRuleResource GetCosmosDBForPostgreSqlFirewallRuleResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlFirewallRuleResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlFirewallRuleResource(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 CosmosDBForPostgreSqlRoleResource GetCosmosDBForPostgreSqlRoleResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlRoleResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlRoleResource(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 CosmosDBForPostgreSqlPrivateEndpointConnectionResource GetCosmosDBForPostgreSqlPrivateEndpointConnectionResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlPrivateEndpointConnectionResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlPrivateEndpointConnectionResource(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 CosmosDBForPostgreSqlPrivateLinkResource GetCosmosDBForPostgreSqlPrivateLinkResource(ResourceIdentifier id) + { + CosmosDBForPostgreSqlPrivateLinkResource.ValidateResourceId(id); + return new CosmosDBForPostgreSqlPrivateLinkResource(Client, id); + } + } +} diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlExtensions.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlExtensions.cs index 4b3c0e12c5f1..fffffe750b8e 100644 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlExtensions.cs +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDBForPostgreSql.Mocking; using Azure.ResourceManager.CosmosDBForPostgreSql.Models; using Azure.ResourceManager.Resources; @@ -19,214 +20,177 @@ namespace Azure.ResourceManager.CosmosDBForPostgreSql /// A class to add extension methods to Azure.ResourceManager.CosmosDBForPostgreSql. public static partial class CosmosDBForPostgreSqlExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CosmosDBForPostgreSqlArmClientMockingExtension GetCosmosDBForPostgreSqlArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CosmosDBForPostgreSqlArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CosmosDBForPostgreSqlResourceGroupMockingExtension GetCosmosDBForPostgreSqlResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CosmosDBForPostgreSqlResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CosmosDBForPostgreSqlSubscriptionMockingExtension GetCosmosDBForPostgreSqlSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CosmosDBForPostgreSqlSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region CosmosDBForPostgreSqlClusterResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlClusterResource GetCosmosDBForPostgreSqlClusterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlClusterResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlClusterResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlClusterResource(id); } - #endregion - #region CosmosDBForPostgreSqlClusterServerResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlClusterServerResource GetCosmosDBForPostgreSqlClusterServerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlClusterServerResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlClusterServerResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlClusterServerResource(id); } - #endregion - #region CosmosDBForPostgreSqlConfigurationResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlConfigurationResource GetCosmosDBForPostgreSqlConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlConfigurationResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlConfigurationResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlConfigurationResource(id); } - #endregion - #region CosmosDBForPostgreSqlCoordinatorConfigurationResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlCoordinatorConfigurationResource GetCosmosDBForPostgreSqlCoordinatorConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlCoordinatorConfigurationResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlCoordinatorConfigurationResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlCoordinatorConfigurationResource(id); } - #endregion - #region CosmosDBForPostgreSqlNodeConfigurationResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlNodeConfigurationResource GetCosmosDBForPostgreSqlNodeConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlNodeConfigurationResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlNodeConfigurationResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlNodeConfigurationResource(id); } - #endregion - #region CosmosDBForPostgreSqlFirewallRuleResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlFirewallRuleResource GetCosmosDBForPostgreSqlFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlFirewallRuleResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlFirewallRuleResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlFirewallRuleResource(id); } - #endregion - #region CosmosDBForPostgreSqlRoleResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlRoleResource GetCosmosDBForPostgreSqlRoleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlRoleResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlRoleResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlRoleResource(id); } - #endregion - #region CosmosDBForPostgreSqlPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlPrivateEndpointConnectionResource GetCosmosDBForPostgreSqlPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlPrivateEndpointConnectionResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlPrivateEndpointConnectionResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlPrivateEndpointConnectionResource(id); } - #endregion - #region CosmosDBForPostgreSqlPrivateLinkResource /// /// 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. /// Returns a object. public static CosmosDBForPostgreSqlPrivateLinkResource GetCosmosDBForPostgreSqlPrivateLinkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - CosmosDBForPostgreSqlPrivateLinkResource.ValidateResourceId(id); - return new CosmosDBForPostgreSqlPrivateLinkResource(client, id); - } - ); + return GetCosmosDBForPostgreSqlArmClientMockingExtension(client).GetCosmosDBForPostgreSqlPrivateLinkResource(id); } - #endregion - /// Gets a collection of CosmosDBForPostgreSqlClusterResources in the ResourceGroupResource. + /// + /// Gets a collection of CosmosDBForPostgreSqlClusterResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of CosmosDBForPostgreSqlClusterResources and their operations over a CosmosDBForPostgreSqlClusterResource. public static CosmosDBForPostgreSqlClusterCollection GetCosmosDBForPostgreSqlClusters(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetCosmosDBForPostgreSqlClusters(); + return GetCosmosDBForPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBForPostgreSqlClusters(); } /// @@ -241,16 +205,20 @@ public static CosmosDBForPostgreSqlClusterCollection GetCosmosDBForPostgreSqlClu /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static async Task> GetCosmosDBForPostgreSqlClusterAsync(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetCosmosDBForPostgreSqlClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBForPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBForPostgreSqlClusterAsync(clusterName, cancellationToken).ConfigureAwait(false); } /// @@ -265,16 +233,20 @@ public static async Task> GetCosm /// Clusters_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the cluster. /// The cancellation token to use. - /// 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 static Response GetCosmosDBForPostgreSqlCluster(this ResourceGroupResource resourceGroupResource, string clusterName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetCosmosDBForPostgreSqlClusters().Get(clusterName, cancellationToken); + return GetCosmosDBForPostgreSqlResourceGroupMockingExtension(resourceGroupResource).GetCosmosDBForPostgreSqlCluster(clusterName, cancellationToken); } /// @@ -289,13 +261,17 @@ public static Response GetCosmosDBForPostg /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCosmosDBForPostgreSqlClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCosmosDBForPostgreSqlClustersAsync(cancellationToken); + return GetCosmosDBForPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetCosmosDBForPostgreSqlClustersAsync(cancellationToken); } /// @@ -310,13 +286,17 @@ public static AsyncPageable GetCosmosDBFor /// Clusters_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCosmosDBForPostgreSqlClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCosmosDBForPostgreSqlClusters(cancellationToken); + return GetCosmosDBForPostgreSqlSubscriptionMockingExtension(subscriptionResource).GetCosmosDBForPostgreSqlClusters(cancellationToken); } /// @@ -331,6 +311,10 @@ public static Pageable GetCosmosDBForPostg /// Clusters_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if cluster name is available. @@ -338,9 +322,7 @@ public static Pageable GetCosmosDBForPostg /// is null. public static async Task> CheckCosmosDBForPostgreSqlClusterNameAvailabilityAsync(this SubscriptionResource subscriptionResource, CosmosDBForPostgreSqlClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCosmosDBForPostgreSqlClusterNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBForPostgreSqlSubscriptionMockingExtension(subscriptionResource).CheckCosmosDBForPostgreSqlClusterNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -355,6 +337,10 @@ public static async TaskClusters_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The required parameters for checking if cluster name is available. @@ -362,9 +348,7 @@ public static async Task is null. public static Response CheckCosmosDBForPostgreSqlClusterNameAvailability(this SubscriptionResource subscriptionResource, CosmosDBForPostgreSqlClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckCosmosDBForPostgreSqlClusterNameAvailability(content, cancellationToken); + return GetCosmosDBForPostgreSqlSubscriptionMockingExtension(subscriptionResource).CheckCosmosDBForPostgreSqlClusterNameAvailability(content, cancellationToken); } } } diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlResourceGroupMockingExtension.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..8684bcd72bfa --- /dev/null +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDBForPostgreSql; + +namespace Azure.ResourceManager.CosmosDBForPostgreSql.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CosmosDBForPostgreSqlResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CosmosDBForPostgreSqlResourceGroupMockingExtension() + { + } + + /// 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 CosmosDBForPostgreSqlResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CosmosDBForPostgreSqlClusterResources in the ResourceGroupResource. + /// An object representing collection of CosmosDBForPostgreSqlClusterResources and their operations over a CosmosDBForPostgreSqlClusterResource. + public virtual CosmosDBForPostgreSqlClusterCollection GetCosmosDBForPostgreSqlClusters() + { + return GetCachedClient(client => new CosmosDBForPostgreSqlClusterCollection(client, Id)); + } + + /// + /// Gets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCosmosDBForPostgreSqlClusterAsync(string clusterName, CancellationToken cancellationToken = default) + { + return await GetCosmosDBForPostgreSqlClusters().GetAsync(clusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/{clusterName} + /// + /// + /// Operation Id + /// Clusters_Get + /// + /// + /// + /// The name of the cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCosmosDBForPostgreSqlCluster(string clusterName, CancellationToken cancellationToken = default) + { + return GetCosmosDBForPostgreSqlClusters().Get(clusterName, cancellationToken); + } + } +} diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlSubscriptionMockingExtension.cs similarity index 84% rename from sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlSubscriptionMockingExtension.cs index 3f97299bef20..b10717f9bbf2 100644 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/CosmosDBForPostgreSqlSubscriptionMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDBForPostgreSql; using Azure.ResourceManager.CosmosDBForPostgreSql.Models; -namespace Azure.ResourceManager.CosmosDBForPostgreSql +namespace Azure.ResourceManager.CosmosDBForPostgreSql.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CosmosDBForPostgreSqlSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _cosmosDBForPostgreSqlClusterClustersClientDiagnostics; private ClustersRestOperations _cosmosDBForPostgreSqlClusterClustersRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CosmosDBForPostgreSqlSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CosmosDBForPostgreSqlSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -63,7 +64,7 @@ public virtual AsyncPageable GetCosmosDBFo { HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBForPostgreSqlClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBForPostgreSqlClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBForPostgreSqlClusterResource(Client, CosmosDBForPostgreSqlClusterData.DeserializeCosmosDBForPostgreSqlClusterData(e)), CosmosDBForPostgreSqlClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCosmosDBForPostgreSqlClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBForPostgreSqlClusterResource(Client, CosmosDBForPostgreSqlClusterData.DeserializeCosmosDBForPostgreSqlClusterData(e)), CosmosDBForPostgreSqlClusterClustersClientDiagnostics, Pipeline, "CosmosDBForPostgreSqlSubscriptionMockingExtension.GetCosmosDBForPostgreSqlClusters", "value", "nextLink", cancellationToken); } /// @@ -85,7 +86,7 @@ public virtual Pageable GetCosmosDBForPost { HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBForPostgreSqlClusterClustersRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBForPostgreSqlClusterClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBForPostgreSqlClusterResource(Client, CosmosDBForPostgreSqlClusterData.DeserializeCosmosDBForPostgreSqlClusterData(e)), CosmosDBForPostgreSqlClusterClustersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCosmosDBForPostgreSqlClusters", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBForPostgreSqlClusterResource(Client, CosmosDBForPostgreSqlClusterData.DeserializeCosmosDBForPostgreSqlClusterData(e)), CosmosDBForPostgreSqlClusterClustersClientDiagnostics, Pipeline, "CosmosDBForPostgreSqlSubscriptionMockingExtension.GetCosmosDBForPostgreSqlClusters", "value", "nextLink", cancellationToken); } /// @@ -103,9 +104,12 @@ public virtual Pageable GetCosmosDBForPost /// /// The required parameters for checking if cluster name is available. /// The cancellation token to use. + /// is null. public virtual async Task> CheckCosmosDBForPostgreSqlClusterNameAvailabilityAsync(CosmosDBForPostgreSqlClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CosmosDBForPostgreSqlClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCosmosDBForPostgreSqlClusterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CosmosDBForPostgreSqlClusterClustersClientDiagnostics.CreateScope("CosmosDBForPostgreSqlSubscriptionMockingExtension.CheckCosmosDBForPostgreSqlClusterNameAvailability"); scope.Start(); try { @@ -134,9 +138,12 @@ public virtual async Task /// The required parameters for checking if cluster name is available. /// The cancellation token to use. + /// is null. public virtual Response CheckCosmosDBForPostgreSqlClusterNameAvailability(CosmosDBForPostgreSqlClusterNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = CosmosDBForPostgreSqlClusterClustersClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckCosmosDBForPostgreSqlClusterNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = CosmosDBForPostgreSqlClusterClustersClientDiagnostics.CreateScope("CosmosDBForPostgreSqlSubscriptionMockingExtension.CheckCosmosDBForPostgreSqlClusterNameAvailability"); scope.Start(); try { diff --git a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index b253817e3d4b..000000000000 --- a/sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.CosmosDBForPostgreSql -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CosmosDBForPostgreSqlClusterResources in the ResourceGroupResource. - /// An object representing collection of CosmosDBForPostgreSqlClusterResources and their operations over a CosmosDBForPostgreSqlClusterResource. - public virtual CosmosDBForPostgreSqlClusterCollection GetCosmosDBForPostgreSqlClusters() - { - return GetCachedClient(Client => new CosmosDBForPostgreSqlClusterCollection(Client, Id)); - } - } -} diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 95011d0e1e1c..000000000000 --- a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.CostManagement.Models; - -namespace Azure.ResourceManager.CostManagement -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - private ClientDiagnostics _benefitRecommendationsClientDiagnostics; - private BenefitRecommendationsRestOperations _benefitRecommendationsRestClient; - private ClientDiagnostics _forecastClientDiagnostics; - private ForecastRestOperations _forecastRestClient; - private ClientDiagnostics _dimensionsClientDiagnostics; - private DimensionsRestOperations _dimensionsRestClient; - private ClientDiagnostics _queryClientDiagnostics; - private QueryRestOperations _queryRestClient; - private ClientDiagnostics _scheduledActionsClientDiagnostics; - private ScheduledActionsRestOperations _scheduledActionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// 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 ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics BenefitRecommendationsClientDiagnostics => _benefitRecommendationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private BenefitRecommendationsRestOperations BenefitRecommendationsRestClient => _benefitRecommendationsRestClient ??= new BenefitRecommendationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ForecastClientDiagnostics => _forecastClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ForecastRestOperations ForecastRestClient => _forecastRestClient ??= new ForecastRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics DimensionsClientDiagnostics => _dimensionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private DimensionsRestOperations DimensionsRestClient => _dimensionsRestClient ??= new DimensionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics QueryClientDiagnostics => _queryClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private QueryRestOperations QueryRestClient => _queryRestClient ??= new QueryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ScheduledActionsClientDiagnostics => _scheduledActionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ScheduledActionsRestOperations ScheduledActionsRestClient => _scheduledActionsRestClient ??= new ScheduledActionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of CostManagementExportResources in the ArmResource. - /// An object representing collection of CostManagementExportResources and their operations over a CostManagementExportResource. - public virtual CostManagementExportCollection GetCostManagementExports() - { - return GetCachedClient(Client => new CostManagementExportCollection(Client, Id)); - } - - /// Gets a collection of CostManagementViewsResources in the ArmResource. - /// An object representing collection of CostManagementViewsResources and their operations over a CostManagementViewsResource. - public virtual CostManagementViewsCollection GetAllCostManagementViews() - { - return GetCachedClient(Client => new CostManagementViewsCollection(Client, Id)); - } - - /// Gets a collection of CostManagementAlertResources in the ArmResource. - /// An object representing collection of CostManagementAlertResources and their operations over a CostManagementAlertResource. - public virtual CostManagementAlertCollection GetCostManagementAlerts() - { - return GetCachedClient(Client => new CostManagementAlertCollection(Client, Id)); - } - - /// Gets a collection of ScheduledActionResources in the ArmResource. - /// An object representing collection of ScheduledActionResources and their operations over a ScheduledActionResource. - public virtual ScheduledActionCollection GetScheduledActions() - { - return GetCachedClient(Client => new ScheduledActionCollection(Client, Id)); - } - - /// - /// List of recommendations for purchasing savings plan. - /// - /// - /// Request Path - /// /{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations - /// - /// - /// Operation Id - /// BenefitRecommendations_List - /// - /// - /// - /// Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. - /// May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause. - /// May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBenefitRecommendationsAsync(string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitRecommendationsRestClient.CreateListRequest(Id, filter, orderby, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitRecommendationsRestClient.CreateListNextPageRequest(nextLink, Id, filter, orderby, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitRecommendationModel.DeserializeBenefitRecommendationModel, BenefitRecommendationsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetBenefitRecommendations", "value", "nextLink", cancellationToken); - } - - /// - /// List of recommendations for purchasing savings plan. - /// - /// - /// Request Path - /// /{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations - /// - /// - /// Operation Id - /// BenefitRecommendations_List - /// - /// - /// - /// Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. - /// May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause. - /// May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBenefitRecommendations(string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitRecommendationsRestClient.CreateListRequest(Id, filter, orderby, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitRecommendationsRestClient.CreateListNextPageRequest(nextLink, Id, filter, orderby, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitRecommendationModel.DeserializeBenefitRecommendationModel, BenefitRecommendationsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetBenefitRecommendations", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the forecast charges for scope defined. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/forecast - /// - /// - /// Operation Id - /// Forecast_Usage - /// - /// - /// - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. - /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - /// The cancellation token to use. - public virtual async Task> UsageForecastAsync(ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) - { - using var scope = ForecastClientDiagnostics.CreateScope("ArmResourceExtensionClient.UsageForecast"); - scope.Start(); - try - { - var response = await ForecastRestClient.UsageAsync(Id, forecastDefinition, filter, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the forecast charges for scope defined. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/forecast - /// - /// - /// Operation Id - /// Forecast_Usage - /// - /// - /// - /// Parameters supplied to the CreateOrUpdate Forecast Config operation. - /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - /// The cancellation token to use. - public virtual Response UsageForecast(ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) - { - using var scope = ForecastClientDiagnostics.CreateScope("ArmResourceExtensionClient.UsageForecast"); - scope.Start(); - try - { - var response = ForecastRestClient.Usage(Id, forecastDefinition, filter, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the dimensions by the defined scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/dimensions - /// - /// - /// Operation Id - /// Dimensions_List - /// - /// - /// - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. - /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N dimension data. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDimensionsAsync(string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateListRequest(Id, filter, expand, skiptoken, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetDimensions", "value", null, cancellationToken); - } - - /// - /// Lists the dimensions by the defined scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/dimensions - /// - /// - /// Operation Id - /// Dimensions_List - /// - /// - /// - /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. - /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. - /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N dimension data. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDimensions(string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateListRequest(Id, filter, expand, skiptoken, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "ArmResourceExtensionClient.GetDimensions", "value", null, cancellationToken); - } - - /// - /// Query the usage data for scope defined. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/query - /// - /// - /// Operation Id - /// Query_Usage - /// - /// - /// - /// Parameters supplied to the CreateOrUpdate Query Config operation. - /// The cancellation token to use. - public virtual async Task> UsageQueryAsync(QueryDefinition queryDefinition, CancellationToken cancellationToken = default) - { - using var scope = QueryClientDiagnostics.CreateScope("ArmResourceExtensionClient.UsageQuery"); - scope.Start(); - try - { - var response = await QueryRestClient.UsageAsync(Id, queryDefinition, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Query the usage data for scope defined. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/query - /// - /// - /// Operation Id - /// Query_Usage - /// - /// - /// - /// Parameters supplied to the CreateOrUpdate Query Config operation. - /// The cancellation token to use. - public virtual Response UsageQuery(QueryDefinition queryDefinition, CancellationToken cancellationToken = default) - { - using var scope = QueryClientDiagnostics.CreateScope("ArmResourceExtensionClient.UsageQuery"); - scope.Start(); - try - { - var response = QueryRestClient.Usage(Id, queryDefinition, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks availability and correctness of the name for a scheduled action within the given scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/checkNameAvailability - /// - /// - /// Operation Id - /// ScheduledActions_CheckNameAvailabilityByScope - /// - /// - /// - /// Scheduled action to be created or updated. - /// The cancellation token to use. - public virtual async Task> CheckCostManagementNameAvailabilityByScopeScheduledActionAsync(CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = ScheduledActionsClientDiagnostics.CreateScope("ArmResourceExtensionClient.CheckCostManagementNameAvailabilityByScopeScheduledAction"); - scope.Start(); - try - { - var response = await ScheduledActionsRestClient.CheckNameAvailabilityByScopeAsync(Id, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks availability and correctness of the name for a scheduled action within the given scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.CostManagement/checkNameAvailability - /// - /// - /// Operation Id - /// ScheduledActions_CheckNameAvailabilityByScope - /// - /// - /// - /// Scheduled action to be created or updated. - /// The cancellation token to use. - public virtual Response CheckCostManagementNameAvailabilityByScopeScheduledAction(CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - using var scope = ScheduledActionsClientDiagnostics.CreateScope("ArmResourceExtensionClient.CheckCostManagementNameAvailabilityByScopeScheduledAction"); - scope.Start(); - try - { - var response = ScheduledActionsRestClient.CheckNameAvailabilityByScope(Id, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementArmClientMockingExtension.cs b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementArmClientMockingExtension.cs new file mode 100644 index 000000000000..9390e736e594 --- /dev/null +++ b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementArmClientMockingExtension.cs @@ -0,0 +1,679 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.CostManagement; +using Azure.ResourceManager.CostManagement.Models; + +namespace Azure.ResourceManager.CostManagement.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CostManagementArmClientMockingExtension : ArmResource + { + private ClientDiagnostics _benefitRecommendationsClientDiagnostics; + private BenefitRecommendationsRestOperations _benefitRecommendationsRestClient; + private ClientDiagnostics _forecastClientDiagnostics; + private ForecastRestOperations _forecastRestClient; + private ClientDiagnostics _dimensionsClientDiagnostics; + private DimensionsRestOperations _dimensionsRestClient; + private ClientDiagnostics _queryClientDiagnostics; + private QueryRestOperations _queryRestClient; + private ClientDiagnostics _scheduledActionsClientDiagnostics; + private ScheduledActionsRestOperations _scheduledActionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected CostManagementArmClientMockingExtension() + { + } + + /// 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 CostManagementArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CostManagementArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private ClientDiagnostics BenefitRecommendationsClientDiagnostics => _benefitRecommendationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private BenefitRecommendationsRestOperations BenefitRecommendationsRestClient => _benefitRecommendationsRestClient ??= new BenefitRecommendationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ForecastClientDiagnostics => _forecastClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ForecastRestOperations ForecastRestClient => _forecastRestClient ??= new ForecastRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics DimensionsClientDiagnostics => _dimensionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private DimensionsRestOperations DimensionsRestClient => _dimensionsRestClient ??= new DimensionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics QueryClientDiagnostics => _queryClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private QueryRestOperations QueryRestClient => _queryRestClient ??= new QueryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ScheduledActionsClientDiagnostics => _scheduledActionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CostManagement", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ScheduledActionsRestOperations ScheduledActionsRestClient => _scheduledActionsRestClient ??= new ScheduledActionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CostManagementExportResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of CostManagementExportResources and their operations over a CostManagementExportResource. + public virtual CostManagementExportCollection GetCostManagementExports(ResourceIdentifier scope) + { + return new CostManagementExportCollection(Client, scope); + } + + /// + /// The operation to get the export for the defined scope by export name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/exports/{exportName} + /// + /// + /// Operation Id + /// Exports_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Export Name. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 runs of the export. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCostManagementExportAsync(ResourceIdentifier scope, string exportName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetCostManagementExports(scope).GetAsync(exportName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation to get the export for the defined scope by export name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/exports/{exportName} + /// + /// + /// Operation Id + /// Exports_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Export Name. + /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 runs of the export. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCostManagementExport(ResourceIdentifier scope, string exportName, string expand = null, CancellationToken cancellationToken = default) + { + return GetCostManagementExports(scope).Get(exportName, expand, cancellationToken); + } + + /// Gets a collection of CostManagementViewsResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of CostManagementViewsResources and their operations over a CostManagementViewsResource. + public virtual CostManagementViewsCollection GetAllCostManagementViews(ResourceIdentifier scope) + { + return new CostManagementViewsCollection(Client, scope); + } + + /// + /// Gets the view for the defined scope by view name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/views/{viewName} + /// + /// + /// Operation Id + /// Views_GetByScope + /// + /// + /// + /// The scope that the resource will apply against. + /// View name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCostManagementViewsAsync(ResourceIdentifier scope, string viewName, CancellationToken cancellationToken = default) + { + return await GetAllCostManagementViews(scope).GetAsync(viewName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the view for the defined scope by view name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/views/{viewName} + /// + /// + /// Operation Id + /// Views_GetByScope + /// + /// + /// + /// The scope that the resource will apply against. + /// View name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCostManagementViews(ResourceIdentifier scope, string viewName, CancellationToken cancellationToken = default) + { + return GetAllCostManagementViews(scope).Get(viewName, cancellationToken); + } + + /// Gets a collection of CostManagementAlertResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of CostManagementAlertResources and their operations over a CostManagementAlertResource. + public virtual CostManagementAlertCollection GetCostManagementAlerts(ResourceIdentifier scope) + { + return new CostManagementAlertCollection(Client, scope); + } + + /// + /// Gets the alert for the scope by alert ID. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/alerts/{alertId} + /// + /// + /// Operation Id + /// Alerts_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Alert ID. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetCostManagementAlertAsync(ResourceIdentifier scope, string alertId, CancellationToken cancellationToken = default) + { + return await GetCostManagementAlerts(scope).GetAsync(alertId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the alert for the scope by alert ID. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/alerts/{alertId} + /// + /// + /// Operation Id + /// Alerts_Get + /// + /// + /// + /// The scope that the resource will apply against. + /// Alert ID. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetCostManagementAlert(ResourceIdentifier scope, string alertId, CancellationToken cancellationToken = default) + { + return GetCostManagementAlerts(scope).Get(alertId, cancellationToken); + } + + /// Gets a collection of ScheduledActionResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of ScheduledActionResources and their operations over a ScheduledActionResource. + public virtual ScheduledActionCollection GetScheduledActions(ResourceIdentifier scope) + { + return new ScheduledActionCollection(Client, scope); + } + + /// + /// Get the shared scheduled action from the given scope by name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/scheduledActions/{name} + /// + /// + /// Operation Id + /// ScheduledActions_GetByScope + /// + /// + /// + /// The scope that the resource will apply against. + /// Scheduled action name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetScheduledActionAsync(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return await GetScheduledActions(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the shared scheduled action from the given scope by name. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/scheduledActions/{name} + /// + /// + /// Operation Id + /// ScheduledActions_GetByScope + /// + /// + /// + /// The scope that the resource will apply against. + /// Scheduled action name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetScheduledAction(ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) + { + return GetScheduledActions(scope).Get(name, cancellationToken); + } + + /// + /// List of recommendations for purchasing savings plan. + /// + /// + /// Request Path + /// /{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations + /// + /// + /// Operation Id + /// BenefitRecommendations_List + /// + /// + /// + /// The scope to use. + /// Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. + /// May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause. + /// May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetBenefitRecommendationsAsync(ResourceIdentifier scope, string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitRecommendationsRestClient.CreateListRequest(scope, filter, orderby, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter, orderby, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitRecommendationModel.DeserializeBenefitRecommendationModel, BenefitRecommendationsClientDiagnostics, Pipeline, "CostManagementArmClientMockingExtension.GetBenefitRecommendations", "value", "nextLink", cancellationToken); + } + + /// + /// List of recommendations for purchasing savings plan. + /// + /// + /// Request Path + /// /{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations + /// + /// + /// Operation Id + /// BenefitRecommendations_List + /// + /// + /// + /// The scope to use. + /// Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; properties/subscriptionId; properties/resourceGroup. + /// May be used to order the recommendations by: properties/armSkuName. For the savings plan, the results are in order by default. There is no need to use this clause. + /// May be used to expand the properties by: properties/usage, properties/allRecommendationDetails. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetBenefitRecommendations(ResourceIdentifier scope, string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitRecommendationsRestClient.CreateListRequest(scope, filter, orderby, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter, orderby, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitRecommendationModel.DeserializeBenefitRecommendationModel, BenefitRecommendationsClientDiagnostics, Pipeline, "CostManagementArmClientMockingExtension.GetBenefitRecommendations", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the forecast charges for scope defined. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/forecast + /// + /// + /// Operation Id + /// Forecast_Usage + /// + /// + /// + /// The scope to use. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// The cancellation token to use. + /// is null. + public virtual async Task> UsageForecastAsync(ResourceIdentifier scope, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); + + using var scope0 = ForecastClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.UsageForecast"); + scope0.Start(); + try + { + var response = await ForecastRestClient.UsageAsync(scope, forecastDefinition, filter, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Lists the forecast charges for scope defined. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/forecast + /// + /// + /// Operation Id + /// Forecast_Usage + /// + /// + /// + /// The scope to use. + /// Parameters supplied to the CreateOrUpdate Forecast Config operation. + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// The cancellation token to use. + /// is null. + public virtual Response UsageForecast(ResourceIdentifier scope, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); + + using var scope0 = ForecastClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.UsageForecast"); + scope0.Start(); + try + { + var response = ForecastRestClient.Usage(scope, forecastDefinition, filter, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Lists the dimensions by the defined scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/dimensions + /// + /// + /// Operation Id + /// Dimensions_List + /// + /// + /// + /// The scope to use. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. + /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N dimension data. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDimensionsAsync(ResourceIdentifier scope, string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateListRequest(scope, filter, expand, skiptoken, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "CostManagementArmClientMockingExtension.GetDimensions", "value", null, cancellationToken); + } + + /// + /// Lists the dimensions by the defined scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/dimensions + /// + /// + /// Operation Id + /// Dimensions_List + /// + /// + /// + /// The scope to use. + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. + /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N dimension data. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDimensions(ResourceIdentifier scope, string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateListRequest(scope, filter, expand, skiptoken, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "CostManagementArmClientMockingExtension.GetDimensions", "value", null, cancellationToken); + } + + /// + /// Query the usage data for scope defined. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/query + /// + /// + /// Operation Id + /// Query_Usage + /// + /// + /// + /// The scope to use. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UsageQueryAsync(ResourceIdentifier scope, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); + + using var scope0 = QueryClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.UsageQuery"); + scope0.Start(); + try + { + var response = await QueryRestClient.UsageAsync(scope, queryDefinition, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Query the usage data for scope defined. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/query + /// + /// + /// Operation Id + /// Query_Usage + /// + /// + /// + /// The scope to use. + /// Parameters supplied to the CreateOrUpdate Query Config operation. + /// The cancellation token to use. + /// is null. + public virtual Response UsageQuery(ResourceIdentifier scope, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); + + using var scope0 = QueryClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.UsageQuery"); + scope0.Start(); + try + { + var response = QueryRestClient.Usage(scope, queryDefinition, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Checks availability and correctness of the name for a scheduled action within the given scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/checkNameAvailability + /// + /// + /// Operation Id + /// ScheduledActions_CheckNameAvailabilityByScope + /// + /// + /// + /// The scope to use. + /// Scheduled action to be created or updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckCostManagementNameAvailabilityByScopeScheduledActionAsync(ResourceIdentifier scope, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope0 = ScheduledActionsClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.CheckCostManagementNameAvailabilityByScopeScheduledAction"); + scope0.Start(); + try + { + var response = await ScheduledActionsRestClient.CheckNameAvailabilityByScopeAsync(scope, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + + /// + /// Checks availability and correctness of the name for a scheduled action within the given scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.CostManagement/checkNameAvailability + /// + /// + /// Operation Id + /// ScheduledActions_CheckNameAvailabilityByScope + /// + /// + /// + /// The scope to use. + /// Scheduled action to be created or updated. + /// The cancellation token to use. + /// is null. + public virtual Response CheckCostManagementNameAvailabilityByScopeScheduledAction(ResourceIdentifier scope, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope0 = ScheduledActionsClientDiagnostics.CreateScope("CostManagementArmClientMockingExtension.CheckCostManagementNameAvailabilityByScopeScheduledAction"); + scope0.Start(); + try + { + var response = ScheduledActionsRestClient.CheckNameAvailabilityByScope(scope, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope0.Failed(e); + throw; + } + } + /// + /// 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 CostManagementExportResource GetCostManagementExportResource(ResourceIdentifier id) + { + CostManagementExportResource.ValidateResourceId(id); + return new CostManagementExportResource(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 TenantsCostManagementViewsResource GetTenantsCostManagementViewsResource(ResourceIdentifier id) + { + TenantsCostManagementViewsResource.ValidateResourceId(id); + return new TenantsCostManagementViewsResource(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 CostManagementViewsResource GetCostManagementViewsResource(ResourceIdentifier id) + { + CostManagementViewsResource.ValidateResourceId(id); + return new CostManagementViewsResource(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 CostManagementAlertResource GetCostManagementAlertResource(ResourceIdentifier id) + { + CostManagementAlertResource.ValidateResourceId(id); + return new CostManagementAlertResource(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 TenantScheduledActionResource GetTenantScheduledActionResource(ResourceIdentifier id) + { + TenantScheduledActionResource.ValidateResourceId(id); + return new TenantScheduledActionResource(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 ScheduledActionResource GetScheduledActionResource(ResourceIdentifier id) + { + ScheduledActionResource.ValidateResourceId(id); + return new ScheduledActionResource(Client, id); + } + } +} diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementExtensions.cs b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementExtensions.cs index ba58d05238a8..c5369509781d 100644 --- a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementExtensions.cs +++ b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.CostManagement.Mocking; using Azure.ResourceManager.CostManagement.Models; using Azure.ResourceManager.Resources; @@ -19,158 +20,29 @@ namespace Azure.ResourceManager.CostManagement /// A class to add extension methods to Azure.ResourceManager.CostManagement. public static partial class CostManagementExtensions { - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmResource resource) + private static CostManagementArmClientMockingExtension GetCostManagementArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ArmResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CostManagementArmClientMockingExtension(client0)); } - private static ArmResourceExtensionClient GetArmResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CostManagementTenantMockingExtension GetCostManagementTenantMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CostManagementTenantMockingExtension(client, resource.Id)); } - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmResource resource) - { - return resource.GetCachedClient(client => - { - return new TenantResourceExtensionClient(client, resource.Id); - }); - } - - private static TenantResourceExtensionClient GetTenantResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new TenantResourceExtensionClient(client, scope); - }); - } - #region CostManagementExportResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CostManagementExportResource GetCostManagementExportResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CostManagementExportResource.ValidateResourceId(id); - return new CostManagementExportResource(client, id); - } - ); - } - #endregion - - #region TenantsCostManagementViewsResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantsCostManagementViewsResource GetTenantsCostManagementViewsResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantsCostManagementViewsResource.ValidateResourceId(id); - return new TenantsCostManagementViewsResource(client, id); - } - ); - } - #endregion - - #region CostManagementViewsResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CostManagementViewsResource GetCostManagementViewsResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CostManagementViewsResource.ValidateResourceId(id); - return new CostManagementViewsResource(client, id); - } - ); - } - #endregion - - #region CostManagementAlertResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CostManagementAlertResource GetCostManagementAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CostManagementAlertResource.ValidateResourceId(id); - return new CostManagementAlertResource(client, id); - } - ); - } - #endregion - - #region TenantScheduledActionResource - /// - /// 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 instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantScheduledActionResource GetTenantScheduledActionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantScheduledActionResource.ValidateResourceId(id); - return new TenantScheduledActionResource(client, id); - } - ); - } - #endregion - - #region ScheduledActionResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets a collection of CostManagementExportResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ScheduledActionResource GetScheduledActionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ScheduledActionResource.ValidateResourceId(id); - return new ScheduledActionResource(client, id); - } - ); - } - #endregion - - /// Gets a collection of CostManagementExportResources in the ArmResource. - /// The instance the method will execute against. /// The scope that the resource will apply against. /// An object representing collection of CostManagementExportResources and their operations over a CostManagementExportResource. public static CostManagementExportCollection GetCostManagementExports(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetCostManagementExports(); + return GetCostManagementArmClientMockingExtension(client).GetCostManagementExports(scope); } /// @@ -185,18 +57,22 @@ public static CostManagementExportCollection GetCostManagementExports(this ArmCl /// Exports_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Export Name. /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 runs of the export. /// The cancellation token to use. - /// 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 static async Task> GetCostManagementExportAsync(this ArmClient client, ResourceIdentifier scope, string exportName, string expand = null, CancellationToken cancellationToken = default) { - return await client.GetCostManagementExports(scope).GetAsync(exportName, expand, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).GetCostManagementExportAsync(scope, exportName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -211,27 +87,37 @@ public static async Task> GetCostManageme /// Exports_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Export Name. /// May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 runs of the export. /// The cancellation token to use. - /// 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 static Response GetCostManagementExport(this ArmClient client, ResourceIdentifier scope, string exportName, string expand = null, CancellationToken cancellationToken = default) { - return client.GetCostManagementExports(scope).Get(exportName, expand, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetCostManagementExport(scope, exportName, expand, cancellationToken); } - /// Gets a collection of CostManagementViewsResources in the ArmResource. + /// + /// Gets a collection of CostManagementViewsResources 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. /// An object representing collection of CostManagementViewsResources and their operations over a CostManagementViewsResource. public static CostManagementViewsCollection GetAllCostManagementViews(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetAllCostManagementViews(); + return GetCostManagementArmClientMockingExtension(client).GetAllCostManagementViews(scope); } /// @@ -246,17 +132,21 @@ public static CostManagementViewsCollection GetAllCostManagementViews(this ArmCl /// Views_GetByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// View name. /// The cancellation token to use. - /// 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 static async Task> GetCostManagementViewsAsync(this ArmClient client, ResourceIdentifier scope, string viewName, CancellationToken cancellationToken = default) { - return await client.GetAllCostManagementViews(scope).GetAsync(viewName, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).GetCostManagementViewsAsync(scope, viewName, cancellationToken).ConfigureAwait(false); } /// @@ -271,26 +161,36 @@ public static async Task> GetCostManagemen /// Views_GetByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// View name. /// The cancellation token to use. - /// 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 static Response GetCostManagementViews(this ArmClient client, ResourceIdentifier scope, string viewName, CancellationToken cancellationToken = default) { - return client.GetAllCostManagementViews(scope).Get(viewName, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetCostManagementViews(scope, viewName, cancellationToken); } - /// Gets a collection of CostManagementAlertResources in the ArmResource. + /// + /// Gets a collection of CostManagementAlertResources 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. /// An object representing collection of CostManagementAlertResources and their operations over a CostManagementAlertResource. public static CostManagementAlertCollection GetCostManagementAlerts(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetCostManagementAlerts(); + return GetCostManagementArmClientMockingExtension(client).GetCostManagementAlerts(scope); } /// @@ -305,6 +205,10 @@ public static CostManagementAlertCollection GetCostManagementAlerts(this ArmClie /// Alerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -314,7 +218,7 @@ public static CostManagementAlertCollection GetCostManagementAlerts(this ArmClie [ForwardsClientCalls] public static async Task> GetCostManagementAlertAsync(this ArmClient client, ResourceIdentifier scope, string alertId, CancellationToken cancellationToken = default) { - return await client.GetCostManagementAlerts(scope).GetAsync(alertId, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).GetCostManagementAlertAsync(scope, alertId, cancellationToken).ConfigureAwait(false); } /// @@ -329,6 +233,10 @@ public static async Task> GetCostManagemen /// Alerts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -338,16 +246,22 @@ public static async Task> GetCostManagemen [ForwardsClientCalls] public static Response GetCostManagementAlert(this ArmClient client, ResourceIdentifier scope, string alertId, CancellationToken cancellationToken = default) { - return client.GetCostManagementAlerts(scope).Get(alertId, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetCostManagementAlert(scope, alertId, cancellationToken); } - /// Gets a collection of ScheduledActionResources in the ArmResource. + /// + /// Gets a collection of ScheduledActionResources 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. /// An object representing collection of ScheduledActionResources and their operations over a ScheduledActionResource. public static ScheduledActionCollection GetScheduledActions(this ArmClient client, ResourceIdentifier scope) { - return GetArmResourceExtensionClient(client, scope).GetScheduledActions(); + return GetCostManagementArmClientMockingExtension(client).GetScheduledActions(scope); } /// @@ -362,17 +276,21 @@ public static ScheduledActionCollection GetScheduledActions(this ArmClient clien /// ScheduledActions_GetByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Scheduled action name. /// The cancellation token to use. - /// 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 static async Task> GetScheduledActionAsync(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return await client.GetScheduledActions(scope).GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).GetScheduledActionAsync(scope, name, cancellationToken).ConfigureAwait(false); } /// @@ -387,17 +305,21 @@ public static async Task> GetScheduledActionAs /// ScheduledActions_GetByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// Scheduled action name. /// The cancellation token to use. - /// 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 static Response GetScheduledAction(this ArmClient client, ResourceIdentifier scope, string name, CancellationToken cancellationToken = default) { - return client.GetScheduledActions(scope).Get(name, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetScheduledAction(scope, name, cancellationToken); } /// @@ -412,6 +334,10 @@ public static Response GetScheduledAction(this ArmClien /// BenefitRecommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -421,7 +347,7 @@ public static Response GetScheduledAction(this ArmClien /// The cancellation token to use. public static AsyncPageable GetBenefitRecommendationsAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetBenefitRecommendationsAsync(filter, orderby, expand, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetBenefitRecommendationsAsync(scope, filter, orderby, expand, cancellationToken); } /// @@ -436,6 +362,10 @@ public static AsyncPageable GetBenefitRecommendation /// BenefitRecommendations_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -445,7 +375,7 @@ public static AsyncPageable GetBenefitRecommendation /// The cancellation token to use. public static Pageable GetBenefitRecommendations(this ArmClient client, ResourceIdentifier scope, string filter = null, string orderby = null, string expand = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetBenefitRecommendations(filter, orderby, expand, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetBenefitRecommendations(scope, filter, orderby, expand, cancellationToken); } /// @@ -460,6 +390,10 @@ public static Pageable GetBenefitRecommendations(thi /// Forecast_Usage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -469,9 +403,7 @@ public static Pageable GetBenefitRecommendations(thi /// is null. public static async Task> UsageForecastAsync(this ArmClient client, ResourceIdentifier scope, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); - - return await GetArmResourceExtensionClient(client, scope).UsageForecastAsync(forecastDefinition, filter, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).UsageForecastAsync(scope, forecastDefinition, filter, cancellationToken).ConfigureAwait(false); } /// @@ -486,6 +418,10 @@ public static async Task> UsageForecastAsync(this ArmCl /// Forecast_Usage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -495,9 +431,7 @@ public static async Task> UsageForecastAsync(this ArmCl /// is null. public static Response UsageForecast(this ArmClient client, ResourceIdentifier scope, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); - - return GetArmResourceExtensionClient(client, scope).UsageForecast(forecastDefinition, filter, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).UsageForecast(scope, forecastDefinition, filter, cancellationToken); } /// @@ -512,6 +446,10 @@ public static Response UsageForecast(this ArmClient client, Reso /// Dimensions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -522,7 +460,7 @@ public static Response UsageForecast(this ArmClient client, Reso /// The cancellation token to use. public static AsyncPageable GetDimensionsAsync(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetDimensionsAsync(filter, expand, skiptoken, top, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetDimensionsAsync(scope, filter, expand, skiptoken, top, cancellationToken); } /// @@ -537,6 +475,10 @@ public static AsyncPageable GetDimensionsAsync(this Arm /// Dimensions_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -547,7 +489,7 @@ public static AsyncPageable GetDimensionsAsync(this Arm /// The cancellation token to use. public static Pageable GetDimensions(this ArmClient client, ResourceIdentifier scope, string filter = null, string expand = null, string skiptoken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetArmResourceExtensionClient(client, scope).GetDimensions(filter, expand, skiptoken, top, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).GetDimensions(scope, filter, expand, skiptoken, top, cancellationToken); } /// @@ -562,6 +504,10 @@ public static Pageable GetDimensions(this ArmClient cli /// Query_Usage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -570,9 +516,7 @@ public static Pageable GetDimensions(this ArmClient cli /// is null. public static async Task> UsageQueryAsync(this ArmClient client, ResourceIdentifier scope, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); - - return await GetArmResourceExtensionClient(client, scope).UsageQueryAsync(queryDefinition, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).UsageQueryAsync(scope, queryDefinition, cancellationToken).ConfigureAwait(false); } /// @@ -587,6 +531,10 @@ public static async Task> UsageQueryAsync(this ArmClient c /// Query_Usage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -595,9 +543,7 @@ public static async Task> UsageQueryAsync(this ArmClient c /// is null. public static Response UsageQuery(this ArmClient client, ResourceIdentifier scope, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); - - return GetArmResourceExtensionClient(client, scope).UsageQuery(queryDefinition, cancellationToken); + return GetCostManagementArmClientMockingExtension(client).UsageQuery(scope, queryDefinition, cancellationToken); } /// @@ -612,6 +558,10 @@ public static Response UsageQuery(this ArmClient client, ResourceId /// ScheduledActions_CheckNameAvailabilityByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -620,9 +570,7 @@ public static Response UsageQuery(this ArmClient client, ResourceId /// is null. public static async Task> CheckCostManagementNameAvailabilityByScopeScheduledActionAsync(this ArmClient client, ResourceIdentifier scope, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetArmResourceExtensionClient(client, scope).CheckCostManagementNameAvailabilityByScopeScheduledActionAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementArmClientMockingExtension(client).CheckCostManagementNameAvailabilityByScopeScheduledActionAsync(scope, content, cancellationToken).ConfigureAwait(false); } /// @@ -637,6 +585,10 @@ public static async Task> CheckCo /// ScheduledActions_CheckNameAvailabilityByScope /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. @@ -645,17 +597,117 @@ public static async Task> CheckCo /// is null. public static Response CheckCostManagementNameAvailabilityByScopeScheduledAction(this ArmClient client, ResourceIdentifier scope, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + return GetCostManagementArmClientMockingExtension(client).CheckCostManagementNameAvailabilityByScopeScheduledAction(scope, content, 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. + /// Returns a object. + public static CostManagementExportResource GetCostManagementExportResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetCostManagementExportResource(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. + /// Returns a object. + public static TenantsCostManagementViewsResource GetTenantsCostManagementViewsResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetTenantsCostManagementViewsResource(id); + } - return GetArmResourceExtensionClient(client, scope).CheckCostManagementNameAvailabilityByScopeScheduledAction(content, 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. + /// Returns a object. + public static CostManagementViewsResource GetCostManagementViewsResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetCostManagementViewsResource(id); } - /// Gets a collection of TenantsCostManagementViewsResources in the TenantResource. + /// + /// 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. + /// Returns a object. + public static CostManagementAlertResource GetCostManagementAlertResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetCostManagementAlertResource(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. + /// Returns a object. + public static TenantScheduledActionResource GetTenantScheduledActionResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetTenantScheduledActionResource(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. + /// Returns a object. + public static ScheduledActionResource GetScheduledActionResource(this ArmClient client, ResourceIdentifier id) + { + return GetCostManagementArmClientMockingExtension(client).GetScheduledActionResource(id); + } + + /// + /// Gets a collection of TenantsCostManagementViewsResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TenantsCostManagementViewsResources and their operations over a TenantsCostManagementViewsResource. public static TenantsCostManagementViewsCollection GetAllTenantsCostManagementViews(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetAllTenantsCostManagementViews(); + return GetCostManagementTenantMockingExtension(tenantResource).GetAllTenantsCostManagementViews(); } /// @@ -670,16 +722,20 @@ public static TenantsCostManagementViewsCollection GetAllTenantsCostManagementVi /// Views_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// View name. /// The cancellation token to use. - /// 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 static async Task> GetTenantsCostManagementViewsAsync(this TenantResource tenantResource, string viewName, CancellationToken cancellationToken = default) { - return await tenantResource.GetAllTenantsCostManagementViews().GetAsync(viewName, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GetTenantsCostManagementViewsAsync(viewName, cancellationToken).ConfigureAwait(false); } /// @@ -694,24 +750,34 @@ public static async Task> GetTenant /// Views_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// View name. /// The cancellation token to use. - /// 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 static Response GetTenantsCostManagementViews(this TenantResource tenantResource, string viewName, CancellationToken cancellationToken = default) { - return tenantResource.GetAllTenantsCostManagementViews().Get(viewName, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetTenantsCostManagementViews(viewName, cancellationToken); } - /// Gets a collection of TenantScheduledActionResources in the TenantResource. + /// + /// Gets a collection of TenantScheduledActionResources in the TenantResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of TenantScheduledActionResources and their operations over a TenantScheduledActionResource. public static TenantScheduledActionCollection GetTenantScheduledActions(this TenantResource tenantResource) { - return GetTenantResourceExtensionClient(tenantResource).GetTenantScheduledActions(); + return GetCostManagementTenantMockingExtension(tenantResource).GetTenantScheduledActions(); } /// @@ -726,16 +792,20 @@ public static TenantScheduledActionCollection GetTenantScheduledActions(this Ten /// ScheduledActions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Scheduled action name. /// The cancellation token to use. - /// 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 static async Task> GetTenantScheduledActionAsync(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return await tenantResource.GetTenantScheduledActions().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GetTenantScheduledActionAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -750,16 +820,20 @@ public static async Task> GetTenantSched /// ScheduledActions_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Scheduled action name. /// The cancellation token to use. - /// 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 static Response GetTenantScheduledAction(this TenantResource tenantResource, string name, CancellationToken cancellationToken = default) { - return tenantResource.GetTenantScheduledActions().Get(name, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetTenantScheduledAction(name, cancellationToken); } /// @@ -774,6 +848,10 @@ public static Response GetTenantScheduledAction(t /// BenefitUtilizationSummaries_ListByBillingAccountId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing account ID. @@ -785,9 +863,7 @@ public static Response GetTenantScheduledAction(t /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBenefitUtilizationSummariesByBillingAccountIdAsync(this TenantResource tenantResource, string billingAccountId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesByBillingAccountIdAsync(billingAccountId, grainParameter, filter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesByBillingAccountIdAsync(billingAccountId, grainParameter, filter, cancellationToken); } /// @@ -802,6 +878,10 @@ public static AsyncPageable GetBenefitUtilizationSumm /// BenefitUtilizationSummaries_ListByBillingAccountId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing account ID. @@ -813,9 +893,7 @@ public static AsyncPageable GetBenefitUtilizationSumm /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBenefitUtilizationSummariesByBillingAccountId(this TenantResource tenantResource, string billingAccountId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesByBillingAccountId(billingAccountId, grainParameter, filter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesByBillingAccountId(billingAccountId, grainParameter, filter, cancellationToken); } /// @@ -830,6 +908,10 @@ public static Pageable GetBenefitUtilizationSummaries /// BenefitUtilizationSummaries_ListByBillingProfileId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing account ID. @@ -842,10 +924,7 @@ public static Pageable GetBenefitUtilizationSummaries /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBenefitUtilizationSummariesByBillingProfileIdAsync(this TenantResource tenantResource, string billingAccountId, string billingProfileId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesByBillingProfileIdAsync(billingAccountId, billingProfileId, grainParameter, filter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesByBillingProfileIdAsync(billingAccountId, billingProfileId, grainParameter, filter, cancellationToken); } /// @@ -860,6 +939,10 @@ public static AsyncPageable GetBenefitUtilizationSumm /// BenefitUtilizationSummaries_ListByBillingProfileId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Billing account ID. @@ -872,10 +955,7 @@ public static AsyncPageable GetBenefitUtilizationSumm /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBenefitUtilizationSummariesByBillingProfileId(this TenantResource tenantResource, string billingAccountId, string billingProfileId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesByBillingProfileId(billingAccountId, billingProfileId, grainParameter, filter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesByBillingProfileId(billingAccountId, billingProfileId, grainParameter, filter, cancellationToken); } /// @@ -890,6 +970,10 @@ public static Pageable GetBenefitUtilizationSummaries /// BenefitUtilizationSummaries_ListBySavingsPlanOrder /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Savings plan order ID. @@ -901,9 +985,7 @@ public static Pageable GetBenefitUtilizationSummaries /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBenefitUtilizationSummariesBySavingsPlanOrderAsync(this TenantResource tenantResource, string savingsPlanOrderId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanOrderAsync(savingsPlanOrderId, filter, grainParameter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanOrderAsync(savingsPlanOrderId, filter, grainParameter, cancellationToken); } /// @@ -918,6 +1000,10 @@ public static AsyncPageable GetBenefitUtilizationSumm /// BenefitUtilizationSummaries_ListBySavingsPlanOrder /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Savings plan order ID. @@ -929,9 +1015,7 @@ public static AsyncPageable GetBenefitUtilizationSumm /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBenefitUtilizationSummariesBySavingsPlanOrder(this TenantResource tenantResource, string savingsPlanOrderId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanOrder(savingsPlanOrderId, filter, grainParameter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanOrder(savingsPlanOrderId, filter, grainParameter, cancellationToken); } /// @@ -946,6 +1030,10 @@ public static Pageable GetBenefitUtilizationSummaries /// BenefitUtilizationSummaries_ListBySavingsPlanId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Savings plan order ID. @@ -958,10 +1046,7 @@ public static Pageable GetBenefitUtilizationSummaries /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetBenefitUtilizationSummariesBySavingsPlanIdAsync(this TenantResource tenantResource, string savingsPlanOrderId, string savingsPlanId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanIdAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanIdAsync(savingsPlanOrderId, savingsPlanId, filter, grainParameter, cancellationToken); } /// @@ -976,6 +1061,10 @@ public static AsyncPageable GetBenefitUtilizationSumm /// BenefitUtilizationSummaries_ListBySavingsPlanId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Savings plan order ID. @@ -988,10 +1077,7 @@ public static AsyncPageable GetBenefitUtilizationSumm /// A collection of that may take multiple service requests to iterate over. public static Pageable GetBenefitUtilizationSummariesBySavingsPlanId(this TenantResource tenantResource, string savingsPlanOrderId, string savingsPlanId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); - - return GetTenantResourceExtensionClient(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanId(savingsPlanOrderId, savingsPlanId, filter, grainParameter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetBenefitUtilizationSummariesBySavingsPlanId(savingsPlanOrderId, savingsPlanId, filter, grainParameter, cancellationToken); } /// @@ -1006,6 +1092,10 @@ public static Pageable GetBenefitUtilizationSummaries /// BillingAccountScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1016,10 +1106,7 @@ public static Pageable GetBenefitUtilizationSummaries /// or is null. public static async Task> GenerateBenefitUtilizationSummariesReportBillingAccountScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportBillingAccountScopeAsync(waitUntil, billingAccountId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportBillingAccountScopeAsync(waitUntil, billingAccountId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1034,6 +1121,10 @@ public static async TaskBillingAccountScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1044,10 +1135,7 @@ public static async Task or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportBillingAccountScope(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportBillingAccountScope(waitUntil, billingAccountId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportBillingAccountScope(waitUntil, billingAccountId, content, cancellationToken); } /// @@ -1062,6 +1150,10 @@ public static ArmOperation GenerateB /// BillingProfileScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1073,11 +1165,7 @@ public static ArmOperation GenerateB /// , or is null. public static async Task> GenerateBenefitUtilizationSummariesReportBillingProfileScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string billingProfileId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportBillingProfileScopeAsync(waitUntil, billingAccountId, billingProfileId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportBillingProfileScopeAsync(waitUntil, billingAccountId, billingProfileId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1092,6 +1180,10 @@ public static async TaskBillingProfileScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1103,11 +1195,7 @@ public static async Task , or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportBillingProfileScope(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string billingProfileId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportBillingProfileScope(waitUntil, billingAccountId, billingProfileId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportBillingProfileScope(waitUntil, billingAccountId, billingProfileId, content, cancellationToken); } /// @@ -1122,6 +1210,10 @@ public static ArmOperation GenerateB /// ReservationOrderScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1132,10 +1224,7 @@ public static ArmOperation GenerateB /// or is null. public static async Task> GenerateBenefitUtilizationSummariesReportReservationOrderScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string reservationOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportReservationOrderScopeAsync(waitUntil, reservationOrderId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportReservationOrderScopeAsync(waitUntil, reservationOrderId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1150,6 +1239,10 @@ public static async TaskReservationOrderScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1160,10 +1253,7 @@ public static async Task or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportReservationOrderScope(this TenantResource tenantResource, WaitUntil waitUntil, string reservationOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportReservationOrderScope(waitUntil, reservationOrderId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportReservationOrderScope(waitUntil, reservationOrderId, content, cancellationToken); } /// @@ -1178,6 +1268,10 @@ public static ArmOperation GenerateB /// ReservationScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1189,11 +1283,7 @@ public static ArmOperation GenerateB /// , or is null. public static async Task> GenerateBenefitUtilizationSummariesReportReservationScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string reservationOrderId, string reservationId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); - Argument.AssertNotNullOrEmpty(reservationId, nameof(reservationId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportReservationScopeAsync(waitUntil, reservationOrderId, reservationId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportReservationScopeAsync(waitUntil, reservationOrderId, reservationId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1208,6 +1298,10 @@ public static async TaskReservationScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1219,11 +1313,7 @@ public static async Task , or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportReservationScope(this TenantResource tenantResource, WaitUntil waitUntil, string reservationOrderId, string reservationId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); - Argument.AssertNotNullOrEmpty(reservationId, nameof(reservationId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportReservationScope(waitUntil, reservationOrderId, reservationId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportReservationScope(waitUntil, reservationOrderId, reservationId, content, cancellationToken); } /// @@ -1238,6 +1328,10 @@ public static ArmOperation GenerateB /// SavingsPlanOrderScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1248,10 +1342,7 @@ public static ArmOperation GenerateB /// or is null. public static async Task> GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string savingsPlanOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScopeAsync(waitUntil, savingsPlanOrderId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScopeAsync(waitUntil, savingsPlanOrderId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1266,6 +1357,10 @@ public static async TaskSavingsPlanOrderScope_GenerateBenefitUtilizationSummariesReport /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1276,10 +1371,7 @@ public static async Task or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope(this TenantResource tenantResource, WaitUntil waitUntil, string savingsPlanOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope(waitUntil, savingsPlanOrderId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope(waitUntil, savingsPlanOrderId, content, cancellationToken); } /// @@ -1294,6 +1386,10 @@ public static ArmOperation GenerateB /// SavingsPlanScope_GenerateBenefitUtilizationSummariesReportAsync /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1305,11 +1401,7 @@ public static ArmOperation GenerateB /// , or is null. public static async Task> GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScopeAsync(this TenantResource tenantResource, WaitUntil waitUntil, string savingsPlanOrderId, string savingsPlanId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScopeAsync(waitUntil, savingsPlanOrderId, savingsPlanId, content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScopeAsync(waitUntil, savingsPlanOrderId, savingsPlanId, content, cancellationToken).ConfigureAwait(false); } /// @@ -1324,6 +1416,10 @@ public static async TaskSavingsPlanScope_GenerateBenefitUtilizationSummariesReportAsync /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1335,11 +1431,7 @@ public static async Task , or is null. public static ArmOperation GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope(this TenantResource tenantResource, WaitUntil waitUntil, string savingsPlanOrderId, string savingsPlanId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); - Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope(waitUntil, savingsPlanOrderId, savingsPlanId, content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope(waitUntil, savingsPlanOrderId, savingsPlanId, content, cancellationToken); } /// @@ -1354,6 +1446,10 @@ public static ArmOperation GenerateB /// Alerts_ListExternal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1364,9 +1460,7 @@ public static ArmOperation GenerateB /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetCostManagementAlertsAsync(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - - return GetTenantResourceExtensionClient(tenantResource).GetCostManagementAlertsAsync(externalCloudProviderType, externalCloudProviderId, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetCostManagementAlertsAsync(externalCloudProviderType, externalCloudProviderId, cancellationToken); } /// @@ -1381,6 +1475,10 @@ public static AsyncPageable GetCostManagementAlerts /// Alerts_ListExternal /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1391,9 +1489,7 @@ public static AsyncPageable GetCostManagementAlerts /// A collection of that may take multiple service requests to iterate over. public static Pageable GetCostManagementAlerts(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - - return GetTenantResourceExtensionClient(tenantResource).GetCostManagementAlerts(externalCloudProviderType, externalCloudProviderId, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).GetCostManagementAlerts(externalCloudProviderType, externalCloudProviderId, cancellationToken); } /// @@ -1408,6 +1504,10 @@ public static Pageable GetCostManagementAlerts(this /// Forecast_ExternalCloudProviderUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1419,10 +1519,7 @@ public static Pageable GetCostManagementAlerts(this /// or is null. public static async Task> ExternalCloudProviderUsageForecastAsync(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); - - return await GetTenantResourceExtensionClient(tenantResource).ExternalCloudProviderUsageForecastAsync(externalCloudProviderType, externalCloudProviderId, forecastDefinition, filter, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).ExternalCloudProviderUsageForecastAsync(externalCloudProviderType, externalCloudProviderId, forecastDefinition, filter, cancellationToken).ConfigureAwait(false); } /// @@ -1437,6 +1534,10 @@ public static async Task> ExternalCloudProviderUsageFor /// Forecast_ExternalCloudProviderUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1448,10 +1549,7 @@ public static async Task> ExternalCloudProviderUsageFor /// or is null. public static Response ExternalCloudProviderUsageForecast(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); - - return GetTenantResourceExtensionClient(tenantResource).ExternalCloudProviderUsageForecast(externalCloudProviderType, externalCloudProviderId, forecastDefinition, filter, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).ExternalCloudProviderUsageForecast(externalCloudProviderType, externalCloudProviderId, forecastDefinition, filter, cancellationToken); } /// @@ -1466,6 +1564,10 @@ public static Response ExternalCloudProviderUsageForecast(this T /// Dimensions_ByExternalCloudProviderType /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1474,9 +1576,7 @@ public static Response ExternalCloudProviderUsageForecast(this T /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable ByExternalCloudProviderTypeDimensionsAsync(this TenantResource tenantResource, TenantResourceByExternalCloudProviderTypeDimensionsOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetTenantResourceExtensionClient(tenantResource).ByExternalCloudProviderTypeDimensionsAsync(options, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).ByExternalCloudProviderTypeDimensionsAsync(options, cancellationToken); } /// @@ -1491,6 +1591,10 @@ public static AsyncPageable ByExternalCloudProviderType /// Dimensions_ByExternalCloudProviderType /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -1499,9 +1603,7 @@ public static AsyncPageable ByExternalCloudProviderType /// A collection of that may take multiple service requests to iterate over. public static Pageable ByExternalCloudProviderTypeDimensions(this TenantResource tenantResource, TenantResourceByExternalCloudProviderTypeDimensionsOptions options, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(options, nameof(options)); - - return GetTenantResourceExtensionClient(tenantResource).ByExternalCloudProviderTypeDimensions(options, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).ByExternalCloudProviderTypeDimensions(options, cancellationToken); } /// @@ -1516,6 +1618,10 @@ public static Pageable ByExternalCloudProviderTypeDimen /// Query_UsageByExternalCloudProviderType /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1526,10 +1632,7 @@ public static Pageable ByExternalCloudProviderTypeDimen /// or is null. public static async Task> UsageByExternalCloudProviderTypeQueryAsync(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); - - return await GetTenantResourceExtensionClient(tenantResource).UsageByExternalCloudProviderTypeQueryAsync(externalCloudProviderType, externalCloudProviderId, queryDefinition, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).UsageByExternalCloudProviderTypeQueryAsync(externalCloudProviderType, externalCloudProviderId, queryDefinition, cancellationToken).ConfigureAwait(false); } /// @@ -1544,6 +1647,10 @@ public static async Task> UsageByExternalCloudProviderType /// Query_UsageByExternalCloudProviderType /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. @@ -1554,10 +1661,7 @@ public static async Task> UsageByExternalCloudProviderType /// or is null. public static Response UsageByExternalCloudProviderTypeQuery(this TenantResource tenantResource, ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); - Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); - - return GetTenantResourceExtensionClient(tenantResource).UsageByExternalCloudProviderTypeQuery(externalCloudProviderType, externalCloudProviderId, queryDefinition, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).UsageByExternalCloudProviderTypeQuery(externalCloudProviderType, externalCloudProviderId, queryDefinition, cancellationToken); } /// @@ -1572,6 +1676,10 @@ public static Response UsageByExternalCloudProviderTypeQuery(this T /// GenerateReservationDetailsReport_ByBillingAccountId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1583,11 +1691,7 @@ public static Response UsageByExternalCloudProviderTypeQuery(this T /// , or is null. public static async Task> ByBillingAccountIdGenerateReservationDetailsReportAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string startDate, string endDate, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNull(startDate, nameof(startDate)); - Argument.AssertNotNull(endDate, nameof(endDate)); - - return await GetTenantResourceExtensionClient(tenantResource).ByBillingAccountIdGenerateReservationDetailsReportAsync(waitUntil, billingAccountId, startDate, endDate, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).ByBillingAccountIdGenerateReservationDetailsReportAsync(waitUntil, billingAccountId, startDate, endDate, cancellationToken).ConfigureAwait(false); } /// @@ -1602,6 +1706,10 @@ public static async Task> ByBillingAccountIdGenera /// GenerateReservationDetailsReport_ByBillingAccountId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1613,11 +1721,7 @@ public static async Task> ByBillingAccountIdGenera /// , or is null. public static ArmOperation ByBillingAccountIdGenerateReservationDetailsReport(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string startDate, string endDate, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNull(startDate, nameof(startDate)); - Argument.AssertNotNull(endDate, nameof(endDate)); - - return GetTenantResourceExtensionClient(tenantResource).ByBillingAccountIdGenerateReservationDetailsReport(waitUntil, billingAccountId, startDate, endDate, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).ByBillingAccountIdGenerateReservationDetailsReport(waitUntil, billingAccountId, startDate, endDate, cancellationToken); } /// @@ -1632,6 +1736,10 @@ public static ArmOperation ByBillingAccountIdGenerateReservatio /// GenerateReservationDetailsReport_ByBillingProfileId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1644,12 +1752,7 @@ public static ArmOperation ByBillingAccountIdGenerateReservatio /// , , or is null. public static async Task> ByBillingProfileIdGenerateReservationDetailsReportAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string billingProfileId, string startDate, string endDate, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - Argument.AssertNotNull(startDate, nameof(startDate)); - Argument.AssertNotNull(endDate, nameof(endDate)); - - return await GetTenantResourceExtensionClient(tenantResource).ByBillingProfileIdGenerateReservationDetailsReportAsync(waitUntil, billingAccountId, billingProfileId, startDate, endDate, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).ByBillingProfileIdGenerateReservationDetailsReportAsync(waitUntil, billingAccountId, billingProfileId, startDate, endDate, cancellationToken).ConfigureAwait(false); } /// @@ -1664,6 +1767,10 @@ public static async Task> ByBillingProfileIdGenera /// GenerateReservationDetailsReport_ByBillingProfileId /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1676,12 +1783,7 @@ public static async Task> ByBillingProfileIdGenera /// , , or is null. public static ArmOperation ByBillingProfileIdGenerateReservationDetailsReport(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountId, string billingProfileId, string startDate, string endDate, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); - Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); - Argument.AssertNotNull(startDate, nameof(startDate)); - Argument.AssertNotNull(endDate, nameof(endDate)); - - return GetTenantResourceExtensionClient(tenantResource).ByBillingProfileIdGenerateReservationDetailsReport(waitUntil, billingAccountId, billingProfileId, startDate, endDate, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).ByBillingProfileIdGenerateReservationDetailsReport(waitUntil, billingAccountId, billingProfileId, startDate, endDate, cancellationToken); } /// @@ -1696,6 +1798,10 @@ public static ArmOperation ByBillingProfileIdGenerateReservatio /// PriceSheet_Download /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1707,11 +1813,7 @@ public static ArmOperation ByBillingProfileIdGenerateReservatio /// , or is null. public static async Task> DownloadPriceSheetAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); - Argument.AssertNotNullOrEmpty(invoiceName, nameof(invoiceName)); - - return await GetTenantResourceExtensionClient(tenantResource).DownloadPriceSheetAsync(waitUntil, billingAccountName, billingProfileName, invoiceName, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).DownloadPriceSheetAsync(waitUntil, billingAccountName, billingProfileName, invoiceName, cancellationToken).ConfigureAwait(false); } /// @@ -1726,6 +1828,10 @@ public static async Task> DownloadPriceSheetAsync(this /// PriceSheet_Download /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1737,11 +1843,7 @@ public static async Task> DownloadPriceSheetAsync(this /// , or is null. public static ArmOperation DownloadPriceSheet(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); - Argument.AssertNotNullOrEmpty(invoiceName, nameof(invoiceName)); - - return GetTenantResourceExtensionClient(tenantResource).DownloadPriceSheet(waitUntil, billingAccountName, billingProfileName, invoiceName, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).DownloadPriceSheet(waitUntil, billingAccountName, billingProfileName, invoiceName, cancellationToken); } /// @@ -1756,6 +1858,10 @@ public static ArmOperation DownloadPriceSheet(this TenantResource t /// PriceSheet_DownloadByBillingProfile /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1766,10 +1872,7 @@ public static ArmOperation DownloadPriceSheet(this TenantResource t /// or is null. public static async Task> DownloadByBillingProfilePriceSheetAsync(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); - - return await GetTenantResourceExtensionClient(tenantResource).DownloadByBillingProfilePriceSheetAsync(waitUntil, billingAccountName, billingProfileName, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).DownloadByBillingProfilePriceSheetAsync(waitUntil, billingAccountName, billingProfileName, cancellationToken).ConfigureAwait(false); } /// @@ -1784,6 +1887,10 @@ public static async Task> DownloadByBillingProfilePric /// PriceSheet_DownloadByBillingProfile /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// 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. @@ -1794,10 +1901,7 @@ public static async Task> DownloadByBillingProfilePric /// or is null. public static ArmOperation DownloadByBillingProfilePriceSheet(this TenantResource tenantResource, WaitUntil waitUntil, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); - Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); - - return GetTenantResourceExtensionClient(tenantResource).DownloadByBillingProfilePriceSheet(waitUntil, billingAccountName, billingProfileName, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).DownloadByBillingProfilePriceSheet(waitUntil, billingAccountName, billingProfileName, cancellationToken); } /// @@ -1812,6 +1916,10 @@ public static ArmOperation DownloadByBillingProfilePriceSheet(this /// ScheduledActions_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Scheduled action to be created or updated. @@ -1819,9 +1927,7 @@ public static ArmOperation DownloadByBillingProfilePriceSheet(this /// is null. public static async Task> CheckCostManagementNameAvailabilityByScheduledActionAsync(this TenantResource tenantResource, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetTenantResourceExtensionClient(tenantResource).CheckCostManagementNameAvailabilityByScheduledActionAsync(content, cancellationToken).ConfigureAwait(false); + return await GetCostManagementTenantMockingExtension(tenantResource).CheckCostManagementNameAvailabilityByScheduledActionAsync(content, cancellationToken).ConfigureAwait(false); } /// @@ -1836,6 +1942,10 @@ public static async Task> CheckCo /// ScheduledActions_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Scheduled action to be created or updated. @@ -1843,9 +1953,7 @@ public static async Task> CheckCo /// is null. public static Response CheckCostManagementNameAvailabilityByScheduledAction(this TenantResource tenantResource, CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetTenantResourceExtensionClient(tenantResource).CheckCostManagementNameAvailabilityByScheduledAction(content, cancellationToken); + return GetCostManagementTenantMockingExtension(tenantResource).CheckCostManagementNameAvailabilityByScheduledAction(content, cancellationToken); } } } diff --git a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementTenantMockingExtension.cs similarity index 78% rename from sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs rename to sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementTenantMockingExtension.cs index 19274737033d..68b10c52f5a1 100644 --- a/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ b/sdk/costmanagement/Azure.ResourceManager.CostManagement/src/Generated/Extensions/CostManagementTenantMockingExtension.cs @@ -13,12 +13,13 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CostManagement; using Azure.ResourceManager.CostManagement.Models; -namespace Azure.ResourceManager.CostManagement +namespace Azure.ResourceManager.CostManagement.Mocking { /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource + public partial class CostManagementTenantMockingExtension : ArmResource { private ClientDiagnostics _benefitUtilizationSummariesClientDiagnostics; private BenefitUtilizationSummariesRestOperations _benefitUtilizationSummariesRestClient; @@ -49,15 +50,15 @@ internal partial class TenantResourceExtensionClient : ArmResource private ClientDiagnostics _scheduledActionsClientDiagnostics; private ScheduledActionsRestOperations _scheduledActionsRestClient; - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CostManagementTenantMockingExtension() { } - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CostManagementTenantMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -100,14 +101,106 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of TenantsCostManagementViewsResources and their operations over a TenantsCostManagementViewsResource. public virtual TenantsCostManagementViewsCollection GetAllTenantsCostManagementViews() { - return GetCachedClient(Client => new TenantsCostManagementViewsCollection(Client, Id)); + return GetCachedClient(client => new TenantsCostManagementViewsCollection(client, Id)); + } + + /// + /// Gets the view by view name. + /// + /// + /// Request Path + /// /providers/Microsoft.CostManagement/views/{viewName} + /// + /// + /// Operation Id + /// Views_Get + /// + /// + /// + /// View name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTenantsCostManagementViewsAsync(string viewName, CancellationToken cancellationToken = default) + { + return await GetAllTenantsCostManagementViews().GetAsync(viewName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the view by view name. + /// + /// + /// Request Path + /// /providers/Microsoft.CostManagement/views/{viewName} + /// + /// + /// Operation Id + /// Views_Get + /// + /// + /// + /// View name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTenantsCostManagementViews(string viewName, CancellationToken cancellationToken = default) + { + return GetAllTenantsCostManagementViews().Get(viewName, cancellationToken); } /// Gets a collection of TenantScheduledActionResources in the TenantResource. /// An object representing collection of TenantScheduledActionResources and their operations over a TenantScheduledActionResource. public virtual TenantScheduledActionCollection GetTenantScheduledActions() { - return GetCachedClient(Client => new TenantScheduledActionCollection(Client, Id)); + return GetCachedClient(client => new TenantScheduledActionCollection(client, Id)); + } + + /// + /// Get the private scheduled action by name. + /// + /// + /// Request Path + /// /providers/Microsoft.CostManagement/scheduledActions/{name} + /// + /// + /// Operation Id + /// ScheduledActions_Get + /// + /// + /// + /// Scheduled action name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetTenantScheduledActionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetTenantScheduledActions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the private scheduled action by name. + /// + /// + /// Request Path + /// /providers/Microsoft.CostManagement/scheduledActions/{name} + /// + /// + /// Operation Id + /// ScheduledActions_Get + /// + /// + /// + /// Scheduled action name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetTenantScheduledAction(string name, CancellationToken cancellationToken = default) + { + return GetTenantScheduledActions().Get(name, cancellationToken); } /// @@ -127,12 +220,16 @@ public virtual TenantScheduledActionCollection GetTenantScheduledActions() /// Grain. /// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBenefitUtilizationSummariesByBillingAccountIdAsync(string billingAccountId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListByBillingAccountIdRequest(billingAccountId, grainParameter, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListByBillingAccountIdNextPageRequest(nextLink, billingAccountId, grainParameter, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesByBillingAccountId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesByBillingAccountId", "value", "nextLink", cancellationToken); } /// @@ -152,12 +249,16 @@ public virtual AsyncPageable GetBenefitUtilizationSum /// Grain. /// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBenefitUtilizationSummariesByBillingAccountId(string billingAccountId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListByBillingAccountIdRequest(billingAccountId, grainParameter, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListByBillingAccountIdNextPageRequest(nextLink, billingAccountId, grainParameter, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesByBillingAccountId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesByBillingAccountId", "value", "nextLink", cancellationToken); } /// @@ -178,12 +279,17 @@ public virtual Pageable GetBenefitUtilizationSummarie /// Grain. /// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBenefitUtilizationSummariesByBillingProfileIdAsync(string billingAccountId, string billingProfileId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListByBillingProfileIdRequest(billingAccountId, billingProfileId, grainParameter, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListByBillingProfileIdNextPageRequest(nextLink, billingAccountId, billingProfileId, grainParameter, filter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesByBillingProfileId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesByBillingProfileId", "value", "nextLink", cancellationToken); } /// @@ -204,12 +310,17 @@ public virtual AsyncPageable GetBenefitUtilizationSum /// Grain. /// Supports filtering by properties/benefitId, properties/benefitOrderId and properties/usageDate. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBenefitUtilizationSummariesByBillingProfileId(string billingAccountId, string billingProfileId, GrainContent? grainParameter = null, string filter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListByBillingProfileIdRequest(billingAccountId, billingProfileId, grainParameter, filter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListByBillingProfileIdNextPageRequest(nextLink, billingAccountId, billingProfileId, grainParameter, filter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesByBillingProfileId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesByBillingProfileId", "value", "nextLink", cancellationToken); } /// @@ -229,12 +340,16 @@ public virtual Pageable GetBenefitUtilizationSummarie /// Supports filtering by properties/usageDate. /// Grain. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBenefitUtilizationSummariesBySavingsPlanOrderAsync(string savingsPlanOrderId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanOrderRequest(savingsPlanOrderId, filter, grainParameter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanOrderNextPageRequest(nextLink, savingsPlanOrderId, filter, grainParameter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesBySavingsPlanOrder", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesBySavingsPlanOrder", "value", "nextLink", cancellationToken); } /// @@ -254,12 +369,16 @@ public virtual AsyncPageable GetBenefitUtilizationSum /// Supports filtering by properties/usageDate. /// Grain. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBenefitUtilizationSummariesBySavingsPlanOrder(string savingsPlanOrderId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanOrderRequest(savingsPlanOrderId, filter, grainParameter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanOrderNextPageRequest(nextLink, savingsPlanOrderId, filter, grainParameter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesBySavingsPlanOrder", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesBySavingsPlanOrder", "value", "nextLink", cancellationToken); } /// @@ -280,12 +399,17 @@ public virtual Pageable GetBenefitUtilizationSummarie /// Supports filtering by properties/usageDate. /// Grain. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetBenefitUtilizationSummariesBySavingsPlanIdAsync(string savingsPlanOrderId, string savingsPlanId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanIdRequest(savingsPlanOrderId, savingsPlanId, filter, grainParameter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanIdNextPageRequest(nextLink, savingsPlanOrderId, savingsPlanId, filter, grainParameter); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesBySavingsPlanId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesBySavingsPlanId", "value", "nextLink", cancellationToken); } /// @@ -306,12 +430,17 @@ public virtual AsyncPageable GetBenefitUtilizationSum /// Supports filtering by properties/usageDate. /// Grain. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetBenefitUtilizationSummariesBySavingsPlanId(string savingsPlanOrderId, string savingsPlanId, string filter = null, GrainContent? grainParameter = null, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanIdRequest(savingsPlanOrderId, savingsPlanId, filter, grainParameter); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BenefitUtilizationSummariesRestClient.CreateListBySavingsPlanIdNextPageRequest(nextLink, savingsPlanOrderId, savingsPlanId, filter, grainParameter); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetBenefitUtilizationSummariesBySavingsPlanId", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, BenefitUtilizationSummary.DeserializeBenefitUtilizationSummary, BenefitUtilizationSummariesClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetBenefitUtilizationSummariesBySavingsPlanId", "value", "nextLink", cancellationToken); } /// @@ -331,9 +460,14 @@ public virtual Pageable GetBenefitUtilizationSummarie /// Billing account ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportBillingAccountScopeAsync(WaitUntil waitUntil, string billingAccountId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = BillingAccountScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportBillingAccountScope"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BillingAccountScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportBillingAccountScope"); scope.Start(); try { @@ -367,9 +501,14 @@ public virtual async Task Billing account ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportBillingAccountScope(WaitUntil waitUntil, string billingAccountId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = BillingAccountScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportBillingAccountScope"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BillingAccountScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportBillingAccountScope"); scope.Start(); try { @@ -404,9 +543,15 @@ public virtual ArmOperation Generate /// Billing profile ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportBillingProfileScopeAsync(WaitUntil waitUntil, string billingAccountId, string billingProfileId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = BillingProfileScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportBillingProfileScope"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BillingProfileScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportBillingProfileScope"); scope.Start(); try { @@ -441,9 +586,15 @@ public virtual async Task Billing profile ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportBillingProfileScope(WaitUntil waitUntil, string billingAccountId, string billingProfileId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = BillingProfileScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportBillingProfileScope"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BillingProfileScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportBillingProfileScope"); scope.Start(); try { @@ -477,9 +628,14 @@ public virtual ArmOperation Generate /// Reservation Order ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportReservationOrderScopeAsync(WaitUntil waitUntil, string reservationOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationOrderScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportReservationOrderScope"); + Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationOrderScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportReservationOrderScope"); scope.Start(); try { @@ -513,9 +669,14 @@ public virtual async Task Reservation Order ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportReservationOrderScope(WaitUntil waitUntil, string reservationOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationOrderScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportReservationOrderScope"); + Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationOrderScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportReservationOrderScope"); scope.Start(); try { @@ -550,9 +711,15 @@ public virtual ArmOperation Generate /// Reservation ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportReservationScopeAsync(WaitUntil waitUntil, string reservationOrderId, string reservationId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportReservationScope"); + Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); + Argument.AssertNotNullOrEmpty(reservationId, nameof(reservationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportReservationScope"); scope.Start(); try { @@ -587,9 +754,15 @@ public virtual async Task Reservation ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportReservationScope(WaitUntil waitUntil, string reservationOrderId, string reservationId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = ReservationScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportReservationScope"); + Argument.AssertNotNullOrEmpty(reservationOrderId, nameof(reservationOrderId)); + Argument.AssertNotNullOrEmpty(reservationId, nameof(reservationId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ReservationScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportReservationScope"); scope.Start(); try { @@ -623,9 +796,14 @@ public virtual ArmOperation Generate /// Savings plan order ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScopeAsync(WaitUntil waitUntil, string savingsPlanOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = SavingsPlanOrderScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope"); + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SavingsPlanOrderScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope"); scope.Start(); try { @@ -659,9 +837,14 @@ public virtual async Task Savings plan order ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope(WaitUntil waitUntil, string savingsPlanOrderId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = SavingsPlanOrderScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope"); + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SavingsPlanOrderScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportSavingsPlanOrderScope"); scope.Start(); try { @@ -696,9 +879,15 @@ public virtual ArmOperation Generate /// Savings plan ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScopeAsync(WaitUntil waitUntil, string savingsPlanOrderId, string savingsPlanId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = SavingsPlanScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope"); + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SavingsPlanScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope"); scope.Start(); try { @@ -733,9 +922,15 @@ public virtual async Task Savings plan ID. /// Async Benefit Utilization Summary report to be created. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual ArmOperation GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope(WaitUntil waitUntil, string savingsPlanOrderId, string savingsPlanId, BenefitUtilizationSummariesContent content, CancellationToken cancellationToken = default) { - using var scope = SavingsPlanScopeClientDiagnostics.CreateScope("TenantResourceExtensionClient.GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope"); + Argument.AssertNotNullOrEmpty(savingsPlanOrderId, nameof(savingsPlanOrderId)); + Argument.AssertNotNullOrEmpty(savingsPlanId, nameof(savingsPlanId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SavingsPlanScopeClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.GenerateBenefitUtilizationSummariesReportAsyncSavingsPlanScope"); scope.Start(); try { @@ -768,11 +963,15 @@ public virtual ArmOperation Generate /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetCostManagementAlertsAsync(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => CostManagementAlertAlertsRestClient.CreateListExternalRequest(externalCloudProviderType, externalCloudProviderId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CostManagementAlertResource(Client, CostManagementAlertData.DeserializeCostManagementAlertData(e)), CostManagementAlertAlertsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetCostManagementAlerts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CostManagementAlertResource(Client, CostManagementAlertData.DeserializeCostManagementAlertData(e)), CostManagementAlertAlertsClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetCostManagementAlerts", "value", null, cancellationToken); } /// @@ -791,11 +990,15 @@ public virtual AsyncPageable GetCostManagementAlert /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetCostManagementAlerts(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + HttpMessage FirstPageRequest(int? pageSizeHint) => CostManagementAlertAlertsRestClient.CreateListExternalRequest(externalCloudProviderType, externalCloudProviderId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CostManagementAlertResource(Client, CostManagementAlertData.DeserializeCostManagementAlertData(e)), CostManagementAlertAlertsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetCostManagementAlerts", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CostManagementAlertResource(Client, CostManagementAlertData.DeserializeCostManagementAlertData(e)), CostManagementAlertAlertsClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.GetCostManagementAlerts", "value", null, cancellationToken); } /// @@ -816,9 +1019,14 @@ public virtual Pageable GetCostManagementAlerts(Ext /// Parameters supplied to the CreateOrUpdate Forecast Config operation. /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> ExternalCloudProviderUsageForecastAsync(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - using var scope = ForecastClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExternalCloudProviderUsageForecast"); + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); + + using var scope = ForecastClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ExternalCloudProviderUsageForecast"); scope.Start(); try { @@ -850,9 +1058,14 @@ public virtual async Task> ExternalCloudProviderUsageFo /// Parameters supplied to the CreateOrUpdate Forecast Config operation. /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response ExternalCloudProviderUsageForecast(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, ForecastDefinition forecastDefinition, string filter = null, CancellationToken cancellationToken = default) { - using var scope = ForecastClientDiagnostics.CreateScope("TenantResourceExtensionClient.ExternalCloudProviderUsageForecast"); + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + Argument.AssertNotNull(forecastDefinition, nameof(forecastDefinition)); + + using var scope = ForecastClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ExternalCloudProviderUsageForecast"); scope.Start(); try { @@ -881,11 +1094,14 @@ public virtual Response ExternalCloudProviderUsageForecast(Exter /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable ByExternalCloudProviderTypeDimensionsAsync(TenantResourceByExternalCloudProviderTypeDimensionsOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateByExternalCloudProviderTypeRequest(options.ExternalCloudProviderType, options.ExternalCloudProviderId, options.Filter, options.Expand, options.Skiptoken, options.Top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.ByExternalCloudProviderTypeDimensions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.ByExternalCloudProviderTypeDimensions", "value", null, cancellationToken); } /// @@ -903,11 +1119,14 @@ public virtual AsyncPageable ByExternalCloudProviderTyp /// /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable ByExternalCloudProviderTypeDimensions(TenantResourceByExternalCloudProviderTypeDimensionsOptions options, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(options, nameof(options)); + HttpMessage FirstPageRequest(int? pageSizeHint) => DimensionsRestClient.CreateByExternalCloudProviderTypeRequest(options.ExternalCloudProviderType, options.ExternalCloudProviderId, options.Filter, options.Expand, options.Skiptoken, options.Top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.ByExternalCloudProviderTypeDimensions", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, CostManagementDimension.DeserializeCostManagementDimension, DimensionsClientDiagnostics, Pipeline, "CostManagementTenantMockingExtension.ByExternalCloudProviderTypeDimensions", "value", null, cancellationToken); } /// @@ -927,9 +1146,14 @@ public virtual Pageable ByExternalCloudProviderTypeDime /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. /// Parameters supplied to the CreateOrUpdate Query Config operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> UsageByExternalCloudProviderTypeQueryAsync(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - using var scope = QueryClientDiagnostics.CreateScope("TenantResourceExtensionClient.UsageByExternalCloudProviderTypeQuery"); + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); + + using var scope = QueryClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.UsageByExternalCloudProviderTypeQuery"); scope.Start(); try { @@ -960,9 +1184,14 @@ public virtual async Task> UsageByExternalCloudProviderTyp /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. /// Parameters supplied to the CreateOrUpdate Query Config operation. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. public virtual Response UsageByExternalCloudProviderTypeQuery(ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, QueryDefinition queryDefinition, CancellationToken cancellationToken = default) { - using var scope = QueryClientDiagnostics.CreateScope("TenantResourceExtensionClient.UsageByExternalCloudProviderTypeQuery"); + Argument.AssertNotNullOrEmpty(externalCloudProviderId, nameof(externalCloudProviderId)); + Argument.AssertNotNull(queryDefinition, nameof(queryDefinition)); + + using var scope = QueryClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.UsageByExternalCloudProviderTypeQuery"); scope.Start(); try { @@ -994,9 +1223,15 @@ public virtual Response UsageByExternalCloudProviderTypeQuery(Exter /// Start Date. /// End Date. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> ByBillingAccountIdGenerateReservationDetailsReportAsync(WaitUntil waitUntil, string billingAccountId, string startDate, string endDate, CancellationToken cancellationToken = default) { - using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("TenantResourceExtensionClient.ByBillingAccountIdGenerateReservationDetailsReport"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNull(startDate, nameof(startDate)); + Argument.AssertNotNull(endDate, nameof(endDate)); + + using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ByBillingAccountIdGenerateReservationDetailsReport"); scope.Start(); try { @@ -1031,9 +1266,15 @@ public virtual async Task> ByBillingAccountIdGener /// Start Date. /// End Date. /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. public virtual ArmOperation ByBillingAccountIdGenerateReservationDetailsReport(WaitUntil waitUntil, string billingAccountId, string startDate, string endDate, CancellationToken cancellationToken = default) { - using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("TenantResourceExtensionClient.ByBillingAccountIdGenerateReservationDetailsReport"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNull(startDate, nameof(startDate)); + Argument.AssertNotNull(endDate, nameof(endDate)); + + using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ByBillingAccountIdGenerateReservationDetailsReport"); scope.Start(); try { @@ -1069,9 +1310,16 @@ public virtual ArmOperation ByBillingAccountIdGenerateReservati /// Start Date. /// End Date. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual async Task> ByBillingProfileIdGenerateReservationDetailsReportAsync(WaitUntil waitUntil, string billingAccountId, string billingProfileId, string startDate, string endDate, CancellationToken cancellationToken = default) { - using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("TenantResourceExtensionClient.ByBillingProfileIdGenerateReservationDetailsReport"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + Argument.AssertNotNull(startDate, nameof(startDate)); + Argument.AssertNotNull(endDate, nameof(endDate)); + + using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ByBillingProfileIdGenerateReservationDetailsReport"); scope.Start(); try { @@ -1107,9 +1355,16 @@ public virtual async Task> ByBillingProfileIdGener /// Start Date. /// End Date. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// , , or is null. public virtual ArmOperation ByBillingProfileIdGenerateReservationDetailsReport(WaitUntil waitUntil, string billingAccountId, string billingProfileId, string startDate, string endDate, CancellationToken cancellationToken = default) { - using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("TenantResourceExtensionClient.ByBillingProfileIdGenerateReservationDetailsReport"); + Argument.AssertNotNullOrEmpty(billingAccountId, nameof(billingAccountId)); + Argument.AssertNotNullOrEmpty(billingProfileId, nameof(billingProfileId)); + Argument.AssertNotNull(startDate, nameof(startDate)); + Argument.AssertNotNull(endDate, nameof(endDate)); + + using var scope = GenerateReservationDetailsReportClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.ByBillingProfileIdGenerateReservationDetailsReport"); scope.Start(); try { @@ -1144,9 +1399,15 @@ public virtual ArmOperation ByBillingProfileIdGenerateReservati /// The ID that uniquely identifies a billing profile. /// The ID that uniquely identifies an invoice. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual async Task> DownloadPriceSheetAsync(WaitUntil waitUntil, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("TenantResourceExtensionClient.DownloadPriceSheet"); + Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); + Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); + Argument.AssertNotNullOrEmpty(invoiceName, nameof(invoiceName)); + + using var scope = PriceSheetClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.DownloadPriceSheet"); scope.Start(); try { @@ -1181,9 +1442,15 @@ public virtual async Task> DownloadPriceSheetAsync(Wai /// The ID that uniquely identifies a billing profile. /// The ID that uniquely identifies an invoice. /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. public virtual ArmOperation DownloadPriceSheet(WaitUntil waitUntil, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("TenantResourceExtensionClient.DownloadPriceSheet"); + Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); + Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); + Argument.AssertNotNullOrEmpty(invoiceName, nameof(invoiceName)); + + using var scope = PriceSheetClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.DownloadPriceSheet"); scope.Start(); try { @@ -1217,9 +1484,14 @@ public virtual ArmOperation DownloadPriceSheet(WaitUntil waitUntil, /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a billing profile. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual async Task> DownloadByBillingProfilePriceSheetAsync(WaitUntil waitUntil, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("TenantResourceExtensionClient.DownloadByBillingProfilePriceSheet"); + Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); + Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); + + using var scope = PriceSheetClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.DownloadByBillingProfilePriceSheet"); scope.Start(); try { @@ -1253,9 +1525,14 @@ public virtual async Task> DownloadByBillingProfilePri /// The ID that uniquely identifies a billing account. /// The ID that uniquely identifies a billing profile. /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. public virtual ArmOperation DownloadByBillingProfilePriceSheet(WaitUntil waitUntil, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default) { - using var scope = PriceSheetClientDiagnostics.CreateScope("TenantResourceExtensionClient.DownloadByBillingProfilePriceSheet"); + Argument.AssertNotNullOrEmpty(billingAccountName, nameof(billingAccountName)); + Argument.AssertNotNullOrEmpty(billingProfileName, nameof(billingProfileName)); + + using var scope = PriceSheetClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.DownloadByBillingProfilePriceSheet"); scope.Start(); try { @@ -1287,9 +1564,12 @@ public virtual ArmOperation DownloadByBillingProfilePriceSheet(Wait /// /// Scheduled action to be created or updated. /// The cancellation token to use. + /// is null. public virtual async Task> CheckCostManagementNameAvailabilityByScheduledActionAsync(CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ScheduledActionsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckCostManagementNameAvailabilityByScheduledAction"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.CheckCostManagementNameAvailabilityByScheduledAction"); scope.Start(); try { @@ -1318,9 +1598,12 @@ public virtual async Task> CheckC /// /// Scheduled action to be created or updated. /// The cancellation token to use. + /// is null. public virtual Response CheckCostManagementNameAvailabilityByScheduledAction(CostManagementNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ScheduledActionsClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckCostManagementNameAvailabilityByScheduledAction"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("CostManagementTenantMockingExtension.CheckCostManagementNameAvailabilityByScheduledAction"); scope.Start(); try { diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/ConnectorResourceFormatResource.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/ConnectorResourceFormatResource.cs index ee2355f1a90c..e20788062ea7 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/ConnectorResourceFormatResource.cs +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/ConnectorResourceFormatResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ConnectorMappingResourceFormatResources and their operations over a ConnectorMappingResourceFormatResource. public virtual ConnectorMappingResourceFormatCollection GetConnectorMappingResourceFormats() { - return GetCachedClient(Client => new ConnectorMappingResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new ConnectorMappingResourceFormatCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual ConnectorMappingResourceFormatCollection GetConnectorMappingResou /// /// The name of the connector mapping. /// The cancellation token to use. - /// 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> GetConnectorMappingResourceFormatAsync(string mappingName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetC /// /// The name of the connector mapping. /// The cancellation token to use. - /// 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 GetConnectorMappingResourceFormat(string mappingName, CancellationToken cancellationToken = default) { diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsArmClientMockingExtension.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsArmClientMockingExtension.cs new file mode 100644 index 000000000000..3f5b2ed511f3 --- /dev/null +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsArmClientMockingExtension.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CustomerInsights; + +namespace Azure.ResourceManager.CustomerInsights.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class CustomerInsightsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CustomerInsightsArmClientMockingExtension() + { + } + + /// 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 CustomerInsightsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal CustomerInsightsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual HubResource GetHubResource(ResourceIdentifier id) + { + HubResource.ValidateResourceId(id); + return new HubResource(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 ProfileResourceFormatResource GetProfileResourceFormatResource(ResourceIdentifier id) + { + ProfileResourceFormatResource.ValidateResourceId(id); + return new ProfileResourceFormatResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual InteractionResourceFormatResource GetInteractionResourceFormatResource(ResourceIdentifier id) + { + InteractionResourceFormatResource.ValidateResourceId(id); + return new InteractionResourceFormatResource(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 RelationshipResourceFormatResource GetRelationshipResourceFormatResource(ResourceIdentifier id) + { + RelationshipResourceFormatResource.ValidateResourceId(id); + return new RelationshipResourceFormatResource(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 RelationshipLinkResourceFormatResource GetRelationshipLinkResourceFormatResource(ResourceIdentifier id) + { + RelationshipLinkResourceFormatResource.ValidateResourceId(id); + return new RelationshipLinkResourceFormatResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AuthorizationPolicyResourceFormatResource GetAuthorizationPolicyResourceFormatResource(ResourceIdentifier id) + { + AuthorizationPolicyResourceFormatResource.ValidateResourceId(id); + return new AuthorizationPolicyResourceFormatResource(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 ConnectorResourceFormatResource GetConnectorResourceFormatResource(ResourceIdentifier id) + { + ConnectorResourceFormatResource.ValidateResourceId(id); + return new ConnectorResourceFormatResource(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 ConnectorMappingResourceFormatResource GetConnectorMappingResourceFormatResource(ResourceIdentifier id) + { + ConnectorMappingResourceFormatResource.ValidateResourceId(id); + return new ConnectorMappingResourceFormatResource(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 KpiResourceFormatResource GetKpiResourceFormatResource(ResourceIdentifier id) + { + KpiResourceFormatResource.ValidateResourceId(id); + return new KpiResourceFormatResource(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 WidgetTypeResourceFormatResource GetWidgetTypeResourceFormatResource(ResourceIdentifier id) + { + WidgetTypeResourceFormatResource.ValidateResourceId(id); + return new WidgetTypeResourceFormatResource(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 ViewResourceFormatResource GetViewResourceFormatResource(ResourceIdentifier id) + { + ViewResourceFormatResource.ValidateResourceId(id); + return new ViewResourceFormatResource(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 LinkResourceFormatResource GetLinkResourceFormatResource(ResourceIdentifier id) + { + LinkResourceFormatResource.ValidateResourceId(id); + return new LinkResourceFormatResource(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 RoleAssignmentResourceFormatResource GetRoleAssignmentResourceFormatResource(ResourceIdentifier id) + { + RoleAssignmentResourceFormatResource.ValidateResourceId(id); + return new RoleAssignmentResourceFormatResource(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 PredictionResourceFormatResource GetPredictionResourceFormatResource(ResourceIdentifier id) + { + PredictionResourceFormatResource.ValidateResourceId(id); + return new PredictionResourceFormatResource(Client, id); + } + } +} diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsExtensions.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsExtensions.cs index a500d3fc3bab..359295acdf95 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsExtensions.cs +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.CustomerInsights.Mocking; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.CustomerInsights @@ -18,309 +19,257 @@ namespace Azure.ResourceManager.CustomerInsights /// A class to add extension methods to Azure.ResourceManager.CustomerInsights. public static partial class CustomerInsightsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static CustomerInsightsArmClientMockingExtension GetCustomerInsightsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new CustomerInsightsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static CustomerInsightsResourceGroupMockingExtension GetCustomerInsightsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new CustomerInsightsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static CustomerInsightsSubscriptionMockingExtension GetCustomerInsightsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new CustomerInsightsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region HubResource /// /// 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. /// Returns a object. public static HubResource GetHubResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - HubResource.ValidateResourceId(id); - return new HubResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetHubResource(id); } - #endregion - #region ProfileResourceFormatResource /// /// 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. /// Returns a object. public static ProfileResourceFormatResource GetProfileResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ProfileResourceFormatResource.ValidateResourceId(id); - return new ProfileResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetProfileResourceFormatResource(id); } - #endregion - #region InteractionResourceFormatResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static InteractionResourceFormatResource GetInteractionResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - InteractionResourceFormatResource.ValidateResourceId(id); - return new InteractionResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetInteractionResourceFormatResource(id); } - #endregion - #region RelationshipResourceFormatResource /// /// 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. /// Returns a object. public static RelationshipResourceFormatResource GetRelationshipResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelationshipResourceFormatResource.ValidateResourceId(id); - return new RelationshipResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetRelationshipResourceFormatResource(id); } - #endregion - #region RelationshipLinkResourceFormatResource /// /// 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. /// Returns a object. public static RelationshipLinkResourceFormatResource GetRelationshipLinkResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RelationshipLinkResourceFormatResource.ValidateResourceId(id); - return new RelationshipLinkResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetRelationshipLinkResourceFormatResource(id); } - #endregion - #region AuthorizationPolicyResourceFormatResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// Returns a object. public static AuthorizationPolicyResourceFormatResource GetAuthorizationPolicyResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - AuthorizationPolicyResourceFormatResource.ValidateResourceId(id); - return new AuthorizationPolicyResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetAuthorizationPolicyResourceFormatResource(id); } - #endregion - #region ConnectorResourceFormatResource /// /// 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. /// Returns a object. public static ConnectorResourceFormatResource GetConnectorResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectorResourceFormatResource.ValidateResourceId(id); - return new ConnectorResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetConnectorResourceFormatResource(id); } - #endregion - #region ConnectorMappingResourceFormatResource /// /// 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. /// Returns a object. public static ConnectorMappingResourceFormatResource GetConnectorMappingResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ConnectorMappingResourceFormatResource.ValidateResourceId(id); - return new ConnectorMappingResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetConnectorMappingResourceFormatResource(id); } - #endregion - #region KpiResourceFormatResource /// /// 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. /// Returns a object. public static KpiResourceFormatResource GetKpiResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - KpiResourceFormatResource.ValidateResourceId(id); - return new KpiResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetKpiResourceFormatResource(id); } - #endregion - #region WidgetTypeResourceFormatResource /// /// 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. /// Returns a object. public static WidgetTypeResourceFormatResource GetWidgetTypeResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - WidgetTypeResourceFormatResource.ValidateResourceId(id); - return new WidgetTypeResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetWidgetTypeResourceFormatResource(id); } - #endregion - #region ViewResourceFormatResource /// /// 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. /// Returns a object. public static ViewResourceFormatResource GetViewResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - ViewResourceFormatResource.ValidateResourceId(id); - return new ViewResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetViewResourceFormatResource(id); } - #endregion - #region LinkResourceFormatResource /// /// 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. /// Returns a object. public static LinkResourceFormatResource GetLinkResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - LinkResourceFormatResource.ValidateResourceId(id); - return new LinkResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetLinkResourceFormatResource(id); } - #endregion - #region RoleAssignmentResourceFormatResource /// /// 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. /// Returns a object. public static RoleAssignmentResourceFormatResource GetRoleAssignmentResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - RoleAssignmentResourceFormatResource.ValidateResourceId(id); - return new RoleAssignmentResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetRoleAssignmentResourceFormatResource(id); } - #endregion - #region PredictionResourceFormatResource /// /// 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. /// Returns a object. public static PredictionResourceFormatResource GetPredictionResourceFormatResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - PredictionResourceFormatResource.ValidateResourceId(id); - return new PredictionResourceFormatResource(client, id); - } - ); + return GetCustomerInsightsArmClientMockingExtension(client).GetPredictionResourceFormatResource(id); } - #endregion - /// Gets a collection of HubResources in the ResourceGroupResource. + /// + /// Gets a collection of HubResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of HubResources and their operations over a HubResource. public static HubCollection GetHubs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetHubs(); + return GetCustomerInsightsResourceGroupMockingExtension(resourceGroupResource).GetHubs(); } /// @@ -335,16 +284,20 @@ public static HubCollection GetHubs(this ResourceGroupResource resourceGroupReso /// Hubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the hub. /// The cancellation token to use. - /// 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 static async Task> GetHubAsync(this ResourceGroupResource resourceGroupResource, string hubName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetHubs().GetAsync(hubName, cancellationToken).ConfigureAwait(false); + return await GetCustomerInsightsResourceGroupMockingExtension(resourceGroupResource).GetHubAsync(hubName, cancellationToken).ConfigureAwait(false); } /// @@ -359,16 +312,20 @@ public static async Task> GetHubAsync(this ResourceGroupRe /// Hubs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the hub. /// The cancellation token to use. - /// 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 static Response GetHub(this ResourceGroupResource resourceGroupResource, string hubName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetHubs().Get(hubName, cancellationToken); + return GetCustomerInsightsResourceGroupMockingExtension(resourceGroupResource).GetHub(hubName, cancellationToken); } /// @@ -383,13 +340,17 @@ public static Response GetHub(this ResourceGroupResource resourceGr /// Hubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetHubsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHubsAsync(cancellationToken); + return GetCustomerInsightsSubscriptionMockingExtension(subscriptionResource).GetHubsAsync(cancellationToken); } /// @@ -404,13 +365,17 @@ public static AsyncPageable GetHubsAsync(this SubscriptionResource /// Hubs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetHubs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetHubs(cancellationToken); + return GetCustomerInsightsSubscriptionMockingExtension(subscriptionResource).GetHubs(cancellationToken); } } } diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsResourceGroupMockingExtension.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..2ad562f43067 --- /dev/null +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.CustomerInsights; + +namespace Azure.ResourceManager.CustomerInsights.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class CustomerInsightsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected CustomerInsightsResourceGroupMockingExtension() + { + } + + /// 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 CustomerInsightsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of HubResources in the ResourceGroupResource. + /// An object representing collection of HubResources and their operations over a HubResource. + public virtual HubCollection GetHubs() + { + return GetCachedClient(client => new HubCollection(client, Id)); + } + + /// + /// Gets information about the specified hub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName} + /// + /// + /// Operation Id + /// Hubs_Get + /// + /// + /// + /// The name of the hub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHubAsync(string hubName, CancellationToken cancellationToken = default) + { + return await GetHubs().GetAsync(hubName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified hub. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName} + /// + /// + /// Operation Id + /// Hubs_Get + /// + /// + /// + /// The name of the hub. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHub(string hubName, CancellationToken cancellationToken = default) + { + return GetHubs().Get(hubName, cancellationToken); + } + } +} diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsSubscriptionMockingExtension.cs similarity index 83% rename from sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsSubscriptionMockingExtension.cs index 86b7a5a888b7..ab165a68d753 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/CustomerInsightsSubscriptionMockingExtension.cs @@ -11,24 +11,25 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CustomerInsights; -namespace Azure.ResourceManager.CustomerInsights +namespace Azure.ResourceManager.CustomerInsights.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class CustomerInsightsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _hubClientDiagnostics; private HubsRestOperations _hubRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected CustomerInsightsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal CustomerInsightsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -60,7 +61,7 @@ public virtual AsyncPageable GetHubsAsync(CancellationToken cancell { HttpMessage FirstPageRequest(int? pageSizeHint) => HubRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HubRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HubResource(Client, HubData.DeserializeHubData(e)), HubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HubResource(Client, HubData.DeserializeHubData(e)), HubClientDiagnostics, Pipeline, "CustomerInsightsSubscriptionMockingExtension.GetHubs", "value", "nextLink", cancellationToken); } /// @@ -82,7 +83,7 @@ public virtual Pageable GetHubs(CancellationToken cancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => HubRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HubRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HubResource(Client, HubData.DeserializeHubData(e)), HubClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetHubs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HubResource(Client, HubData.DeserializeHubData(e)), HubClientDiagnostics, Pipeline, "CustomerInsightsSubscriptionMockingExtension.GetHubs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 4e2892bedf55..000000000000 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.CustomerInsights -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of HubResources in the ResourceGroupResource. - /// An object representing collection of HubResources and their operations over a HubResource. - public virtual HubCollection GetHubs() - { - return GetCachedClient(Client => new HubCollection(Client, Id)); - } - } -} diff --git a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/HubResource.cs b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/HubResource.cs index 534422bf9cd4..3b9d8c3a0e99 100644 --- a/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/HubResource.cs +++ b/sdk/customer-insights/Azure.ResourceManager.CustomerInsights/src/Generated/HubResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of ProfileResourceFormatResources and their operations over a ProfileResourceFormatResource. public virtual ProfileResourceFormatCollection GetProfileResourceFormats() { - return GetCachedClient(Client => new ProfileResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new ProfileResourceFormatCollection(client, Id)); } /// @@ -121,8 +121,8 @@ public virtual ProfileResourceFormatCollection GetProfileResourceFormats() /// The name of the profile. /// Locale of profile to retrieve, default is en-us. /// The cancellation token to use. - /// 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> GetProfileResourceFormatAsync(string profileName, string localeCode = null, CancellationToken cancellationToken = default) { @@ -145,8 +145,8 @@ public virtual async Task> GetProfileRes /// The name of the profile. /// Locale of profile to retrieve, default is en-us. /// The cancellation token to use. - /// 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 GetProfileResourceFormat(string profileName, string localeCode = null, CancellationToken cancellationToken = default) { @@ -157,7 +157,7 @@ public virtual Response GetProfileResourceFormat( /// An object representing collection of InteractionResourceFormatResources and their operations over a InteractionResourceFormatResource. public virtual InteractionResourceFormatCollection GetInteractionResourceFormats() { - return GetCachedClient(Client => new InteractionResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new InteractionResourceFormatCollection(client, Id)); } /// @@ -176,8 +176,8 @@ public virtual InteractionResourceFormatCollection GetInteractionResourceFormats /// The name of the interaction. /// Locale of interaction to retrieve, default is en-us. /// The cancellation token to use. - /// 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> GetInteractionResourceFormatAsync(string interactionName, string localeCode = null, CancellationToken cancellationToken = default) { @@ -200,8 +200,8 @@ public virtual async Task> GetIntera /// The name of the interaction. /// Locale of interaction to retrieve, default is en-us. /// The cancellation token to use. - /// 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 GetInteractionResourceFormat(string interactionName, string localeCode = null, CancellationToken cancellationToken = default) { @@ -212,7 +212,7 @@ public virtual Response GetInteractionResourc /// An object representing collection of RelationshipResourceFormatResources and their operations over a RelationshipResourceFormatResource. public virtual RelationshipResourceFormatCollection GetRelationshipResourceFormats() { - return GetCachedClient(Client => new RelationshipResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new RelationshipResourceFormatCollection(client, Id)); } /// @@ -230,8 +230,8 @@ public virtual RelationshipResourceFormatCollection GetRelationshipResourceForma /// /// The name of the relationship. /// The cancellation token to use. - /// 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> GetRelationshipResourceFormatAsync(string relationshipName, CancellationToken cancellationToken = default) { @@ -253,8 +253,8 @@ public virtual async Task> GetRelat /// /// The name of the relationship. /// The cancellation token to use. - /// 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 GetRelationshipResourceFormat(string relationshipName, CancellationToken cancellationToken = default) { @@ -265,7 +265,7 @@ public virtual Response GetRelationshipResou /// An object representing collection of RelationshipLinkResourceFormatResources and their operations over a RelationshipLinkResourceFormatResource. public virtual RelationshipLinkResourceFormatCollection GetRelationshipLinkResourceFormats() { - return GetCachedClient(Client => new RelationshipLinkResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new RelationshipLinkResourceFormatCollection(client, Id)); } /// @@ -283,8 +283,8 @@ public virtual RelationshipLinkResourceFormatCollection GetRelationshipLinkResou /// /// The name of the relationship link. /// The cancellation token to use. - /// 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> GetRelationshipLinkResourceFormatAsync(string relationshipLinkName, CancellationToken cancellationToken = default) { @@ -306,8 +306,8 @@ public virtual async Task> GetR /// /// The name of the relationship link. /// The cancellation token to use. - /// 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 GetRelationshipLinkResourceFormat(string relationshipLinkName, CancellationToken cancellationToken = default) { @@ -318,7 +318,7 @@ public virtual Response GetRelationshipL /// An object representing collection of AuthorizationPolicyResourceFormatResources and their operations over a AuthorizationPolicyResourceFormatResource. public virtual AuthorizationPolicyResourceFormatCollection GetAuthorizationPolicyResourceFormats() { - return GetCachedClient(Client => new AuthorizationPolicyResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new AuthorizationPolicyResourceFormatCollection(client, Id)); } /// @@ -336,8 +336,8 @@ public virtual AuthorizationPolicyResourceFormatCollection GetAuthorizationPolic /// /// The name of the policy. /// The cancellation token to use. - /// 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> GetAuthorizationPolicyResourceFormatAsync(string authorizationPolicyName, CancellationToken cancellationToken = default) { @@ -359,8 +359,8 @@ public virtual async Task> G /// /// The name of the policy. /// The cancellation token to use. - /// 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 GetAuthorizationPolicyResourceFormat(string authorizationPolicyName, CancellationToken cancellationToken = default) { @@ -371,7 +371,7 @@ public virtual Response GetAuthorizat /// An object representing collection of ConnectorResourceFormatResources and their operations over a ConnectorResourceFormatResource. public virtual ConnectorResourceFormatCollection GetConnectorResourceFormats() { - return GetCachedClient(Client => new ConnectorResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new ConnectorResourceFormatCollection(client, Id)); } /// @@ -389,8 +389,8 @@ public virtual ConnectorResourceFormatCollection GetConnectorResourceFormats() /// /// The name of the connector. /// The cancellation token to use. - /// 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> GetConnectorResourceFormatAsync(string connectorName, CancellationToken cancellationToken = default) { @@ -412,8 +412,8 @@ public virtual async Task> GetConnecto /// /// The name of the connector. /// The cancellation token to use. - /// 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 GetConnectorResourceFormat(string connectorName, CancellationToken cancellationToken = default) { @@ -424,7 +424,7 @@ public virtual Response GetConnectorResourceFor /// An object representing collection of KpiResourceFormatResources and their operations over a KpiResourceFormatResource. public virtual KpiResourceFormatCollection GetKpiResourceFormats() { - return GetCachedClient(Client => new KpiResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new KpiResourceFormatCollection(client, Id)); } /// @@ -442,8 +442,8 @@ public virtual KpiResourceFormatCollection GetKpiResourceFormats() /// /// The name of the KPI. /// The cancellation token to use. - /// 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> GetKpiResourceFormatAsync(string kpiName, CancellationToken cancellationToken = default) { @@ -465,8 +465,8 @@ public virtual async Task> GetKpiResourceFor /// /// The name of the KPI. /// The cancellation token to use. - /// 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 GetKpiResourceFormat(string kpiName, CancellationToken cancellationToken = default) { @@ -477,7 +477,7 @@ public virtual Response GetKpiResourceFormat(string k /// An object representing collection of WidgetTypeResourceFormatResources and their operations over a WidgetTypeResourceFormatResource. public virtual WidgetTypeResourceFormatCollection GetWidgetTypeResourceFormats() { - return GetCachedClient(Client => new WidgetTypeResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new WidgetTypeResourceFormatCollection(client, Id)); } /// @@ -495,8 +495,8 @@ public virtual WidgetTypeResourceFormatCollection GetWidgetTypeResourceFormats() /// /// The name of the widget type. /// The cancellation token to use. - /// 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> GetWidgetTypeResourceFormatAsync(string widgetTypeName, CancellationToken cancellationToken = default) { @@ -518,8 +518,8 @@ public virtual async Task> GetWidgetT /// /// The name of the widget type. /// The cancellation token to use. - /// 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 GetWidgetTypeResourceFormat(string widgetTypeName, CancellationToken cancellationToken = default) { @@ -530,7 +530,7 @@ public virtual Response GetWidgetTypeResourceF /// An object representing collection of ViewResourceFormatResources and their operations over a ViewResourceFormatResource. public virtual ViewResourceFormatCollection GetViewResourceFormats() { - return GetCachedClient(Client => new ViewResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new ViewResourceFormatCollection(client, Id)); } /// @@ -549,8 +549,8 @@ public virtual ViewResourceFormatCollection GetViewResourceFormats() /// The name of the view. /// The user ID. Use * to retrieve hub level view. /// The cancellation token to use. - /// 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 virtual async Task> GetViewResourceFormatAsync(string viewName, string userId, CancellationToken cancellationToken = default) { @@ -573,8 +573,8 @@ public virtual async Task> GetViewResourceF /// The name of the view. /// The user ID. Use * to retrieve hub level view. /// The cancellation token to use. - /// 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 virtual Response GetViewResourceFormat(string viewName, string userId, CancellationToken cancellationToken = default) { @@ -585,7 +585,7 @@ public virtual Response GetViewResourceFormat(string /// An object representing collection of LinkResourceFormatResources and their operations over a LinkResourceFormatResource. public virtual LinkResourceFormatCollection GetLinkResourceFormats() { - return GetCachedClient(Client => new LinkResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new LinkResourceFormatCollection(client, Id)); } /// @@ -603,8 +603,8 @@ public virtual LinkResourceFormatCollection GetLinkResourceFormats() /// /// The name of the link. /// The cancellation token to use. - /// 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> GetLinkResourceFormatAsync(string linkName, CancellationToken cancellationToken = default) { @@ -626,8 +626,8 @@ public virtual async Task> GetLinkResourceF /// /// The name of the link. /// The cancellation token to use. - /// 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 GetLinkResourceFormat(string linkName, CancellationToken cancellationToken = default) { @@ -638,7 +638,7 @@ public virtual Response GetLinkResourceFormat(string /// An object representing collection of RoleAssignmentResourceFormatResources and their operations over a RoleAssignmentResourceFormatResource. public virtual RoleAssignmentResourceFormatCollection GetRoleAssignmentResourceFormats() { - return GetCachedClient(Client => new RoleAssignmentResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new RoleAssignmentResourceFormatCollection(client, Id)); } /// @@ -656,8 +656,8 @@ public virtual RoleAssignmentResourceFormatCollection GetRoleAssignmentResourceF /// /// The name of the role assignment. /// The cancellation token to use. - /// 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> GetRoleAssignmentResourceFormatAsync(string assignmentName, CancellationToken cancellationToken = default) { @@ -679,8 +679,8 @@ public virtual async Task> GetRol /// /// The name of the role assignment. /// The cancellation token to use. - /// 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 GetRoleAssignmentResourceFormat(string assignmentName, CancellationToken cancellationToken = default) { @@ -691,7 +691,7 @@ public virtual Response GetRoleAssignmentR /// An object representing collection of PredictionResourceFormatResources and their operations over a PredictionResourceFormatResource. public virtual PredictionResourceFormatCollection GetPredictionResourceFormats() { - return GetCachedClient(Client => new PredictionResourceFormatCollection(Client, Id)); + return GetCachedClient(client => new PredictionResourceFormatCollection(client, Id)); } /// @@ -709,8 +709,8 @@ public virtual PredictionResourceFormatCollection GetPredictionResourceFormats() /// /// The name of the Prediction. /// The cancellation token to use. - /// 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> GetPredictionResourceFormatAsync(string predictionName, CancellationToken cancellationToken = default) { @@ -732,8 +732,8 @@ public virtual async Task> GetPredict /// /// The name of the Prediction. /// The cancellation token to use. - /// 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 GetPredictionResourceFormat(string predictionName, CancellationToken cancellationToken = default) { diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxArmClientMockingExtension.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxArmClientMockingExtension.cs new file mode 100644 index 000000000000..4f0b5b8ce418 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxArmClientMockingExtension.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataBox; + +namespace Azure.ResourceManager.DataBox.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataBoxArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataBoxArmClientMockingExtension() + { + } + + /// 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 DataBoxArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataBoxArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataBoxJobResource GetDataBoxJobResource(ResourceIdentifier id) + { + DataBoxJobResource.ValidateResourceId(id); + return new DataBoxJobResource(Client, id); + } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxExtensions.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxExtensions.cs index e14c3f81fb13..a1edd82211b8 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxExtensions.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataBox.Mocking; using Azure.ResourceManager.DataBox.Models; using Azure.ResourceManager.Resources; @@ -19,62 +20,49 @@ namespace Azure.ResourceManager.DataBox /// A class to add extension methods to Azure.ResourceManager.DataBox. public static partial class DataBoxExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataBoxArmClientMockingExtension GetDataBoxArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataBoxArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataBoxResourceGroupMockingExtension GetDataBoxResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataBoxResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataBoxSubscriptionMockingExtension GetDataBoxSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataBoxSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataBoxJobResource /// /// 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. /// Returns a object. public static DataBoxJobResource GetDataBoxJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxJobResource.ValidateResourceId(id); - return new DataBoxJobResource(client, id); - } - ); + return GetDataBoxArmClientMockingExtension(client).GetDataBoxJobResource(id); } - #endregion - /// Gets a collection of DataBoxJobResources in the ResourceGroupResource. + /// + /// Gets a collection of DataBoxJobResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataBoxJobResources and their operations over a DataBoxJobResource. public static DataBoxJobCollection GetDataBoxJobs(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataBoxJobs(); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetDataBoxJobs(); } /// @@ -89,17 +77,21 @@ public static DataBoxJobCollection GetDataBoxJobs(this ResourceGroupResource res /// Jobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. /// $expand is supported on details parameter for job, which provides details on the job stages. /// The cancellation token to use. - /// 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 static async Task> GetDataBoxJobAsync(this ResourceGroupResource resourceGroupResource, string jobName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataBoxJobs().GetAsync(jobName, expand, cancellationToken).ConfigureAwait(false); + return await GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetDataBoxJobAsync(jobName, expand, cancellationToken).ConfigureAwait(false); } /// @@ -114,17 +106,21 @@ public static async Task> GetDataBoxJobAsync(this R /// Jobs_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. /// $expand is supported on details parameter for job, which provides details on the job stages. /// The cancellation token to use. - /// 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 static Response GetDataBoxJob(this ResourceGroupResource resourceGroupResource, string jobName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataBoxJobs().Get(jobName, expand, cancellationToken); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetDataBoxJob(jobName, expand, cancellationToken); } /// @@ -139,6 +135,10 @@ public static Response GetDataBoxJob(this ResourceGroupResou /// Service_ListAvailableSkusByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -148,9 +148,7 @@ public static Response GetDataBoxJob(this ResourceGroupResou /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableSkusAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, AvailableSkusContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableSkusAsync(location, content, cancellationToken); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetAvailableSkusAsync(location, content, cancellationToken); } /// @@ -165,6 +163,10 @@ public static AsyncPageable GetAvailableSkusAsync(this Re /// Service_ListAvailableSkusByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -174,9 +176,7 @@ public static AsyncPageable GetAvailableSkusAsync(this Re /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableSkus(this ResourceGroupResource resourceGroupResource, AzureLocation location, AvailableSkusContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetAvailableSkus(location, content, cancellationToken); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetAvailableSkus(location, content, cancellationToken); } /// @@ -191,6 +191,10 @@ public static Pageable GetAvailableSkus(this ResourceGrou /// Service_ValidateInputsByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -199,9 +203,7 @@ public static Pageable GetAvailableSkus(this ResourceGrou /// is null. public static async Task> ValidateInputsAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateInputsAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataBoxResourceGroupMockingExtension(resourceGroupResource).ValidateInputsAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -216,6 +218,10 @@ public static async Task> ValidateInputsAsync( /// Service_ValidateInputsByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -224,9 +230,7 @@ public static async Task> ValidateInputsAsync( /// is null. public static Response ValidateInputs(this ResourceGroupResource resourceGroupResource, AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).ValidateInputs(location, content, cancellationToken); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).ValidateInputs(location, content, cancellationToken); } /// @@ -241,6 +245,10 @@ public static Response ValidateInputs(this ResourceGrou /// Service_RegionConfigurationByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -249,9 +257,7 @@ public static Response ValidateInputs(this ResourceGrou /// is null. public static async Task> GetRegionConfigurationAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRegionConfigurationAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetRegionConfigurationAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -266,6 +272,10 @@ public static async Task> GetRegionConfigura /// Service_RegionConfigurationByResourceGroup /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -274,9 +284,7 @@ public static async Task> GetRegionConfigura /// is null. public static Response GetRegionConfiguration(this ResourceGroupResource resourceGroupResource, AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetRegionConfiguration(location, content, cancellationToken); + return GetDataBoxResourceGroupMockingExtension(resourceGroupResource).GetRegionConfiguration(location, content, cancellationToken); } /// @@ -291,6 +299,10 @@ public static Response GetRegionConfiguration(this Re /// Jobs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. @@ -298,7 +310,7 @@ public static Response GetRegionConfiguration(this Re /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataBoxJobsAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataBoxJobsAsync(skipToken, cancellationToken); + return GetDataBoxSubscriptionMockingExtension(subscriptionResource).GetDataBoxJobsAsync(skipToken, cancellationToken); } /// @@ -313,6 +325,10 @@ public static AsyncPageable GetDataBoxJobsAsync(this Subscri /// Jobs_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. @@ -320,7 +336,7 @@ public static AsyncPageable GetDataBoxJobsAsync(this Subscri /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataBoxJobs(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataBoxJobs(skipToken, cancellationToken); + return GetDataBoxSubscriptionMockingExtension(subscriptionResource).GetDataBoxJobs(skipToken, cancellationToken); } /// @@ -335,6 +351,10 @@ public static Pageable GetDataBoxJobs(this SubscriptionResou /// Service_ValidateAddress /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -343,9 +363,7 @@ public static Pageable GetDataBoxJobs(this SubscriptionResou /// is null. public static async Task> ValidateAddressAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataBoxValidateAddressContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateAddressAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataBoxSubscriptionMockingExtension(subscriptionResource).ValidateAddressAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -360,6 +378,10 @@ public static async Task> ValidateAddressAsync /// Service_ValidateAddress /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -368,9 +390,7 @@ public static async Task> ValidateAddressAsync /// is null. public static Response ValidateAddress(this SubscriptionResource subscriptionResource, AzureLocation location, DataBoxValidateAddressContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateAddress(location, content, cancellationToken); + return GetDataBoxSubscriptionMockingExtension(subscriptionResource).ValidateAddress(location, content, cancellationToken); } /// @@ -385,6 +405,10 @@ public static Response ValidateAddress(this Subscriptio /// Service_ValidateInputs /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -393,9 +417,7 @@ public static Response ValidateAddress(this Subscriptio /// is null. public static async Task> ValidateInputsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateInputsAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataBoxSubscriptionMockingExtension(subscriptionResource).ValidateInputsAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -410,6 +432,10 @@ public static async Task> ValidateInputsAsync( /// Service_ValidateInputs /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -418,9 +444,7 @@ public static async Task> ValidateInputsAsync( /// is null. public static Response ValidateInputs(this SubscriptionResource subscriptionResource, AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ValidateInputs(location, content, cancellationToken); + return GetDataBoxSubscriptionMockingExtension(subscriptionResource).ValidateInputs(location, content, cancellationToken); } /// @@ -435,6 +459,10 @@ public static Response ValidateInputs(this Subscription /// Service_RegionConfiguration /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -443,9 +471,7 @@ public static Response ValidateInputs(this Subscription /// is null. public static async Task> GetRegionConfigurationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetRegionConfigurationAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataBoxSubscriptionMockingExtension(subscriptionResource).GetRegionConfigurationAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -460,6 +486,10 @@ public static async Task> GetRegionConfigura /// Service_RegionConfiguration /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location of the resource. @@ -468,9 +498,7 @@ public static async Task> GetRegionConfigura /// is null. public static Response GetRegionConfiguration(this SubscriptionResource subscriptionResource, AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetRegionConfiguration(location, content, cancellationToken); + return GetDataBoxSubscriptionMockingExtension(subscriptionResource).GetRegionConfiguration(location, content, cancellationToken); } } } diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxResourceGroupMockingExtension.cs similarity index 70% rename from sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs rename to sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxResourceGroupMockingExtension.cs index b3bb2577ac18..31007ad2d3a3 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxResourceGroupMockingExtension.cs @@ -13,25 +13,26 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataBox; using Azure.ResourceManager.DataBox.Models; -namespace Azure.ResourceManager.DataBox +namespace Azure.ResourceManager.DataBox.Mocking { /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource + public partial class DataBoxResourceGroupMockingExtension : ArmResource { private ClientDiagnostics _serviceClientDiagnostics; private ServiceRestOperations _serviceRestClient; - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataBoxResourceGroupMockingExtension() { } - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataBoxResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -48,7 +49,55 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An object representing collection of DataBoxJobResources and their operations over a DataBoxJobResource. public virtual DataBoxJobCollection GetDataBoxJobs() { - return GetCachedClient(Client => new DataBoxJobCollection(Client, Id)); + return GetCachedClient(client => new DataBoxJobCollection(client, Id)); + } + + /// + /// Gets information about the specified job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// + /// The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// $expand is supported on details parameter for job, which provides details on the job stages. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataBoxJobAsync(string jobName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetDataBoxJobs().GetAsync(jobName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// + /// The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// $expand is supported on details parameter for job, which provides details on the job stages. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataBoxJob(string jobName, string expand = null, CancellationToken cancellationToken = default) + { + return GetDataBoxJobs().Get(jobName, expand, cancellationToken); } /// @@ -67,12 +116,15 @@ public virtual DataBoxJobCollection GetDataBoxJobs() /// The location of the resource. /// Filters for showing the available skus. /// The cancellation token to use. + /// is null. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAvailableSkusAsync(AzureLocation location, AvailableSkusContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceRestClient.CreateListAvailableSkusByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceRestClient.CreateListAvailableSkusByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, content); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataBoxSkuInformation.DeserializeDataBoxSkuInformation, ServiceClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataBoxSkuInformation.DeserializeDataBoxSkuInformation, ServiceClientDiagnostics, Pipeline, "DataBoxResourceGroupMockingExtension.GetAvailableSkus", "value", "nextLink", cancellationToken); } /// @@ -91,12 +143,15 @@ public virtual AsyncPageable GetAvailableSkusAsync(AzureL /// The location of the resource. /// Filters for showing the available skus. /// The cancellation token to use. + /// is null. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAvailableSkus(AzureLocation location, AvailableSkusContent content, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(content, nameof(content)); + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceRestClient.CreateListAvailableSkusByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, location, content); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceRestClient.CreateListAvailableSkusByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, location, content); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataBoxSkuInformation.DeserializeDataBoxSkuInformation, ServiceClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAvailableSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataBoxSkuInformation.DeserializeDataBoxSkuInformation, ServiceClientDiagnostics, Pipeline, "DataBoxResourceGroupMockingExtension.GetAvailableSkus", "value", "nextLink", cancellationToken); } /// @@ -115,9 +170,12 @@ public virtual Pageable GetAvailableSkus(AzureLocation lo /// The location of the resource. /// Inputs of the customer. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateInputsAsync(AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateInputs"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxResourceGroupMockingExtension.ValidateInputs"); scope.Start(); try { @@ -147,9 +205,12 @@ public virtual async Task> ValidateInputsAsync /// The location of the resource. /// Inputs of the customer. /// The cancellation token to use. + /// is null. public virtual Response ValidateInputs(AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.ValidateInputs"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxResourceGroupMockingExtension.ValidateInputs"); scope.Start(); try { @@ -179,9 +240,12 @@ public virtual Response ValidateInputs(AzureLocation lo /// The location of the resource. /// Request body to get the configuration for the region at resource group level. /// The cancellation token to use. + /// is null. public virtual async Task> GetRegionConfigurationAsync(AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetRegionConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxResourceGroupMockingExtension.GetRegionConfiguration"); scope.Start(); try { @@ -211,9 +275,12 @@ public virtual async Task> GetRegionConfigur /// The location of the resource. /// Request body to get the configuration for the region at resource group level. /// The cancellation token to use. + /// is null. public virtual Response GetRegionConfiguration(AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetRegionConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxResourceGroupMockingExtension.GetRegionConfiguration"); scope.Start(); try { diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxSubscriptionMockingExtension.cs similarity index 87% rename from sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxSubscriptionMockingExtension.cs index a0a972d78467..e9c921152c84 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Extensions/DataBoxSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataBox; using Azure.ResourceManager.DataBox.Models; -namespace Azure.ResourceManager.DataBox +namespace Azure.ResourceManager.DataBox.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataBoxSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataBoxJobJobsClientDiagnostics; private JobsRestOperations _dataBoxJobJobsRestClient; private ClientDiagnostics _serviceClientDiagnostics; private ServiceRestOperations _serviceRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataBoxSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataBoxSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -68,7 +69,7 @@ public virtual AsyncPageable GetDataBoxJobsAsync(string skip { HttpMessage FirstPageRequest(int? pageSizeHint) => DataBoxJobJobsRestClient.CreateListRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataBoxJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataBoxJobResource(Client, DataBoxJobData.DeserializeDataBoxJobData(e)), DataBoxJobJobsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataBoxJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataBoxJobResource(Client, DataBoxJobData.DeserializeDataBoxJobData(e)), DataBoxJobJobsClientDiagnostics, Pipeline, "DataBoxSubscriptionMockingExtension.GetDataBoxJobs", "value", "nextLink", cancellationToken); } /// @@ -91,7 +92,7 @@ public virtual Pageable GetDataBoxJobs(string skipToken = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => DataBoxJobJobsRestClient.CreateListRequest(Id.SubscriptionId, skipToken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataBoxJobJobsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataBoxJobResource(Client, DataBoxJobData.DeserializeDataBoxJobData(e)), DataBoxJobJobsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataBoxJobs", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataBoxJobResource(Client, DataBoxJobData.DeserializeDataBoxJobData(e)), DataBoxJobJobsClientDiagnostics, Pipeline, "DataBoxSubscriptionMockingExtension.GetDataBoxJobs", "value", "nextLink", cancellationToken); } /// @@ -110,9 +111,12 @@ public virtual Pageable GetDataBoxJobs(string skipToken = nu /// The location of the resource. /// Shipping address of the customer. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateAddressAsync(AzureLocation location, DataBoxValidateAddressContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateAddress"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.ValidateAddress"); scope.Start(); try { @@ -142,9 +146,12 @@ public virtual async Task> ValidateAddressAsyn /// The location of the resource. /// Shipping address of the customer. /// The cancellation token to use. + /// is null. public virtual Response ValidateAddress(AzureLocation location, DataBoxValidateAddressContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateAddress"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.ValidateAddress"); scope.Start(); try { @@ -174,9 +181,12 @@ public virtual Response ValidateAddress(AzureLocation l /// The location of the resource. /// Inputs of the customer. /// The cancellation token to use. + /// is null. public virtual async Task> ValidateInputsAsync(AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateInputs"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.ValidateInputs"); scope.Start(); try { @@ -206,9 +216,12 @@ public virtual async Task> ValidateInputsAsync /// The location of the resource. /// Inputs of the customer. /// The cancellation token to use. + /// is null. public virtual Response ValidateInputs(AzureLocation location, DataBoxValidationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ValidateInputs"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.ValidateInputs"); scope.Start(); try { @@ -238,9 +251,12 @@ public virtual Response ValidateInputs(AzureLocation lo /// The location of the resource. /// Request body to get the configuration for the region. /// The cancellation token to use. + /// is null. public virtual async Task> GetRegionConfigurationAsync(AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRegionConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.GetRegionConfiguration"); scope.Start(); try { @@ -270,9 +286,12 @@ public virtual async Task> GetRegionConfigur /// The location of the resource. /// Request body to get the configuration for the region. /// The cancellation token to use. + /// is null. public virtual Response GetRegionConfiguration(AzureLocation location, RegionConfigurationContent content, CancellationToken cancellationToken = default) { - using var scope = ServiceClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetRegionConfiguration"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ServiceClientDiagnostics.CreateScope("DataBoxSubscriptionMockingExtension.GetRegionConfiguration"); scope.Start(); try { diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeDeviceResource.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeDeviceResource.cs index 1f2d3a808992..d59f58765ae8 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeDeviceResource.cs +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeDeviceResource.cs @@ -110,7 +110,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataBoxEdgeAlertResources and their operations over a DataBoxEdgeAlertResource. public virtual DataBoxEdgeAlertCollection GetDataBoxEdgeAlerts() { - return GetCachedClient(Client => new DataBoxEdgeAlertCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeAlertCollection(client, Id)); } /// @@ -128,8 +128,8 @@ public virtual DataBoxEdgeAlertCollection GetDataBoxEdgeAlerts() /// /// The alert name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeAlertAsync(string name, CancellationToken cancellationToken = default) { @@ -151,8 +151,8 @@ public virtual async Task> GetDataBoxEdgeAler /// /// The alert name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeAlert(string name, CancellationToken cancellationToken = default) { @@ -163,7 +163,7 @@ public virtual Response GetDataBoxEdgeAlert(string nam /// An object representing collection of BandwidthScheduleResources and their operations over a BandwidthScheduleResource. public virtual BandwidthScheduleCollection GetBandwidthSchedules() { - return GetCachedClient(Client => new BandwidthScheduleCollection(Client, Id)); + return GetCachedClient(client => new BandwidthScheduleCollection(client, Id)); } /// @@ -181,8 +181,8 @@ public virtual BandwidthScheduleCollection GetBandwidthSchedules() /// /// The bandwidth schedule name. /// The cancellation token to use. - /// 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> GetBandwidthScheduleAsync(string name, CancellationToken cancellationToken = default) { @@ -204,8 +204,8 @@ public virtual async Task> GetBandwidthSched /// /// The bandwidth schedule name. /// The cancellation token to use. - /// 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 GetBandwidthSchedule(string name, CancellationToken cancellationToken = default) { @@ -230,7 +230,7 @@ public virtual DiagnosticRemoteSupportSettingResource GetDiagnosticRemoteSupport /// An object representing collection of DataBoxEdgeJobResources and their operations over a DataBoxEdgeJobResource. public virtual DataBoxEdgeJobCollection GetDataBoxEdgeJobs() { - return GetCachedClient(Client => new DataBoxEdgeJobCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeJobCollection(client, Id)); } /// @@ -248,8 +248,8 @@ public virtual DataBoxEdgeJobCollection GetDataBoxEdgeJobs() /// /// The job name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeJobAsync(string name, CancellationToken cancellationToken = default) { @@ -271,8 +271,8 @@ public virtual async Task> GetDataBoxEdgeJobAsy /// /// The job name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeJob(string name, CancellationToken cancellationToken = default) { @@ -290,7 +290,7 @@ public virtual DataBoxEdgeOrderResource GetDataBoxEdgeOrder() /// An object representing collection of DataBoxEdgeRoleResources and their operations over a DataBoxEdgeRoleResource. public virtual DataBoxEdgeRoleCollection GetDataBoxEdgeRoles() { - return GetCachedClient(Client => new DataBoxEdgeRoleCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeRoleCollection(client, Id)); } /// @@ -308,8 +308,8 @@ public virtual DataBoxEdgeRoleCollection GetDataBoxEdgeRoles() /// /// The role name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeRoleAsync(string name, CancellationToken cancellationToken = default) { @@ -331,8 +331,8 @@ public virtual async Task> GetDataBoxEdgeRoleA /// /// The role name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeRole(string name, CancellationToken cancellationToken = default) { @@ -343,7 +343,7 @@ public virtual Response GetDataBoxEdgeRole(string name, /// An object representing collection of DataBoxEdgeShareResources and their operations over a DataBoxEdgeShareResource. public virtual DataBoxEdgeShareCollection GetDataBoxEdgeShares() { - return GetCachedClient(Client => new DataBoxEdgeShareCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeShareCollection(client, Id)); } /// @@ -361,8 +361,8 @@ public virtual DataBoxEdgeShareCollection GetDataBoxEdgeShares() /// /// The share name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeShareAsync(string name, CancellationToken cancellationToken = default) { @@ -384,8 +384,8 @@ public virtual async Task> GetDataBoxEdgeShar /// /// The share name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeShare(string name, CancellationToken cancellationToken = default) { @@ -396,7 +396,7 @@ public virtual Response GetDataBoxEdgeShare(string nam /// An object representing collection of DataBoxEdgeStorageAccountCredentialResources and their operations over a DataBoxEdgeStorageAccountCredentialResource. public virtual DataBoxEdgeStorageAccountCredentialCollection GetDataBoxEdgeStorageAccountCredentials() { - return GetCachedClient(Client => new DataBoxEdgeStorageAccountCredentialCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeStorageAccountCredentialCollection(client, Id)); } /// @@ -414,8 +414,8 @@ public virtual DataBoxEdgeStorageAccountCredentialCollection GetDataBoxEdgeStora /// /// The storage account credential name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeStorageAccountCredentialAsync(string name, CancellationToken cancellationToken = default) { @@ -437,8 +437,8 @@ public virtual async Task> /// /// The storage account credential name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeStorageAccountCredential(string name, CancellationToken cancellationToken = default) { @@ -449,7 +449,7 @@ public virtual Response GetDataBoxE /// An object representing collection of DataBoxEdgeStorageAccountResources and their operations over a DataBoxEdgeStorageAccountResource. public virtual DataBoxEdgeStorageAccountCollection GetDataBoxEdgeStorageAccounts() { - return GetCachedClient(Client => new DataBoxEdgeStorageAccountCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeStorageAccountCollection(client, Id)); } /// @@ -467,8 +467,8 @@ public virtual DataBoxEdgeStorageAccountCollection GetDataBoxEdgeStorageAccounts /// /// The storage account name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeStorageAccountAsync(string storageAccountName, CancellationToken cancellationToken = default) { @@ -490,8 +490,8 @@ public virtual async Task> GetDataBo /// /// The storage account name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeStorageAccount(string storageAccountName, CancellationToken cancellationToken = default) { @@ -502,7 +502,7 @@ public virtual Response GetDataBoxEdgeStorage /// An object representing collection of DataBoxEdgeTriggerResources and their operations over a DataBoxEdgeTriggerResource. public virtual DataBoxEdgeTriggerCollection GetDataBoxEdgeTriggers() { - return GetCachedClient(Client => new DataBoxEdgeTriggerCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeTriggerCollection(client, Id)); } /// @@ -520,8 +520,8 @@ public virtual DataBoxEdgeTriggerCollection GetDataBoxEdgeTriggers() /// /// The trigger name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeTriggerAsync(string name, CancellationToken cancellationToken = default) { @@ -543,8 +543,8 @@ public virtual async Task> GetDataBoxEdgeTr /// /// The trigger name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeTrigger(string name, CancellationToken cancellationToken = default) { @@ -555,7 +555,7 @@ public virtual Response GetDataBoxEdgeTrigger(string /// An object representing collection of DataBoxEdgeUserResources and their operations over a DataBoxEdgeUserResource. public virtual DataBoxEdgeUserCollection GetDataBoxEdgeUsers() { - return GetCachedClient(Client => new DataBoxEdgeUserCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeUserCollection(client, Id)); } /// @@ -573,8 +573,8 @@ public virtual DataBoxEdgeUserCollection GetDataBoxEdgeUsers() /// /// The user name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeUserAsync(string name, CancellationToken cancellationToken = default) { @@ -596,8 +596,8 @@ public virtual async Task> GetDataBoxEdgeUserA /// /// The user name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeUser(string name, CancellationToken cancellationToken = default) { diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeRoleResource.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeRoleResource.cs index 7b69e6271bbd..76a99a129121 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeRoleResource.cs +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeRoleResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataBoxEdgeRoleAddonResources and their operations over a DataBoxEdgeRoleAddonResource. public virtual DataBoxEdgeRoleAddonCollection GetDataBoxEdgeRoleAddons() { - return GetCachedClient(Client => new DataBoxEdgeRoleAddonCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeRoleAddonCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual DataBoxEdgeRoleAddonCollection GetDataBoxEdgeRoleAddons() /// /// The addon name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeRoleAddonAsync(string addonName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetDataBoxEdge /// /// The addon name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeRoleAddon(string addonName, CancellationToken cancellationToken = default) { diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeStorageAccountResource.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeStorageAccountResource.cs index a32f56794a5a..1f9c5553a924 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeStorageAccountResource.cs +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/DataBoxEdgeStorageAccountResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataBoxEdgeStorageContainerResources and their operations over a DataBoxEdgeStorageContainerResource. public virtual DataBoxEdgeStorageContainerCollection GetDataBoxEdgeStorageContainers() { - return GetCachedClient(Client => new DataBoxEdgeStorageContainerCollection(Client, Id)); + return GetCachedClient(client => new DataBoxEdgeStorageContainerCollection(client, Id)); } /// @@ -108,8 +108,8 @@ public virtual DataBoxEdgeStorageContainerCollection GetDataBoxEdgeStorageContai /// /// The container Name. /// The cancellation token to use. - /// 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> GetDataBoxEdgeStorageContainerAsync(string containerName, CancellationToken cancellationToken = default) { @@ -131,8 +131,8 @@ public virtual async Task> GetData /// /// The container Name. /// The cancellation token to use. - /// 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 GetDataBoxEdgeStorageContainer(string containerName, CancellationToken cancellationToken = default) { diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeArmClientMockingExtension.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeArmClientMockingExtension.cs new file mode 100644 index 000000000000..b4c0d19a07dc --- /dev/null +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeArmClientMockingExtension.cs @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataBoxEdge; + +namespace Azure.ResourceManager.DataBoxEdge.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataBoxEdgeArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataBoxEdgeArmClientMockingExtension() + { + } + + /// 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 DataBoxEdgeArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataBoxEdgeArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataBoxEdgeDeviceResource GetDataBoxEdgeDeviceResource(ResourceIdentifier id) + { + DataBoxEdgeDeviceResource.ValidateResourceId(id); + return new DataBoxEdgeDeviceResource(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 DataBoxEdgeAlertResource GetDataBoxEdgeAlertResource(ResourceIdentifier id) + { + DataBoxEdgeAlertResource.ValidateResourceId(id); + return new DataBoxEdgeAlertResource(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 BandwidthScheduleResource GetBandwidthScheduleResource(ResourceIdentifier id) + { + BandwidthScheduleResource.ValidateResourceId(id); + return new BandwidthScheduleResource(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 DiagnosticProactiveLogCollectionSettingResource GetDiagnosticProactiveLogCollectionSettingResource(ResourceIdentifier id) + { + DiagnosticProactiveLogCollectionSettingResource.ValidateResourceId(id); + return new DiagnosticProactiveLogCollectionSettingResource(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 DiagnosticRemoteSupportSettingResource GetDiagnosticRemoteSupportSettingResource(ResourceIdentifier id) + { + DiagnosticRemoteSupportSettingResource.ValidateResourceId(id); + return new DiagnosticRemoteSupportSettingResource(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 DataBoxEdgeJobResource GetDataBoxEdgeJobResource(ResourceIdentifier id) + { + DataBoxEdgeJobResource.ValidateResourceId(id); + return new DataBoxEdgeJobResource(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 DataBoxEdgeOrderResource GetDataBoxEdgeOrderResource(ResourceIdentifier id) + { + DataBoxEdgeOrderResource.ValidateResourceId(id); + return new DataBoxEdgeOrderResource(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 DataBoxEdgeRoleResource GetDataBoxEdgeRoleResource(ResourceIdentifier id) + { + DataBoxEdgeRoleResource.ValidateResourceId(id); + return new DataBoxEdgeRoleResource(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 DataBoxEdgeRoleAddonResource GetDataBoxEdgeRoleAddonResource(ResourceIdentifier id) + { + DataBoxEdgeRoleAddonResource.ValidateResourceId(id); + return new DataBoxEdgeRoleAddonResource(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 MonitoringMetricConfigurationResource GetMonitoringMetricConfigurationResource(ResourceIdentifier id) + { + MonitoringMetricConfigurationResource.ValidateResourceId(id); + return new MonitoringMetricConfigurationResource(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 DataBoxEdgeShareResource GetDataBoxEdgeShareResource(ResourceIdentifier id) + { + DataBoxEdgeShareResource.ValidateResourceId(id); + return new DataBoxEdgeShareResource(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 DataBoxEdgeStorageAccountCredentialResource GetDataBoxEdgeStorageAccountCredentialResource(ResourceIdentifier id) + { + DataBoxEdgeStorageAccountCredentialResource.ValidateResourceId(id); + return new DataBoxEdgeStorageAccountCredentialResource(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 DataBoxEdgeStorageAccountResource GetDataBoxEdgeStorageAccountResource(ResourceIdentifier id) + { + DataBoxEdgeStorageAccountResource.ValidateResourceId(id); + return new DataBoxEdgeStorageAccountResource(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 DataBoxEdgeStorageContainerResource GetDataBoxEdgeStorageContainerResource(ResourceIdentifier id) + { + DataBoxEdgeStorageContainerResource.ValidateResourceId(id); + return new DataBoxEdgeStorageContainerResource(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 DataBoxEdgeTriggerResource GetDataBoxEdgeTriggerResource(ResourceIdentifier id) + { + DataBoxEdgeTriggerResource.ValidateResourceId(id); + return new DataBoxEdgeTriggerResource(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 DataBoxEdgeUserResource GetDataBoxEdgeUserResource(ResourceIdentifier id) + { + DataBoxEdgeUserResource.ValidateResourceId(id); + return new DataBoxEdgeUserResource(Client, id); + } + } +} diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeExtensions.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeExtensions.cs index 6a56a0b9553f..841f270ea12e 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeExtensions.cs +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataBoxEdge.Mocking; using Azure.ResourceManager.DataBoxEdge.Models; using Azure.ResourceManager.Resources; @@ -19,347 +20,289 @@ namespace Azure.ResourceManager.DataBoxEdge /// A class to add extension methods to Azure.ResourceManager.DataBoxEdge. public static partial class DataBoxEdgeExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataBoxEdgeArmClientMockingExtension GetDataBoxEdgeArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataBoxEdgeArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataBoxEdgeResourceGroupMockingExtension GetDataBoxEdgeResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataBoxEdgeResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataBoxEdgeSubscriptionMockingExtension GetDataBoxEdgeSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataBoxEdgeSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataBoxEdgeDeviceResource /// /// 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. /// Returns a object. public static DataBoxEdgeDeviceResource GetDataBoxEdgeDeviceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeDeviceResource.ValidateResourceId(id); - return new DataBoxEdgeDeviceResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeDeviceResource(id); } - #endregion - #region DataBoxEdgeAlertResource /// /// 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. /// Returns a object. public static DataBoxEdgeAlertResource GetDataBoxEdgeAlertResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeAlertResource.ValidateResourceId(id); - return new DataBoxEdgeAlertResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeAlertResource(id); } - #endregion - #region BandwidthScheduleResource /// /// 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. /// Returns a object. public static BandwidthScheduleResource GetBandwidthScheduleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - BandwidthScheduleResource.ValidateResourceId(id); - return new BandwidthScheduleResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetBandwidthScheduleResource(id); } - #endregion - #region DiagnosticProactiveLogCollectionSettingResource /// /// 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. /// Returns a object. public static DiagnosticProactiveLogCollectionSettingResource GetDiagnosticProactiveLogCollectionSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiagnosticProactiveLogCollectionSettingResource.ValidateResourceId(id); - return new DiagnosticProactiveLogCollectionSettingResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDiagnosticProactiveLogCollectionSettingResource(id); } - #endregion - #region DiagnosticRemoteSupportSettingResource /// /// 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. /// Returns a object. public static DiagnosticRemoteSupportSettingResource GetDiagnosticRemoteSupportSettingResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DiagnosticRemoteSupportSettingResource.ValidateResourceId(id); - return new DiagnosticRemoteSupportSettingResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDiagnosticRemoteSupportSettingResource(id); } - #endregion - #region DataBoxEdgeJobResource /// /// 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. /// Returns a object. public static DataBoxEdgeJobResource GetDataBoxEdgeJobResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeJobResource.ValidateResourceId(id); - return new DataBoxEdgeJobResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeJobResource(id); } - #endregion - #region DataBoxEdgeOrderResource /// /// 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. /// Returns a object. public static DataBoxEdgeOrderResource GetDataBoxEdgeOrderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeOrderResource.ValidateResourceId(id); - return new DataBoxEdgeOrderResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeOrderResource(id); } - #endregion - #region DataBoxEdgeRoleResource /// /// 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. /// Returns a object. public static DataBoxEdgeRoleResource GetDataBoxEdgeRoleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeRoleResource.ValidateResourceId(id); - return new DataBoxEdgeRoleResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeRoleResource(id); } - #endregion - #region DataBoxEdgeRoleAddonResource /// /// 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. /// Returns a object. public static DataBoxEdgeRoleAddonResource GetDataBoxEdgeRoleAddonResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeRoleAddonResource.ValidateResourceId(id); - return new DataBoxEdgeRoleAddonResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeRoleAddonResource(id); } - #endregion - #region MonitoringMetricConfigurationResource /// /// 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. /// Returns a object. public static MonitoringMetricConfigurationResource GetMonitoringMetricConfigurationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MonitoringMetricConfigurationResource.ValidateResourceId(id); - return new MonitoringMetricConfigurationResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetMonitoringMetricConfigurationResource(id); } - #endregion - #region DataBoxEdgeShareResource /// /// 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. /// Returns a object. public static DataBoxEdgeShareResource GetDataBoxEdgeShareResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeShareResource.ValidateResourceId(id); - return new DataBoxEdgeShareResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeShareResource(id); } - #endregion - #region DataBoxEdgeStorageAccountCredentialResource /// /// 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. /// Returns a object. public static DataBoxEdgeStorageAccountCredentialResource GetDataBoxEdgeStorageAccountCredentialResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeStorageAccountCredentialResource.ValidateResourceId(id); - return new DataBoxEdgeStorageAccountCredentialResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeStorageAccountCredentialResource(id); } - #endregion - #region DataBoxEdgeStorageAccountResource /// /// 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. /// Returns a object. public static DataBoxEdgeStorageAccountResource GetDataBoxEdgeStorageAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeStorageAccountResource.ValidateResourceId(id); - return new DataBoxEdgeStorageAccountResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeStorageAccountResource(id); } - #endregion - #region DataBoxEdgeStorageContainerResource /// /// 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. /// Returns a object. public static DataBoxEdgeStorageContainerResource GetDataBoxEdgeStorageContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeStorageContainerResource.ValidateResourceId(id); - return new DataBoxEdgeStorageContainerResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeStorageContainerResource(id); } - #endregion - #region DataBoxEdgeTriggerResource /// /// 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. /// Returns a object. public static DataBoxEdgeTriggerResource GetDataBoxEdgeTriggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeTriggerResource.ValidateResourceId(id); - return new DataBoxEdgeTriggerResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeTriggerResource(id); } - #endregion - #region DataBoxEdgeUserResource /// /// 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. /// Returns a object. public static DataBoxEdgeUserResource GetDataBoxEdgeUserResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataBoxEdgeUserResource.ValidateResourceId(id); - return new DataBoxEdgeUserResource(client, id); - } - ); + return GetDataBoxEdgeArmClientMockingExtension(client).GetDataBoxEdgeUserResource(id); } - #endregion - /// Gets a collection of DataBoxEdgeDeviceResources in the ResourceGroupResource. + /// + /// Gets a collection of DataBoxEdgeDeviceResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataBoxEdgeDeviceResources and their operations over a DataBoxEdgeDeviceResource. public static DataBoxEdgeDeviceCollection GetDataBoxEdgeDevices(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataBoxEdgeDevices(); + return GetDataBoxEdgeResourceGroupMockingExtension(resourceGroupResource).GetDataBoxEdgeDevices(); } /// @@ -374,16 +317,20 @@ public static DataBoxEdgeDeviceCollection GetDataBoxEdgeDevices(this ResourceGro /// Devices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The device name. /// The cancellation token to use. - /// 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 static async Task> GetDataBoxEdgeDeviceAsync(this ResourceGroupResource resourceGroupResource, string deviceName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataBoxEdgeDevices().GetAsync(deviceName, cancellationToken).ConfigureAwait(false); + return await GetDataBoxEdgeResourceGroupMockingExtension(resourceGroupResource).GetDataBoxEdgeDeviceAsync(deviceName, cancellationToken).ConfigureAwait(false); } /// @@ -398,16 +345,20 @@ public static async Task> GetDataBoxEdgeDevi /// Devices_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The device name. /// The cancellation token to use. - /// 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 static Response GetDataBoxEdgeDevice(this ResourceGroupResource resourceGroupResource, string deviceName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataBoxEdgeDevices().Get(deviceName, cancellationToken); + return GetDataBoxEdgeResourceGroupMockingExtension(resourceGroupResource).GetDataBoxEdgeDevice(deviceName, cancellationToken); } /// @@ -422,13 +373,17 @@ public static Response GetDataBoxEdgeDevice(this Reso /// AvailableSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAvailableSkusAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableSkusAsync(cancellationToken); + return GetDataBoxEdgeSubscriptionMockingExtension(subscriptionResource).GetAvailableSkusAsync(cancellationToken); } /// @@ -443,13 +398,17 @@ public static AsyncPageable GetAvailableSkusAsync(this /// AvailableSkus_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAvailableSkus(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAvailableSkus(cancellationToken); + return GetDataBoxEdgeSubscriptionMockingExtension(subscriptionResource).GetAvailableSkus(cancellationToken); } /// @@ -464,6 +423,10 @@ public static Pageable GetAvailableSkus(this Subscripti /// Devices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. @@ -471,7 +434,7 @@ public static Pageable GetAvailableSkus(this Subscripti /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataBoxEdgeDevicesAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataBoxEdgeDevicesAsync(expand, cancellationToken); + return GetDataBoxEdgeSubscriptionMockingExtension(subscriptionResource).GetDataBoxEdgeDevicesAsync(expand, cancellationToken); } /// @@ -486,6 +449,10 @@ public static AsyncPageable GetDataBoxEdgeDevicesAsyn /// Devices_ListBySubscription /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. @@ -493,7 +460,7 @@ public static AsyncPageable GetDataBoxEdgeDevicesAsyn /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataBoxEdgeDevices(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataBoxEdgeDevices(expand, cancellationToken); + return GetDataBoxEdgeSubscriptionMockingExtension(subscriptionResource).GetDataBoxEdgeDevices(expand, cancellationToken); } } } diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeResourceGroupMockingExtension.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..bcc889ab5013 --- /dev/null +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataBoxEdge; + +namespace Azure.ResourceManager.DataBoxEdge.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataBoxEdgeResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataBoxEdgeResourceGroupMockingExtension() + { + } + + /// 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 DataBoxEdgeResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataBoxEdgeDeviceResources in the ResourceGroupResource. + /// An object representing collection of DataBoxEdgeDeviceResources and their operations over a DataBoxEdgeDeviceResource. + public virtual DataBoxEdgeDeviceCollection GetDataBoxEdgeDevices() + { + return GetCachedClient(client => new DataBoxEdgeDeviceCollection(client, Id)); + } + + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName} + /// + /// + /// Operation Id + /// Devices_Get + /// + /// + /// + /// The device name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataBoxEdgeDeviceAsync(string deviceName, CancellationToken cancellationToken = default) + { + return await GetDataBoxEdgeDevices().GetAsync(deviceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName} + /// + /// + /// Operation Id + /// Devices_Get + /// + /// + /// + /// The device name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataBoxEdgeDevice(string deviceName, CancellationToken cancellationToken = default) + { + return GetDataBoxEdgeDevices().Get(deviceName, cancellationToken); + } + } +} diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeSubscriptionMockingExtension.cs similarity index 89% rename from sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeSubscriptionMockingExtension.cs index 46c4ea7a5d1a..ff386930ce83 100644 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/DataBoxEdgeSubscriptionMockingExtension.cs @@ -11,27 +11,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataBoxEdge; using Azure.ResourceManager.DataBoxEdge.Models; -namespace Azure.ResourceManager.DataBoxEdge +namespace Azure.ResourceManager.DataBoxEdge.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataBoxEdgeSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _availableSkusClientDiagnostics; private AvailableSkusRestOperations _availableSkusRestClient; private ClientDiagnostics _dataBoxEdgeDeviceDevicesClientDiagnostics; private DevicesRestOperations _dataBoxEdgeDeviceDevicesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataBoxEdgeSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataBoxEdgeSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -65,7 +66,7 @@ public virtual AsyncPageable GetAvailableSkusAsync(Canc { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDataBoxEdgeSku.DeserializeAvailableDataBoxEdgeSku, AvailableSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AvailableDataBoxEdgeSku.DeserializeAvailableDataBoxEdgeSku, AvailableSkusClientDiagnostics, Pipeline, "DataBoxEdgeSubscriptionMockingExtension.GetAvailableSkus", "value", "nextLink", cancellationToken); } /// @@ -87,7 +88,7 @@ public virtual Pageable GetAvailableSkus(CancellationTo { HttpMessage FirstPageRequest(int? pageSizeHint) => AvailableSkusRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AvailableSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDataBoxEdgeSku.DeserializeAvailableDataBoxEdgeSku, AvailableSkusClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAvailableSkus", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AvailableDataBoxEdgeSku.DeserializeAvailableDataBoxEdgeSku, AvailableSkusClientDiagnostics, Pipeline, "DataBoxEdgeSubscriptionMockingExtension.GetAvailableSkus", "value", "nextLink", cancellationToken); } /// @@ -110,7 +111,7 @@ public virtual AsyncPageable GetDataBoxEdgeDevicesAsy { HttpMessage FirstPageRequest(int? pageSizeHint) => DataBoxEdgeDeviceDevicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataBoxEdgeDeviceDevicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataBoxEdgeDeviceResource(Client, DataBoxEdgeDeviceData.DeserializeDataBoxEdgeDeviceData(e)), DataBoxEdgeDeviceDevicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataBoxEdgeDevices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataBoxEdgeDeviceResource(Client, DataBoxEdgeDeviceData.DeserializeDataBoxEdgeDeviceData(e)), DataBoxEdgeDeviceDevicesClientDiagnostics, Pipeline, "DataBoxEdgeSubscriptionMockingExtension.GetDataBoxEdgeDevices", "value", "nextLink", cancellationToken); } /// @@ -133,7 +134,7 @@ public virtual Pageable GetDataBoxEdgeDevices(string { HttpMessage FirstPageRequest(int? pageSizeHint) => DataBoxEdgeDeviceDevicesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, expand); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataBoxEdgeDeviceDevicesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataBoxEdgeDeviceResource(Client, DataBoxEdgeDeviceData.DeserializeDataBoxEdgeDeviceData(e)), DataBoxEdgeDeviceDevicesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataBoxEdgeDevices", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataBoxEdgeDeviceResource(Client, DataBoxEdgeDeviceData.DeserializeDataBoxEdgeDeviceData(e)), DataBoxEdgeDeviceDevicesClientDiagnostics, Pipeline, "DataBoxEdgeSubscriptionMockingExtension.GetDataBoxEdgeDevices", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 339de49f050e..000000000000 --- a/sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataBoxEdge -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataBoxEdgeDeviceResources in the ResourceGroupResource. - /// An object representing collection of DataBoxEdgeDeviceResources and their operations over a DataBoxEdgeDeviceResource. - public virtual DataBoxEdgeDeviceCollection GetDataBoxEdgeDevices() - { - return GetCachedClient(Client => new DataBoxEdgeDeviceCollection(Client, Id)); - } - } -} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs index af5992f12a29..57ff330c1eba 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/DatadogMonitorResource.cs @@ -96,7 +96,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of MonitoringTagRuleResources and their operations over a MonitoringTagRuleResource. public virtual MonitoringTagRuleCollection GetMonitoringTagRules() { - return GetCachedClient(Client => new MonitoringTagRuleCollection(Client, Id)); + return GetCachedClient(client => new MonitoringTagRuleCollection(client, Id)); } /// @@ -114,8 +114,8 @@ public virtual MonitoringTagRuleCollection GetMonitoringTagRules() /// /// Rule set name. /// The cancellation token to use. - /// 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> GetMonitoringTagRuleAsync(string ruleSetName, CancellationToken cancellationToken = default) { @@ -137,8 +137,8 @@ public virtual async Task> GetMonitoringTagR /// /// Rule set name. /// The cancellation token to use. - /// 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 GetMonitoringTagRule(string ruleSetName, CancellationToken cancellationToken = default) { @@ -149,7 +149,7 @@ public virtual Response GetMonitoringTagRule(string r /// An object representing collection of DatadogSingleSignOnResources and their operations over a DatadogSingleSignOnResource. public virtual DatadogSingleSignOnResourceCollection GetDatadogSingleSignOnResources() { - return GetCachedClient(Client => new DatadogSingleSignOnResourceCollection(Client, Id)); + return GetCachedClient(client => new DatadogSingleSignOnResourceCollection(client, Id)); } /// @@ -167,8 +167,8 @@ public virtual DatadogSingleSignOnResourceCollection GetDatadogSingleSignOnResou /// /// Configuration name. /// The cancellation token to use. - /// 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> GetDatadogSingleSignOnResourceAsync(string configurationName, CancellationToken cancellationToken = default) { @@ -190,8 +190,8 @@ public virtual async Task> GetDatadogSingl /// /// Configuration name. /// The cancellation token to use. - /// 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 GetDatadogSingleSignOnResource(string configurationName, CancellationToken cancellationToken = default) { diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogArmClientMockingExtension.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogArmClientMockingExtension.cs new file mode 100644 index 000000000000..17d61854315c --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogArmClientMockingExtension.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Datadog; + +namespace Azure.ResourceManager.Datadog.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DatadogArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DatadogArmClientMockingExtension() + { + } + + /// 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 DatadogArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DatadogArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DatadogMonitorResource GetDatadogMonitorResource(ResourceIdentifier id) + { + DatadogMonitorResource.ValidateResourceId(id); + return new DatadogMonitorResource(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 MonitoringTagRuleResource GetMonitoringTagRuleResource(ResourceIdentifier id) + { + MonitoringTagRuleResource.ValidateResourceId(id); + return new MonitoringTagRuleResource(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 DatadogSingleSignOnResource GetDatadogSingleSignOnResource(ResourceIdentifier id) + { + DatadogSingleSignOnResource.ValidateResourceId(id); + return new DatadogSingleSignOnResource(Client, id); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs index e82e409d3385..78fd1bc494ad 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.Datadog.Mocking; using Azure.ResourceManager.Datadog.Models; using Azure.ResourceManager.Resources; @@ -19,100 +20,81 @@ namespace Azure.ResourceManager.Datadog /// A class to add extension methods to Azure.ResourceManager.Datadog. public static partial class DatadogExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DatadogArmClientMockingExtension GetDatadogArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DatadogArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DatadogResourceGroupMockingExtension GetDatadogResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DatadogResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DatadogSubscriptionMockingExtension GetDatadogSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DatadogSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DatadogMonitorResource /// /// 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. /// Returns a object. public static DatadogMonitorResource GetDatadogMonitorResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatadogMonitorResource.ValidateResourceId(id); - return new DatadogMonitorResource(client, id); - } - ); + return GetDatadogArmClientMockingExtension(client).GetDatadogMonitorResource(id); } - #endregion - #region MonitoringTagRuleResource /// /// 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. /// Returns a object. public static MonitoringTagRuleResource GetMonitoringTagRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - MonitoringTagRuleResource.ValidateResourceId(id); - return new MonitoringTagRuleResource(client, id); - } - ); + return GetDatadogArmClientMockingExtension(client).GetMonitoringTagRuleResource(id); } - #endregion - #region DatadogSingleSignOnResource /// /// 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. /// Returns a object. public static DatadogSingleSignOnResource GetDatadogSingleSignOnResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DatadogSingleSignOnResource.ValidateResourceId(id); - return new DatadogSingleSignOnResource(client, id); - } - ); + return GetDatadogArmClientMockingExtension(client).GetDatadogSingleSignOnResource(id); } - #endregion - /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. + /// + /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DatadogMonitorResources and their operations over a DatadogMonitorResource. public static DatadogMonitorResourceCollection GetDatadogMonitorResources(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDatadogMonitorResources(); + return GetDatadogResourceGroupMockingExtension(resourceGroupResource).GetDatadogMonitorResources(); } /// @@ -127,16 +109,20 @@ public static DatadogMonitorResourceCollection GetDatadogMonitorResources(this R /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static async Task> GetDatadogMonitorResourceAsync(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDatadogMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + return await GetDatadogResourceGroupMockingExtension(resourceGroupResource).GetDatadogMonitorResourceAsync(monitorName, cancellationToken).ConfigureAwait(false); } /// @@ -151,16 +137,20 @@ public static async Task> GetDatadogMonitorReso /// Monitors_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// Monitor resource name. /// The cancellation token to use. - /// 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 static Response GetDatadogMonitorResource(this ResourceGroupResource resourceGroupResource, string monitorName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDatadogMonitorResources().Get(monitorName, cancellationToken); + return GetDatadogResourceGroupMockingExtension(resourceGroupResource).GetDatadogMonitorResource(monitorName, cancellationToken); } /// @@ -175,13 +165,17 @@ public static Response GetDatadogMonitorResource(this Re /// MarketplaceAgreements_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetMarketplaceAgreementsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreementsAsync(cancellationToken); + return GetDatadogSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreementsAsync(cancellationToken); } /// @@ -196,13 +190,17 @@ public static AsyncPageable GetMarketplaceAg /// MarketplaceAgreements_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetMarketplaceAgreements(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMarketplaceAgreements(cancellationToken); + return GetDatadogSubscriptionMockingExtension(subscriptionResource).GetMarketplaceAgreements(cancellationToken); } /// @@ -217,13 +215,17 @@ public static Pageable GetMarketplaceAgreeme /// MarketplaceAgreements_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The DatadogAgreementResourceProperties to use. /// The cancellation token to use. public static async Task> CreateOrUpdateMarketplaceAgreementAsync(this SubscriptionResource subscriptionResource, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateMarketplaceAgreementAsync(body, cancellationToken).ConfigureAwait(false); + return await GetDatadogSubscriptionMockingExtension(subscriptionResource).CreateOrUpdateMarketplaceAgreementAsync(body, cancellationToken).ConfigureAwait(false); } /// @@ -238,13 +240,17 @@ public static async Task> CreateOrU /// MarketplaceAgreements_CreateOrUpdate /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The DatadogAgreementResourceProperties to use. /// The cancellation token to use. public static Response CreateOrUpdateMarketplaceAgreement(this SubscriptionResource subscriptionResource, DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).CreateOrUpdateMarketplaceAgreement(body, cancellationToken); + return GetDatadogSubscriptionMockingExtension(subscriptionResource).CreateOrUpdateMarketplaceAgreement(body, cancellationToken); } /// @@ -259,13 +265,17 @@ public static Response CreateOrUpdateMarketp /// Monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDatadogMonitorResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDatadogMonitorResourcesAsync(cancellationToken); + return GetDatadogSubscriptionMockingExtension(subscriptionResource).GetDatadogMonitorResourcesAsync(cancellationToken); } /// @@ -280,13 +290,17 @@ public static AsyncPageable GetDatadogMonitorResourcesAs /// Monitors_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDatadogMonitorResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDatadogMonitorResources(cancellationToken); + return GetDatadogSubscriptionMockingExtension(subscriptionResource).GetDatadogMonitorResources(cancellationToken); } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogResourceGroupMockingExtension.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..e4d1dd8e2434 --- /dev/null +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Datadog; + +namespace Azure.ResourceManager.Datadog.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DatadogResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DatadogResourceGroupMockingExtension() + { + } + + /// 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 DatadogResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. + /// An object representing collection of DatadogMonitorResources and their operations over a DatadogMonitorResource. + public virtual DatadogMonitorResourceCollection GetDatadogMonitorResources() + { + return GetCachedClient(client => new DatadogMonitorResourceCollection(client, Id)); + } + + /// + /// Get the properties of a specific monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDatadogMonitorResourceAsync(string monitorName, CancellationToken cancellationToken = default) + { + return await GetDatadogMonitorResources().GetAsync(monitorName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a specific monitor resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName} + /// + /// + /// Operation Id + /// Monitors_Get + /// + /// + /// + /// Monitor resource name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDatadogMonitorResource(string monitorName, CancellationToken cancellationToken = default) + { + return GetDatadogMonitorResources().Get(monitorName, cancellationToken); + } + } +} diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogSubscriptionMockingExtension.cs similarity index 92% rename from sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogSubscriptionMockingExtension.cs index f9440815f165..d69a19eb6a79 100644 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/DatadogSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.Datadog; using Azure.ResourceManager.Datadog.Models; -namespace Azure.ResourceManager.Datadog +namespace Azure.ResourceManager.Datadog.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DatadogSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _marketplaceAgreementsClientDiagnostics; private MarketplaceAgreementsRestOperations _marketplaceAgreementsRestClient; private ClientDiagnostics _datadogMonitorResourceMonitorsClientDiagnostics; private MonitorsRestOperations _datadogMonitorResourceMonitorsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DatadogSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DatadogSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetMarketplaceA { HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties, MarketplaceAgreementsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties, MarketplaceAgreementsClientDiagnostics, Pipeline, "DatadogSubscriptionMockingExtension.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetMarketplaceAgreem { HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplaceAgreementsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplaceAgreementsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties, MarketplaceAgreementsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DatadogAgreementResourceProperties.DeserializeDatadogAgreementResourceProperties, MarketplaceAgreementsClientDiagnostics, Pipeline, "DatadogSubscriptionMockingExtension.GetMarketplaceAgreements", "value", "nextLink", cancellationToken); } /// @@ -109,7 +110,7 @@ public virtual Pageable GetMarketplaceAgreem /// The cancellation token to use. public virtual async Task> CreateOrUpdateMarketplaceAgreementAsync(DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateMarketplaceAgreement"); + using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("DatadogSubscriptionMockingExtension.CreateOrUpdateMarketplaceAgreement"); scope.Start(); try { @@ -140,7 +141,7 @@ public virtual async Task> CreateOr /// The cancellation token to use. public virtual Response CreateOrUpdateMarketplaceAgreement(DatadogAgreementResourceProperties body = null, CancellationToken cancellationToken = default) { - using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CreateOrUpdateMarketplaceAgreement"); + using var scope = MarketplaceAgreementsClientDiagnostics.CreateScope("DatadogSubscriptionMockingExtension.CreateOrUpdateMarketplaceAgreement"); scope.Start(); try { @@ -173,7 +174,7 @@ public virtual AsyncPageable GetDatadogMonitorResourcesA { HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogSubscriptionMockingExtension.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); } /// @@ -195,7 +196,7 @@ public virtual Pageable GetDatadogMonitorResources(Cance { HttpMessage FirstPageRequest(int? pageSizeHint) => DatadogMonitorResourceMonitorsRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DatadogMonitorResourceMonitorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DatadogMonitorResource(Client, DatadogMonitorResourceData.DeserializeDatadogMonitorResourceData(e)), DatadogMonitorResourceMonitorsClientDiagnostics, Pipeline, "DatadogSubscriptionMockingExtension.GetDatadogMonitorResources", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index a928814494d5..000000000000 --- a/sdk/datadog/Azure.ResourceManager.Datadog/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.Datadog -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DatadogMonitorResources in the ResourceGroupResource. - /// An object representing collection of DatadogMonitorResources and their operations over a DatadogMonitorResource. - public virtual DatadogMonitorResourceCollection GetDatadogMonitorResources() - { - return GetCachedClient(Client => new DatadogMonitorResourceCollection(Client, Id)); - } - } -} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryManagedVirtualNetworkResource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryManagedVirtualNetworkResource.cs index b901315d94b0..6079e302b2c1 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryManagedVirtualNetworkResource.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryManagedVirtualNetworkResource.cs @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataFactoryPrivateEndpointResources and their operations over a DataFactoryPrivateEndpointResource. public virtual DataFactoryPrivateEndpointCollection GetDataFactoryPrivateEndpoints() { - return GetCachedClient(Client => new DataFactoryPrivateEndpointCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryPrivateEndpointCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual DataFactoryPrivateEndpointCollection GetDataFactoryPrivateEndpoin /// Managed private endpoint name. /// ETag of the managed private endpoint entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryPrivateEndpointAsync(string managedPrivateEndpointName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetDataF /// Managed private endpoint name. /// ETag of the managed private endpoint entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryPrivateEndpoint(string managedPrivateEndpointName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs index 54a373e150cb..2bdfcaff3126 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs @@ -123,7 +123,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataFactoryIntegrationRuntimeResources and their operations over a DataFactoryIntegrationRuntimeResource. public virtual DataFactoryIntegrationRuntimeCollection GetDataFactoryIntegrationRuntimes() { - return GetCachedClient(Client => new DataFactoryIntegrationRuntimeCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryIntegrationRuntimeCollection(client, Id)); } /// @@ -142,8 +142,8 @@ public virtual DataFactoryIntegrationRuntimeCollection GetDataFactoryIntegration /// The integration runtime name. /// ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryIntegrationRuntimeAsync(string integrationRuntimeName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -166,8 +166,8 @@ public virtual async Task> GetDa /// The integration runtime name. /// ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryIntegrationRuntime(string integrationRuntimeName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -178,7 +178,7 @@ public virtual Response GetDataFactoryInt /// An object representing collection of DataFactoryLinkedServiceResources and their operations over a DataFactoryLinkedServiceResource. public virtual DataFactoryLinkedServiceCollection GetDataFactoryLinkedServices() { - return GetCachedClient(Client => new DataFactoryLinkedServiceCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryLinkedServiceCollection(client, Id)); } /// @@ -197,8 +197,8 @@ public virtual DataFactoryLinkedServiceCollection GetDataFactoryLinkedServices() /// The linked service name. /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryLinkedServiceAsync(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -221,8 +221,8 @@ public virtual async Task> GetDataFac /// The linked service name. /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryLinkedService(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -233,7 +233,7 @@ public virtual Response GetDataFactoryLinkedSe /// An object representing collection of DataFactoryDatasetResources and their operations over a DataFactoryDatasetResource. public virtual DataFactoryDatasetCollection GetDataFactoryDatasets() { - return GetCachedClient(Client => new DataFactoryDatasetCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryDatasetCollection(client, Id)); } /// @@ -252,8 +252,8 @@ public virtual DataFactoryDatasetCollection GetDataFactoryDatasets() /// The dataset name. /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryDatasetAsync(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -276,8 +276,8 @@ public virtual async Task> GetDataFactoryDa /// The dataset name. /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryDataset(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -288,7 +288,7 @@ public virtual Response GetDataFactoryDataset(string /// An object representing collection of DataFactoryPipelineResources and their operations over a DataFactoryPipelineResource. public virtual DataFactoryPipelineCollection GetDataFactoryPipelines() { - return GetCachedClient(Client => new DataFactoryPipelineCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryPipelineCollection(client, Id)); } /// @@ -307,8 +307,8 @@ public virtual DataFactoryPipelineCollection GetDataFactoryPipelines() /// The pipeline name. /// ETag of the pipeline entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryPipelineAsync(string pipelineName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -331,8 +331,8 @@ public virtual async Task> GetDataFactoryP /// The pipeline name. /// ETag of the pipeline entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryPipeline(string pipelineName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -343,7 +343,7 @@ public virtual Response GetDataFactoryPipeline(stri /// An object representing collection of DataFactoryTriggerResources and their operations over a DataFactoryTriggerResource. public virtual DataFactoryTriggerCollection GetDataFactoryTriggers() { - return GetCachedClient(Client => new DataFactoryTriggerCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryTriggerCollection(client, Id)); } /// @@ -362,8 +362,8 @@ public virtual DataFactoryTriggerCollection GetDataFactoryTriggers() /// The trigger name. /// ETag of the trigger entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryTriggerAsync(string triggerName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -386,8 +386,8 @@ public virtual async Task> GetDataFactoryTr /// The trigger name. /// ETag of the trigger entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryTrigger(string triggerName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -398,7 +398,7 @@ public virtual Response GetDataFactoryTrigger(string /// An object representing collection of DataFactoryDataFlowResources and their operations over a DataFactoryDataFlowResource. public virtual DataFactoryDataFlowCollection GetDataFactoryDataFlows() { - return GetCachedClient(Client => new DataFactoryDataFlowCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryDataFlowCollection(client, Id)); } /// @@ -417,8 +417,8 @@ public virtual DataFactoryDataFlowCollection GetDataFactoryDataFlows() /// The data flow name. /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryDataFlowAsync(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -441,8 +441,8 @@ public virtual async Task> GetDataFactoryD /// The data flow name. /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryDataFlow(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -453,7 +453,7 @@ public virtual Response GetDataFactoryDataFlow(stri /// An object representing collection of DataFactoryManagedVirtualNetworkResources and their operations over a DataFactoryManagedVirtualNetworkResource. public virtual DataFactoryManagedVirtualNetworkCollection GetDataFactoryManagedVirtualNetworks() { - return GetCachedClient(Client => new DataFactoryManagedVirtualNetworkCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryManagedVirtualNetworkCollection(client, Id)); } /// @@ -472,8 +472,8 @@ public virtual DataFactoryManagedVirtualNetworkCollection GetDataFactoryManagedV /// Managed virtual network name. /// ETag of the managed Virtual Network entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryManagedVirtualNetworkAsync(string managedVirtualNetworkName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -496,8 +496,8 @@ public virtual async Task> Ge /// Managed virtual network name. /// ETag of the managed Virtual Network entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryManagedVirtualNetwork(string managedVirtualNetworkName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -508,7 +508,7 @@ public virtual Response GetDataFactory /// An object representing collection of DataFactoryManagedIdentityCredentialResources and their operations over a DataFactoryManagedIdentityCredentialResource. public virtual DataFactoryManagedIdentityCredentialCollection GetDataFactoryManagedIdentityCredentials() { - return GetCachedClient(Client => new DataFactoryManagedIdentityCredentialCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryManagedIdentityCredentialCollection(client, Id)); } /// @@ -527,8 +527,8 @@ public virtual DataFactoryManagedIdentityCredentialCollection GetDataFactoryMana /// Credential name. /// ETag of the credential entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryManagedIdentityCredentialAsync(string credentialName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -551,8 +551,8 @@ public virtual async Task /// Credential name. /// ETag of the credential entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryManagedIdentityCredential(string credentialName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -563,7 +563,7 @@ public virtual Response GetDataFac /// An object representing collection of DataFactoryPrivateEndpointConnectionResources and their operations over a DataFactoryPrivateEndpointConnectionResource. public virtual DataFactoryPrivateEndpointConnectionCollection GetDataFactoryPrivateEndpointConnections() { - return GetCachedClient(Client => new DataFactoryPrivateEndpointConnectionCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryPrivateEndpointConnectionCollection(client, Id)); } /// @@ -582,8 +582,8 @@ public virtual DataFactoryPrivateEndpointConnectionCollection GetDataFactoryPriv /// The private endpoint connection name. /// ETag of the private endpoint connection entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryPrivateEndpointConnectionAsync(string privateEndpointConnectionName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -606,8 +606,8 @@ public virtual async Task /// The private endpoint connection name. /// ETag of the private endpoint connection entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryPrivateEndpointConnection(string privateEndpointConnectionName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -618,7 +618,7 @@ public virtual Response GetDataFac /// An object representing collection of DataFactoryGlobalParameterResources and their operations over a DataFactoryGlobalParameterResource. public virtual DataFactoryGlobalParameterCollection GetDataFactoryGlobalParameters() { - return GetCachedClient(Client => new DataFactoryGlobalParameterCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryGlobalParameterCollection(client, Id)); } /// @@ -636,8 +636,8 @@ public virtual DataFactoryGlobalParameterCollection GetDataFactoryGlobalParamete /// /// The global parameter name. /// The cancellation token to use. - /// 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> GetDataFactoryGlobalParameterAsync(string globalParameterName, CancellationToken cancellationToken = default) { @@ -659,8 +659,8 @@ public virtual async Task> GetDataF /// /// The global parameter name. /// The cancellation token to use. - /// 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 GetDataFactoryGlobalParameter(string globalParameterName, CancellationToken cancellationToken = default) { @@ -671,7 +671,7 @@ public virtual Response GetDataFactoryGlobal /// An object representing collection of DataFactoryChangeDataCaptureResources and their operations over a DataFactoryChangeDataCaptureResource. public virtual DataFactoryChangeDataCaptureCollection GetDataFactoryChangeDataCaptures() { - return GetCachedClient(Client => new DataFactoryChangeDataCaptureCollection(Client, Id)); + return GetCachedClient(client => new DataFactoryChangeDataCaptureCollection(client, Id)); } /// @@ -690,8 +690,8 @@ public virtual DataFactoryChangeDataCaptureCollection GetDataFactoryChangeDataCa /// The change data capture name. /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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> GetDataFactoryChangeDataCaptureAsync(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { @@ -714,8 +714,8 @@ public virtual async Task> GetDat /// The change data capture name. /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 GetDataFactoryChangeDataCapture(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryArmClientMockingExtension.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryArmClientMockingExtension.cs new file mode 100644 index 000000000000..38f4bf9ff3f8 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryArmClientMockingExtension.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataFactory; + +namespace Azure.ResourceManager.DataFactory.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataFactoryArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataFactoryArmClientMockingExtension() + { + } + + /// 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 DataFactoryArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataFactoryArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataFactoryResource GetDataFactoryResource(ResourceIdentifier id) + { + DataFactoryResource.ValidateResourceId(id); + return new DataFactoryResource(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 DataFactoryIntegrationRuntimeResource GetDataFactoryIntegrationRuntimeResource(ResourceIdentifier id) + { + DataFactoryIntegrationRuntimeResource.ValidateResourceId(id); + return new DataFactoryIntegrationRuntimeResource(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 DataFactoryLinkedServiceResource GetDataFactoryLinkedServiceResource(ResourceIdentifier id) + { + DataFactoryLinkedServiceResource.ValidateResourceId(id); + return new DataFactoryLinkedServiceResource(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 DataFactoryDatasetResource GetDataFactoryDatasetResource(ResourceIdentifier id) + { + DataFactoryDatasetResource.ValidateResourceId(id); + return new DataFactoryDatasetResource(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 DataFactoryPipelineResource GetDataFactoryPipelineResource(ResourceIdentifier id) + { + DataFactoryPipelineResource.ValidateResourceId(id); + return new DataFactoryPipelineResource(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 DataFactoryTriggerResource GetDataFactoryTriggerResource(ResourceIdentifier id) + { + DataFactoryTriggerResource.ValidateResourceId(id); + return new DataFactoryTriggerResource(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 DataFactoryDataFlowResource GetDataFactoryDataFlowResource(ResourceIdentifier id) + { + DataFactoryDataFlowResource.ValidateResourceId(id); + return new DataFactoryDataFlowResource(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 DataFactoryManagedVirtualNetworkResource GetDataFactoryManagedVirtualNetworkResource(ResourceIdentifier id) + { + DataFactoryManagedVirtualNetworkResource.ValidateResourceId(id); + return new DataFactoryManagedVirtualNetworkResource(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 DataFactoryPrivateEndpointResource GetDataFactoryPrivateEndpointResource(ResourceIdentifier id) + { + DataFactoryPrivateEndpointResource.ValidateResourceId(id); + return new DataFactoryPrivateEndpointResource(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 DataFactoryManagedIdentityCredentialResource GetDataFactoryManagedIdentityCredentialResource(ResourceIdentifier id) + { + DataFactoryManagedIdentityCredentialResource.ValidateResourceId(id); + return new DataFactoryManagedIdentityCredentialResource(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 DataFactoryPrivateEndpointConnectionResource GetDataFactoryPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DataFactoryPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DataFactoryPrivateEndpointConnectionResource(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 DataFactoryGlobalParameterResource GetDataFactoryGlobalParameterResource(ResourceIdentifier id) + { + DataFactoryGlobalParameterResource.ValidateResourceId(id); + return new DataFactoryGlobalParameterResource(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 DataFactoryChangeDataCaptureResource GetDataFactoryChangeDataCaptureResource(ResourceIdentifier id) + { + DataFactoryChangeDataCaptureResource.ValidateResourceId(id); + return new DataFactoryChangeDataCaptureResource(Client, id); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs index 40984d0ff8c9..3bc23e836715 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataFactory.Mocking; using Azure.ResourceManager.DataFactory.Models; using Azure.ResourceManager.Resources; @@ -19,290 +20,241 @@ namespace Azure.ResourceManager.DataFactory /// A class to add extension methods to Azure.ResourceManager.DataFactory. public static partial class DataFactoryExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataFactoryArmClientMockingExtension GetDataFactoryArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataFactoryArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataFactoryResourceGroupMockingExtension GetDataFactoryResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataFactoryResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataFactorySubscriptionMockingExtension GetDataFactorySubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataFactorySubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataFactoryResource /// /// 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. /// Returns a object. public static DataFactoryResource GetDataFactoryResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryResource.ValidateResourceId(id); - return new DataFactoryResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryResource(id); } - #endregion - #region DataFactoryIntegrationRuntimeResource /// /// 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. /// Returns a object. public static DataFactoryIntegrationRuntimeResource GetDataFactoryIntegrationRuntimeResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryIntegrationRuntimeResource.ValidateResourceId(id); - return new DataFactoryIntegrationRuntimeResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryIntegrationRuntimeResource(id); } - #endregion - #region DataFactoryLinkedServiceResource /// /// 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. /// Returns a object. public static DataFactoryLinkedServiceResource GetDataFactoryLinkedServiceResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryLinkedServiceResource.ValidateResourceId(id); - return new DataFactoryLinkedServiceResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryLinkedServiceResource(id); } - #endregion - #region DataFactoryDatasetResource /// /// 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. /// Returns a object. public static DataFactoryDatasetResource GetDataFactoryDatasetResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryDatasetResource.ValidateResourceId(id); - return new DataFactoryDatasetResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryDatasetResource(id); } - #endregion - #region DataFactoryPipelineResource /// /// 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. /// Returns a object. public static DataFactoryPipelineResource GetDataFactoryPipelineResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryPipelineResource.ValidateResourceId(id); - return new DataFactoryPipelineResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryPipelineResource(id); } - #endregion - #region DataFactoryTriggerResource /// /// 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. /// Returns a object. public static DataFactoryTriggerResource GetDataFactoryTriggerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryTriggerResource.ValidateResourceId(id); - return new DataFactoryTriggerResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryTriggerResource(id); } - #endregion - #region DataFactoryDataFlowResource /// /// 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. /// Returns a object. public static DataFactoryDataFlowResource GetDataFactoryDataFlowResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryDataFlowResource.ValidateResourceId(id); - return new DataFactoryDataFlowResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryDataFlowResource(id); } - #endregion - #region DataFactoryManagedVirtualNetworkResource /// /// 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. /// Returns a object. public static DataFactoryManagedVirtualNetworkResource GetDataFactoryManagedVirtualNetworkResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryManagedVirtualNetworkResource.ValidateResourceId(id); - return new DataFactoryManagedVirtualNetworkResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryManagedVirtualNetworkResource(id); } - #endregion - #region DataFactoryPrivateEndpointResource /// /// 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. /// Returns a object. public static DataFactoryPrivateEndpointResource GetDataFactoryPrivateEndpointResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryPrivateEndpointResource.ValidateResourceId(id); - return new DataFactoryPrivateEndpointResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryPrivateEndpointResource(id); } - #endregion - #region DataFactoryManagedIdentityCredentialResource /// /// 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. /// Returns a object. public static DataFactoryManagedIdentityCredentialResource GetDataFactoryManagedIdentityCredentialResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryManagedIdentityCredentialResource.ValidateResourceId(id); - return new DataFactoryManagedIdentityCredentialResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryManagedIdentityCredentialResource(id); } - #endregion - #region DataFactoryPrivateEndpointConnectionResource /// /// 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. /// Returns a object. public static DataFactoryPrivateEndpointConnectionResource GetDataFactoryPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryPrivateEndpointConnectionResource.ValidateResourceId(id); - return new DataFactoryPrivateEndpointConnectionResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryPrivateEndpointConnectionResource(id); } - #endregion - #region DataFactoryGlobalParameterResource /// /// 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. /// Returns a object. public static DataFactoryGlobalParameterResource GetDataFactoryGlobalParameterResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryGlobalParameterResource.ValidateResourceId(id); - return new DataFactoryGlobalParameterResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryGlobalParameterResource(id); } - #endregion - #region DataFactoryChangeDataCaptureResource /// /// 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. /// Returns a object. public static DataFactoryChangeDataCaptureResource GetDataFactoryChangeDataCaptureResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataFactoryChangeDataCaptureResource.ValidateResourceId(id); - return new DataFactoryChangeDataCaptureResource(client, id); - } - ); + return GetDataFactoryArmClientMockingExtension(client).GetDataFactoryChangeDataCaptureResource(id); } - #endregion - /// Gets a collection of DataFactoryResources in the ResourceGroupResource. + /// + /// Gets a collection of DataFactoryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataFactoryResources and their operations over a DataFactoryResource. public static DataFactoryCollection GetDataFactories(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataFactories(); + return GetDataFactoryResourceGroupMockingExtension(resourceGroupResource).GetDataFactories(); } /// @@ -317,17 +269,21 @@ public static DataFactoryCollection GetDataFactories(this ResourceGroupResource /// Factories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The factory name. /// ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 static async Task> GetDataFactoryAsync(this ResourceGroupResource resourceGroupResource, string factoryName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataFactories().GetAsync(factoryName, ifNoneMatch, cancellationToken).ConfigureAwait(false); + return await GetDataFactoryResourceGroupMockingExtension(resourceGroupResource).GetDataFactoryAsync(factoryName, ifNoneMatch, cancellationToken).ConfigureAwait(false); } /// @@ -342,17 +298,21 @@ public static async Task> GetDataFactoryAsync(this /// Factories_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The factory name. /// ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. /// The cancellation token to use. - /// 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 static Response GetDataFactory(this ResourceGroupResource resourceGroupResource, string factoryName, string ifNoneMatch = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataFactories().Get(factoryName, ifNoneMatch, cancellationToken); + return GetDataFactoryResourceGroupMockingExtension(resourceGroupResource).GetDataFactory(factoryName, ifNoneMatch, cancellationToken); } /// @@ -367,13 +327,17 @@ public static Response GetDataFactory(this ResourceGroupRes /// Factories_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetDataFactoriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataFactoriesAsync(cancellationToken); + return GetDataFactorySubscriptionMockingExtension(subscriptionResource).GetDataFactoriesAsync(cancellationToken); } /// @@ -388,13 +352,17 @@ public static AsyncPageable GetDataFactoriesAsync(this Subs /// Factories_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public static Pageable GetDataFactories(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetDataFactories(cancellationToken); + return GetDataFactorySubscriptionMockingExtension(subscriptionResource).GetDataFactories(cancellationToken); } /// @@ -409,6 +377,10 @@ public static Pageable GetDataFactories(this SubscriptionRe /// Factories_ConfigureFactoryRepo /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location identifier. @@ -417,9 +389,7 @@ public static Pageable GetDataFactories(this SubscriptionRe /// is null. public static async Task> ConfigureFactoryRepoInformationAsync(this SubscriptionResource subscriptionResource, AzureLocation locationId, FactoryRepoContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).ConfigureFactoryRepoInformationAsync(locationId, content, cancellationToken).ConfigureAwait(false); + return await GetDataFactorySubscriptionMockingExtension(subscriptionResource).ConfigureFactoryRepoInformationAsync(locationId, content, cancellationToken).ConfigureAwait(false); } /// @@ -434,6 +404,10 @@ public static async Task> ConfigureFactoryRepoInfo /// Factories_ConfigureFactoryRepo /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location identifier. @@ -442,9 +416,7 @@ public static async Task> ConfigureFactoryRepoInfo /// is null. public static Response ConfigureFactoryRepoInformation(this SubscriptionResource subscriptionResource, AzureLocation locationId, FactoryRepoContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).ConfigureFactoryRepoInformation(locationId, content, cancellationToken); + return GetDataFactorySubscriptionMockingExtension(subscriptionResource).ConfigureFactoryRepoInformation(locationId, content, cancellationToken); } /// @@ -459,6 +431,10 @@ public static Response ConfigureFactoryRepoInformation(this /// ExposureControl_GetFeatureValue /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location identifier. @@ -467,9 +443,7 @@ public static Response ConfigureFactoryRepoInformation(this /// is null. public static async Task> GetFeatureValueExposureControlAsync(this SubscriptionResource subscriptionResource, AzureLocation locationId, ExposureControlContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetFeatureValueExposureControlAsync(locationId, content, cancellationToken).ConfigureAwait(false); + return await GetDataFactorySubscriptionMockingExtension(subscriptionResource).GetFeatureValueExposureControlAsync(locationId, content, cancellationToken).ConfigureAwait(false); } /// @@ -484,6 +458,10 @@ public static async Task> GetFeatureValueExposur /// ExposureControl_GetFeatureValue /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The location identifier. @@ -492,9 +470,7 @@ public static async Task> GetFeatureValueExposur /// is null. public static Response GetFeatureValueExposureControl(this SubscriptionResource subscriptionResource, AzureLocation locationId, ExposureControlContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFeatureValueExposureControl(locationId, content, cancellationToken); + return GetDataFactorySubscriptionMockingExtension(subscriptionResource).GetFeatureValueExposureControl(locationId, content, cancellationToken); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryResourceGroupMockingExtension.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..cb4e58bb26f9 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryResourceGroupMockingExtension.cs @@ -0,0 +1,94 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataFactory; + +namespace Azure.ResourceManager.DataFactory.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataFactoryResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataFactoryResourceGroupMockingExtension() + { + } + + /// 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 DataFactoryResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataFactoryResources in the ResourceGroupResource. + /// An object representing collection of DataFactoryResources and their operations over a DataFactoryResource. + public virtual DataFactoryCollection GetDataFactories() + { + return GetCachedClient(client => new DataFactoryCollection(client, Id)); + } + + /// + /// Gets a factory. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName} + /// + /// + /// Operation Id + /// Factories_Get + /// + /// + /// + /// The factory name. + /// ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataFactoryAsync(string factoryName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + return await GetDataFactories().GetAsync(factoryName, ifNoneMatch, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a factory. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName} + /// + /// + /// Operation Id + /// Factories_Get + /// + /// + /// + /// The factory name. + /// ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataFactory(string factoryName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + return GetDataFactories().Get(factoryName, ifNoneMatch, cancellationToken); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactorySubscriptionMockingExtension.cs similarity index 85% rename from sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactorySubscriptionMockingExtension.cs index 5bc6c11b361e..68062dd22445 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactorySubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataFactory; using Azure.ResourceManager.DataFactory.Models; -namespace Azure.ResourceManager.DataFactory +namespace Azure.ResourceManager.DataFactory.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataFactorySubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataFactoryFactoriesClientDiagnostics; private FactoriesRestOperations _dataFactoryFactoriesRestClient; private ClientDiagnostics _exposureControlClientDiagnostics; private ExposureControlRestOperations _exposureControlRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataFactorySubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataFactorySubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -67,7 +68,7 @@ public virtual AsyncPageable GetDataFactoriesAsync(Cancella { HttpMessage FirstPageRequest(int? pageSizeHint) => DataFactoryFactoriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataFactoryFactoriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataFactoryResource(Client, DataFactoryData.DeserializeDataFactoryData(e)), DataFactoryFactoriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataFactories", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataFactoryResource(Client, DataFactoryData.DeserializeDataFactoryData(e)), DataFactoryFactoriesClientDiagnostics, Pipeline, "DataFactorySubscriptionMockingExtension.GetDataFactories", "value", "nextLink", cancellationToken); } /// @@ -89,7 +90,7 @@ public virtual Pageable GetDataFactories(CancellationToken { HttpMessage FirstPageRequest(int? pageSizeHint) => DataFactoryFactoriesRestClient.CreateListRequest(Id.SubscriptionId); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataFactoryFactoriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataFactoryResource(Client, DataFactoryData.DeserializeDataFactoryData(e)), DataFactoryFactoriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDataFactories", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataFactoryResource(Client, DataFactoryData.DeserializeDataFactoryData(e)), DataFactoryFactoriesClientDiagnostics, Pipeline, "DataFactorySubscriptionMockingExtension.GetDataFactories", "value", "nextLink", cancellationToken); } /// @@ -108,9 +109,12 @@ public virtual Pageable GetDataFactories(CancellationToken /// The location identifier. /// Update factory repo request definition. /// The cancellation token to use. + /// is null. public virtual async Task> ConfigureFactoryRepoInformationAsync(AzureLocation locationId, FactoryRepoContent content, CancellationToken cancellationToken = default) { - using var scope = DataFactoryFactoriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ConfigureFactoryRepoInformation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataFactoryFactoriesClientDiagnostics.CreateScope("DataFactorySubscriptionMockingExtension.ConfigureFactoryRepoInformation"); scope.Start(); try { @@ -140,9 +144,12 @@ public virtual async Task> ConfigureFactoryRepoInf /// The location identifier. /// Update factory repo request definition. /// The cancellation token to use. + /// is null. public virtual Response ConfigureFactoryRepoInformation(AzureLocation locationId, FactoryRepoContent content, CancellationToken cancellationToken = default) { - using var scope = DataFactoryFactoriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.ConfigureFactoryRepoInformation"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataFactoryFactoriesClientDiagnostics.CreateScope("DataFactorySubscriptionMockingExtension.ConfigureFactoryRepoInformation"); scope.Start(); try { @@ -172,9 +179,12 @@ public virtual Response ConfigureFactoryRepoInformation(Azu /// The location identifier. /// The exposure control request. /// The cancellation token to use. + /// is null. public virtual async Task> GetFeatureValueExposureControlAsync(AzureLocation locationId, ExposureControlContent content, CancellationToken cancellationToken = default) { - using var scope = ExposureControlClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetFeatureValueExposureControl"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ExposureControlClientDiagnostics.CreateScope("DataFactorySubscriptionMockingExtension.GetFeatureValueExposureControl"); scope.Start(); try { @@ -204,9 +214,12 @@ public virtual async Task> GetFeatureValueExposu /// The location identifier. /// The exposure control request. /// The cancellation token to use. + /// is null. public virtual Response GetFeatureValueExposureControl(AzureLocation locationId, ExposureControlContent content, CancellationToken cancellationToken = default) { - using var scope = ExposureControlClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetFeatureValueExposureControl"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ExposureControlClientDiagnostics.CreateScope("DataFactorySubscriptionMockingExtension.GetFeatureValueExposureControl"); scope.Start(); try { diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d9090efdae84..000000000000 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataFactory -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataFactoryResources in the ResourceGroupResource. - /// An object representing collection of DataFactoryResources and their operations over a DataFactoryResource. - public virtual DataFactoryCollection GetDataFactories() - { - return GetCachedClient(Client => new DataFactoryCollection(Client, Id)); - } - } -} diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsAccountResource.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsAccountResource.cs index aea955c5c60a..6ff188cb86ef 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsAccountResource.cs +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsAccountResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataLakeStoreAccountInformationResources and their operations over a DataLakeStoreAccountInformationResource. public virtual DataLakeStoreAccountInformationCollection GetAllDataLakeStoreAccountInformation() { - return GetCachedClient(Client => new DataLakeStoreAccountInformationCollection(Client, Id)); + return GetCachedClient(client => new DataLakeStoreAccountInformationCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual DataLakeStoreAccountInformationCollection GetAllDataLakeStoreAcco /// /// The name of the Data Lake Store account to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeStoreAccountInformationAsync(string dataLakeStoreAccountName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> Get /// /// The name of the Data Lake Store account to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeStoreAccountInformation(string dataLakeStoreAccountName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetDataLakeStor /// An object representing collection of DataLakeAnalyticsStorageAccountInformationResources and their operations over a DataLakeAnalyticsStorageAccountInformationResource. public virtual DataLakeAnalyticsStorageAccountInformationCollection GetAllDataLakeAnalyticsStorageAccountInformation() { - return GetCachedClient(Client => new DataLakeAnalyticsStorageAccountInformationCollection(Client, Id)); + return GetCachedClient(client => new DataLakeAnalyticsStorageAccountInformationCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual DataLakeAnalyticsStorageAccountInformationCollection GetAllDataLa /// /// The name of the Azure Storage account for which to retrieve the details. /// The cancellation token to use. - /// 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> GetDataLakeAnalyticsStorageAccountInformationAsync(string storageAccountName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task /// The name of the Azure Storage account for which to retrieve the details. /// The cancellation token to use. - /// 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 GetDataLakeAnalyticsStorageAccountInformation(string storageAccountName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetD /// An object representing collection of DataLakeAnalyticsComputePolicyResources and their operations over a DataLakeAnalyticsComputePolicyResource. public virtual DataLakeAnalyticsComputePolicyCollection GetDataLakeAnalyticsComputePolicies() { - return GetCachedClient(Client => new DataLakeAnalyticsComputePolicyCollection(Client, Id)); + return GetCachedClient(client => new DataLakeAnalyticsComputePolicyCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual DataLakeAnalyticsComputePolicyCollection GetDataLakeAnalyticsComp /// /// The name of the compute policy to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeAnalyticsComputePolicyAsync(string computePolicyName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> GetD /// /// The name of the compute policy to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeAnalyticsComputePolicy(string computePolicyName, CancellationToken cancellationToken = default) { @@ -251,7 +251,7 @@ public virtual Response GetDataLakeAnaly /// An object representing collection of DataLakeAnalyticsFirewallRuleResources and their operations over a DataLakeAnalyticsFirewallRuleResource. public virtual DataLakeAnalyticsFirewallRuleCollection GetDataLakeAnalyticsFirewallRules() { - return GetCachedClient(Client => new DataLakeAnalyticsFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new DataLakeAnalyticsFirewallRuleCollection(client, Id)); } /// @@ -269,8 +269,8 @@ public virtual DataLakeAnalyticsFirewallRuleCollection GetDataLakeAnalyticsFirew /// /// The name of the firewall rule to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeAnalyticsFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -292,8 +292,8 @@ public virtual async Task> GetDa /// /// The name of the firewall rule to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeAnalyticsFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsStorageAccountInformationResource.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsStorageAccountInformationResource.cs index 0125c0dd95a9..08808e8e5a34 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsStorageAccountInformationResource.cs +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/DataLakeAnalyticsStorageAccountInformationResource.cs @@ -91,7 +91,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataLakeAnalyticsStorageContainerResources and their operations over a DataLakeAnalyticsStorageContainerResource. public virtual DataLakeAnalyticsStorageContainerCollection GetDataLakeAnalyticsStorageContainers() { - return GetCachedClient(Client => new DataLakeAnalyticsStorageContainerCollection(Client, Id)); + return GetCachedClient(client => new DataLakeAnalyticsStorageContainerCollection(client, Id)); } /// @@ -109,8 +109,8 @@ public virtual DataLakeAnalyticsStorageContainerCollection GetDataLakeAnalyticsS /// /// The name of the Azure storage container to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeAnalyticsStorageContainerAsync(string containerName, CancellationToken cancellationToken = default) { @@ -132,8 +132,8 @@ public virtual async Task> G /// /// The name of the Azure storage container to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeAnalyticsStorageContainer(string containerName, CancellationToken cancellationToken = default) { diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsArmClientMockingExtension.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsArmClientMockingExtension.cs new file mode 100644 index 000000000000..c33f47f3b3a6 --- /dev/null +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsArmClientMockingExtension.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeAnalytics; + +namespace Azure.ResourceManager.DataLakeAnalytics.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataLakeAnalyticsArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataLakeAnalyticsArmClientMockingExtension() + { + } + + /// 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 DataLakeAnalyticsArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataLakeAnalyticsArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataLakeAnalyticsAccountResource GetDataLakeAnalyticsAccountResource(ResourceIdentifier id) + { + DataLakeAnalyticsAccountResource.ValidateResourceId(id); + return new DataLakeAnalyticsAccountResource(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 DataLakeStoreAccountInformationResource GetDataLakeStoreAccountInformationResource(ResourceIdentifier id) + { + DataLakeStoreAccountInformationResource.ValidateResourceId(id); + return new DataLakeStoreAccountInformationResource(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 DataLakeAnalyticsStorageAccountInformationResource GetDataLakeAnalyticsStorageAccountInformationResource(ResourceIdentifier id) + { + DataLakeAnalyticsStorageAccountInformationResource.ValidateResourceId(id); + return new DataLakeAnalyticsStorageAccountInformationResource(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 DataLakeAnalyticsStorageContainerResource GetDataLakeAnalyticsStorageContainerResource(ResourceIdentifier id) + { + DataLakeAnalyticsStorageContainerResource.ValidateResourceId(id); + return new DataLakeAnalyticsStorageContainerResource(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 DataLakeAnalyticsComputePolicyResource GetDataLakeAnalyticsComputePolicyResource(ResourceIdentifier id) + { + DataLakeAnalyticsComputePolicyResource.ValidateResourceId(id); + return new DataLakeAnalyticsComputePolicyResource(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 DataLakeAnalyticsFirewallRuleResource GetDataLakeAnalyticsFirewallRuleResource(ResourceIdentifier id) + { + DataLakeAnalyticsFirewallRuleResource.ValidateResourceId(id); + return new DataLakeAnalyticsFirewallRuleResource(Client, id); + } + } +} diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsExtensions.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsExtensions.cs index 5c69bccdd82c..66ff396b70e7 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsExtensions.cs +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeAnalytics.Mocking; using Azure.ResourceManager.DataLakeAnalytics.Models; using Azure.ResourceManager.Resources; @@ -19,157 +20,129 @@ namespace Azure.ResourceManager.DataLakeAnalytics /// A class to add extension methods to Azure.ResourceManager.DataLakeAnalytics. public static partial class DataLakeAnalyticsExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataLakeAnalyticsArmClientMockingExtension GetDataLakeAnalyticsArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataLakeAnalyticsArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataLakeAnalyticsResourceGroupMockingExtension GetDataLakeAnalyticsResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataLakeAnalyticsResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataLakeAnalyticsSubscriptionMockingExtension GetDataLakeAnalyticsSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataLakeAnalyticsSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataLakeAnalyticsAccountResource /// /// 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. /// Returns a object. public static DataLakeAnalyticsAccountResource GetDataLakeAnalyticsAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeAnalyticsAccountResource.ValidateResourceId(id); - return new DataLakeAnalyticsAccountResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeAnalyticsAccountResource(id); } - #endregion - #region DataLakeStoreAccountInformationResource /// /// 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. /// Returns a object. public static DataLakeStoreAccountInformationResource GetDataLakeStoreAccountInformationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeStoreAccountInformationResource.ValidateResourceId(id); - return new DataLakeStoreAccountInformationResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeStoreAccountInformationResource(id); } - #endregion - #region DataLakeAnalyticsStorageAccountInformationResource /// /// 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. /// Returns a object. public static DataLakeAnalyticsStorageAccountInformationResource GetDataLakeAnalyticsStorageAccountInformationResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeAnalyticsStorageAccountInformationResource.ValidateResourceId(id); - return new DataLakeAnalyticsStorageAccountInformationResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeAnalyticsStorageAccountInformationResource(id); } - #endregion - #region DataLakeAnalyticsStorageContainerResource /// /// 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. /// Returns a object. public static DataLakeAnalyticsStorageContainerResource GetDataLakeAnalyticsStorageContainerResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeAnalyticsStorageContainerResource.ValidateResourceId(id); - return new DataLakeAnalyticsStorageContainerResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeAnalyticsStorageContainerResource(id); } - #endregion - #region DataLakeAnalyticsComputePolicyResource /// /// 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. /// Returns a object. public static DataLakeAnalyticsComputePolicyResource GetDataLakeAnalyticsComputePolicyResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeAnalyticsComputePolicyResource.ValidateResourceId(id); - return new DataLakeAnalyticsComputePolicyResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeAnalyticsComputePolicyResource(id); } - #endregion - #region DataLakeAnalyticsFirewallRuleResource /// /// 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. /// Returns a object. public static DataLakeAnalyticsFirewallRuleResource GetDataLakeAnalyticsFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeAnalyticsFirewallRuleResource.ValidateResourceId(id); - return new DataLakeAnalyticsFirewallRuleResource(client, id); - } - ); + return GetDataLakeAnalyticsArmClientMockingExtension(client).GetDataLakeAnalyticsFirewallRuleResource(id); } - #endregion - /// Gets a collection of DataLakeAnalyticsAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of DataLakeAnalyticsAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataLakeAnalyticsAccountResources and their operations over a DataLakeAnalyticsAccountResource. public static DataLakeAnalyticsAccountCollection GetDataLakeAnalyticsAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataLakeAnalyticsAccounts(); + return GetDataLakeAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetDataLakeAnalyticsAccounts(); } /// @@ -184,16 +157,20 @@ public static DataLakeAnalyticsAccountCollection GetDataLakeAnalyticsAccounts(th /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Data Lake Analytics account. /// The cancellation token to use. - /// 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 static async Task> GetDataLakeAnalyticsAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataLakeAnalyticsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetDataLakeAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetDataLakeAnalyticsAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -208,16 +185,20 @@ public static async Task> GetDataLake /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Data Lake Analytics account. /// The cancellation token to use. - /// 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 static Response GetDataLakeAnalyticsAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataLakeAnalyticsAccounts().Get(accountName, cancellationToken); + return GetDataLakeAnalyticsResourceGroupMockingExtension(resourceGroupResource).GetDataLakeAnalyticsAccount(accountName, cancellationToken); } /// @@ -232,6 +213,10 @@ public static Response GetDataLakeAnalyticsAcc /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -239,9 +224,7 @@ public static Response GetDataLakeAnalyticsAcc /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAccountsAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetAccountsOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAccountsAsync(options, cancellationToken); + return GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).GetAccountsAsync(options, cancellationToken); } /// @@ -256,6 +239,10 @@ public static AsyncPageable GetAccountsAsync(this /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -263,9 +250,7 @@ public static AsyncPageable GetAccountsAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAccounts(this SubscriptionResource subscriptionResource, SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetAccountsOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAccounts(options, cancellationToken); + return GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).GetAccounts(options, cancellationToken); } /// @@ -280,6 +265,10 @@ public static Pageable GetAccounts(this Subscript /// Accounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -288,9 +277,7 @@ public static Pageable GetAccounts(this Subscript /// is null. public static async Task> CheckDataLakeAnalyticsAccountNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataLakeAnalyticsAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataLakeAnalyticsAccountNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).CheckDataLakeAnalyticsAccountNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -305,6 +292,10 @@ public static async TaskAccounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -313,9 +304,7 @@ public static async Task is null. public static Response CheckDataLakeAnalyticsAccountNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DataLakeAnalyticsAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataLakeAnalyticsAccountNameAvailability(location, content, cancellationToken); + return GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).CheckDataLakeAnalyticsAccountNameAvailability(location, content, cancellationToken); } /// @@ -330,13 +319,17 @@ public static Response CheckData /// Locations_GetCapability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. /// The cancellation token to use. public static async Task> GetCapabilityLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilityLocationAsync(location, cancellationToken).ConfigureAwait(false); + return await GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).GetCapabilityLocationAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -351,13 +344,17 @@ public static async Task> GetCa /// Locations_GetCapability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. /// The cancellation token to use. public static Response GetCapabilityLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilityLocation(location, cancellationToken); + return GetDataLakeAnalyticsSubscriptionMockingExtension(subscriptionResource).GetCapabilityLocation(location, cancellationToken); } } } diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsResourceGroupMockingExtension.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..3bfbc8a6a175 --- /dev/null +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeAnalytics; + +namespace Azure.ResourceManager.DataLakeAnalytics.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataLakeAnalyticsResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataLakeAnalyticsResourceGroupMockingExtension() + { + } + + /// 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 DataLakeAnalyticsResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataLakeAnalyticsAccountResources in the ResourceGroupResource. + /// An object representing collection of DataLakeAnalyticsAccountResources and their operations over a DataLakeAnalyticsAccountResource. + public virtual DataLakeAnalyticsAccountCollection GetDataLakeAnalyticsAccounts() + { + return GetCachedClient(client => new DataLakeAnalyticsAccountCollection(client, Id)); + } + + /// + /// Gets details of the specified Data Lake Analytics account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Data Lake Analytics account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataLakeAnalyticsAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetDataLakeAnalyticsAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets details of the specified Data Lake Analytics account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Data Lake Analytics account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataLakeAnalyticsAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetDataLakeAnalyticsAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsSubscriptionMockingExtension.cs similarity index 87% rename from sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsSubscriptionMockingExtension.cs index b69ade11f79f..f9840d018ae3 100644 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/DataLakeAnalyticsSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeAnalytics; using Azure.ResourceManager.DataLakeAnalytics.Models; -namespace Azure.ResourceManager.DataLakeAnalytics +namespace Azure.ResourceManager.DataLakeAnalytics.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataLakeAnalyticsSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataLakeAnalyticsAccountAccountsClientDiagnostics; private AccountsRestOperations _dataLakeAnalyticsAccountAccountsRestClient; private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataLakeAnalyticsSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataLakeAnalyticsSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,9 +67,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAccountsAsync(SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetAccountsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DataLakeAnalyticsAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.Orderby, options.Count); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataLakeAnalyticsAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.Orderby, options.Count); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataLakeAnalyticsAccountBasic.DeserializeDataLakeAnalyticsAccountBasic, DataLakeAnalyticsAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataLakeAnalyticsAccountBasic.DeserializeDataLakeAnalyticsAccountBasic, DataLakeAnalyticsAccountAccountsClientDiagnostics, Pipeline, "DataLakeAnalyticsSubscriptionMockingExtension.GetAccounts", "value", "nextLink", cancellationToken); } /// @@ -89,9 +92,11 @@ public virtual AsyncPageable GetAccountsAsync(Sub /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAccounts(SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetAccountsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DataLakeAnalyticsAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.Orderby, options.Count); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataLakeAnalyticsAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.Orderby, options.Count); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataLakeAnalyticsAccountBasic.DeserializeDataLakeAnalyticsAccountBasic, DataLakeAnalyticsAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataLakeAnalyticsAccountBasic.DeserializeDataLakeAnalyticsAccountBasic, DataLakeAnalyticsAccountAccountsClientDiagnostics, Pipeline, "DataLakeAnalyticsSubscriptionMockingExtension.GetAccounts", "value", "nextLink", cancellationToken); } /// @@ -110,9 +115,12 @@ public virtual Pageable GetAccounts(SubscriptionR /// The resource location without whitespace. /// Parameters supplied to check the Data Lake Analytics account name availability. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDataLakeAnalyticsAccountNameAvailabilityAsync(AzureLocation location, DataLakeAnalyticsAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DataLakeAnalyticsAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataLakeAnalyticsAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataLakeAnalyticsAccountAccountsClientDiagnostics.CreateScope("DataLakeAnalyticsSubscriptionMockingExtension.CheckDataLakeAnalyticsAccountNameAvailability"); scope.Start(); try { @@ -142,9 +150,12 @@ public virtual async Task The resource location without whitespace. /// Parameters supplied to check the Data Lake Analytics account name availability. /// The cancellation token to use. + /// is null. public virtual Response CheckDataLakeAnalyticsAccountNameAvailability(AzureLocation location, DataLakeAnalyticsAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DataLakeAnalyticsAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataLakeAnalyticsAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataLakeAnalyticsAccountAccountsClientDiagnostics.CreateScope("DataLakeAnalyticsSubscriptionMockingExtension.CheckDataLakeAnalyticsAccountNameAvailability"); scope.Start(); try { @@ -175,7 +186,7 @@ public virtual Response CheckDat /// The cancellation token to use. public virtual async Task> GetCapabilityLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilityLocation"); + using var scope = LocationsClientDiagnostics.CreateScope("DataLakeAnalyticsSubscriptionMockingExtension.GetCapabilityLocation"); scope.Start(); try { @@ -206,7 +217,7 @@ public virtual async Task> GetC /// The cancellation token to use. public virtual Response GetCapabilityLocation(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilityLocation"); + using var scope = LocationsClientDiagnostics.CreateScope("DataLakeAnalyticsSubscriptionMockingExtension.GetCapabilityLocation"); scope.Start(); try { diff --git a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 7e666d930b83..000000000000 --- a/sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataLakeAnalytics -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataLakeAnalyticsAccountResources in the ResourceGroupResource. - /// An object representing collection of DataLakeAnalyticsAccountResources and their operations over a DataLakeAnalyticsAccountResource. - public virtual DataLakeAnalyticsAccountCollection GetDataLakeAnalyticsAccounts() - { - return GetCachedClient(Client => new DataLakeAnalyticsAccountCollection(Client, Id)); - } - } -} diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/DataLakeStoreAccountResource.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/DataLakeStoreAccountResource.cs index 17590d25ce64..51be43d6afa6 100644 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/DataLakeStoreAccountResource.cs +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/DataLakeStoreAccountResource.cs @@ -92,7 +92,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// An object representing collection of DataLakeStoreFirewallRuleResources and their operations over a DataLakeStoreFirewallRuleResource. public virtual DataLakeStoreFirewallRuleCollection GetDataLakeStoreFirewallRules() { - return GetCachedClient(Client => new DataLakeStoreFirewallRuleCollection(Client, Id)); + return GetCachedClient(client => new DataLakeStoreFirewallRuleCollection(client, Id)); } /// @@ -110,8 +110,8 @@ public virtual DataLakeStoreFirewallRuleCollection GetDataLakeStoreFirewallRules /// /// The name of the firewall rule to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeStoreFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -133,8 +133,8 @@ public virtual async Task> GetDataLa /// /// The name of the firewall rule to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeStoreFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) { @@ -145,7 +145,7 @@ public virtual Response GetDataLakeStoreFirew /// An object representing collection of DataLakeStoreVirtualNetworkRuleResources and their operations over a DataLakeStoreVirtualNetworkRuleResource. public virtual DataLakeStoreVirtualNetworkRuleCollection GetDataLakeStoreVirtualNetworkRules() { - return GetCachedClient(Client => new DataLakeStoreVirtualNetworkRuleCollection(Client, Id)); + return GetCachedClient(client => new DataLakeStoreVirtualNetworkRuleCollection(client, Id)); } /// @@ -163,8 +163,8 @@ public virtual DataLakeStoreVirtualNetworkRuleCollection GetDataLakeStoreVirtual /// /// The name of the virtual network rule to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeStoreVirtualNetworkRuleAsync(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -186,8 +186,8 @@ public virtual async Task> Get /// /// The name of the virtual network rule to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeStoreVirtualNetworkRule(string virtualNetworkRuleName, CancellationToken cancellationToken = default) { @@ -198,7 +198,7 @@ public virtual Response GetDataLakeStor /// An object representing collection of DataLakeStoreTrustedIdProviderResources and their operations over a DataLakeStoreTrustedIdProviderResource. public virtual DataLakeStoreTrustedIdProviderCollection GetDataLakeStoreTrustedIdProviders() { - return GetCachedClient(Client => new DataLakeStoreTrustedIdProviderCollection(Client, Id)); + return GetCachedClient(client => new DataLakeStoreTrustedIdProviderCollection(client, Id)); } /// @@ -216,8 +216,8 @@ public virtual DataLakeStoreTrustedIdProviderCollection GetDataLakeStoreTrustedI /// /// The name of the trusted identity provider to retrieve. /// The cancellation token to use. - /// 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> GetDataLakeStoreTrustedIdProviderAsync(string trustedIdProviderName, CancellationToken cancellationToken = default) { @@ -239,8 +239,8 @@ public virtual async Task> GetD /// /// The name of the trusted identity provider to retrieve. /// The cancellation token to use. - /// 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 GetDataLakeStoreTrustedIdProvider(string trustedIdProviderName, CancellationToken cancellationToken = default) { diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreArmClientMockingExtension.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreArmClientMockingExtension.cs new file mode 100644 index 000000000000..2bd36ad31c11 --- /dev/null +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreArmClientMockingExtension.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeStore; + +namespace Azure.ResourceManager.DataLakeStore.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class DataLakeStoreArmClientMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataLakeStoreArmClientMockingExtension() + { + } + + /// 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 DataLakeStoreArmClientMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal DataLakeStoreArmClientMockingExtension(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataLakeStoreAccountResource GetDataLakeStoreAccountResource(ResourceIdentifier id) + { + DataLakeStoreAccountResource.ValidateResourceId(id); + return new DataLakeStoreAccountResource(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 DataLakeStoreFirewallRuleResource GetDataLakeStoreFirewallRuleResource(ResourceIdentifier id) + { + DataLakeStoreFirewallRuleResource.ValidateResourceId(id); + return new DataLakeStoreFirewallRuleResource(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 DataLakeStoreVirtualNetworkRuleResource GetDataLakeStoreVirtualNetworkRuleResource(ResourceIdentifier id) + { + DataLakeStoreVirtualNetworkRuleResource.ValidateResourceId(id); + return new DataLakeStoreVirtualNetworkRuleResource(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 DataLakeStoreTrustedIdProviderResource GetDataLakeStoreTrustedIdProviderResource(ResourceIdentifier id) + { + DataLakeStoreTrustedIdProviderResource.ValidateResourceId(id); + return new DataLakeStoreTrustedIdProviderResource(Client, id); + } + } +} diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreExtensions.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreExtensions.cs index fd3244939321..8314e755ea2c 100644 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreExtensions.cs +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreExtensions.cs @@ -11,6 +11,7 @@ using Azure; using Azure.Core; using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeStore.Mocking; using Azure.ResourceManager.DataLakeStore.Models; using Azure.ResourceManager.Resources; @@ -19,119 +20,97 @@ namespace Azure.ResourceManager.DataLakeStore /// A class to add extension methods to Azure.ResourceManager.DataLakeStore. public static partial class DataLakeStoreExtensions { - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + private static DataLakeStoreArmClientMockingExtension GetDataLakeStoreArmClientMockingExtension(ArmClient client) { - return resource.GetCachedClient(client => - { - return new ResourceGroupResourceExtensionClient(client, resource.Id); - }); + return client.GetCachedClient(client0 => new DataLakeStoreArmClientMockingExtension(client0)); } - private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + private static DataLakeStoreResourceGroupMockingExtension GetDataLakeStoreResourceGroupMockingExtension(ArmResource resource) { - return client.GetResourceClient(() => - { - return new ResourceGroupResourceExtensionClient(client, scope); - }); + return resource.GetCachedClient(client => new DataLakeStoreResourceGroupMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + private static DataLakeStoreSubscriptionMockingExtension GetDataLakeStoreSubscriptionMockingExtension(ArmResource resource) { - return resource.GetCachedClient(client => - { - return new SubscriptionResourceExtensionClient(client, resource.Id); - }); + return resource.GetCachedClient(client => new DataLakeStoreSubscriptionMockingExtension(client, resource.Id)); } - private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new SubscriptionResourceExtensionClient(client, scope); - }); - } - #region DataLakeStoreAccountResource /// /// 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. /// Returns a object. public static DataLakeStoreAccountResource GetDataLakeStoreAccountResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeStoreAccountResource.ValidateResourceId(id); - return new DataLakeStoreAccountResource(client, id); - } - ); + return GetDataLakeStoreArmClientMockingExtension(client).GetDataLakeStoreAccountResource(id); } - #endregion - #region DataLakeStoreFirewallRuleResource /// /// 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. /// Returns a object. public static DataLakeStoreFirewallRuleResource GetDataLakeStoreFirewallRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeStoreFirewallRuleResource.ValidateResourceId(id); - return new DataLakeStoreFirewallRuleResource(client, id); - } - ); + return GetDataLakeStoreArmClientMockingExtension(client).GetDataLakeStoreFirewallRuleResource(id); } - #endregion - #region DataLakeStoreVirtualNetworkRuleResource /// /// 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. /// Returns a object. public static DataLakeStoreVirtualNetworkRuleResource GetDataLakeStoreVirtualNetworkRuleResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeStoreVirtualNetworkRuleResource.ValidateResourceId(id); - return new DataLakeStoreVirtualNetworkRuleResource(client, id); - } - ); + return GetDataLakeStoreArmClientMockingExtension(client).GetDataLakeStoreVirtualNetworkRuleResource(id); } - #endregion - #region DataLakeStoreTrustedIdProviderResource /// /// 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. /// Returns a object. public static DataLakeStoreTrustedIdProviderResource GetDataLakeStoreTrustedIdProviderResource(this ArmClient client, ResourceIdentifier id) { - return client.GetResourceClient(() => - { - DataLakeStoreTrustedIdProviderResource.ValidateResourceId(id); - return new DataLakeStoreTrustedIdProviderResource(client, id); - } - ); + return GetDataLakeStoreArmClientMockingExtension(client).GetDataLakeStoreTrustedIdProviderResource(id); } - #endregion - /// Gets a collection of DataLakeStoreAccountResources in the ResourceGroupResource. + /// + /// Gets a collection of DataLakeStoreAccountResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// /// The instance the method will execute against. /// An object representing collection of DataLakeStoreAccountResources and their operations over a DataLakeStoreAccountResource. public static DataLakeStoreAccountCollection GetDataLakeStoreAccounts(this ResourceGroupResource resourceGroupResource) { - return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetDataLakeStoreAccounts(); + return GetDataLakeStoreResourceGroupMockingExtension(resourceGroupResource).GetDataLakeStoreAccounts(); } /// @@ -146,16 +125,20 @@ public static DataLakeStoreAccountCollection GetDataLakeStoreAccounts(this Resou /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Data Lake Store account. /// The cancellation token to use. - /// 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 static async Task> GetDataLakeStoreAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetDataLakeStoreAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetDataLakeStoreResourceGroupMockingExtension(resourceGroupResource).GetDataLakeStoreAccountAsync(accountName, cancellationToken).ConfigureAwait(false); } /// @@ -170,16 +153,20 @@ public static async Task> GetDataLakeStor /// Accounts_Get /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The name of the Data Lake Store account. /// The cancellation token to use. - /// 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 static Response GetDataLakeStoreAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetDataLakeStoreAccounts().Get(accountName, cancellationToken); + return GetDataLakeStoreResourceGroupMockingExtension(resourceGroupResource).GetDataLakeStoreAccount(accountName, cancellationToken); } /// @@ -194,6 +181,10 @@ public static Response GetDataLakeStoreAccount(thi /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -201,9 +192,7 @@ public static Response GetDataLakeStoreAccount(thi /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetAccountsAsync(this SubscriptionResource subscriptionResource, SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetAccountsOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAccountsAsync(options, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetAccountsAsync(options, cancellationToken); } /// @@ -218,6 +207,10 @@ public static AsyncPageable GetAccountsAsync(this /// Accounts_List /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. @@ -225,9 +218,7 @@ public static AsyncPageable GetAccountsAsync(this /// A collection of that may take multiple service requests to iterate over. public static Pageable GetAccounts(this SubscriptionResource subscriptionResource, SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { - options ??= new SubscriptionResourceGetAccountsOptions(); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetAccounts(options, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetAccounts(options, cancellationToken); } /// @@ -242,6 +233,10 @@ public static Pageable GetAccounts(this Subscript /// Accounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -250,9 +245,7 @@ public static Pageable GetAccounts(this Subscript /// is null. public static async Task> CheckDataLakeStoreAccountNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataLakeStoreAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataLakeStoreAccountNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + return await GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).CheckDataLakeStoreAccountNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); } /// @@ -267,6 +260,10 @@ public static async Task> C /// Accounts_CheckNameAvailability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -275,9 +272,7 @@ public static async Task> C /// is null. public static Response CheckDataLakeStoreAccountNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DataLakeStoreAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckDataLakeStoreAccountNameAvailability(location, content, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).CheckDataLakeStoreAccountNameAvailability(location, content, cancellationToken); } /// @@ -292,13 +287,17 @@ public static Response CheckDataLake /// Locations_GetCapability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. /// The cancellation token to use. public static async Task> GetCapabilityByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return await GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilityByLocationAsync(location, cancellationToken).ConfigureAwait(false); + return await GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetCapabilityByLocationAsync(location, cancellationToken).ConfigureAwait(false); } /// @@ -313,13 +312,17 @@ public static async Task> GetCapabi /// Locations_GetCapability /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. /// The cancellation token to use. public static Response GetCapabilityByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCapabilityByLocation(location, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetCapabilityByLocation(location, cancellationToken); } /// @@ -334,6 +337,10 @@ public static Response GetCapabilityByLocati /// Locations_GetUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -341,7 +348,7 @@ public static Response GetCapabilityByLocati /// An async collection of that may take multiple service requests to iterate over. public static AsyncPageable GetUsagesByLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesByLocationAsync(location, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetUsagesByLocationAsync(location, cancellationToken); } /// @@ -356,6 +363,10 @@ public static AsyncPageable GetUsagesByLocationAsync(this Su /// Locations_GetUsage /// /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// /// /// The instance the method will execute against. /// The resource location without whitespace. @@ -363,7 +374,7 @@ public static AsyncPageable GetUsagesByLocationAsync(this Su /// A collection of that may take multiple service requests to iterate over. public static Pageable GetUsagesByLocation(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) { - return GetSubscriptionResourceExtensionClient(subscriptionResource).GetUsagesByLocation(location, cancellationToken); + return GetDataLakeStoreSubscriptionMockingExtension(subscriptionResource).GetUsagesByLocation(location, cancellationToken); } } } diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreResourceGroupMockingExtension.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreResourceGroupMockingExtension.cs new file mode 100644 index 000000000000..6ebfa8ef9861 --- /dev/null +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreResourceGroupMockingExtension.cs @@ -0,0 +1,92 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeStore; + +namespace Azure.ResourceManager.DataLakeStore.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class DataLakeStoreResourceGroupMockingExtension : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected DataLakeStoreResourceGroupMockingExtension() + { + } + + /// 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 DataLakeStoreResourceGroupMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataLakeStoreAccountResources in the ResourceGroupResource. + /// An object representing collection of DataLakeStoreAccountResources and their operations over a DataLakeStoreAccountResource. + public virtual DataLakeStoreAccountCollection GetDataLakeStoreAccounts() + { + return GetCachedClient(client => new DataLakeStoreAccountCollection(client, Id)); + } + + /// + /// Gets the specified Data Lake Store account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Data Lake Store account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataLakeStoreAccountAsync(string accountName, CancellationToken cancellationToken = default) + { + return await GetDataLakeStoreAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Data Lake Store account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName} + /// + /// + /// Operation Id + /// Accounts_Get + /// + /// + /// + /// The name of the Data Lake Store account. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataLakeStoreAccount(string accountName, CancellationToken cancellationToken = default) + { + return GetDataLakeStoreAccounts().Get(accountName, cancellationToken); + } + } +} diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreSubscriptionMockingExtension.cs similarity index 88% rename from sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreSubscriptionMockingExtension.cs index bcb106d3a4fa..07324963fdd7 100644 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/DataLakeStoreSubscriptionMockingExtension.cs @@ -13,27 +13,28 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.DataLakeStore; using Azure.ResourceManager.DataLakeStore.Models; -namespace Azure.ResourceManager.DataLakeStore +namespace Azure.ResourceManager.DataLakeStore.Mocking { /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + public partial class DataLakeStoreSubscriptionMockingExtension : ArmResource { private ClientDiagnostics _dataLakeStoreAccountAccountsClientDiagnostics; private AccountsRestOperations _dataLakeStoreAccountAccountsRestClient; private ClientDiagnostics _locationsClientDiagnostics; private LocationsRestOperations _locationsRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected DataLakeStoreSubscriptionMockingExtension() { } - /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DataLakeStoreSubscriptionMockingExtension(ArmClient client, ResourceIdentifier id) : base(client, id) { } @@ -66,9 +67,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAccountsAsync(SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetAccountsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DataLakeStoreAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.OrderBy, options.Count); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataLakeStoreAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.OrderBy, options.Count); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataLakeStoreAccountBasicData.DeserializeDataLakeStoreAccountBasicData, DataLakeStoreAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataLakeStoreAccountBasicData.DeserializeDataLakeStoreAccountBasicData, DataLakeStoreAccountAccountsClientDiagnostics, Pipeline, "DataLakeStoreSubscriptionMockingExtension.GetAccounts", "value", "nextLink", cancellationToken); } /// @@ -89,9 +92,11 @@ public virtual AsyncPageable GetAccountsAsync(Sub /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAccounts(SubscriptionResourceGetAccountsOptions options, CancellationToken cancellationToken = default) { + options ??= new SubscriptionResourceGetAccountsOptions(); + HttpMessage FirstPageRequest(int? pageSizeHint) => DataLakeStoreAccountAccountsRestClient.CreateListRequest(Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.OrderBy, options.Count); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataLakeStoreAccountAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, options.Filter, options.Top, options.Skip, options.Select, options.OrderBy, options.Count); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataLakeStoreAccountBasicData.DeserializeDataLakeStoreAccountBasicData, DataLakeStoreAccountAccountsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAccounts", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataLakeStoreAccountBasicData.DeserializeDataLakeStoreAccountBasicData, DataLakeStoreAccountAccountsClientDiagnostics, Pipeline, "DataLakeStoreSubscriptionMockingExtension.GetAccounts", "value", "nextLink", cancellationToken); } /// @@ -110,9 +115,12 @@ public virtual Pageable GetAccounts(SubscriptionR /// The resource location without whitespace. /// Parameters supplied to check the Data Lake Store account name availability. /// The cancellation token to use. + /// is null. public virtual async Task> CheckDataLakeStoreAccountNameAvailabilityAsync(AzureLocation location, DataLakeStoreAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DataLakeStoreAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataLakeStoreAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataLakeStoreAccountAccountsClientDiagnostics.CreateScope("DataLakeStoreSubscriptionMockingExtension.CheckDataLakeStoreAccountNameAvailability"); scope.Start(); try { @@ -142,9 +150,12 @@ public virtual async Task> /// The resource location without whitespace. /// Parameters supplied to check the Data Lake Store account name availability. /// The cancellation token to use. + /// is null. public virtual Response CheckDataLakeStoreAccountNameAvailability(AzureLocation location, DataLakeStoreAccountNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = DataLakeStoreAccountAccountsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckDataLakeStoreAccountNameAvailability"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = DataLakeStoreAccountAccountsClientDiagnostics.CreateScope("DataLakeStoreSubscriptionMockingExtension.CheckDataLakeStoreAccountNameAvailability"); scope.Start(); try { @@ -175,7 +186,7 @@ public virtual Response CheckDataLak /// The cancellation token to use. public virtual async Task> GetCapabilityByLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilityByLocation"); + using var scope = LocationsClientDiagnostics.CreateScope("DataLakeStoreSubscriptionMockingExtension.GetCapabilityByLocation"); scope.Start(); try { @@ -206,7 +217,7 @@ public virtual async Task> GetCapab /// The cancellation token to use. public virtual Response GetCapabilityByLocation(AzureLocation location, CancellationToken cancellationToken = default) { - using var scope = LocationsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetCapabilityByLocation"); + using var scope = LocationsClientDiagnostics.CreateScope("DataLakeStoreSubscriptionMockingExtension.GetCapabilityByLocation"); scope.Start(); try { @@ -239,7 +250,7 @@ public virtual Response GetCapabilityByLocat public virtual AsyncPageable GetUsagesByLocationAsync(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationsRestClient.CreateGetUsageRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, DataLakeStoreUsage.DeserializeDataLakeStoreUsage, LocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesByLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, DataLakeStoreUsage.DeserializeDataLakeStoreUsage, LocationsClientDiagnostics, Pipeline, "DataLakeStoreSubscriptionMockingExtension.GetUsagesByLocation", "value", null, cancellationToken); } /// @@ -261,7 +272,7 @@ public virtual AsyncPageable GetUsagesByLocationAsync(AzureL public virtual Pageable GetUsagesByLocation(AzureLocation location, CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => LocationsRestClient.CreateGetUsageRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, DataLakeStoreUsage.DeserializeDataLakeStoreUsage, LocationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetUsagesByLocation", "value", null, cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, DataLakeStoreUsage.DeserializeDataLakeStoreUsage, LocationsClientDiagnostics, Pipeline, "DataLakeStoreSubscriptionMockingExtension.GetUsagesByLocation", "value", null, cancellationToken); } } } diff --git a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index 3690c2ade852..000000000000 --- a/sdk/datalake-store/Azure.ResourceManager.DataLakeStore/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.DataLakeStore -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of DataLakeStoreAccountResources in the ResourceGroupResource. - /// An object representing collection of DataLakeStoreAccountResources and their operations over a DataLakeStoreAccountResource. - public virtual DataLakeStoreAccountCollection GetDataLakeStoreAccounts() - { - return GetCachedClient(Client => new DataLakeStoreAccountCollection(Client, Id)); - } - } -}